Closed shuther closed 3 months ago
I use only Percy in GitHub Actions/CI. It should pass without any issue, here is the latest PR and Percy is passing: https://github.com/ixartz/Next-js-Boilerplate/pull/290
I have never tried Percy in a local environment.
so running percy requires: npx percy exec -- npm run test:e2e
, npm run test:e2e
is useful only if percy is not used. I am not sure who can update the documentation.
Now it returns no error but I ran previously: npm run test-storybook:ci
, not sure if this is the reason why the tests are working fine now.
I still get some warning message however [percy] Invalid snapshot options:
[percy] Successfully downloaded Chromium 1262509
[percy] Percy has started!
[percy] Running "npm run test:e2e"
> next-js-boilerplate@3.54.0 test:e2e
> playwright test
Running 7 tests using 4 workers
✓ 1 [chromium] › e2e/Sanity.check.spec.ts:20:9 › Sanity › Static pages › should display the homepage (8.4s)
[percy] Invalid snapshot options:
✓ 2 [chromium] › integration/Guestbook.spec.ts:8:9 › Guestbook › Basic CRUD operations › should create a new entry in the guestbook and delete it (10.2s)
[percy] Snapshot taken: Homepage
✓ 3 [chromium] › e2e/Visual.spec.ts:6:9 › Visual testing › Static pages › should take screenshot of the homepage (10.2s)
✓ 4 [chromium] › e2e/Guestbook.spec.ts:6:9 › Guestbook › CRUD operation › should browse to guestbook, crate a new entry, read, update and remove the newly created (11.8s)
✓ 5 [chromium] › e2e/Sanity.check.spec.ts:30:9 › Sanity › Static pages › should navigate to the about page (5.7s)
[percy] Invalid snapshot options:
[percy] Snapshot taken: About
✓ 6 [chromium] › e2e/Visual.spec.ts:18:9 › Visual testing › Static pages › should take screenshot of the about page (6.3s)
✓ 7 [chromium] › e2e/Sanity.check.spec.ts:41:9 › Sanity › Static pages › should navigate to the portfolio page (4.4s)
Slow test file: [chromium] › e2e/Sanity.check.spec.ts (18.4s)
Slow test file: [chromium] › e2e/Visual.spec.ts (16.5s)
Consider splitting slow test files to speed up parallel execution
7 passed (32.8s)
[percy] Finalized build #2: https://percy.io/326c6016/proj-web-test1/builds/35535039
npm run test:e2e
just run without Percy. And, if you want to run with Percy, you can use npx percy exec -- npm run test:e2e
I just run Percy locally and it works perfectly, no issue with Percy on local. I just never tried it locally. Usually, I only use it with GitHub Actions.
About the warning [percy] Invalid snapshot options:
, it's a new issue from Percy cli: https://github.com/percy/cli/issues/1674. Several other people have the same issue.
Could you confirm how the E2E tests should be launched? In the readme, there is a mention about
npm run test:e2e
; if I set the export for PERCY_TOKEN, I get:So it looks that percy is not recognized.
However in the github action, the statement is:
npx percy exec -- npm run test:e2e
; now it seems percy is working but I get many errors while I just started with the boilerplate: