Skip to content
Snippets Groups Projects
Commit 4f779e55 authored by srosse's avatar srosse
Browse files

no-jira: hardened selenium for Firefox

parent c2e5d613
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
*/ */
package org.olat.ldap; package org.olat.ldap;
import javax.naming.NamingException;
import javax.naming.directory.Attributes; import javax.naming.directory.Attributes;
import javax.naming.ldap.LdapContext; import javax.naming.ldap.LdapContext;
...@@ -68,7 +67,7 @@ public class LDAPLoginTest extends OlatTestCase { ...@@ -68,7 +67,7 @@ public class LDAPLoginTest extends OlatTestCase {
} }
@Test @Test
public void testUserBind() throws NamingException { public void testUserBind() throws Exception {
Assume.assumeTrue(ldapLoginModule.isLDAPEnabled()); Assume.assumeTrue(ldapLoginModule.isLDAPEnabled());
LDAPError errors = new LDAPError(); LDAPError errors = new LDAPError();
......
...@@ -56,6 +56,7 @@ public class ContactPage { ...@@ -56,6 +56,7 @@ public class ContactPage {
browser.findElement(subjectBy).sendKeys(subject); browser.findElement(subjectBy).sendKeys(subject);
String containerCssSelector = "div.o_sel_contact_body"; String containerCssSelector = "div.o_sel_contact_body";
OOGraphene.waitTinymce(browser);
OOGraphene.tinymce(body, containerCssSelector, browser); OOGraphene.tinymce(body, containerCssSelector, browser);
return this; return this;
} }
......
...@@ -42,6 +42,7 @@ public class AuthoringEnvPage { ...@@ -42,6 +42,7 @@ public class AuthoringEnvPage {
public static final By createMenuCaretBy = By.cssSelector("a.o_sel_author_create"); public static final By createMenuCaretBy = By.cssSelector("a.o_sel_author_create");
public static final By createMenuBy = By.cssSelector("ul.o_sel_author_create"); public static final By createMenuBy = By.cssSelector("ul.o_sel_author_create");
public static final By generaltabBy = By.className("o_sel_edit_repositoryentry");
private WebDriver browser; private WebDriver browser;
...@@ -135,7 +136,8 @@ public class AuthoringEnvPage { ...@@ -135,7 +136,8 @@ public class AuthoringEnvPage {
browser.findElement(submitBy).click(); browser.findElement(submitBy).click();
OOGraphene.waitBusy(browser); OOGraphene.waitBusy(browser);
OOGraphene.waitModalDialogDisappears(browser); OOGraphene.waitModalDialogDisappears(browser);
OOGraphene.waitElement(RepositoryEditDescriptionPage.generaltabBy, browser); OOGraphene.waitElement(generaltabBy, browser);
OOGraphene.waitTinymce(browser);
return new RepositorySettingsPage(browser); return new RepositorySettingsPage(browser);
} }
...@@ -197,7 +199,7 @@ public class AuthoringEnvPage { ...@@ -197,7 +199,7 @@ public class AuthoringEnvPage {
saveButton.click(); saveButton.click();
OOGraphene.waitBusy(browser); OOGraphene.waitBusy(browser);
OOGraphene.waitModalDialogDisappears(browser); OOGraphene.waitModalDialogDisappears(browser);
OOGraphene.waitElement(RepositoryEditDescriptionPage.generaltabBy, browser); OOGraphene.waitElement(generaltabBy, browser);
OOGraphene.waitTinymce(browser); OOGraphene.waitTinymce(browser);
} }
return this; return this;
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
package org.olat.selenium.page.repository; package org.olat.selenium.page.repository;
import org.olat.selenium.page.graphene.OOGraphene; import org.olat.selenium.page.graphene.OOGraphene;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriver;
/** /**
...@@ -32,8 +31,6 @@ import org.openqa.selenium.WebDriver; ...@@ -32,8 +31,6 @@ import org.openqa.selenium.WebDriver;
* *
*/ */
public class RepositoryEditDescriptionPage { public class RepositoryEditDescriptionPage {
public static final By generaltabBy = By.className("o_sel_edit_repositoryentry");
private final WebDriver browser; private final WebDriver browser;
......
...@@ -52,6 +52,9 @@ public class TaxonomyTreePage { ...@@ -52,6 +52,9 @@ public class TaxonomyTreePage {
* @return Itself * @return Itself
*/ */
public TaxonomyTreePage atLeastOneLevel(String identifier, String name) { public TaxonomyTreePage atLeastOneLevel(String identifier, String name) {
By tableTreeBy = By.cssSelector("div.o_sel_taxonomy_levels_tree table");
OOGraphene.waitElement(tableTreeBy, browser);
By tableBy = By.xpath("//div[contains(@class,'o_sel_taxonomy_levels_tree')]//table//tr/td[text()[contains(.,'" + identifier + "')]]"); By tableBy = By.xpath("//div[contains(@class,'o_sel_taxonomy_levels_tree')]//table//tr/td[text()[contains(.,'" + identifier + "')]]");
List<WebElement> tableEls = browser.findElements(tableBy); List<WebElement> tableEls = browser.findElements(tableBy);
if(tableEls.isEmpty()) { if(tableEls.isEmpty()) {
...@@ -83,6 +86,7 @@ public class TaxonomyTreePage { ...@@ -83,6 +86,7 @@ public class TaxonomyTreePage {
By identifierBy = By.cssSelector("div.o_sel_taxonomy_level_identifier input[type='text']"); By identifierBy = By.cssSelector("div.o_sel_taxonomy_level_identifier input[type='text']");
OOGraphene.waitElement(identifierBy, browser); OOGraphene.waitElement(identifierBy, browser);
OOGraphene.waitTinymce(browser);// to be nice to firefox
browser.findElement(identifierBy).sendKeys(identifier); browser.findElement(identifierBy).sendKeys(identifier);
By nameBy = By.cssSelector("div.o_sel_taxonomy_level_name input[type='text']"); By nameBy = By.cssSelector("div.o_sel_taxonomy_level_name input[type='text']");
...@@ -92,6 +96,10 @@ public class TaxonomyTreePage { ...@@ -92,6 +96,10 @@ public class TaxonomyTreePage {
browser.findElement(saveBy).click(); browser.findElement(saveBy).click();
OOGraphene.waitBusy(browser); OOGraphene.waitBusy(browser);
OOGraphene.waitModalDialogDisappears(browser); OOGraphene.waitModalDialogDisappears(browser);
// wait update in the table
By editTabsBy = By.className("o_sel_taxonomy_level_tabs");
OOGraphene.waitElement(editTabsBy, browser);
return this; return this;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment