Permalink
Browse files

SetScreenshot commented out

  • Loading branch information...
1 parent dec68df commit e851ecff724676363bbbf357120c820f29a7bb0c @sebarmeli committed Nov 15, 2011
Showing with 22 additions and 22 deletions.
  1. +2 −1 README.md
  2. +20 −21 src/main/resources/archetype-resources/src/test/java/pages/TestBase.java
View
@@ -44,7 +44,8 @@ Hudson/Jenkins).
decouple the DOM element from the functionalities offered by the page.
-In case of test failure, a screenshot will be taken if the driver supports that feature.
+In the TestBase class, I commented out the method launched after the suite runs and it takes screenshots in case of failure. Feel free to uncomment it out if you need and if your driver supports that
+funcitonality. (at the moment it's not supported on mobile devices)
Adding Chrome Driver to the project
@@ -65,25 +65,24 @@ public void tearDown() {
}
}
- @AfterMethod
- public void setScreenshot(ITestResult result) {
- if (!result.isSuccess()) {
- try {
- WebDriver returned = new Augmenter().augment(webDriver);
- if (returned != null) {
- File f = ((TakesScreenshot) returned)
- .getScreenshotAs(OutputType.FILE);
- try {
- FileUtils.copyFile(f, new File(SCREENSHOT_FOLDER
- + result.getName() + SCREENSHOT_FORMAT));
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- } catch (ScreenshotException se) {
- se.printStackTrace();
- }
- }
- }
-
+// @AfterMethod
+// public void setScreenshot(ITestResult result) {
+// if (!result.isSuccess()) {
+// try {
+// WebDriver returned = new Augmenter().augment(webDriver);
+// if (returned != null) {
+// File f = ((TakesScreenshot) returned)
+// .getScreenshotAs(OutputType.FILE);
+// try {
+// FileUtils.copyFile(f, new File(SCREENSHOT_FOLDER
+// + result.getName() + SCREENSHOT_FORMAT));
+// } catch (IOException e) {
+// e.printStackTrace();
+// }
+// }
+// } catch (ScreenshotException se) {
+// se.printStackTrace();
+// }
+// }
+// }
}

0 comments on commit e851ecf

Please sign in to comment.