diff --git a/src/main/java/org/olat/core/gui/control/navigation/AbstractSiteInstance.java b/src/main/java/org/olat/core/gui/control/navigation/AbstractSiteInstance.java index 4d09f1e0a1ea2b22595e7d8832eaac8687897b77..b31b627d67f1044a4779d9e40246b68042d0a722 100644 --- a/src/main/java/org/olat/core/gui/control/navigation/AbstractSiteInstance.java +++ b/src/main/java/org/olat/core/gui/control/navigation/AbstractSiteInstance.java @@ -47,9 +47,6 @@ public abstract class AbstractSiteInstance implements SiteInstance { public AbstractSiteInstance(SiteDefinition siteDef) { this.siteDef = siteDef; } - - @Override - public abstract NavElement getNavElement(); @Override public final Controller createController(UserRequest ureq, WindowControl wControl) { @@ -57,7 +54,7 @@ public abstract class AbstractSiteInstance implements SiteInstance { SiteConfiguration config = siteDefinitions.getConfigurationSite(siteDef); if(config != null && StringHelper.containsNonWhitespace(config.getSecurityCallbackBeanId())) { String secCallbackBeanId = config.getSecurityCallbackBeanId(); - Object siteSecCallback = getSiteSecurityCallback(secCallbackBeanId);; + Object siteSecCallback = getSiteSecurityCallback(secCallbackBeanId); if (siteSecCallback instanceof SiteSecurityCallback && !((SiteSecurityCallback)siteSecCallback).isAllowedToLaunchSite(ureq)) { return getAlternativeController(ureq, wControl, config); @@ -70,7 +67,7 @@ public abstract class AbstractSiteInstance implements SiteInstance { try { return CoreSpringFactory.getBean(secCallbackBeanId); } catch (Exception e) { - log.error("Cannot find security callback: " + secCallbackBeanId + " return administrator only security callback"); + log.error("Cannot find security callback: {} return administrator only security callback", secCallbackBeanId); return CoreSpringFactory.getBean("adminSiteSecurityCallback"); } } diff --git a/src/main/java/org/olat/repository/site/RepositorySite.java b/src/main/java/org/olat/repository/site/RepositorySite.java index aa6d5ed0f5318125f8dbe5819482bcf6c9179709..4eb1e081873a41636a66914d71c8e8df8132ce33 100644 --- a/src/main/java/org/olat/repository/site/RepositorySite.java +++ b/src/main/java/org/olat/repository/site/RepositorySite.java @@ -66,9 +66,7 @@ public class RepositorySite extends AbstractSiteInstance { curNavElem = new DefaultNavElement(origNavElem); } - /** - * @see org.olat.navigation.SiteInstance#getNavElement() - */ + @Override public NavElement getNavElement() { return curNavElem; } @@ -81,13 +79,7 @@ public class RepositorySite extends AbstractSiteInstance { return new OverviewAuthoringController(ureq, bwControl); } - /** - * @see org.olat.navigation.SiteInstance#isKeepState() - */ - public boolean isKeepState() { - return true; - } - + @Override public void reset() { curNavElem = new DefaultNavElement(origNavElem); } diff --git a/src/main/java/org/olat/repository/ui/author/OverviewAuthoringController.java b/src/main/java/org/olat/repository/ui/author/OverviewAuthoringController.java index 494748e1c4bb1b44b08fab512c2d3f7b52743b35..4df6d5881eaebafcb8f8809d822d20e997472c36 100644 --- a/src/main/java/org/olat/repository/ui/author/OverviewAuthoringController.java +++ b/src/main/java/org/olat/repository/ui/author/OverviewAuthoringController.java @@ -67,12 +67,17 @@ public class OverviewAuthoringController extends BasicController implements Acti private Link favoriteLink; private final Link searchLink; private final Link myEntriesLink; - private AuthorListController currentCtrl, markedCtrl, myEntriesCtrl, searchEntriesCtrl; + private AuthorListController markedCtrl; + private AuthorListController currentCtrl; + private AuthorListController myEntriesCtrl; + private AuthorListController searchEntriesCtrl; private AuthorDeletedListController deletedEntriesCtrl; private final boolean isAdministrator; private final boolean isGuestOnly; - private boolean favoritDirty, myDirty, deletedDirty; + private boolean myDirty; + private boolean favoritDirty; + private boolean deletedDirty; private final EventBus eventBus; public OverviewAuthoringController(UserRequest ureq, WindowControl wControl) { diff --git a/src/main/java/org/olat/repository/ui/author/_content/overview.html b/src/main/java/org/olat/repository/ui/author/_content/overview.html index 71b1d3daa200dc398905ccd8ea99fdc29d1e39a9..0372fb87a3147eb69e8a49e4f01b220147a02a2b 100644 --- a/src/main/java/org/olat/repository/ui/author/_content/overview.html +++ b/src/main/java/org/olat/repository/ui/author/_content/overview.html @@ -1,4 +1,6 @@ -$r.render("segments") -<div class="o_segments_content clearfix"> - $r.render("segmentCmp") +<div class="o_sel_author_env"> + $r.render("segments") + <div class="o_segments_content clearfix"> + $r.render("segmentCmp") + </div> </div> diff --git a/src/test/java/org/olat/selenium/AssessmentTest.java b/src/test/java/org/olat/selenium/AssessmentTest.java index 6fcfd8065943d56b90756b98c9576f35e0fa76b3..1509492ca410b39692b8c163d6d9e23b11a6a2e1 100644 --- a/src/test/java/org/olat/selenium/AssessmentTest.java +++ b/src/test/java/org/olat/selenium/AssessmentTest.java @@ -527,7 +527,6 @@ public class AssessmentTest extends Deployments { courseRuntime .clickTree() .selectWithTitle(testNodeTitle); - OOGraphene.closeBlueMessageWindow(browser); //check that the title of the start page of test is correct WebElement testH2 = browser.findElement(By.cssSelector("div.o_course_run h2")); diff --git a/src/test/java/org/olat/selenium/CourseElementTest.java b/src/test/java/org/olat/selenium/CourseElementTest.java index 862783da859b385854d0c1afd9589dc53aed47e4..e673bbd968a79fb72259ce336834c32d851ca286 100644 --- a/src/test/java/org/olat/selenium/CourseElementTest.java +++ b/src/test/java/org/olat/selenium/CourseElementTest.java @@ -31,7 +31,6 @@ import org.jboss.arquillian.drone.api.annotation.Drone; import org.jboss.arquillian.junit.Arquillian; import org.jboss.arquillian.test.api.ArquillianResource; import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.olat.repository.RepositoryEntryStatusEnum; @@ -57,9 +56,9 @@ import org.olat.selenium.page.course.MemberListPage; import org.olat.selenium.page.course.MembersPage; import org.olat.selenium.page.course.ParticipantFolderPage; import org.olat.selenium.page.course.STConfigurationPage; +import org.olat.selenium.page.course.STConfigurationPage.DisplayType; import org.olat.selenium.page.course.SinglePage; import org.olat.selenium.page.course.SinglePageConfigurationPage; -import org.olat.selenium.page.course.STConfigurationPage.DisplayType; import org.olat.selenium.page.forum.ForumPage; import org.olat.selenium.page.graphene.OOGraphene; import org.olat.selenium.page.repository.AuthoringEnvPage; @@ -1292,13 +1291,12 @@ public class CourseElementTest extends Deployments { * @throws URISyntaxException */ @Test - @Ignore @RunAsClient public void courseWithForum_concurrent(@Drone @Participant WebDriver kanuBrowser, @Drone @Student WebDriver reiBrowser) throws IOException, URISyntaxException { - UserVO author = new UserRestClient(deploymentUrl).createAuthor(); + UserVO author = new UserRestClient(deploymentUrl).createRandomAuthor(); UserVO kanu = new UserRestClient(deploymentUrl).createRandomUser("Kanu"); UserVO rei = new UserRestClient(deploymentUrl).createRandomUser("Rei"); LoginPage loginPage = LoginPage.load(browser, deploymentUrl); @@ -1316,12 +1314,30 @@ public class CourseElementTest extends Deployments { String foTitle = "FO - " + UUID.randomUUID(); CourseEditorPageFragment courseEditor = CoursePageFragment.getCourse(browser) .edit(); + // setup peekview + STConfigurationPage stConfig = new STConfigurationPage(browser); + stConfig + .selectOverview() + .setDisplay(DisplayType.peekview); + // create forum courseEditor .createNode("fo") .nodeTitle(foTitle) - //publish the course + // publish the course .publish() - .quickPublish(UserAccess.registred); + .quickPublish(UserAccess.membersOnly); + + MembersPage membersPage = courseEditor + .clickToolbarBack() + .members(); + + membersPage + .importMembers() + .setMembers(kanu, rei) + .nextUsers() + .nextOverview() + .nextPermissions() + .finish(); //go to the forum courseEditor @@ -1345,13 +1361,13 @@ public class CourseElementTest extends Deployments { .openMyCourses() .openSearch() .extendedSearch(courseTitle) - .select(courseTitle) - .start(); + .select(courseTitle); //go to the forum new CoursePageFragment(kanuBrowser) .clickTree() - .selectWithTitle(foTitle.substring(0, 20)); + .selectWithTitle(foTitle.substring(0, 20)) + .assertWithTitleSelected(foTitle.substring(0, 20)); ForumPage kanuForum = ForumPage .getCourseForumPage(kanuBrowser) @@ -1368,8 +1384,8 @@ public class CourseElementTest extends Deployments { .openMyCourses() .openSearch() .extendedSearch(courseTitle) - .select(courseTitle) - .start(); + .select(courseTitle); + //select the thread in peekview ForumPage reiForum = new ForumPage(reiBrowser) .openThreadInPeekview("The best anime ever"); diff --git a/src/test/java/org/olat/selenium/CourseTest.java b/src/test/java/org/olat/selenium/CourseTest.java index d7049bfb161bb378708733c97c910b2013284cb4..d2d6404c62de57dbf4eb0365950134330bceb890 100644 --- a/src/test/java/org/olat/selenium/CourseTest.java +++ b/src/test/java/org/olat/selenium/CourseTest.java @@ -248,7 +248,7 @@ public class CourseTest extends Deployments { .nextNodes() .nextCatalog() .finish(); - OOGraphene.closeBlueMessageWindow(browser); + OOGraphene.waitAndCloseBlueMessageWindow(browser); RepositorySettingsPage settings = new RepositorySettingsPage(browser); //from description editor, back to details and launch the course @@ -921,10 +921,10 @@ public class CourseTest extends Deployments { public void courseBooking(@Drone @User WebDriver ryomouBrowser) throws IOException, URISyntaxException { - UserVO author = new UserRestClient(deploymentUrl).createAuthor(); + UserVO author = new UserRestClient(deploymentUrl).createRandomAuthor(); + UserVO ryomou = new UserRestClient(deploymentUrl).createRandomUser("Ryomou"); LoginPage loginPage = LoginPage.load(browser, deploymentUrl); loginPage.loginAs(author.getLogin(), author.getPassword()); - UserVO ryomou = new UserRestClient(deploymentUrl).createRandomUser("Ryomou"); //go to authoring NavigationPage navBar = NavigationPage.load(browser); diff --git a/src/test/java/org/olat/selenium/page/LoginPage.java b/src/test/java/org/olat/selenium/page/LoginPage.java index b712b464565f6f0f17c5f2ffa98fef9a1798ecff..ecce3821b4095aba3659e0eaa809d26615e3d8af 100644 --- a/src/test/java/org/olat/selenium/page/LoginPage.java +++ b/src/test/java/org/olat/selenium/page/LoginPage.java @@ -42,7 +42,7 @@ import org.openqa.selenium.WebElement; public class LoginPage { private static final String footerUserDivXPath = "//div[@id='o_footer_user']/span[@id='o_username']"; - private static final String acknowledgeCheckboxXPath = "//input[@name='acknowledge_checkbox']"; + private static final String acknowledgeCheckboxXPath = "//div[contains(@class,'modal-dialog')]//fieldset[contains(@class,'o_disclaimer')]//input[@name='acknowledge_checkbox']"; public static final By loginFormBy = By.cssSelector("div.o_login_form"); private static final By authOrDisclaimerXPath = By.xpath(footerUserDivXPath + "|" + acknowledgeCheckboxXPath); @@ -168,8 +168,17 @@ public class LoginPage { List<WebElement> disclaimer = browser.findElements(disclaimerXPath); if(disclaimer.size() > 0) { //click the disclaimer - disclaimer.get(0).click(); + OOGraphene.waitModalDialog(browser); + browser.findElement(disclaimerXPath).click(); browser.findElement(disclaimerButtonXPath).click(); + try { + OOGraphene.waitElementDisappears(disclaimerXPath, 10, browser); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + OOGraphene.takeScreenshot("Login disclaimer", browser); + throw e; + } } //wait until the content appears diff --git a/src/test/java/org/olat/selenium/page/NavigationPage.java b/src/test/java/org/olat/selenium/page/NavigationPage.java index 5987611bd2e3a71a08419d9851607eca388658c9..cb609f68cd38e2ab4d63bd9d9e30bd52aa885ee2 100644 --- a/src/test/java/org/olat/selenium/page/NavigationPage.java +++ b/src/test/java/org/olat/selenium/page/NavigationPage.java @@ -78,8 +78,8 @@ public class NavigationPage { } public AuthoringEnvPage openAuthoringEnvironment() { - OOGraphene.closeBlueMessageWindow(browser); navigate(authoringEnvTabBy); + OOGraphene.waitElement(By.className("o_sel_author_env"), browser); return new AuthoringEnvPage(browser); } @@ -95,9 +95,14 @@ public class NavigationPage { } public MyCoursesPage openMyCourses() { - navigate(myCoursesBy); - OOGraphene.waitElement(myCoursesAssertBy, browser); - return new MyCoursesPage(browser); + try { + navigate(myCoursesBy); + OOGraphene.waitElement(myCoursesAssertBy, browser); + return new MyCoursesPage(browser); + } catch (Exception e) { + OOGraphene.takeScreenshot("Open my courses", browser); + throw e; + } } public UserAdminPage openUserManagement() { @@ -126,7 +131,6 @@ public class NavigationPage { } private void navigate(By linkBy) { - OOGraphene.closeBlueMessageWindow(browser); List<WebElement> links = browser.findElements(linkBy); if(links.isEmpty() || !links.get(0).isDisplayed()) { //try to open the more menu @@ -150,7 +154,6 @@ public class NavigationPage { courseLinks.get(0).click(); OOGraphene.waitBusy(browser); - OOGraphene.closeBlueMessageWindow(browser); } private void openMoreMenu() { diff --git a/src/test/java/org/olat/selenium/page/core/MenuTreePageFragment.java b/src/test/java/org/olat/selenium/page/core/MenuTreePageFragment.java index 90677ad7af5b27ea17da4e10b8ecdcbfd2ce0717..281f02cb904a04dcd35f8cfeb27cd75eb588b52a 100644 --- a/src/test/java/org/olat/selenium/page/core/MenuTreePageFragment.java +++ b/src/test/java/org/olat/selenium/page/core/MenuTreePageFragment.java @@ -51,12 +51,9 @@ public class MenuTreePageFragment { * @return The menu page fragment */ public MenuTreePageFragment selectRoot() { - WebElement tree = browser.findElement(treeBy); - List<WebElement> rootLinks = tree.findElements(By.cssSelector("span.o_tree_link>a")); - Assert.assertNotNull(rootLinks); - Assert.assertFalse(rootLinks.isEmpty()); - - rootLinks.get(0).click(); + By rootNodeBy = By.cssSelector("div.o_tree span.o_tree_link.o_tree_l0>a"); + OOGraphene.waitElement(rootNodeBy, browser); + browser.findElement(rootNodeBy).click(); OOGraphene.waitBusy(browser); return this; } diff --git a/src/test/java/org/olat/selenium/page/course/AssessmentModePage.java b/src/test/java/org/olat/selenium/page/course/AssessmentModePage.java index b26e75f241289c17f7291dbd8be8d4ed722e9c8e..479b43e13a4aea54a8d477a489014c626e5b03d1 100644 --- a/src/test/java/org/olat/selenium/page/course/AssessmentModePage.java +++ b/src/test/java/org/olat/selenium/page/course/AssessmentModePage.java @@ -68,8 +68,6 @@ public class AssessmentModePage { * @return */ public AssessmentModePage editAssessment(String name, Date begin, Date end, boolean manual) { - OOGraphene.closeBlueMessageWindow(browser); - By nameBy = By.cssSelector("div.o_sel_assessment_mode_name input[type='text']"); OOGraphene.waitElement(nameBy, browser); browser.findElement(nameBy).sendKeys(name); diff --git a/src/test/java/org/olat/selenium/page/course/AssessmentToolPage.java b/src/test/java/org/olat/selenium/page/course/AssessmentToolPage.java index fd5642fbb083877ca16a0947c70d541c291243a8..ca7b57f3555e34412b4df69a44b83b76dfcd9208 100644 --- a/src/test/java/org/olat/selenium/page/course/AssessmentToolPage.java +++ b/src/test/java/org/olat/selenium/page/course/AssessmentToolPage.java @@ -148,19 +148,11 @@ public class AssessmentToolPage { } public AssessmentToolPage assertPassed(UserVO user) { - By userInfosBy = By.cssSelector("div.o_user_infos div.o_user_infos_inner table tr td"); - List<WebElement> userInfoList = browser.findElements(userInfosBy); - Assert.assertFalse(userInfoList.isEmpty()); - boolean foundFirstName = false; - for(WebElement userInfo:userInfoList) { - foundFirstName |= userInfo.getText().contains(user.getFirstName()); - } - Assert.assertTrue(foundFirstName); + By userInfosBy = By.xpath("//div[@class='o_user_infos']/div[@class='o_user_infos_inner']//tr[contains(@class,'o_userDisplayName')]/td[text()[contains(.,'" + user.getFirstName() + "')]]"); + OOGraphene.waitElement(userInfosBy, browser); By passedBy = By.cssSelector("div.o_table_wrapper table tr td.text-left span.o_state.o_passed"); - List<WebElement> passedEl = browser.findElements(passedBy); - Assert.assertFalse(passedEl.isEmpty()); - Assert.assertTrue(passedEl.get(0).isDisplayed()); + OOGraphene.waitElement(passedBy, browser); return this; } @@ -234,7 +226,6 @@ public class AssessmentToolPage { * @return */ public CoursePageFragment clickToolbarRootCrumb() { - OOGraphene.closeBlueMessageWindow(browser); By toolbarBackBy = By.xpath("//li[contains(@class,'o_breadcrumb_back')]/following-sibling::li/a"); browser.findElement(toolbarBackBy).click(); OOGraphene.waitBusy(browser); diff --git a/src/test/java/org/olat/selenium/page/course/BulkAssessmentPage.java b/src/test/java/org/olat/selenium/page/course/BulkAssessmentPage.java index 8f3dad909189bfab7ed0e144ee646a527c6c4c50..40cf1f50dd24e7e1107e8f9cc4c18085ff964c6b 100644 --- a/src/test/java/org/olat/selenium/page/course/BulkAssessmentPage.java +++ b/src/test/java/org/olat/selenium/page/course/BulkAssessmentPage.java @@ -69,7 +69,6 @@ public class BulkAssessmentPage { public BulkAssessmentPage nextNodes() { OOGraphene.nextStep(browser); - OOGraphene.closeBlueMessageWindow(browser); OOGraphene.waitElement(By.cssSelector("fieldset.o_sel_bulk_assessment_data"), browser); return this; } @@ -81,21 +80,18 @@ public class BulkAssessmentPage { OOGraphene.moveTo(modalFooterBy, browser); } OOGraphene.nextStep(browser); - OOGraphene.closeBlueMessageWindow(browser); OOGraphene.waitElement(By.cssSelector("fieldset.o_sel_bulk_assessment_columns"), browser); return this; } public BulkAssessmentPage nextColumns() { OOGraphene.nextStep(browser); - OOGraphene.closeBlueMessageWindow(browser); OOGraphene.waitElement(By.cssSelector("div.o_sel_bulk_assessment_validation"), browser); return this; } public BulkAssessmentPage nextValidation() { OOGraphene.nextStep(browser); - OOGraphene.closeBlueMessageWindow(browser); OOGraphene.waitElement(By.cssSelector("fieldset.o_sel_bulk_assessment_schedule"), browser); return this; } diff --git a/src/test/java/org/olat/selenium/page/course/CourseEditorPageFragment.java b/src/test/java/org/olat/selenium/page/course/CourseEditorPageFragment.java index 33f1b79017bbab8e0cc29c5436c58a8a6223a702..232a5ad921045debcb35b862897ba5f9876f2ebb 100644 --- a/src/test/java/org/olat/selenium/page/course/CourseEditorPageFragment.java +++ b/src/test/java/org/olat/selenium/page/course/CourseEditorPageFragment.java @@ -76,7 +76,6 @@ public class CourseEditorPageFragment { public static CourseEditorPageFragment getEditor(WebDriver browser) { OOGraphene.waitElement(editorBy, browser); - OOGraphene.closeBlueMessageWindow(browser); return new CourseEditorPageFragment(browser); } @@ -463,8 +462,6 @@ public class CourseEditorPageFragment { } private CourseEditorPageFragment createResource(By chooseButton, String resourceTitle, String resourceType) { - OOGraphene.closeBlueMessageWindow(browser); - browser.findElement(chooseButton).click(); OOGraphene.waitBusy(browser); //popup @@ -541,7 +538,6 @@ public class CourseEditorPageFragment { public CoursePageFragment clickToolbarBack() { browser.findElement(toolbarBackBy).click(); OOGraphene.waitBusy(browser); - OOGraphene.closeBlueMessageWindow(browser); By mainId = By.id("o_main"); OOGraphene.waitElement(mainId, 5, browser); diff --git a/src/test/java/org/olat/selenium/page/course/CoursePageFragment.java b/src/test/java/org/olat/selenium/page/course/CoursePageFragment.java index 15bf5fea4ee7f3fd0cd5bb033046d562f40d6035..235f4ce98760963f18cf16e8e8da8d1f0b793d58 100644 --- a/src/test/java/org/olat/selenium/page/course/CoursePageFragment.java +++ b/src/test/java/org/olat/selenium/page/course/CoursePageFragment.java @@ -139,8 +139,7 @@ public class CoursePageFragment { public MenuTreePageFragment clickTree() { OOGraphene.waitElement(MenuTreePageFragment.treeBy, browser); MenuTreePageFragment menuTree = new MenuTreePageFragment(browser); - menuTree.selectRoot(); - return menuTree; + return menuTree.selectRoot(); } /** @@ -187,8 +186,7 @@ public class CoursePageFragment { } browser.findElement(editCourseBy).click(); OOGraphene.waitBusy(browser); - OOGraphene.waitElement(By.xpath("//div[contains(@class,'o_edit_mode')]"), 5, browser); - OOGraphene.closeBlueMessageWindow(browser); + OOGraphene.waitElement(By.xpath("//div[contains(@class,'o_edit_mode')]"), browser); return new CourseEditorPageFragment(browser); } @@ -203,7 +201,6 @@ public class CoursePageFragment { } browser.findElement(editCourseBy).click(); OOGraphene.waitBusy(browser); - OOGraphene.closeBlueMessageWindow(browser); return new CourseEditorPageFragment(browser); } diff --git a/src/test/java/org/olat/selenium/page/course/CourseWizardPage.java b/src/test/java/org/olat/selenium/page/course/CourseWizardPage.java index 864c9582cb5c56d243d4bcd5b20691cd08e529a3..d1f180b34b9b7b84dba4e394ea4be7c0deca22f0 100644 --- a/src/test/java/org/olat/selenium/page/course/CourseWizardPage.java +++ b/src/test/java/org/olat/selenium/page/course/CourseWizardPage.java @@ -55,7 +55,6 @@ public class CourseWizardPage { */ public CourseWizardPage nextNodes() { OOGraphene.nextStep(browser); - OOGraphene.closeBlueMessageWindow(browser); OOGraphene.waitElement(By.cssSelector("div.o_sel_catalog_chooser_tree"), 5, browser); return this; } @@ -67,7 +66,6 @@ public class CourseWizardPage { */ public CourseWizardPage nextCatalog() { OOGraphene.nextStep(browser); - OOGraphene.closeBlueMessageWindow(browser); OOGraphene.waitElement(By.cssSelector("fieldset.o_sel_repo_access_configuration"), browser); return this; } diff --git a/src/test/java/org/olat/selenium/page/course/MembersPage.java b/src/test/java/org/olat/selenium/page/course/MembersPage.java index 8d6d4d71d6c36b9bad1c99bbe3696aa4f65eb960..e7d21e165f3d6c03b6d650c7206a66261cd464d2 100644 --- a/src/test/java/org/olat/selenium/page/course/MembersPage.java +++ b/src/test/java/org/olat/selenium/page/course/MembersPage.java @@ -253,7 +253,6 @@ public class MembersPage { * @return */ public CoursePageFragment clickToolbarBack() { - OOGraphene.closeBlueMessageWindow(browser); OOGraphene.clickBreadcrumbBack(browser); return new CoursePageFragment(browser); } diff --git a/src/test/java/org/olat/selenium/page/graphene/OOGraphene.java b/src/test/java/org/olat/selenium/page/graphene/OOGraphene.java index 58063180e183955fb2af46a6f8e30093b84618ec..b8142d2e2a02f7641511f4ccaa7c1b92471df9a2 100644 --- a/src/test/java/org/olat/selenium/page/graphene/OOGraphene.java +++ b/src/test/java/org/olat/selenium/page/graphene/OOGraphene.java @@ -254,7 +254,9 @@ public class OOGraphene { WebElement buttonEl = browser.findElement(buttonBy); boolean move = buttonEl.getLocation().getY() > 669; if(move) { - scrollTo(buttonBy, browser); + if(browser instanceof FirefoxDriver) { + scrollTo(buttonBy, browser);// Firefox doesn't implement moveToElement + } new Actions(browser) .moveToElement(buttonEl) .pause(movePause) @@ -280,7 +282,9 @@ public class OOGraphene { WebElement buttonEl = browser.findElement(buttonBy); boolean move = buttonEl.getLocation().getY() > 669; if(move) { - scrollTo(buttonBy, browser); + if(browser instanceof FirefoxDriver) { + scrollTo(buttonBy, browser);// Firefox doesn't implement moveToElement + } new Actions(browser) .moveToElement(buttonEl) .pause(movePause) @@ -312,7 +316,9 @@ public class OOGraphene { public static void moveTo(By by, WebDriver browser) { waitElement(by, browser); WebElement el = browser.findElement(by); - scrollTo(by, browser); + if(browser instanceof FirefoxDriver) { + scrollTo(by, browser); + } new Actions(browser) .moveToElement(el) .pause(moveToPause) @@ -336,7 +342,9 @@ public class OOGraphene { */ public static void moveTop(WebDriver browser) { By topBy = By.id("o_top"); - scrollTo(topBy, browser); + if(browser instanceof FirefoxDriver) { + scrollTo(topBy, browser);// Firefox doesn't implement moveToElement + } WebElement el = browser.findElement(topBy); new Actions(browser) .moveToElement(el) @@ -634,7 +642,7 @@ public class OOGraphene { closeBlueMessageWindow(browser); } - public static final void closeBlueMessageWindow(WebDriver browser) { + private static final void closeBlueMessageWindow(WebDriver browser) { List<WebElement> closeButtons = browser.findElements(closeBlueBoxButtonBy); for(WebElement closeButton:closeButtons) { if(closeButton.isDisplayed()) { diff --git a/src/test/java/org/olat/selenium/page/group/MembersWizardPage.java b/src/test/java/org/olat/selenium/page/group/MembersWizardPage.java index 22681cd541766ceeb2401bb4dd7929064e9ee39d..1e8035582fefa887bd1f7c7628d53be39e032ad3 100644 --- a/src/test/java/org/olat/selenium/page/group/MembersWizardPage.java +++ b/src/test/java/org/olat/selenium/page/group/MembersWizardPage.java @@ -46,21 +46,18 @@ public class MembersWizardPage { public MembersWizardPage nextUsers() { OOGraphene.nextStep(browser); - OOGraphene.closeBlueMessageWindow(browser); OOGraphene.waitElement(By.cssSelector("fieldset.o_sel_user_import_overview"), 5, browser); return this; } public MembersWizardPage nextOverview() { OOGraphene.nextStep(browser); - OOGraphene.closeBlueMessageWindow(browser); OOGraphene.waitElement(By.cssSelector("div.o_sel_edit_permissions"), browser); return this; } public MembersWizardPage nextPermissions() { OOGraphene.nextStep(browser); - OOGraphene.closeBlueMessageWindow(browser); OOGraphene.waitElement(By.cssSelector("fieldset.o_sel_contact_form"), browser); return this; } @@ -92,8 +89,13 @@ public class MembersWizardPage { String search = admin ? user.getLogin() : user.getFirstName(); searchFields.get(0).sendKeys(search); - By searchBy = By.cssSelector(".o_sel_usersearch_searchform a.btn-default"); - OOGraphene.clickAndWait(searchBy, browser); + try { + By searchBy = By.cssSelector(".o_sel_usersearch_searchform a.btn-default"); + OOGraphene.clickAndWait(searchBy, browser); + } catch (Exception e) { + OOGraphene.takeScreenshot("Search member", browser); + throw e; + } // select all By selectAll = By.xpath("//div[contains(@class,'modal')]//div[contains(@class,'o_table_checkall')]/a[i[contains(@class,'o_icon_check_on')]]"); diff --git a/src/test/java/org/olat/selenium/page/lecture/LectureRepositoryAdminPage.java b/src/test/java/org/olat/selenium/page/lecture/LectureRepositoryAdminPage.java index bb8c54bb02205287689503fc7275a2449e63b288..8171f597c49a03554d8c1ced6606f0c3439613a9 100644 --- a/src/test/java/org/olat/selenium/page/lecture/LectureRepositoryAdminPage.java +++ b/src/test/java/org/olat/selenium/page/lecture/LectureRepositoryAdminPage.java @@ -66,7 +66,6 @@ public class LectureRepositoryAdminPage { * @return */ public CoursePageFragment clickToolbarRootCrumb() { - OOGraphene.closeBlueMessageWindow(browser); OOGraphene.clickBreadcrumbBack(browser); return new CoursePageFragment(browser); } diff --git a/src/test/java/org/olat/selenium/page/lecture/LecturesRepositoryPage.java b/src/test/java/org/olat/selenium/page/lecture/LecturesRepositoryPage.java index 5d30405a9876d63e617a7ceb2d2b48a259f2a1f8..af03f23946b2b3d5260f99733451633750f3b1ca 100644 --- a/src/test/java/org/olat/selenium/page/lecture/LecturesRepositoryPage.java +++ b/src/test/java/org/olat/selenium/page/lecture/LecturesRepositoryPage.java @@ -53,7 +53,6 @@ public class LecturesRepositoryPage { * @return */ public CoursePageFragment clickToolbarRootCrumb() { - OOGraphene.closeBlueMessageWindow(browser); By toolbarBackBy = By.xpath("//li[contains(@class,'o_breadcrumb_back')]/following-sibling::li/a"); browser.findElement(toolbarBackBy).click(); OOGraphene.waitBusy(browser); diff --git a/src/test/java/org/olat/selenium/page/portfolio/BinderMemberWizardPage.java b/src/test/java/org/olat/selenium/page/portfolio/BinderMemberWizardPage.java index bebe79cc48915a1387c2c5af10b138f9669fcefd..08d7ff651c7ff27979fd97909e470c7944bbc7b4 100644 --- a/src/test/java/org/olat/selenium/page/portfolio/BinderMemberWizardPage.java +++ b/src/test/java/org/olat/selenium/page/portfolio/BinderMemberWizardPage.java @@ -61,21 +61,18 @@ public class BinderMemberWizardPage { public BinderMemberWizardPage nextUsers() { OOGraphene.nextStep(browser); - OOGraphene.closeBlueMessageWindow(browser); OOGraphene.waitElement(By.cssSelector("fieldset.o_sel_user_import_overview"), browser); return this; } public BinderMemberWizardPage nextOverview() { OOGraphene.nextStep(browser); - OOGraphene.closeBlueMessageWindow(browser); OOGraphene.waitElement(By.cssSelector("div.o_portfolio_rights"), browser); return this; } public BinderMemberWizardPage nextPermissions() { OOGraphene.nextStep(browser); - OOGraphene.closeBlueMessageWindow(browser); OOGraphene.waitElement(By.cssSelector("fieldset.o_sel_contact_form"), browser); return this; } diff --git a/src/test/java/org/olat/selenium/page/repository/CPEditorPage.java b/src/test/java/org/olat/selenium/page/repository/CPEditorPage.java index 5c96343b5e0afdbaa5c09b57b7ce61c4d4177ff4..5b1a7b7cf8f0bba46e3ccdf65d0760afc0568f60 100644 --- a/src/test/java/org/olat/selenium/page/repository/CPEditorPage.java +++ b/src/test/java/org/olat/selenium/page/repository/CPEditorPage.java @@ -138,7 +138,6 @@ public class CPEditorPage { } public CPPage clickToolbarBack() { - OOGraphene.closeBlueMessageWindow(browser); browser.findElement(NavigationPage.toolbarBackBy).click(); OOGraphene.waitBusy(browser); diff --git a/src/test/java/org/olat/selenium/page/repository/RepositoryAccessPage.java b/src/test/java/org/olat/selenium/page/repository/RepositoryAccessPage.java index f6512823162bd05e979a5709f75fc6910e1e057b..e1246435a9de973e76ace8526a2676ffbb234aca 100644 --- a/src/test/java/org/olat/selenium/page/repository/RepositoryAccessPage.java +++ b/src/test/java/org/olat/selenium/page/repository/RepositoryAccessPage.java @@ -85,7 +85,6 @@ public class RepositoryAccessPage { * Click toolbar */ public void clickToolbarBack() { - OOGraphene.closeBlueMessageWindow(browser); By toolbarBackBy = By.cssSelector("li.o_breadcrumb_back>a"); browser.findElement(toolbarBackBy).click(); OOGraphene.waitBusy(browser); diff --git a/src/test/java/org/olat/selenium/page/repository/RepositoryDetailsPage.java b/src/test/java/org/olat/selenium/page/repository/RepositoryDetailsPage.java index 7de8f8daf4de25f00ea11b8260095d3228e44e2f..ef8722515d9e87f9ada07ae3e548b882d1eded4e 100644 --- a/src/test/java/org/olat/selenium/page/repository/RepositoryDetailsPage.java +++ b/src/test/java/org/olat/selenium/page/repository/RepositoryDetailsPage.java @@ -60,13 +60,11 @@ public class RepositoryDetailsPage { public void launch() { browser.findElement(launchBy).click(); OOGraphene.waitBusy(browser); - OOGraphene.closeBlueMessageWindow(browser); } public void edit() { browser.findElement(editBy).click(); OOGraphene.waitBusy(browser); - OOGraphene.closeBlueMessageWindow(browser); } } diff --git a/src/test/java/org/olat/selenium/page/taxonomy/TaxonomyLevelPage.java b/src/test/java/org/olat/selenium/page/taxonomy/TaxonomyLevelPage.java index fc269250e3af3addd4fd4ed10ed9db2a770f01b0..caada8041c6af637768d41b59b4a2624456d304a 100644 --- a/src/test/java/org/olat/selenium/page/taxonomy/TaxonomyLevelPage.java +++ b/src/test/java/org/olat/selenium/page/taxonomy/TaxonomyLevelPage.java @@ -24,11 +24,11 @@ import java.util.List; import org.junit.Assert; import org.olat.modules.taxonomy.TaxonomyCompetenceTypes; import org.olat.selenium.page.graphene.OOGraphene; -import org.olat.selenium.page.group.MembersWizardPage; import org.olat.user.restapi.UserVO; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; +import org.openqa.selenium.firefox.FirefoxDriver; /** * @@ -67,9 +67,7 @@ public class TaxonomyLevelPage { OOGraphene.waitBusy(browser); OOGraphene.waitModalDialog(browser); - MembersWizardPage members = new MembersWizardPage(browser); - members.searchMember(user, true); - OOGraphene.waitBusy(browser); + searchMember(user); By chooseBy = By.xpath("//fieldset[@class='o_sel_usersearch_searchform']//div[@class='o_table_buttons']/button[@name='msc']"); browser.findElement(chooseBy).click(); @@ -78,6 +76,31 @@ public class TaxonomyLevelPage { return this; } + /** + * Search member and select them + * @param user + * @return + */ + private TaxonomyLevelPage searchMember(UserVO user) { + //Search by username + By usernameBy = By.cssSelector(".o_sel_usersearch_searchform input.o_sel_user_search_username[type='text']"); + OOGraphene.waitElement(usernameBy, browser); + browser.findElement(usernameBy).sendKeys(user.getLogin()); + + By searchBy = By.cssSelector(".o_sel_usersearch_searchform a.btn-default"); + OOGraphene.moveAndClick(searchBy, browser); + + // select all + By selectAll = By.xpath("//div[contains(@class,'modal')]//div[contains(@class,'o_table_checkall')]/a[i[contains(@class,'o_icon_check_on')]]"); + OOGraphene.waitElement(selectAll, browser); + if(browser instanceof FirefoxDriver) { + OOGraphene.waitingALittleLonger();// link is obscured by the scroll bar + } + browser.findElement(selectAll).click(); + OOGraphene.waitBusy(browser); + return this; + } + private TaxonomyLevelPage selectTab(By tabBy) { By tabLinkBy = By.cssSelector("ul.o_sel_taxonomy_level_tabs>li>a"); List<WebElement> tabLinks = browser.findElements(tabLinkBy); diff --git a/src/test/java/org/olat/selenium/page/user/ImportUserPage.java b/src/test/java/org/olat/selenium/page/user/ImportUserPage.java index 828c74bdb9bdc2aeb907a2203ccad2451219c00c..4b63537c60087ff1296ba93ebb930d62e0dc2d59 100644 --- a/src/test/java/org/olat/selenium/page/user/ImportUserPage.java +++ b/src/test/java/org/olat/selenium/page/user/ImportUserPage.java @@ -160,21 +160,18 @@ public class ImportUserPage { public ImportUserPage nextData() { OOGraphene.nextStep(browser); - //OOGraphene.closeBlueMessageWindow(browser); OOGraphene.waitElement(By.cssSelector("fieldset.o_sel_import_users_overview"), browser); return this; } public ImportUserPage nextOverview() { OOGraphene.nextStep(browser); - //OOGraphene.closeBlueMessageWindow(browser); OOGraphene.waitElement(By.cssSelector("fieldset.o_sel_groups_search"), browser); return this; } public ImportUserPage nextGroups() { OOGraphene.nextStep(browser); - //OOGraphene.closeBlueMessageWindow(browser); OOGraphene.waitElement(By.cssSelector("fieldset.o_sel_users_import_contact"), browser); return this; } @@ -185,7 +182,6 @@ public class ImportUserPage { */ public ImportUserPage finish() { OOGraphene.finishStep(browser); - OOGraphene.closeBlueMessageWindow(browser); return this; } diff --git a/src/test/java/org/olat/selenium/page/user/UserAdminPage.java b/src/test/java/org/olat/selenium/page/user/UserAdminPage.java index 94596f342a2dd63dc910d3a31367693e770718b3..5ce30b3119167eae71623a5dd146db55387051c4 100644 --- a/src/test/java/org/olat/selenium/page/user/UserAdminPage.java +++ b/src/test/java/org/olat/selenium/page/user/UserAdminPage.java @@ -61,7 +61,6 @@ public class UserAdminPage { public UserAdminPage openSearchUser() { //In case it stay in the way - OOGraphene.closeBlueMessageWindow(browser); By createBy = By.cssSelector(".o_tree li.o_sel_useradmin_search>div>span.o_tree_link>a"); OOGraphene.waitElement(createBy, 5, browser); browser.findElement(createBy).click(); @@ -85,7 +84,6 @@ public class UserAdminPage { * @return */ public UserAdminPage searchUserToDelete(String username) { - OOGraphene.closeBlueMessageWindow(browser); By createBy = By.cssSelector("fieldset.o_sel_user_search_form div.o_sel_user_search_username input[type='text']"); OOGraphene.waitElement(createBy, browser); browser.findElement(createBy).sendKeys(username); diff --git a/src/test/java/org/olat/selenium/page/user/UserToolsPage.java b/src/test/java/org/olat/selenium/page/user/UserToolsPage.java index 11c0146c7c2b9d087178694e29238ba8da065c9a..47805d7b3d17d25663ebec926509e4aff9021136 100644 --- a/src/test/java/org/olat/selenium/page/user/UserToolsPage.java +++ b/src/test/java/org/olat/selenium/page/user/UserToolsPage.java @@ -178,7 +178,6 @@ public class UserToolsPage { * Log out and wait until the login form appears */ public void logout() { - OOGraphene.closeBlueMessageWindow(browser); openUserToolsMenu(); By logoutBy = By.className("o_logout");