Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screenshots are crashing testcafe #53

Closed
franciscolosardo opened this issue Oct 23, 2019 · 6 comments
Closed

Screenshots are crashing testcafe #53

franciscolosardo opened this issue Oct 23, 2019 · 6 comments

Comments

@franciscolosardo
Copy link

What is your Test Scenario?

When using the screenshot option running on a jenkins pipeline with saucelabs provider the following occurs.
When a test fails the following message is displayed multiple times and the test finally crashes. Testcafe exits with an error.

Error: [saveScreenshot("/OURJENKINSDOCKERDIR/screenshots/2019-10-22_17-03-12/test-1/Chrome_75.0.3770_Windows_10.0.0/errors/1.png")] ENOENT: no such file or directory, open '/OURJENKINSDOCKERDIR/screenshots/2019-10-22_17-03-12/test-1/Chrome_75.0.3770_Windows_10.0.0/errors/1.png'

This started happening without any change to our running instance and everything worked fine before. It even included the screenshot it took on our allure report.

Your Environment details:

  • testcafe version: 1.6.0
  • node.js version: v10.16.3
  • command-line arguments:
  • browser name and version: Chrome 76 @ Saucelabs
  • platform and version: Win 7
  • other: We are using the saucelabs browser provider
@miherlosev miherlosev self-assigned this Oct 24, 2019
@miherlosev
Copy link

Hi @franciscolosardo

As I see, your environment is very complex: Jenkins, docker, SauceLabs, a custom Allure report.
It's difficult to set up the same environment on my side.
Try to debug the TestCafe yourself. You can use this as a starting point: https://github.com/DevExpress/testcafe/blob/b9c73f0823b0b15d35fc21b5796c8ac4c2ce55bd/src/browser/provider/built-in/dedicated/chrome/cdp.ts#L88.

@vire
Copy link

vire commented Oct 30, 2019

I can confirm this issue when I run a test via testcafe-browser-provider-saucelabs locally or on CI the test fails on the following error

image

When I run the same test locally against chrome I don't get the error and a screenshot is saved as expected.

testcafe: 1.6.0
testcafe-browser-provider-browserstack: 1.9.0
node: v10.16.3

@vire
Copy link

vire commented Oct 30, 2019

After investigation the problem is related to a non-existing folder being part of the path where to save the screenshot

e.g.

// in case "screenshots" does not exist
./tmp/

`<tescafecommand> -s ./tmp/screenshots`

ERROR
// in case "screenshots" does exist 
./tmp/screenshots/

`<tescafecommand> -s ./tmp/screenshots`

SUCCESS

@franciscolosardo
Copy link
Author

We made sure to create the folder screenshots where screenshots are stored , but even when making the folders respectively we still get this error.
Note we are creating screenshots folder but not the subfolders that testcafe should create using the path prefix...
We even tried removing this prefix to see if using just a folder without folder patterns it worked, but i didn't

@AlexKamaev AlexKamaev assigned AlexKamaev and unassigned miherlosev Oct 31, 2019
@AlexKamaev AlexKamaev transferred this issue from DevExpress/testcafe Oct 31, 2019
@AlexKamaev
Copy link

I was able to reproduce the issue with the following command: testcafe "saucelabs:Chrome@76.0:Windows 10" D:\Projects\testcafe\test\functional\fixtures\regression\gh-199 4\testcafe-fixtures\index.js -s path=screens/tmp/notexists/notexists/notexists

@AlexKamaev
Copy link

fixed in the context of DevExpress/testcafe#4477

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

No branches or pull requests

4 participants