-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
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:
Running 7 tests using 4 workers
✓ 1 [chromium] › e2e/Sanity.check.spec.ts:20:9 › Sanity › Static pages › should display the homepage (4.7s)
✓ 2 [chromium] › integration/Guestbook.spec.ts:8:9 › Guestbook › Basic CRUD operations › should create a new entry in the guestbook and delete it (7.1s)
✓ 3 [chromium] › e2e/Visual.spec.ts:6:9 › Visual testing › Static pages › should take screenshot of the homepage (4.8s)
✓ 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 (8.2s)
[percy] Percy is not running, disabling snapshots
✓ 5 [chromium] › e2e/Sanity.check.spec.ts:30:9 › Sanity › Static pages › should navigate to the about page (3.2s)
✓ 6 [chromium] › e2e/Visual.spec.ts:18:9 › Visual testing › Static pages › should take screenshot of the about page (3.7s)
✓ 7 [chromium] › e2e/Sanity.check.spec.ts:41:9 › Sanity › Static pages › should navigate to the portfolio page (3.2s)
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:
✓ 1 [chromium] › e2e/Sanity.check.spec.ts:20:9 › Sanity › Static pages › should display the homepage (6.5s)
[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 (9.5s)
[percy] Snapshot taken: Homepage
✓ 3 [chromium] › e2e/Visual.spec.ts:6:9 › Visual testing › Static pages › should take screenshot of the homepage (7.9s)
✘ 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 (8.7s)
✓ 5 [chromium] › e2e/Sanity.check.spec.ts:30:9 › Sanity › Static pages › should navigate to the about page (3.6s)
[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 (3.3s)
✓ 7 [chromium] › e2e/Sanity.check.spec.ts:41:9 › Sanity › Static pages › should navigate to the portfolio page (2.8s)
1) [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
Error: locator.fill: Error: strict mode violation: getByTestId('guestbook-list').getByText('Username') resolved to 2 elements:
1) <span class="text-gray-500">RANDOM_USERNAME:</span> aka getByText('RANDOM_USERNAME:')
2) <label for="username-2" class="text-sm font-bold text-gray-700">…</label> aka getByTestId('guestbook-list').getByText('Username', { exact: true })
Call log:
- waiting for getByTestId('guestbook-list').getByText('Username')
27 | // Update
28 | await guestbookList.locator('button[aria-label=edit]').last().click();
> 29 | await guestbookList.getByText('Username').fill(updatedUsername);
| ^
30 | await guestbookList.getByRole('button', { name: 'Save' }).click();
31 |
32 | // Verify after update
at /Users/shuther/Documents/devP/my-project-name/tests/e2e/Guestbook.spec.ts:29:49
1 failed
[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
6 passed (28.5s)
Metadata
Metadata
Assignees
Labels
No labels