Skip to content

Commit

Permalink
[#244] fixed filepath handling for all OS
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernd Weigel committed Jul 23, 2024
1 parent 55bb965 commit c4cce53
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@ public NeodymiumAfterTestExecutionCallback()
@Override
public void afterTestExecution(ExtensionContext context) throws Exception
{
System.err.println("wtf?");
System.err.println(Neodymium.configuration().enableAcvancedScreenShots());
if (Neodymium.configuration().enableAcvancedScreenShots())
{
System.err.println("wtf^2?");
WebDriver driver = Neodymium.getDriver();
String timeStamp = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss").format(new java.util.Date());

Expand Down Expand Up @@ -132,9 +135,9 @@ public boolean doScreenshotForDriver(WebDriver driver, Capture captureMode, Stri
{
PageSnapshot snapshot = Shutterbug.shootPage(driver, captureMode);
BufferedImage image = snapshot.getImage();
String pathname = this.getFormatedReportsPath() + '\\' + testclassName;
String pathname = this.getFormatedReportsPath() + File.separator + testclassName;
Files.createDirectories(Paths.get(pathname));
String imagePath = pathname + '\\' + filename + ".png";
String imagePath = pathname + File.separator + filename + ".png";
File outputfile = new File(imagePath);
if (this.highlightViewport)
{
Expand Down

0 comments on commit c4cce53

Please sign in to comment.