diff options
author | skygo <skygo@unknown> | 2013-06-07 00:27:25 +0000 |
---|---|---|
committer | skygo <skygo@unknown> | 2013-06-07 00:27:25 +0000 |
commit | 1d3c7600c8162a2985ddc81d2ff4f52321451afe (patch) | |
tree | 876f8f8b354dca6b64c2b6a9f2f65cf7b284d7eb /archiva-modules | |
parent | 8c1904362cf07ab711c366fa6dc1767ac42a2ef5 (diff) | |
download | archiva-1d3c7600c8162a2985ddc81d2ff4f52321451afe.tar.gz archiva-1d3c7600c8162a2985ddc81d2ff4f52321451afe.zip |
add page source capture for fluent content may not be accurate
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1490482 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r-- | archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverTest.java | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverTest.java b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverTest.java index 94c7f393b..f184dd0b9 100644 --- a/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverTest.java +++ b/archiva-modules/archiva-web/archiva-webapp-test/src/test/java/org/apache/archiva/web/test/WebDriverTest.java @@ -33,7 +33,11 @@ import org.openqa.selenium.safari.SafariDriver; import java.io.File; import java.io.FileInputStream; +import java.io.IOException; import java.util.Properties; +import org.apache.commons.io.FileUtils; +import org.fluentlenium.core.Fluent; +import org.junit.Before; /** * @author Olivier Lamy @@ -42,11 +46,35 @@ public class WebDriverTest extends FluentTest { + @Override + public Fluent takeScreenShot( String fileName ) + { + try + { + // save html to have a minimum feedback if jenkins firefox not up + File fileNameHTML = new File( fileName + ".html" ); + FileUtils.writeStringToFile( fileNameHTML, getDriver().getPageSource() ); + } + catch ( IOException e ) + { + System.out.print( e.getMessage() ); + e.printStackTrace(); + } + return super.takeScreenShot( fileName ); + } + + @Before + public void init() + { + setSnapshotMode( Mode.TAKE_SNAPSHOT_ON_FAIL ); + setSnapshotPath( new File( "target", "errorshtmlsnap" ).getAbsolutePath() ); + } + @Test public void simpletest() throws Exception { - + Properties tomcatPortProperties = new Properties(); tomcatPortProperties.load( new FileInputStream( new File( System.getProperty( "tomcat.propertiesPortFilePath" ) ) ) ); |