Skip to content
This repository has been archived by the owner on May 8, 2019. It is now read-only.

Failed screenshot are not saved on results option folder #9

Open
nuriasuarez opened this issue Feb 1, 2016 · 3 comments
Open

Failed screenshot are not saved on results option folder #9

nuriasuarez opened this issue Feb 1, 2016 · 3 comments

Comments

@nuriasuarez
Copy link

Hi,
I configured the task like this:
phantomcss: { desktop: { options: { screenshots: 'test/static/desktop/', results: 'logs/results/desktop/', viewportSize: [1280, 800], rootUrl: 'http://localhost:8080/' // Optional }, src: [ 'test/phantomcss/**.js' ] } },

But when I run the tests and those failed, the results folder is empty and all the images are localized on screenshots folder set.
For example I have a wizard test. when it failed the 'test/static/desktop/' folder has:

  • wizard.png
  • wizard.fail.png
  • wizard.diff.png

I expected to have on 'test/static/desktop/' folder just wizard.png and in 'logs/results/desktop/' (result option) wizard.fail.png.
Maybe I am wrong but I want to know if this is the behavior expected.

Thanks!

@jbidston
Copy link

jbidston commented Mar 9, 2016

Hi,

I am seeing the same issue.

I've had a look at phantomcss.js and I think there may be something odd around folder paths.

I made the following modifications, and it appeared to work as I expected:

Around line 88:

var diffScreenshots = grunt.file.expand([
  // path.join(folderpath + '/' + options.screenshots, '*diff.png'),
  // path.join(folderpath + '/' + options.screenshots, '*fail.png'),
     path.join(options.screenshots, '*diff.png'),
     path.join(options.screenshots, '*fail.png'),
]);

And around line 121:

// Copy fixtures, diffs, and failure images to the results directory
// var allScreenshots = grunt.file.expand(path.join(folderpath + '/' + options.screenshots, '**.png'));
   var allScreenshots = grunt.file.expand(path.join(options.screenshots, '**.png'));

options.screenshots appears to already include the folderpath, while options.results does not.

Thanks
Jonathan

@sstraatemans
Copy link

having the same problem.
the changes of @jbidston seem to work

@jbidston
Copy link

As a side note, this only seems to be happening on a Windows machine.

The folders work as expected on my Mac.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants