Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix a flakiness observed when using master.runScript() #618

Merged
merged 1 commit into from
Nov 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
package org.jenkinsci.test.acceptance.po;

import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.NoSuchElementException;

/**
* Encapsulate CodeMirror wizardry.
Expand All @@ -47,7 +48,8 @@ public void set(String content) {
}

// can't use find() because it wants a visible element
driver.findElement(by.xpath("//*[@path='%s']", getPath())); // wait until the element in question appears in DOM
// wait until the element in question appears in DOM as it is added by JavaScript
waitFor().ignoring(NoSuchElementException.class).until(() -> driver.findElement(by.xpath("//*[@path='%s']", getPath())));

executeScript(scriptSet, String.format("//*[@path='%s']/following-sibling::div", getPath()), content);
}
Expand Down