pretty_face icon indicating copy to clipboard operation
pretty_face copied to clipboard

Screenshots are not created on windows

Open sreepadbhagwat opened this issue 11 years ago • 2 comments

Screenshots are not created or embedded in html report on windows.

sreepadbhagwat avatar Feb 13 '14 03:02 sreepadbhagwat

you need to provide more info to get help. ruby version? windows version? pretty_face gem version? etc. You seem to be following the book. Did you add the code to the hooks file?

uscengineer avatar Feb 13 '14 08:02 uscengineer

I do no think this is a Pretty Face issue. Are you using Time.now in the screenshot filename (in accordance with what Page 192 of the Cucumber and Cheese book suggests)? This is a problem for Windows OS's since Time.now will output like this: 2014-02-17 12:21:44 -0500. The problem is the colon :. This is an invalid character for filenames in Windows. Thus, that part of your code throws an error, the screenshot does not save, and any code after that erring line in your After hook will not execute (i.e. @browser.close).

As a suggestion, I use Time.now.strftime("%Y-%m-%d_%H-%M-%S") instead.

saclark avatar Feb 17 '14 17:02 saclark