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 #610 from zanata/fix-editor-config-id
Browse files Browse the repository at this point in the history
Fix broken editor test
  • Loading branch information
djansen-redhat committed Oct 23, 2014
2 parents 0dbeebb + 633dc30 commit 56cbbb3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Expand Up @@ -58,6 +58,8 @@ public enum Validations {
// first %d is row index, second %d is plural form index (i.e. 0-6)
private static final String TARGET_ID_FMT = "gwt-debug-%d-target-%d";

private static final String EDITOR_SYNTAXHIGHLIGHT =
"gwt-debug-syntax-highlight-chk-input";
// buttons id format
private static final String APPROVE_BUTTON_ID_FMT =
"gwt-debug-target-%d-save-approve";
Expand Down Expand Up @@ -106,7 +108,8 @@ public List<List<String>> getGlossaryResultTable() {
new Function<WebDriver, List<List<String>>>() {
@Override
public List<List<String>> apply(WebDriver input) {
if (input.findElements(glossaryNoResultBy).size() == 1) {
if (input.findElements(glossaryNoResultBy).size() ==
1) {
return Collections.emptyList();
}
List<List<String>> resultTable =
Expand Down Expand Up @@ -148,7 +151,8 @@ public String getMessageSourceAtRowIndex(int rowIndex, Plurals plural) {
*/
public String getMessageTargetAtRowIndex(final int rowIndex) {
log.info("Query text flow target at {}", rowIndex);
return getCodeMirrorContent(rowIndex, TARGET_ID_FMT, Plurals.TargetSingular);
return getCodeMirrorContent(rowIndex, TARGET_ID_FMT,
Plurals.TargetSingular);
}

private String getCodeMirrorContent(final long rowIndex,
Expand All @@ -173,8 +177,8 @@ public EditorPage setSyntaxHighlighting(boolean option) {
WebElement highlight = waitForAMoment().until(new Function<WebDriver, WebElement>() {
@Override
public WebElement apply(WebDriver input) {
WebElement element = getDriver()
.findElement(By.id("gwt-uid-143"));
WebElement element =
getDriver().findElement(By.id(EDITOR_SYNTAXHIGHLIGHT));
if (element.isDisplayed()) {
return element;
}
Expand Down Expand Up @@ -207,7 +211,6 @@ public Boolean apply(WebDriver input) {
.isDisplayed();
}
});

}

/**
Expand Down
Expand Up @@ -122,7 +122,6 @@ public String call() throws Exception {

private static EditorPage openEditor() {
return new BasicWorkFlow().goToEditor("obsolete-test", "master", "fr",
"message1")
.setSyntaxHighlighting(false);
"message1");
}
}
Expand Up @@ -96,6 +96,8 @@ public EditorOptionsView(WebTransMessages messages,
.setText(messages.showTransUnitDetails());
showOptionalTransUnitDetailsChk.setTitle(messages
.showTransUnitDetailsTooltip());

useCodeMirrorChk.ensureDebugId("syntax-highlight-chk");
}

@Override
Expand Down

0 comments on commit 56cbbb3

Please sign in to comment.