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

GraphicsMagick fails when image files are deleted between tests #132

Open
JamEngulfer opened this issue Dec 24, 2015 · 1 comment
Open

Comments

@JamEngulfer
Copy link

I've found an issue with WebdriverCSS where gm will return an error when the image/baseline files are deleted in-between running two tests. The problem doesn't occur when the node server is restarted between tests, only when the files are deleted as the server process is on.

The error I get is this:

Error: [webdrivercss("test",{"name":"body","elem":"body"})] <= 
 Command failed: gm convert: Unable to open file (images/active/baselines/test.720px.png) [No such file or directory].

I've created the smallest possible test server for this. It can be found here: https://gist.github.com/JamEngulfer/a84dcd335952956e7d17

This is a problem, because other than deleting the files and running tests again, there's no practical way to create new baseline images (apart from running a failed test multiple times, but I'm discounting that).

An important note, if the screenWidth property is undefined, this problem doesn't appear.

The line on which the error occurs is most likely cropImage.js:67, based on the line numbers in the current repo. The line is return shot.write(that.filename || that.baselinePath, cb);

@JamEngulfer
Copy link
Author

Upon a little more investigation, it looks like when the test is run after the images have been deleted, webdrivercss doesn't save the result of the screenshot to the file path, but continues looking for it anyway.

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

1 participant