DevExpress / testcafe-browser-provider-electron

This is the Electron browser provider plugin for TestCafe.
https://testcafe.io
MIT License
49 stars 30 forks source link

Can't take a screenshot on github CI #85

Closed EmiM closed 2 years ago

EmiM commented 2 years ago

Hi, I'm running one e2e electron test on CI. I decided to enable screenshots-on-fails to discover why the test fails (it passes locally). Turned out that I can't do that because:

Was unable to take a screenshot due to an error.

  NativeBinaryHasFailedError: The
  /home/runner/work/ZbayLite/ZbayLite/node_modules/testcafe-browser-tools/bin/linux/glibc-64/screenshot
  process failed with the null exit code.

I use DevExpress/testcafe-action@latest. The whole output is here: https://github.com/ZbayApp/ZbayLite/runs/4356621701?check_suite_focus=true

Below the 'NativeBinary(...)" error you can see other error saying that "The file at (...) already exists" but it's misleading as the screenshots directory is empty.

Notes:

holmesworcester commented 2 years ago

It would be great to get this fixed!

Dmitry-Ostashev commented 2 years ago

Hi @EmiM ,

This error occurs because testcafe-browser-provider-electron requires the installed Window Manager to be able to take screenshots. Here is a workflow example, which installs Fluxbox before running tests: https://github.com/Dmitry-Ostashev/electron-quick-start/blob/e2e-tests/.github/workflows/functional-testcafe-action.yml .