<copy todir="${project.build.directory}/local-repo">
<fileset dir="src/test/resources/local-repo"/>
</copy>
+ <copy todir="${project.build.directory}/errorshtmlsnap/css">
+ <fileset dir="${webappDirectory}/css"/>
+ </copy>
+ <copy todir="${project.build.directory}/errorshtmlsnap/js">
+ <fileset dir="${webappDirectory}/js"/>
+ </copy>
+ <copy todir="${project.build.directory}/errorshtmlsnap/img">
+ <fileset dir="${webappDirectory}/img"/>
+ </copy>
+ <copy todir="${project.build.directory}/errorshtmlsnap/imgages">
+ <fileset dir="${webappDirectory}/images"/>
+ </copy>
</tasks>
</configuration>
</execution>
import java.io.File;
import java.io.FileInputStream;
+import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
+import org.apache.commons.io.FileUtils;
/**
* @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
String fileBaseName = methodName + "_" + className + ".java_" + lineNumber + "-" + time;
selenium.windowMaximize();
-
+
+ try
+ {
+ // save html to have a minimum feedback if jenkins firefox not up
+ File fileNameHTML = new File( new File( "target", "errorshtmlsnap" ) , fileBaseName + ".html" );
+ FileUtils.writeStringToFile( fileNameHTML, selenium.getHtmlSource() );
+ }
+ catch ( IOException e )
+ {
+ System.out.print( e.getMessage() );
+ e.printStackTrace();
+ }
+
File fileName = new File( targetPath, fileBaseName + ".png" );
selenium.captureEntirePageScreenshot( fileName.getAbsolutePath(), "background=#FFFFFF" );
-
+
return fileName.getAbsolutePath();
}