From 03e3823e8df5b7937979e38c9878cde6af049338 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Sat, 10 Oct 2015 13:37:34 +0300 Subject: [PATCH] Switch to Firefox selenium driver, since ChromeDriver throws error on 1 test case without obvious reason --- .../main/java/org/teavm/maven/SeleniumRunStrategy.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/maven/plugin/src/main/java/org/teavm/maven/SeleniumRunStrategy.java b/tools/maven/plugin/src/main/java/org/teavm/maven/SeleniumRunStrategy.java index 1bb827c43..721f60b35 100644 --- a/tools/maven/plugin/src/main/java/org/teavm/maven/SeleniumRunStrategy.java +++ b/tools/maven/plugin/src/main/java/org/teavm/maven/SeleniumRunStrategy.java @@ -47,7 +47,7 @@ public class SeleniumRunStrategy implements TestRunStrategy { @Override public void beforeThread() { - RemoteWebDriver driver = new RemoteWebDriver(url, DesiredCapabilities.chrome()); + RemoteWebDriver driver = new RemoteWebDriver(url, DesiredCapabilities.firefox()); webDriver.set(driver); } @@ -71,8 +71,10 @@ public class SeleniumRunStrategy implements TestRunStrategy { log.error("Error occured running test " + testCase.getTestMethod(), e); @SuppressWarnings("unchecked") List errors = (List) js.executeScript("return window.jsErrors;"); - for (Object error : errors) { - log.error(" -- additional error: " + error); + if (errors != null) { + for (Object error : errors) { + log.error(" -- additional error: " + error); + } } return null; }