From 2eb8409eb6b0f44ce66649ea309796f6e095c941 Mon Sep 17 00:00:00 2001 From: skygo Date: Mon, 24 Jun 2013 18:21:01 +0000 Subject: [PATCH] screenshot in target folder (my mistake) git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1496149 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva/web/test/WebDriverBrowseTest.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverBrowseTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverBrowseTest.java index bc96ad63f..2d97c095f 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverBrowseTest.java +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverBrowseTest.java @@ -51,25 +51,26 @@ public class WebDriverBrowseTest @Override public Fluent takeScreenShot( String fileName ) { + File fileNameHTML = new File( "target", "errorshtmlsnap" ); try { // save html to have a minimum feedback if jenkins firefox not up - File fileNameHTML = new File( fileName + ".html" ); - FileUtils.writeStringToFile( fileNameHTML, getDriver().getPageSource() ); + fileNameHTML = new File( fileNameHTML, fileName ); + FileUtils.writeStringToFile( new File ( new File( "target", "errorshtmlsnap" ) , fileName + ".html"), getDriver().getPageSource() ); + } catch ( IOException e ) { - System.out.print( e.getMessage() ); e.printStackTrace(); } - return super.takeScreenShot( fileName ); + return super.takeScreenShot( fileNameHTML.getAbsolutePath() ); + } @Before public void init() { setSnapshotMode( Mode.TAKE_SNAPSHOT_ON_FAIL ); - setSnapshotPath( new File( "target", "errorshtmlsnap" ).getAbsolutePath() ); } @Test @@ -118,10 +119,10 @@ public class WebDriverBrowseTest await().atMost( 2, TimeUnit.SECONDS ).until( "#main_browse_result" ).isPresent(); // give me search page :( not browse page - takeScreenShot( "search" ); + takeScreenShot( "search.png" ); goTo( "http://localhost:" + tomcatPort + "/archiva/index.html#browse?request_lang=en" ); - takeScreenShot( "browse" ); + takeScreenShot( "browse.png" ); // give me a browse page }