Fix InternationalizationTest

(cherry picked from commit d58a575)
This commit is contained in:
Vaclav Muzikar 2016-02-15 17:02:38 +01:00
parent 8006c64dba
commit 9bde0af0f1
3 changed files with 19 additions and 3 deletions

View file

@ -6,6 +6,8 @@ import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import static org.keycloak.testsuite.util.WaitUtils.*;
/**
* @author Vaclav Muzikar <vmuzikar@redhat.com>
*/
@ -17,11 +19,14 @@ public class Dropdown {
private WebDriver driver;
public String getSelected() {
return dropDownRoot.findElement(By.xpath("./a")).getText();
waitUntilElement(dropDownRoot).is().present();
WebElement element = dropDownRoot.findElement(By.xpath("./a"));
return element.getText();
}
public void selectByText(String text) {
String href = dropDownRoot.findElement(By.xpath("./ul/li/a[text()='" + text + "']")).getAttribute("href");
driver.navigate().to(href);
waitUntilElement(dropDownRoot).is().present();
WebElement element = dropDownRoot.findElement(By.xpath("./ul/li/a[text()='" + text + "']"));
driver.navigate().to(element.getAttribute("href"));
}
}

View file

@ -4,6 +4,8 @@ import org.keycloak.testsuite.console.page.AdminConsoleRealm;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import static org.keycloak.testsuite.util.WaitUtils.*;
/**
*
* @author tkyjovsk
@ -37,34 +39,42 @@ public class RealmSettings extends AdminConsoleRealm {
private WebElement defenseTab;
public void general() {
waitUntilElement(generalSettingsTab).is().present();
generalSettingsTab.click();
}
public void login() {
waitUntilElement(loginSettingsTab).is().present();
loginSettingsTab.click();
}
public void keys() {
waitUntilElement(keysSettingsTab).is().present();
keysSettingsTab.click();
}
public void email() {
waitUntilElement(emailSettingsTab).is().present();
emailSettingsTab.click();
}
public void themes() {
waitUntilElement(themeSettingsTab).is().present();
themeSettingsTab.click();
}
public void cache() {
waitUntilElement(cacheSettingsTab).is().present();
cacheSettingsTab.click();
}
public void tokens() {
waitUntilElement(tokenSettingsTab).is().present();
tokenSettingsTab.click();
}
public void securityDefenses() {
waitUntilElement(defenseTab).is().present();
defenseTab.click();
}

View file

@ -29,6 +29,7 @@ public class InternationalizationTest extends AbstractRealmTest {
tabs().themes();
themeSettingsPage.setInternatEnabled(true);
themeSettingsPage.saveTheme();
assertAlertSuccess();
realmSettingsPage.setAdminRealm(AuthRealm.TEST);
accountPage.setAuthRealm(testRealmPage);
deleteAllCookiesForTestRealm();