You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry, I couldn't compare screenshot "basicorderform","body":
ImagickException: Unable to write the file: /web/ee2/tests/_log/debug/tmp//web/ee2/tests/cart/BasicNewsTrialNewUser.basicorderform.png
Looking closely at the path you'll see /web/ee2/tests/ repeated twice. The first one is from Configuration::logDir() and the second one is being generated in VisualCeption::getScreenshotName.
That method calls $this->test->getFilename() to retrieve the test's filename, which is the source of the second path.
Removing $caseName from the return string fixes my basic test, but I'm not familiar enough with what other features this may affect that are looking for that screenshot name to be including a full path....
I don't think the problem is permissions. The problem is that $this->test->getFilename() is returning the full path to the test file, which you are then appending to the Codeception logDir which already contains the full path:
Ok, now I the the problem. We have a flat structure in our test files at the moment, so we do not run into that problem.
I think we are able to remove the tmp image as it is not needed if you use the facebook webdriver executor directly. But we will run into the same problem when we store the reference or compare image.
We have to possible solutions:
create the folders according to the project structure
I guess I know why we can't reproduce your problem. You are using cests, right? We test cepts. That's why getFileName returns the classname in our case, but does returns the path in your test.
The bug should be fixed. The filename is very ugly but we use the same naming convention as codeception 2.0 makeScreenshot(). If there is a fix/beautification in 2.0 we will switch to that one.
Activity
phmLabs commentedon Mar 25, 2014
Hi, I changed some permissions and swiched from mkdir( $dir, 0666) to mkdir( $dir, 0777, true) can you verify the changes took effect?
phmLabs commentedon Mar 25, 2014
Be careful. We changed the methods name to seeVisualChanges and dontSeeVisualChanges.
thinkspill commentedon Mar 25, 2014
I don't think the problem is permissions. The problem is that
$this->test->getFilename()is returning the full path to the test file, which you are then appending to the CodeceptionlogDirwhich already contains the full path:$logdir: /web/ee2/tests/_log/debug/tmp/$testGetFileName: /web/ee2/tests/cart/BasicNewsTrialNewUserCeptYou strip off the Cept, append a .png, and then concatenate the two strings, resulting in this:
/web/ee2/tests/_log/debug/tmp//web/ee2/tests/cart/BasicNewsTrialNewUser.basicorderform.pngMy guess is a correct output for this would be:
/web/ee2/tests/_log/debug/tmp/BasicNewsTrialNewUser.basicorderform.pngphmLabs commentedon Mar 25, 2014
Ok, now I the the problem. We have a flat structure in our test files at the moment, so we do not run into that problem.
I think we are able to remove the tmp image as it is not needed if you use the facebook webdriver executor directly. But we will run into the same problem when we store the reference or compare image.
We have to possible solutions:
What would be the prefered way?
thinkspill commentedon Mar 25, 2014
If the goal is to generate a system-unique filename, converting all directory separators to underscores in GetScreenShotName might be sufficient.
sebastianneubert commentedon Mar 25, 2014
Can I get your codeception.yml file?
phmLabs commentedon Mar 25, 2014
The problem is that the getFileName method returns a relative path in our virtual machine and on travis ci.
thinkspill commentedon Mar 25, 2014
Relevant sections of
codeception.yml. Let me know if you're looking for another section.phmLabs commentedon Mar 25, 2014
I guess I know why we can't reproduce your problem. You are using cests, right? We test cepts. That's why getFileName returns the classname in our case, but does returns the path in your test.
Tomorrow I will check my assumption.
thinkspill commentedon Mar 25, 2014
No, I usually use Cepts:
/web/ee2/tests/cart/BasicNewsTrialNewUserCept.phpfor example.Important to note is that I'm using the Codeception 2.0 beta. Maybe this is a change from 1.8.x. that it returns the full path.
phmLabs commentedon Mar 25, 2014
Ok, I always confuse those two. We are using cests :)
thinkspill commentedon Mar 25, 2014
Right, I'm using the single test file Cept format, rather than the class-based Cest format.
thinkspill commentedon Mar 25, 2014
Interestingly, however, it is
Cept.phpyou are removing from the filename insidegetScreenshotName:$caseName = str_replace('Cept.php', '', $this->test->getFileName());If you all use
CestI'm surprised you're removingCepthere.phmLabs commentedon Mar 25, 2014
Damn. I created a Cept and the travis CI works like a charm.
https://travis-ci.org/DigitalProducts/codeception-module-visualception/jobs/21534609
I guess we have to check Codeception 2.0.
phmLabs commentedon Mar 26, 2014
Ok, it's a 2.0 "Bug".
I created a travis environment for the beta and it fails. The getFileName function has changed its signature.
phmLabs commentedon Mar 26, 2014
https://travis-ci.org/DigitalProducts/codeception-module-visualception/builds/21566265
phmLabs commentedon Mar 26, 2014
The bug should be fixed. The filename is very ugly but we use the same naming convention as codeception 2.0 makeScreenshot(). If there is a fix/beautification in 2.0 we will switch to that one.
thinkspill commentedon Mar 26, 2014
Thanks, I'll give it a try.