Index: lams_tests/tests/org/lamsfoundation/lams/pages/monitor/EditClassPage.java =================================================================== RCS file: /usr/local/cvsroot/lams_tests/tests/org/lamsfoundation/lams/pages/monitor/EditClassPage.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tests/tests/org/lamsfoundation/lams/pages/monitor/EditClassPage.java 14 Dec 2014 03:53:48 -0000 1.1 @@ -0,0 +1,55 @@ +/**************************************************************** + * Copyright (C) 2014 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +package org.lamsfoundation.lams.pages.monitor; + +import org.lamsfoundation.lams.pages.AbstractPage; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +public class EditClassPage extends AbstractPage { + + /** + * Edit class page properties + */ + + @FindBy(id = "classMonitorSelectAll") + private WebElement classMonitorSelectAll; + + + @FindBy(id = "classLearnerSelectAll") + private WebElement classLearnerSelectAll; + + public EditClassPage(WebDriver driver) { + super(driver); + } + + public Boolean areAllMonitorsSelected() { + return classMonitorSelectAll.isSelected(); + } + + public Boolean areAlllearnersSelected() { + return classLearnerSelectAll.isSelected(); + } + +} Index: lams_tests/tests/org/lamsfoundation/lams/pages/monitor/LessonTab.java =================================================================== RCS file: /usr/local/cvsroot/lams_tests/tests/org/lamsfoundation/lams/pages/monitor/LessonTab.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tests/tests/org/lamsfoundation/lams/pages/monitor/LessonTab.java 14 Dec 2014 03:53:48 -0000 1.1 @@ -0,0 +1,145 @@ +/**************************************************************** + * Copyright (C) 2014 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +package org.lamsfoundation.lams.pages.monitor; + +import java.util.concurrent.TimeUnit; + +import org.lamsfoundation.lams.pages.AbstractPage; +import org.lamsfoundation.lams.pages.author.FLAPage; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; +import org.openqa.selenium.support.PageFactory; +import org.openqa.selenium.support.ui.WebDriverWait; + +/** + * + * Monitor Lessontab + * + * @author Ernie Ghiglione (ernieg@lamsfoundation.org) + * + */ +public class LessonTab extends AbstractPage { + + + /** + * Lesson tab attributes + */ + + @FindBy(id = "tabLessonLessonName") + private WebElement tabLessonLessonName; + + @FindBy(id = "tabLessonLessonDescription") + private WebElement tabLessonLessonDescription; + + @FindBy(id = "lessonStateLabel") + private WebElement lessonStateLabel; + + @FindBy(id = "learnersStartedPossibleCell") + private WebElement learnersStartedPossibleCell; + + @FindBy(id = "viewLearnersButton") + private WebElement viewLearnersButton; + + @FindBy(id = "editClassButton") + private WebElement editClassButton; + + @FindBy(id = "notificationButton") + private WebElement notificationButton; + + @FindBy(id = "lessonManageField") + private WebElement lessonManageField; + + @FindBy(id = "exportAvailableField") + private WebElement exportAvailableField; + + @FindBy(id = "presenceAvailableField") + private WebElement presenceAvailableField; + + @FindBy(id = "imAvailableField") + private WebElement imAvailableField; + + @FindBy(id = "lessonStartDateSpan") + private WebElement lessonStartDateSpan; + + @FindBy(id = "scheduleDatetimeField") + private WebElement scheduleDatetimeField; + + @FindBy(id = "startLessonButton") + private WebElement startLessonButton; + + + public LessonTab(WebDriver driver) { + super(driver); + + } + + public String getLessonTitle() { + + return tabLessonLessonName.getText(); + } + + public EditClassPage openEditClass() { + + editClassButton.click(); + + return PageFactory.initElements(driver, EditClassPage.class); + + } + + public String getLessonDescription() { + return tabLessonLessonDescription.getText(); + } + + public boolean isLessonScheduled() { + + return ((scheduleDatetimeField.getCssValue("display").contains("none")) ? false : true); + + + } + + public boolean isNotificationsPresent() { + + driver.manage().timeouts().implicitlyWait(1, TimeUnit.SECONDS); + + Boolean isNotificationsPresent = driver.findElements(By.id("notificationButton")).size() > 0 ? true: false; + + driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); + + return isNotificationsPresent; + } + + public Boolean isPresenceEnabled() { + + return presenceAvailableField.isSelected(); + + + } + + public boolean isImEnabled() { + + return imAvailableField.isSelected(); + } + +} Index: lams_tests/tests/org/lamsfoundation/lams/pages/monitor/MonitorPage.java =================================================================== RCS file: /usr/local/cvsroot/lams_tests/tests/org/lamsfoundation/lams/pages/monitor/MonitorPage.java,v diff -u -r1.1 -r1.2 --- lams_tests/tests/org/lamsfoundation/lams/pages/monitor/MonitorPage.java 29 Oct 2014 20:01:05 -0000 1.1 +++ lams_tests/tests/org/lamsfoundation/lams/pages/monitor/MonitorPage.java 14 Dec 2014 03:53:48 -0000 1.2 @@ -23,22 +23,60 @@ package org.lamsfoundation.lams.pages.monitor; import org.lamsfoundation.lams.pages.AbstractPage; +import org.lamsfoundation.lams.pages.IndexPage; import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; public class MonitorPage extends AbstractPage { + + /** + * Tabs & buttons + * These are the menu buttons and tabs on this interface + */ + + @FindBy(id = "tabLessonLink") + private WebElement tabLessonLink; + + @FindBy(id = "tabSequenceLink") + private WebElement tabSequenceLink; + + @FindBy(id = "closeButton") + private WebElement closeButton; + public MonitorPage(WebDriver driver) { super(driver); } public MonitorPage name() { - - return PageFactory.initElements(driver, MonitorPage.class); } + public LessonTab openLessonTab() { + + tabLessonLink.click(); + + return PageFactory.initElements(driver, LessonTab.class); + } + + public SequenceTab openSequenceTab() { + + tabSequenceLink.click(); + + return PageFactory.initElements(driver, SequenceTab.class); + } + + public IndexPage closeDialog() { + + closeButton.click(); + driver.switchTo().defaultContent(); + return PageFactory.initElements(driver, IndexPage.class); + + } + } Index: lams_tests/tests/org/lamsfoundation/lams/pages/monitor/SequenceTab.java =================================================================== RCS file: /usr/local/cvsroot/lams_tests/tests/org/lamsfoundation/lams/pages/monitor/SequenceTab.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tests/tests/org/lamsfoundation/lams/pages/monitor/SequenceTab.java 14 Dec 2014 03:53:49 -0000 1.1 @@ -0,0 +1,75 @@ +/**************************************************************** + * Copyright (C) 2014 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +package org.lamsfoundation.lams.pages.monitor; + +import java.util.concurrent.TimeUnit; + +import org.lamsfoundation.lams.pages.AbstractPage; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; +import org.openqa.selenium.support.ui.WebDriverWait; + +public class SequenceTab extends AbstractPage { + + + /** + * Sequence tab attributes + */ + + @FindBy(id = "refreshButton") + private WebElement refreshButton; + + @FindBy(id = "exportPortfolioButton") + private WebElement exportPortfolioButton; + + @FindBy(id = "liveEditButton") + private WebElement liveEditButton; + + @FindBy(id = "closeBranchingButton") + private WebElement closeBranchingButton; + + @FindBy(id = "helpButton") + private WebElement helpButton; + + + public SequenceTab(WebDriver driver) { + super(driver); + + } + + public boolean isLiveEditPresent() { + + driver.manage().timeouts().implicitlyWait(1, TimeUnit.SECONDS); + Boolean isLiveEditPresent = driver.findElements(By.id("liveEditButton")).size() > 0 ? true: false; + driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); + + return isLiveEditPresent; + + + + } + + +}