diff --git a/apps/e2e/tests/account/account.spec.ts b/apps/e2e/tests/account/account.spec.ts index 7692a90c5..770d531fa 100644 --- a/apps/e2e/tests/account/account.spec.ts +++ b/apps/e2e/tests/account/account.spec.ts @@ -37,8 +37,7 @@ test.describe('Account Settings', () => { }); test('user can update their password', async () => { - const password = (Math.random() * 1000).toString(); - + const password = (Math.random() * 100000).toString(); await account.updatePassword(password); await page.waitForResponse((resp) => { @@ -50,17 +49,10 @@ test.describe('Account Settings', () => { }); test.describe('Account Deletion', () => { - let page: Page; - let account: AccountPageObject; - - test.beforeAll(async ({ browser }) => { - page = await browser.newPage(); - account = new AccountPageObject(page); + test('user can delete their own account', async ({ page }) => { + const account = new AccountPageObject(page); await account.setup(); - }); - - test('user can delete their own account', async () => { await account.deleteAccount(); await page.waitForURL('http://localhost:3000'); diff --git a/apps/e2e/tests/authentication/auth.po.ts b/apps/e2e/tests/authentication/auth.po.ts index 4767ef65b..c4018e5d4 100644 --- a/apps/e2e/tests/authentication/auth.po.ts +++ b/apps/e2e/tests/authentication/auth.po.ts @@ -48,8 +48,6 @@ export class AuthPageObject { } async visitConfirmEmailLink(email: string) { - await this.page.waitForTimeout(300); - return expect(async() => { const res = await this.mailbox.visitMailbox(email); @@ -58,7 +56,7 @@ export class AuthPageObject { } createRandomEmail() { - const value = Math.random() * 1000; + const value = Math.random() * 10000000000; return `${value.toFixed(0)}@makerkit.dev`; } @@ -76,6 +74,10 @@ export class AuthPageObject { repeatPassword: 'password', }); + await this.page.waitForResponse((resp) => { + return resp.url().includes('auth'); + }); + await this.visitConfirmEmailLink(email); } } \ No newline at end of file diff --git a/apps/e2e/tests/utils/mailbox.ts b/apps/e2e/tests/utils/mailbox.ts index b7c0297ac..342cec84b 100644 --- a/apps/e2e/tests/utils/mailbox.ts +++ b/apps/e2e/tests/utils/mailbox.ts @@ -19,8 +19,6 @@ export class Mailbox { const json = await this.getInviteEmail(mailbox); if (!json.body) { - console.log(json); - throw new Error('Email body was not found'); }