assertj / assertj-swing

Fluent assertions for Swing apps
Other
107 stars 51 forks source link

FEST aborts TestNG Test Execution #46

Open croesch opened 10 years ago

croesch commented 10 years ago

Issue by Alex Ruiz from Sun, 2 Aug 2009 23:56:23 -0500 Originally opened as http://jira.codehaus.org/browse/FEST-208


"ScreenshotOnFailureListenerTest " class seems to be capable of taking screen shot only once in test failure for a method, when I combine this with data driven testing of TestNG, my test execution is aborted as FEST tries to save another image on same path, and I get exception like this -

*******************
Exception in thread "main" org.fest.util.FilesException: Unable to create the new file 'D:\Workspace\FunctionLibrary\reportng\SelTestAutomation Results\com.test.newtest.Login.login.png': a file was found with the same path
*******************

This happens cause "screenshotFileName" method would create same file name again and eventually fail in saving another image with same name in that location. May be we we could append UUID with it to make it unique for each instance of failure.

I could not find an url to browser source code locally and modify this method and build FEST for me, Could any one plase direct me to source core url?

Thanks in Advance,
Tarun K


votes (original issue): 1 watches (original issue): 0

croesch commented 10 years ago

Comment by alexruiz from Mon, 8 Mar 2010 00:53:02 -0600


I looked at the source code, and we are including the parameter values as part of the name of the screenshot file. At this point I'm confused if this is still a bug

You can find information about how to get the source code at http://code.google.com/p/fest/wiki/Source?tm=4 . If you'd like to browse the code, the URL is http://fisheye2.atlassian.com/changelog/fest

It would help me a lot if you could please attach a failing test.

Regards,
-Alex

croesch commented 10 years ago

Comment by mortenbreum from Thu, 8 Jul 2010 03:19:03 -0500


I think I'm having the same issue with a cruise control instance.

The output I get, is
org.fest.swing.junit.ant.ImageHandler decodeBase64AndSaveAsPng
SEVERE: Unable to create the new file '[cruisecontrol-dir]\webapps\junit-report\.[screenshotclass].png': a file was found with the same path
2010-07-07 15:43:05 org.fest.swing.junit.ant.ImageHandler decodeBase64AndSaveAsPng

This means that it is not the generation and saving of the screenshot that fails - rather it's the festreport task that needs to clean existing .png files before producing a new report.

Does that make sense, or should I insert a <delete>-task in ant before calling festreport?
/Morten