Skip to content

Commit

Permalink
Stabilize playwright tests
Browse files Browse the repository at this point in the history
  • Loading branch information
myieye committed May 10, 2024
1 parent 6869617 commit 2869a47
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ local.env
cookies.txt
dump.sql
test-results/
**/*.sqlite
**/*.sqlite-*
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"test-flaky": "playwright test --retries=3 -j 30%",
"test-hard": "playwright test --repeat-each=3 -j 30%",
"test-report": "playwright show-report test-results/_html-report",
"_env-comment": "Run any command with .env.local loaded: (e.g. `pnpm run env test-flaky`)",
"_env-comment": "Run any command with .env.local loaded: (e.g. `pnpm run env run test -g \"test name\")",
"env": "dotenvx run --env-file=.env.local -- pnpm",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
Expand Down
2 changes: 2 additions & 0 deletions frontend/tests/emailWorkflow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ test('forgot password', async ({ page, tempUser }) => {
const forgotPasswordPage = await loginPage.clickForgotPassword();
await forgotPasswordPage.fillForm(tempUser.email);
await forgotPasswordPage.submit();
await page.locator(':text("Check Your Inbox")').first().waitFor();

// Use reset password link
const inboxPage = await getInbox(page, tempUser.mailinatorId).goto();
Expand Down Expand Up @@ -126,6 +127,7 @@ test('register via new-user invitation email', async ({ page }) => {
await addMemberModal.emailField.fill(newEmail);
await addMemberModal.selectEditorRole();
await addMemberModal.submitButton.click();
await page.locator(':text("has been sent an invitation email")').waitFor();

// Check invite link returnTo is relative path, not absolute
const inboxPage = await getInbox(page, uuid).goto();
Expand Down
1 change: 1 addition & 0 deletions frontend/tests/errorHandling.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ test('page load 403 on home page is redirected to login', async ({ page, tempUse
const forgotPasswordPage = await loginPage.clickForgotPassword();
await forgotPasswordPage.fillForm(tempUser.email);
await forgotPasswordPage.submit();
await page.locator(':text("Check Your Inbox")').first().waitFor();

// - Get JWT from reset password link
const inboxPage = await getInbox(page, tempUser.mailinatorId).goto();
Expand Down

0 comments on commit 2869a47

Please sign in to comment.