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

Commit

Permalink
Merge pull request #585 from zanata/fix-broken-validation-test
Browse files Browse the repository at this point in the history
Fix the broken validations test
  • Loading branch information
djansen-redhat committed Sep 18, 2014
2 parents e83adb0 + 19ad2f8 commit 4bdcada
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
Expand Up @@ -342,16 +342,12 @@ public String getValidationMessageCurrentTarget() {
waitForTenSec().until(new Function<WebDriver, Boolean>() {
@Override
public Boolean apply(WebDriver driver) {
WebElement webElement = getDriver()
.findElement(By.className("selected"))
.findElements(By.className("gwt-DisclosurePanel"))
.get(2);
WebElement webElement = getTargetValidationBox();
return webElement.isDisplayed()
&& !webElement.getText().isEmpty();
}
});
return getDriver().findElements(By.className("gwt-DisclosurePanel"))
.get(2).getText();
return getTargetValidationBox().getText();
}

/**
Expand All @@ -361,11 +357,7 @@ public Boolean apply(WebDriver driver) {
*/
public boolean isValidationMessageCurrentTargetVisible() {
log.info("Query is validation message panel displayed");
return getDriver()
.findElement(By.className("selected"))
.findElements(By.className("transUnitCol")).get(1) // Right column
.findElement(By.className("gwt-DisclosurePanel"))
.isDisplayed();
return getTargetValidationBox().isDisplayed();
}

/**
Expand All @@ -388,8 +380,7 @@ public Boolean apply(WebDriver driver) {
*/
public EditorPage openValidationBox() {
log.info("Click to open Validation panel");
getDriver().findElements(By.className("gwt-DisclosurePanel")).get(2)
.click();
getTargetValidationBox().click();
waitForTenSec().until(new Function<WebDriver, Boolean>() {
@Override
public Boolean apply(WebDriver driver) {
Expand Down Expand Up @@ -507,9 +498,21 @@ public EditorPage inputFilterQuery(String query) {
editorFilterField.sendKeys(query + Keys.ENTER);
return this;
}

public String getFilterQuery() {
log.info("Query filter text");
return editorFilterField.getAttribute("value");
}

private WebElement getTranslationTargetColumn() {
return getDriver().findElement(By.className("selected"))
.findElements(By.className("transUnitCol"))
.get(1); // Right column
}

private WebElement getTargetValidationBox() {
return getTranslationTargetColumn()
.findElement(By.className("gwt-DisclosurePanel"));
}

}
Expand Up @@ -86,7 +86,6 @@ public void setValidationOptions() throws Exception {
"translation targets and displays them to the user",
tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
@Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
@Ignore("broken test")
public void verifyValidationsAreErrors() throws Exception {
VersionTranslationTab versionTranslationTab = new LoginWorkFlow()
.signIn("admin", "admin")
Expand Down

0 comments on commit 4bdcada

Please sign in to comment.