Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge branch 'integration/master' of github.com:zanata/zanata into in…
Browse files Browse the repository at this point in the history
…tegration/master
  • Loading branch information
Alex Eng committed May 24, 2012
2 parents 54ef30f + 6bd2ade commit b710b38
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
16 changes: 12 additions & 4 deletions functional-test/src/main/java/org/zanata/page/AddLanguagePage.java
Expand Up @@ -23,24 +23,32 @@
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.ui.Select;

public class AddLanguagePage extends AbstractPage
{
@FindBy(tagName = "select")
private WebElement languageSelection;
@FindBy(xpath = "//input[@type='text' and contains(@id, 'localeName')]")
private WebElement languageInput;

@FindBy(xpath = "//input[@value='Save']")
private WebElement saveButton;

@FindBy(xpath = "//input[@type='checkbox' and contains(@name, 'enabledByDefault')]")
private WebElement enabledByDefaultInput;

public AddLanguagePage(final WebDriver driver)
{
super(driver);
}

public AddLanguagePage selectLanguage(String language)
{
new Select(languageSelection).selectByValue(language);
languageInput.sendKeys(language);
return this;
}

public AddLanguagePage enableLanguageByDefault()
{
enabledByDefaultInput.click();
return this;
}

Expand Down
Expand Up @@ -45,6 +45,7 @@ public ManageLanguagePage addLanguageAndJoin(String localeId)

public ManageLanguagePage addLanguage(String localeId)
{
return goToHome().goToAdministration().goToManageLanguagePage().addNewLanguage().selectLanguage(localeId).saveLanguage();
return goToHome().goToAdministration().goToManageLanguagePage().addNewLanguage()
.enableLanguageByDefault().selectLanguage(localeId).saveLanguage();
}
}

0 comments on commit b710b38

Please sign in to comment.