resolve 'There is no context available for qualifier' message

This commit is contained in:
vramik 2017-02-02 09:18:38 +01:00
parent aec59a7e91
commit 7abe140621

View file

@ -71,10 +71,14 @@ public class TestEventsLogger extends RunListener {
}
private void createPageSrcFile(Description d) throws IOException {
if (driver != null && driver.getPageSource() != null) {
String pageSourceLocation = System.getProperty("page.source.location", "target/failed-tests/page-source/");
FileUtils.writeStringToFile(new File(pageSourceLocation + d.getTestClass().getSimpleName() + "/" + d.getMethodName() + ".html"),
driver.getPageSource());
try {
if (driver != null && driver.getPageSource() != null) {
String pageSourceLocation = System.getProperty("page.source.location", "target/failed-tests/page-source/");
FileUtils.writeStringToFile(new File(pageSourceLocation + d.getTestClass().getSimpleName() + "/" + d.getMethodName() + ".html"),
driver.getPageSource());
}
} catch (IllegalStateException ex) {
Logger.getLogger(TestEventsLogger.class).warn(ex.getMessage());
}
}
}