Skip to content

Commit 15bfcfc

Browse files
authored
e2e/crate/settings: Move Percy snapshot to fix snapshot flakiness (#11486)
In some cases the snapshot was showing an empty page because while the URL had already changed, the content hadn't yet been rendered. By moving the snapshot after the assertions we can ensure that the page content has rendered by the time we take the snapshot.
1 parent 97d9f32 commit 15bfcfc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

e2e/routes/crate/settings.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ test.describe('Route | crate.settings', { tag: '@routes' }, () => {
8383
await page.goto('/crates/foo/settings');
8484
await expect(page).toHaveURL('/crates/foo/settings');
8585

86-
await percy.snapshot();
87-
8886
await expect(page.locator('[data-test-trusted-publishing]')).toBeVisible();
8987
await expect(page.locator('[data-test-add-trusted-publisher-button]')).toBeVisible();
9088
await expect(page.locator('[data-test-github-config]')).toHaveCount(2);
@@ -102,6 +100,8 @@ test.describe('Route | crate.settings', { tag: '@routes' }, () => {
102100
await expect(page.locator('[data-test-github-config="2"] [data-test-remove-config-button]')).toBeVisible();
103101
await expect(page.locator('[data-test-no-config]')).not.toBeVisible();
104102

103+
await percy.snapshot();
104+
105105
// Click the remove button
106106
await page.click('[data-test-github-config="2"] [data-test-remove-config-button]');
107107

0 commit comments

Comments
 (0)