diff --git a/functional-test/src/main/java/org/zanata/page/AbstractPage.java b/functional-test/src/main/java/org/zanata/page/AbstractPage.java index 8951570a6f..c3d76bc899 100644 --- a/functional-test/src/main/java/org/zanata/page/AbstractPage.java +++ b/functional-test/src/main/java/org/zanata/page/AbstractPage.java @@ -222,6 +222,8 @@ public boolean apply(WebDriver input) { // if we get here, the old page is still there return false; } catch (StaleElementReferenceException e) { + // http://www.obeythetestinggoat.com/how-to-get-selenium-to-wait-for-page-load-after-a-click.html + // // This exception means the new page has loaded // (or started to). String script = "return document.readyState === " + diff --git a/functional-test/src/main/java/org/zanata/page/CorePage.java b/functional-test/src/main/java/org/zanata/page/CorePage.java index 23681e430d..a114a744ea 100644 --- a/functional-test/src/main/java/org/zanata/page/CorePage.java +++ b/functional-test/src/main/java/org/zanata/page/CorePage.java @@ -126,15 +126,6 @@ public boolean apply(WebDriver input) { */ public List expectErrors() { waitForPageSilence(); - String msg = "an error message"; - logWaiting(msg); -// waitForAMoment().withMessage(msg).until(new Predicate() { -// @Override -// public boolean apply(WebDriver input) { -// List errors = getErrors(); -// return !errors.isEmpty(); -// } -// }); return getErrors(); } diff --git a/functional-test/src/main/java/org/zanata/page/WebDriverFactory.java b/functional-test/src/main/java/org/zanata/page/WebDriverFactory.java index e7b1ae2cc3..656e7ebc88 100644 --- a/functional-test/src/main/java/org/zanata/page/WebDriverFactory.java +++ b/functional-test/src/main/java/org/zanata/page/WebDriverFactory.java @@ -91,14 +91,22 @@ private String[] getLogTypes() { }; } + /** + * Retrieves all the outstanding WebDriver logs of the specified type. + * @param type a log type from org.openqa.selenium.logging.LogType + * (but they don't all seem to work) + */ public LogEntries getLogs(String type) { - JavascriptExecutor exec = (JavascriptExecutor) getDriver(); - exec.executeScript("console.log('Hello');"); Logs logs = getDriver().manage().logs(); LogEntries logEntries = logs.get(type); return logEntries; } + /** + * Logs all the outstanding WebDriver logs of the specified type. + * @param type a log type from org.openqa.selenium.logging.LogType + * (but they don't all seem to work) + */ public void logLogs(String type) { String logName = WebDriverFactory.class.getName() + "." + type; Logger log = LoggerFactory.getLogger(logName);