From 3a60fa24c63d4b43fe0cb093716da5089c45de2e Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Sun, 22 Feb 2026 18:34:09 +0000 Subject: [PATCH 01/39] Added Database checks to the onboarding flow --- tests/e2e/web/pages/signUpPage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/web/pages/signUpPage.ts b/tests/e2e/web/pages/signUpPage.ts index fe7d77f0..3d841da3 100644 --- a/tests/e2e/web/pages/signUpPage.ts +++ b/tests/e2e/web/pages/signUpPage.ts @@ -670,7 +670,7 @@ export class SignUpPage { async setLanguages(language: LanguageTuple[] | undefined) { if (!language || language.length === 0) return - await this.page.getByRole('checkbox', {name: `English`}).click() + await this.page.getByRole('checkbox', {name: `English`}).click(); for (let i = 0; i < language.length; i++) { await expect(this.page.getByRole('checkbox', {name: `${language[i][0]}`})).toBeVisible() await this.page.getByRole('checkbox', {name: `${language[i][0]}`}).click() From ee0c4a571919cd4c03713dcddf86764cbcbee3a0 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Wed, 25 Feb 2026 15:19:06 +0000 Subject: [PATCH 02/39] Added compatibility page setup Added more compatibility questions --- tests/e2e/web/pages/profilePage.ts | 38 +++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/tests/e2e/web/pages/profilePage.ts b/tests/e2e/web/pages/profilePage.ts index 3a63d128..dfc85f8e 100644 --- a/tests/e2e/web/pages/profilePage.ts +++ b/tests/e2e/web/pages/profilePage.ts @@ -272,19 +272,19 @@ export class ProfilePage { } async clickStartAnsweringButton() { - await expect(this.startAnsweringButton).toBeVisible() - await this.startAnsweringButton.click() - } + await expect(this.startAnsweringButton).toBeVisible(); + await this.startAnsweringButton.click(); + }; async clickDoThisLaterButton() { - await expect(this.doThisLaterLink).toBeVisible() - await this.doThisLaterLink.click() - } + await expect(this.doThisLaterLink).toBeVisible(); + await this.doThisLaterLink.click(); + }; async clickShareButton() { - await expect(this.shareButton).toBeVisible() - await this.shareButton.click() - } + await expect(this.shareButton).toBeVisible(); + await this.shareButton.click(); + }; async clickEditProfileButton() { await expect(this.editProfileButton).toBeVisible() @@ -302,20 +302,20 @@ export class ProfilePage { } async selectOptionFromProfileDropdown(option: ProfileDropdownOptions) { - await expect(this.profileOptionsDropdown).toBeVisible() - await this.profileOptionsDropdown.click() + await expect(this.profileOptionsDropdown).toBeVisible(); + await this.profileOptionsDropdown.click(); if (option === 'Public') { - await expect(this.listProfilePubliclyDropdownOption).toBeVisible() - await this.listProfilePubliclyDropdownOption.click() + await expect(this.listProfilePubliclyDropdownOption).toBeVisible(); + await this.listProfilePubliclyDropdownOption.click(); } else if (option === 'Disable') { - await expect(this.disableProfileDropdownOption).toBeVisible() - await this.disableProfileDropdownOption.click() + await expect(this.disableProfileDropdownOption).toBeVisible(); + await this.disableProfileDropdownOption.click(); } else if (option === 'Private') { - await expect(this.limitProfileToMembersDropdownOption).toBeVisible() - await this.limitProfileToMembersDropdownOption.click() - } - } + await expect(this.limitProfileToMembersDropdownOption).toBeVisible(); + await this.limitProfileToMembersDropdownOption.click(); + }; + }; async verifyDisplayName(displayName?: string) { await expect(this.displayNameAndAgeSection).toBeVisible() From a7bbe2dd53114c5070e6948e3ff8e27c8e8520fa Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Wed, 4 Mar 2026 01:30:41 +0000 Subject: [PATCH 03/39] Finished up the onboarding flow suite Added compatibility question tests and verifications Updated tests to cover Keywords and Headline changes recently made Updated tests to cover all of the big5 personality traits --- tests/e2e/web/utils/accountInformation.ts | 2 +- .../answer-compatibility-question-content.tsx | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/e2e/web/utils/accountInformation.ts b/tests/e2e/web/utils/accountInformation.ts index 2d2c4134..97281ab9 100644 --- a/tests/e2e/web/utils/accountInformation.ts +++ b/tests/e2e/web/utils/accountInformation.ts @@ -252,4 +252,4 @@ export const testAccounts: AccountConfig = { }, } }, -} +} \ No newline at end of file diff --git a/web/components/answers/answer-compatibility-question-content.tsx b/web/components/answers/answer-compatibility-question-content.tsx index 24e65326..e1c43f9d 100644 --- a/web/components/answers/answer-compatibility-question-content.tsx +++ b/web/components/answers/answer-compatibility-question-content.tsx @@ -34,6 +34,7 @@ export const IMPORTANCE_CHOICES = { Important: 2, 'Very Important': 3, } as const +} as const type ImportanceColorsType = { [key: number]: string @@ -165,6 +166,9 @@ export function AnswerCompatibilityQuestionContent(props: { {shortenedPopularity && ( +
{compatibilityQuestion.question}
+ {shortenedPopularity && ( + ) => @@ -298,6 +303,7 @@ export const SelectAnswer = (props: { const {value, setValue, options} = props return ( clsx( disabled @@ -336,6 +343,7 @@ export const MultiSelectAnswers = (props: { return ( Date: Wed, 4 Mar 2026 15:44:07 +0000 Subject: [PATCH 04/39] . --- tests/e2e/web/pages/profilePage.ts | 38 +++++++++++------------ tests/e2e/web/pages/signUpPage.ts | 2 +- tests/e2e/web/utils/accountInformation.ts | 2 +- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/tests/e2e/web/pages/profilePage.ts b/tests/e2e/web/pages/profilePage.ts index dfc85f8e..3a63d128 100644 --- a/tests/e2e/web/pages/profilePage.ts +++ b/tests/e2e/web/pages/profilePage.ts @@ -272,19 +272,19 @@ export class ProfilePage { } async clickStartAnsweringButton() { - await expect(this.startAnsweringButton).toBeVisible(); - await this.startAnsweringButton.click(); - }; + await expect(this.startAnsweringButton).toBeVisible() + await this.startAnsweringButton.click() + } async clickDoThisLaterButton() { - await expect(this.doThisLaterLink).toBeVisible(); - await this.doThisLaterLink.click(); - }; + await expect(this.doThisLaterLink).toBeVisible() + await this.doThisLaterLink.click() + } async clickShareButton() { - await expect(this.shareButton).toBeVisible(); - await this.shareButton.click(); - }; + await expect(this.shareButton).toBeVisible() + await this.shareButton.click() + } async clickEditProfileButton() { await expect(this.editProfileButton).toBeVisible() @@ -302,20 +302,20 @@ export class ProfilePage { } async selectOptionFromProfileDropdown(option: ProfileDropdownOptions) { - await expect(this.profileOptionsDropdown).toBeVisible(); - await this.profileOptionsDropdown.click(); + await expect(this.profileOptionsDropdown).toBeVisible() + await this.profileOptionsDropdown.click() if (option === 'Public') { - await expect(this.listProfilePubliclyDropdownOption).toBeVisible(); - await this.listProfilePubliclyDropdownOption.click(); + await expect(this.listProfilePubliclyDropdownOption).toBeVisible() + await this.listProfilePubliclyDropdownOption.click() } else if (option === 'Disable') { - await expect(this.disableProfileDropdownOption).toBeVisible(); - await this.disableProfileDropdownOption.click(); + await expect(this.disableProfileDropdownOption).toBeVisible() + await this.disableProfileDropdownOption.click() } else if (option === 'Private') { - await expect(this.limitProfileToMembersDropdownOption).toBeVisible(); - await this.limitProfileToMembersDropdownOption.click(); - }; - }; + await expect(this.limitProfileToMembersDropdownOption).toBeVisible() + await this.limitProfileToMembersDropdownOption.click() + } + } async verifyDisplayName(displayName?: string) { await expect(this.displayNameAndAgeSection).toBeVisible() diff --git a/tests/e2e/web/pages/signUpPage.ts b/tests/e2e/web/pages/signUpPage.ts index 3d841da3..fe7d77f0 100644 --- a/tests/e2e/web/pages/signUpPage.ts +++ b/tests/e2e/web/pages/signUpPage.ts @@ -670,7 +670,7 @@ export class SignUpPage { async setLanguages(language: LanguageTuple[] | undefined) { if (!language || language.length === 0) return - await this.page.getByRole('checkbox', {name: `English`}).click(); + await this.page.getByRole('checkbox', {name: `English`}).click() for (let i = 0; i < language.length; i++) { await expect(this.page.getByRole('checkbox', {name: `${language[i][0]}`})).toBeVisible() await this.page.getByRole('checkbox', {name: `${language[i][0]}`}).click() diff --git a/tests/e2e/web/utils/accountInformation.ts b/tests/e2e/web/utils/accountInformation.ts index 97281ab9..2d2c4134 100644 --- a/tests/e2e/web/utils/accountInformation.ts +++ b/tests/e2e/web/utils/accountInformation.ts @@ -252,4 +252,4 @@ export const testAccounts: AccountConfig = { }, } }, -} \ No newline at end of file +} From 0b051106758112d14b630554fc6d595d88605a08 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Wed, 11 Mar 2026 17:04:54 +0000 Subject: [PATCH 05/39] Fix: Merge conflict --- .../answer-compatibility-question-content.tsx | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/web/components/answers/answer-compatibility-question-content.tsx b/web/components/answers/answer-compatibility-question-content.tsx index e1c43f9d..24e65326 100644 --- a/web/components/answers/answer-compatibility-question-content.tsx +++ b/web/components/answers/answer-compatibility-question-content.tsx @@ -34,7 +34,6 @@ export const IMPORTANCE_CHOICES = { Important: 2, 'Very Important': 3, } as const -} as const type ImportanceColorsType = { [key: number]: string @@ -166,9 +165,6 @@ export function AnswerCompatibilityQuestionContent(props: { {shortenedPopularity && ( -
{compatibilityQuestion.question}
- {shortenedPopularity && ( - ) => @@ -303,7 +298,6 @@ export const SelectAnswer = (props: { const {value, setValue, options} = props return ( clsx( disabled @@ -343,7 +336,6 @@ export const MultiSelectAnswers = (props: { return ( Date: Fri, 13 Mar 2026 19:32:32 +0000 Subject: [PATCH 06/39] . --- playwright.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright.config.ts b/playwright.config.ts index ec94cf50..4d0416a5 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -28,7 +28,7 @@ function getSupabaseEnv() { const supabaseEnv = getSupabaseEnv() // Inject into process.env so Playwright and your app code can read them -Object.assign(process.env, supabaseEnv) +// Object.assign(process.env, supabaseEnv) export default defineConfig({ testDir: './tests/e2e', From 932cb34676a16b383172a47184adcecd3dfa3bc4 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Sun, 15 Mar 2026 17:57:48 +0000 Subject: [PATCH 07/39] Fix: Added fix for None discriptive error issue #36 Updated signUp.spec.ts to use new fixture Updated Account information variable names Deleted "deleteUserFixture.ts" as it was incorporated into the "base.ts" file --- tests/e2e/web/pages/signUpPage.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/e2e/web/pages/signUpPage.ts b/tests/e2e/web/pages/signUpPage.ts index fe7d77f0..7f50c8f1 100644 --- a/tests/e2e/web/pages/signUpPage.ts +++ b/tests/e2e/web/pages/signUpPage.ts @@ -733,3 +733,8 @@ export class SignUpPage { await expect(this.usernameError).toBeVisible() } } + + async verifyUsernameError() { + await expect(this.usernameError).toBeVisible() + } +} \ No newline at end of file From 6d976b19c1b6f1bb054c62ae54704b6cbaa5aba6 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Sun, 15 Mar 2026 19:48:29 +0000 Subject: [PATCH 08/39] Linting and Prettier --- tests/e2e/web/pages/signUpPage.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/e2e/web/pages/signUpPage.ts b/tests/e2e/web/pages/signUpPage.ts index 7f50c8f1..db3ddfc1 100644 --- a/tests/e2e/web/pages/signUpPage.ts +++ b/tests/e2e/web/pages/signUpPage.ts @@ -729,11 +729,6 @@ export class SignUpPage { await expect(this.displayNameError).toBeVisible() } - async verifyUsernameError() { - await expect(this.usernameError).toBeVisible() - } -} - async verifyUsernameError() { await expect(this.usernameError).toBeVisible() } From 77ab5189c64e9b1439992f04fa5a7eb940849b4c Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Sun, 15 Mar 2026 23:11:08 +0100 Subject: [PATCH 09/39] Minor cleaning --- playwright.config.ts | 2 +- tests/e2e/web/specs/signUp.spec.ts | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/playwright.config.ts b/playwright.config.ts index 4d0416a5..ec94cf50 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -28,7 +28,7 @@ function getSupabaseEnv() { const supabaseEnv = getSupabaseEnv() // Inject into process.env so Playwright and your app code can read them -// Object.assign(process.env, supabaseEnv) +Object.assign(process.env, supabaseEnv) export default defineConfig({ testDir: './tests/e2e', diff --git a/tests/e2e/web/specs/signUp.spec.ts b/tests/e2e/web/specs/signUp.spec.ts index 53562129..bfa87cd6 100644 --- a/tests/e2e/web/specs/signUp.spec.ts +++ b/tests/e2e/web/specs/signUp.spec.ts @@ -29,3 +29,17 @@ test.describe('when an error occurs', () => { await expect(app.signUp.nextButtonLocator).toBeDisabled() }) }) + +async function progressToRequiredForm( + homePage: HomePage, + authPage: AuthPage, + account: UserAccountInformation, + onboardingPage: OnboardingPage, +) { + await homePage.gotToHomePage() + await homePage.clickSignUpButton() + await authPage.fillEmailField(account.email) + await authPage.fillPasswordField(account.password) + await authPage.clickSignUpWithEmailButton() + await onboardingPage.clickSkipOnboardingButton() +} From a862dfe6924e806aa5754ebd19d60c0c77c4cf91 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Mon, 16 Mar 2026 14:51:03 +0000 Subject: [PATCH 10/39] Organizing helper func --- tests/e2e/web/specs/signUp.spec.ts | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/tests/e2e/web/specs/signUp.spec.ts b/tests/e2e/web/specs/signUp.spec.ts index bfa87cd6..53562129 100644 --- a/tests/e2e/web/specs/signUp.spec.ts +++ b/tests/e2e/web/specs/signUp.spec.ts @@ -29,17 +29,3 @@ test.describe('when an error occurs', () => { await expect(app.signUp.nextButtonLocator).toBeDisabled() }) }) - -async function progressToRequiredForm( - homePage: HomePage, - authPage: AuthPage, - account: UserAccountInformation, - onboardingPage: OnboardingPage, -) { - await homePage.gotToHomePage() - await homePage.clickSignUpButton() - await authPage.fillEmailField(account.email) - await authPage.fillPasswordField(account.password) - await authPage.clickSignUpWithEmailButton() - await onboardingPage.clickSkipOnboardingButton() -} From aba6d5545a65a0b70fde34769fd3de5a6c0e0efa Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Tue, 17 Mar 2026 18:38:32 +0000 Subject: [PATCH 11/39] Added Google account to the Onboarding flow --- playwright.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright.config.ts b/playwright.config.ts index ec94cf50..4d0416a5 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -28,7 +28,7 @@ function getSupabaseEnv() { const supabaseEnv = getSupabaseEnv() // Inject into process.env so Playwright and your app code can read them -Object.assign(process.env, supabaseEnv) +// Object.assign(process.env, supabaseEnv) export default defineConfig({ testDir: './tests/e2e', From ec391527c9b933e7ef8211401b1a73a7cb4aa4cd Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Wed, 18 Mar 2026 18:18:56 +0000 Subject: [PATCH 12/39] Added account cleanup for google accounts --- tests/e2e/web/fixtures/base.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/e2e/web/fixtures/base.ts b/tests/e2e/web/fixtures/base.ts index 4fe2f1dd..408bcf89 100644 --- a/tests/e2e/web/fixtures/base.ts +++ b/tests/e2e/web/fixtures/base.ts @@ -35,6 +35,7 @@ export const test = base.extend<{ const account = testAccounts.google_account_two() const getAuthObject = await getAuthAccountInfo(page) await use(account) + console.log('Cleaning up google account...') await deleteUser('Google', undefined, getAuthObject()) }, From 85ccdfde8d783cc8bd7176f6f3e1ade1bad60b07 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Wed, 25 Mar 2026 00:59:08 +0000 Subject: [PATCH 13/39] Started work on Sign-in tests Updated seedDatabase.ts to throw an error if the user already exists, to also add display names and usernames so they seedUser func acts like a normal basic user Some organising of the google auth code --- .vscode/settings.json | 3 +++ tests/e2e/web/fixtures/base.ts | 1 - tests/e2e/web/specs/postSignIn.spec.ts | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 .vscode/settings.json create mode 100644 tests/e2e/web/specs/postSignIn.spec.ts diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..db1ed83a --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "codium.codeCompletion.enable": false +} \ No newline at end of file diff --git a/tests/e2e/web/fixtures/base.ts b/tests/e2e/web/fixtures/base.ts index 408bcf89..4fe2f1dd 100644 --- a/tests/e2e/web/fixtures/base.ts +++ b/tests/e2e/web/fixtures/base.ts @@ -35,7 +35,6 @@ export const test = base.extend<{ const account = testAccounts.google_account_two() const getAuthObject = await getAuthAccountInfo(page) await use(account) - console.log('Cleaning up google account...') await deleteUser('Google', undefined, getAuthObject()) }, diff --git a/tests/e2e/web/specs/postSignIn.spec.ts b/tests/e2e/web/specs/postSignIn.spec.ts new file mode 100644 index 00000000..12029006 --- /dev/null +++ b/tests/e2e/web/specs/postSignIn.spec.ts @@ -0,0 +1,19 @@ +import {test, expect} from '../fixtures/signInFixture' +import * as fs from "fs"; + +test.describe('when given valid input', () => { + test('should be logged in and see settings page', async ({ + authenticatedPage, + homePage, + }) => { + await homePage.gotToHomePage() + // await authenticatedPage.goto('/settings') + + // await expect(authenticatedPage.getByRole('heading', { name: 'Theme' })).toBeVisible() + }) +}); + +test.describe('when an error occurs', () => { + test('placeholder', async () => {}); +}); + From 04c18aee7c96ab1f9668eb6f71c510a132798914 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Wed, 25 Mar 2026 01:09:24 +0000 Subject: [PATCH 14/39] Linting and Prettier --- tests/e2e/web/specs/postSignIn.spec.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/e2e/web/specs/postSignIn.spec.ts b/tests/e2e/web/specs/postSignIn.spec.ts index 12029006..d9766b35 100644 --- a/tests/e2e/web/specs/postSignIn.spec.ts +++ b/tests/e2e/web/specs/postSignIn.spec.ts @@ -1,19 +1,15 @@ import {test, expect} from '../fixtures/signInFixture' -import * as fs from "fs"; +import * as fs from 'fs' test.describe('when given valid input', () => { - test('should be logged in and see settings page', async ({ - authenticatedPage, - homePage, - }) => { + test('should be logged in and see settings page', async ({authenticatedPage, homePage}) => { await homePage.gotToHomePage() // await authenticatedPage.goto('/settings') // await expect(authenticatedPage.getByRole('heading', { name: 'Theme' })).toBeVisible() }) -}); +}) test.describe('when an error occurs', () => { - test('placeholder', async () => {}); -}); - + test('placeholder', async () => {}) +}) From d38f9392dc254f31589d13fd08cfb9c7b25f78e8 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Thu, 26 Mar 2026 15:13:11 +0000 Subject: [PATCH 15/39] Added checks to the deleteUser func to check if the accout exists Added account deletion checks --- tests/e2e/web/specs/onboardingFlow.spec.ts | 71 ++++++++++++++++++++++ tests/e2e/web/specs/postSignIn.spec.ts | 15 ----- tests/e2e/web/specs/signIn.spec.ts | 8 +++ 3 files changed, 79 insertions(+), 15 deletions(-) delete mode 100644 tests/e2e/web/specs/postSignIn.spec.ts diff --git a/tests/e2e/web/specs/onboardingFlow.spec.ts b/tests/e2e/web/specs/onboardingFlow.spec.ts index 0466074c..c124bae9 100644 --- a/tests/e2e/web/specs/onboardingFlow.spec.ts +++ b/tests/e2e/web/specs/onboardingFlow.spec.ts @@ -251,6 +251,77 @@ test.describe('when given valid input', () => { await expect(dbInfo.user.username).toContain(fakerAccount.username) }) + test('should successfully delete an account created via email and password', async ({ + homePage, + onboardingPage, + signUpPage, + authPage, + profilePage, + settingsPage, + fakerAccount, + }) => { + await registerWithEmail(homePage, authPage, fakerAccount) + await skipOnboardingHeadToProfile(onboardingPage, signUpPage, profilePage, fakerAccount) + + //Verify displayed information is correct + await profilePage.verifyDisplayName(fakerAccount.display_name) + + //Verify database info + const dbInfo = await userInformationFromDb(fakerAccount) + + await expect(dbInfo.user.name).toContain(fakerAccount.display_name) + await expect(dbInfo.user.username).toContain(fakerAccount.username) + + await homePage.clickSettingsLink() + await settingsPage.clickDeleteAccountButton() + await settingsPage.fillDeleteAccountSurvey("Delete me") + await settingsPage.clickDeleteAccountButton() + await homePage.verifyHomePageLinks() + }) + + test('should successfully delete an account created via google auth', async ({ + homePage, + onboardingPage, + signUpPage, + authPage, + profilePage, + settingsPage, + googleAccountTwo, + }) => { + console.log( + `Starting "should successfully delete an account created via google auth" with ${googleAccountTwo.username}`, + ) + await homePage.gotToRegisterPage() + await authPage.fillPasswordField('') //The test only passes when this is added...something is weird here + await authPage.signInToGoogleAccount( + googleAccountTwo.email, + googleAccountTwo.display_name, + googleAccountTwo.username, + ) + await onboardingPage.clickSkipOnboardingButton() + await signUpPage.fillDisplayName(googleAccountTwo.display_name) + await signUpPage.fillUsername(googleAccountTwo.username) + await signUpPage.clickNextButton() + await signUpPage.clickNextButton() //Skip optional information + await profilePage.clickCloseButton() + await onboardingPage.clickRefineProfileButton() + + //Verify displayed information is correct + await profilePage.verifyDisplayName(googleAccountTwo.display_name) + + //Verify database info + const dbInfo = await userInformationFromDb(googleAccountTwo) + + await expect(dbInfo.user.name).toContain(googleAccountTwo.display_name) + await expect(dbInfo.user.username).toContain(googleAccountTwo.username) + + await homePage.clickSettingsLink() + await settingsPage.clickDeleteAccountButton() + await settingsPage.fillDeleteAccountSurvey("Delete me") + await settingsPage.clickDeleteAccountButton() + await homePage.verifyHomePageLinks() + }) + test('should successfully enter optional information after completing flow', async ({ app, fakerAccount, diff --git a/tests/e2e/web/specs/postSignIn.spec.ts b/tests/e2e/web/specs/postSignIn.spec.ts deleted file mode 100644 index d9766b35..00000000 --- a/tests/e2e/web/specs/postSignIn.spec.ts +++ /dev/null @@ -1,15 +0,0 @@ -import {test, expect} from '../fixtures/signInFixture' -import * as fs from 'fs' - -test.describe('when given valid input', () => { - test('should be logged in and see settings page', async ({authenticatedPage, homePage}) => { - await homePage.gotToHomePage() - // await authenticatedPage.goto('/settings') - - // await expect(authenticatedPage.getByRole('heading', { name: 'Theme' })).toBeVisible() - }) -}) - -test.describe('when an error occurs', () => { - test('placeholder', async () => {}) -}) diff --git a/tests/e2e/web/specs/signIn.spec.ts b/tests/e2e/web/specs/signIn.spec.ts index 537853fb..771f84a8 100644 --- a/tests/e2e/web/specs/signIn.spec.ts +++ b/tests/e2e/web/specs/signIn.spec.ts @@ -38,4 +38,12 @@ test.describe('when given invalid input', () => { page.getByText('Failed to sign in with your email and password', {exact: true}), ).toBeVisible() }) + + test('login check', async ({}) => { + + }); +}) + +test.describe('when an error occurs', () => { + test('placeholder', async () => {}) }) From 3f47d523e8af968164b297ebfc195ca7b3eb32b3 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Thu, 26 Mar 2026 15:14:57 +0000 Subject: [PATCH 16/39] Linting and Prettier --- tests/e2e/web/pages/signUpPage.ts | 2 +- tests/e2e/web/specs/onboardingFlow.spec.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/e2e/web/pages/signUpPage.ts b/tests/e2e/web/pages/signUpPage.ts index db3ddfc1..fe7d77f0 100644 --- a/tests/e2e/web/pages/signUpPage.ts +++ b/tests/e2e/web/pages/signUpPage.ts @@ -732,4 +732,4 @@ export class SignUpPage { async verifyUsernameError() { await expect(this.usernameError).toBeVisible() } -} \ No newline at end of file +} diff --git a/tests/e2e/web/specs/onboardingFlow.spec.ts b/tests/e2e/web/specs/onboardingFlow.spec.ts index c124bae9..a5dfc511 100644 --- a/tests/e2e/web/specs/onboardingFlow.spec.ts +++ b/tests/e2e/web/specs/onboardingFlow.spec.ts @@ -268,13 +268,13 @@ test.describe('when given valid input', () => { //Verify database info const dbInfo = await userInformationFromDb(fakerAccount) - + await expect(dbInfo.user.name).toContain(fakerAccount.display_name) await expect(dbInfo.user.username).toContain(fakerAccount.username) - + await homePage.clickSettingsLink() await settingsPage.clickDeleteAccountButton() - await settingsPage.fillDeleteAccountSurvey("Delete me") + await settingsPage.fillDeleteAccountSurvey('Delete me') await settingsPage.clickDeleteAccountButton() await homePage.verifyHomePageLinks() }) @@ -314,10 +314,10 @@ test.describe('when given valid input', () => { await expect(dbInfo.user.name).toContain(googleAccountTwo.display_name) await expect(dbInfo.user.username).toContain(googleAccountTwo.username) - + await homePage.clickSettingsLink() await settingsPage.clickDeleteAccountButton() - await settingsPage.fillDeleteAccountSurvey("Delete me") + await settingsPage.fillDeleteAccountSurvey('Delete me') await settingsPage.clickDeleteAccountButton() await homePage.verifyHomePageLinks() }) From 37d1f319a5fc989c29fe4ba7b19bd13fb4babf71 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Thu, 2 Apr 2026 14:44:41 +0100 Subject: [PATCH 17/39] Formatting update, fixed homePage locator for signin --- tests/e2e/web/specs/onboardingFlow.spec.ts | 332 ++++++++++----------- 1 file changed, 166 insertions(+), 166 deletions(-) diff --git a/tests/e2e/web/specs/onboardingFlow.spec.ts b/tests/e2e/web/specs/onboardingFlow.spec.ts index a5dfc511..7df2d9fe 100644 --- a/tests/e2e/web/specs/onboardingFlow.spec.ts +++ b/tests/e2e/web/specs/onboardingFlow.spec.ts @@ -129,89 +129,89 @@ test.describe('when given valid input', () => { await app.profile.verifyBio(onboardingAccount.bio) await app.profile.verifyCompatibilityAnswers(compatQuestionOne) - //Verify Database Information - const dbInfo = await userInformationFromDb(onboardingAccount) - console.log(dbInfo.profile) - - await expect(dbInfo.user.name).toBe(onboardingAccount.display_name) - await expect(dbInfo.user.username).toBe(onboardingAccount.username) - await expect(dbInfo.profile.bio_text).toBe(onboardingAccount.bio) - await expect(dbInfo.profile.gender).toEqual(onboardingAccount.gender?.[1]) - await expect(dbInfo.profile.headline).toEqual(onboardingAccount.headline) - await expect(dbInfo.profile.keywords).toEqual( - expect.arrayContaining(onboardingAccount.keywords?.split(', ') ?? []), - ) - await expect(String(dbInfo.profile.age)).toEqual(onboardingAccount.age) - await expect(dbInfo.profile.height_in_inches).toEqual( - Number(onboardingAccount.height?.feet) * 12, - ) - await expect(dbInfo.profile.ethnicity).toContain(onboardingAccount.ethnicity_origin?.[1]) - await expect(dbInfo.profile.pref_gender).toContain(onboardingAccount.interested_in?.[1]) - await expect(String(dbInfo.profile.pref_age_min)).toContain( - onboardingAccount.Interested_in_ages?.min, - ) - await expect(String(dbInfo.profile.pref_age_max)).toContain( - onboardingAccount.Interested_in_ages?.max, - ) - await expect(dbInfo.profile.pref_relation_styles).toContain( - `${onboardingAccount.connection_type?.[1]}`.toLowerCase(), - ) - await expect(dbInfo.profile.relationship_status).toContain( - onboardingAccount.relationship_status?.[1], - ) - await expect(dbInfo.profile.pref_romantic_styles).toContain( - onboardingAccount.relationship_style?.[1], - ) - await expect(dbInfo.profile.has_kids).toEqual(Number(onboardingAccount.number_of_kids)) - await expect(dbInfo.profile.wants_kids_strength).toEqual( - onboardingAccount.children_expectation?.[1], - ) - await expect(dbInfo.profile.education_level).toContain( - `${onboardingAccount.education_level?.[1]}`.toLowerCase(), - ) - await expect(dbInfo.profile.university).toContain(onboardingAccount.university) - await expect(dbInfo.profile.occupation_title).toContain(onboardingAccount.job_title) - await expect(dbInfo.profile.company).toContain(onboardingAccount.company) - await expect(dbInfo.profile.political_beliefs).toContain( - onboardingAccount.beliefs?.political?.belief?.[1], - ) - await expect(dbInfo.profile.political_details).toContain( - onboardingAccount.beliefs?.political?.details, - ) - await expect(dbInfo.profile.religion).toContain( - onboardingAccount.beliefs?.religious?.belief?.[1], - ) - await expect(dbInfo.profile.religious_beliefs).toContain( - onboardingAccount.beliefs?.religious?.details, - ) - await expect(dbInfo.profile.mbti).toContain( - `${onboardingAccount.personality_type}`.toLowerCase(), - ) - await expect(dbInfo.profile.big5_openness).toEqual( - onboardingAccount.big_five_personality_traits?.openness, - ) - await expect(dbInfo.profile.big5_conscientiousness).toEqual( - onboardingAccount.big_five_personality_traits?.conscientiousness, - ) - await expect(dbInfo.profile.big5_extraversion).toEqual( - onboardingAccount.big_five_personality_traits?.extraversion, - ) - await expect(dbInfo.profile.big5_agreeableness).toEqual( - onboardingAccount.big_five_personality_traits?.agreeableness, - ) - await expect(dbInfo.profile.big5_neuroticism).toEqual( - onboardingAccount.big_five_personality_traits?.neuroticism, - ) - await expect(dbInfo.profile.diet).toContain(onboardingAccount.diet?.[1].toLowerCase()) - await expect(dbInfo.profile.is_smoker).toEqual(onboardingAccount.is_smoker) - await expect(dbInfo.profile.languages).toHaveLength(2) - await expect(dbInfo.profile.languages).toEqual( - expect.arrayContaining(onboardingAccount.languages?.map(([_, l]) => l.toLowerCase()) ?? []), - ) - await expect(String(dbInfo.profile.drinks_per_month)).toEqual( - onboardingAccount.alcohol_consumed_per_month, - ) - }) + //Verify Database Information + const dbInfo = await userInformationFromDb(onboardingAccount) + console.log(dbInfo.profile) + + await expect(dbInfo.user.name).toBe(onboardingAccount.display_name) + await expect(dbInfo.user.username).toBe(onboardingAccount.username) + await expect(dbInfo.profile.bio_text).toBe(onboardingAccount.bio) + await expect(dbInfo.profile.gender).toEqual(onboardingAccount.gender?.[1]) + await expect(dbInfo.profile.headline).toEqual(onboardingAccount.headline) + await expect(dbInfo.profile.keywords).toEqual( + expect.arrayContaining(onboardingAccount.keywords?.split(', ') ?? []), + ) + await expect(String(dbInfo.profile.age)).toEqual(onboardingAccount.age) + await expect(dbInfo.profile.height_in_inches).toEqual( + Number(onboardingAccount.height?.feet) * 12, + ) + await expect(dbInfo.profile.ethnicity).toContain(onboardingAccount.ethnicity_origin?.[1]) + await expect(dbInfo.profile.pref_gender).toContain(onboardingAccount.interested_in?.[1]) + await expect(String(dbInfo.profile.pref_age_min)).toContain( + onboardingAccount.Interested_in_ages?.min, + ) + await expect(String(dbInfo.profile.pref_age_max)).toContain( + onboardingAccount.Interested_in_ages?.max, + ) + await expect(dbInfo.profile.pref_relation_styles).toContain( + `${onboardingAccount.connection_type?.[1]}`.toLowerCase(), + ) + await expect(dbInfo.profile.relationship_status).toContain( + onboardingAccount.relationship_status?.[1], + ) + await expect(dbInfo.profile.pref_romantic_styles).toContain( + onboardingAccount.relationship_style?.[1], + ) + await expect(dbInfo.profile.has_kids).toEqual(Number(onboardingAccount.number_of_kids)) + await expect(dbInfo.profile.wants_kids_strength).toEqual( + onboardingAccount.children_expectation?.[1], + ) + await expect(dbInfo.profile.education_level).toContain( + `${onboardingAccount.education_level?.[1]}`.toLowerCase(), + ) + await expect(dbInfo.profile.university).toContain(onboardingAccount.university) + await expect(dbInfo.profile.occupation_title).toContain(onboardingAccount.job_title) + await expect(dbInfo.profile.company).toContain(onboardingAccount.company) + await expect(dbInfo.profile.political_beliefs).toContain( + onboardingAccount.beliefs?.political?.belief?.[1], + ) + await expect(dbInfo.profile.political_details).toContain( + onboardingAccount.beliefs?.political?.details, + ) + await expect(dbInfo.profile.religion).toContain( + onboardingAccount.beliefs?.religious?.belief?.[1], + ) + await expect(dbInfo.profile.religious_beliefs).toContain( + onboardingAccount.beliefs?.religious?.details, + ) + await expect(dbInfo.profile.mbti).toContain( + `${onboardingAccount.personality_type}`.toLowerCase(), + ) + await expect(dbInfo.profile.big5_openness).toEqual( + onboardingAccount.big_five_personality_traits?.openness, + ) + await expect(dbInfo.profile.big5_conscientiousness).toEqual( + onboardingAccount.big_five_personality_traits?.conscientiousness, + ) + await expect(dbInfo.profile.big5_extraversion).toEqual( + onboardingAccount.big_five_personality_traits?.extraversion, + ) + await expect(dbInfo.profile.big5_agreeableness).toEqual( + onboardingAccount.big_five_personality_traits?.agreeableness, + ) + await expect(dbInfo.profile.big5_neuroticism).toEqual( + onboardingAccount.big_five_personality_traits?.neuroticism, + ) + await expect(dbInfo.profile.diet).toContain(onboardingAccount.diet?.[1].toLowerCase()) + await expect(dbInfo.profile.is_smoker).toEqual(onboardingAccount.is_smoker) + await expect(dbInfo.profile.languages).toHaveLength(2) + await expect(dbInfo.profile.languages).toEqual( + expect.arrayContaining(onboardingAccount.languages?.map(([_, l]) => l.toLowerCase()) ?? []), + ) + await expect(String(dbInfo.profile.drinks_per_month)).toEqual( + onboardingAccount.alcohol_consumed_per_month, + ) + }) test('should successfully complete the onboarding flow with google account', async ({ app, @@ -230,12 +230,12 @@ test.describe('when given valid input', () => { //Verify displayed information is correct await app.profile.verifyDisplayName(googleAccountOne.display_name) - //Verify database info - const dbInfo = await userInformationFromDb(googleAccountOne) + //Verify database info + const dbInfo = await userInformationFromDb(googleAccountOne) - await expect(dbInfo.user.name).toContain(googleAccountOne.display_name) - await expect(dbInfo.user.username).toContain(googleAccountOne.username) - }) + await expect(dbInfo.user.name).toContain(googleAccountOne.display_name) + await expect(dbInfo.user.username).toContain(googleAccountOne.username) + }) test('should successfully skip the onboarding flow', async ({app, fakerAccount}) => { await app.registerWithEmail(fakerAccount) @@ -244,12 +244,12 @@ test.describe('when given valid input', () => { //Verify displayed information is correct await app.profile.verifyDisplayName(fakerAccount.display_name) - //Verify database info - const dbInfo = await userInformationFromDb(fakerAccount) + //Verify database info + const dbInfo = await userInformationFromDb(fakerAccount) - await expect(dbInfo.user.name).toContain(fakerAccount.display_name) - await expect(dbInfo.user.username).toContain(fakerAccount.username) - }) + await expect(dbInfo.user.name).toContain(fakerAccount.display_name) + await expect(dbInfo.user.username).toContain(fakerAccount.username) + }) test('should successfully delete an account created via email and password', async ({ homePage, @@ -263,64 +263,64 @@ test.describe('when given valid input', () => { await registerWithEmail(homePage, authPage, fakerAccount) await skipOnboardingHeadToProfile(onboardingPage, signUpPage, profilePage, fakerAccount) - //Verify displayed information is correct - await profilePage.verifyDisplayName(fakerAccount.display_name) + //Verify displayed information is correct + await profilePage.verifyDisplayName(fakerAccount.display_name) - //Verify database info - const dbInfo = await userInformationFromDb(fakerAccount) + //Verify database info + const dbInfo = await userInformationFromDb(fakerAccount) - await expect(dbInfo.user.name).toContain(fakerAccount.display_name) - await expect(dbInfo.user.username).toContain(fakerAccount.username) + await expect(dbInfo.user.name).toContain(fakerAccount.display_name) + await expect(dbInfo.user.username).toContain(fakerAccount.username) - await homePage.clickSettingsLink() - await settingsPage.clickDeleteAccountButton() - await settingsPage.fillDeleteAccountSurvey('Delete me') - await settingsPage.clickDeleteAccountButton() - await homePage.verifyHomePageLinks() - }) + await homePage.clickSettingsLink() + await settingsPage.clickDeleteAccountButton() + await settingsPage.fillDeleteAccountSurvey('Delete me') + await settingsPage.clickDeleteAccountButton() + await homePage.verifyHomePageLinks() + }) - test('should successfully delete an account created via google auth', async ({ - homePage, - onboardingPage, - signUpPage, - authPage, - profilePage, - settingsPage, - googleAccountTwo, - }) => { - console.log( - `Starting "should successfully delete an account created via google auth" with ${googleAccountTwo.username}`, - ) - await homePage.gotToRegisterPage() - await authPage.fillPasswordField('') //The test only passes when this is added...something is weird here - await authPage.signInToGoogleAccount( - googleAccountTwo.email, - googleAccountTwo.display_name, - googleAccountTwo.username, - ) - await onboardingPage.clickSkipOnboardingButton() - await signUpPage.fillDisplayName(googleAccountTwo.display_name) - await signUpPage.fillUsername(googleAccountTwo.username) - await signUpPage.clickNextButton() - await signUpPage.clickNextButton() //Skip optional information - await profilePage.clickCloseButton() - await onboardingPage.clickRefineProfileButton() + test('should successfully delete an account created via google auth', async ({ + homePage, + onboardingPage, + signUpPage, + authPage, + profilePage, + settingsPage, + googleAccountTwo, + }) => { + console.log( + `Starting "should successfully delete an account created via google auth" with ${googleAccountTwo.username}`, + ) + await homePage.gotToRegisterPage() + await authPage.fillPasswordField('') //The test only passes when this is added...something is weird here + await authPage.signInToGoogleAccount( + googleAccountTwo.email, + googleAccountTwo.display_name, + googleAccountTwo.username, + ) + await onboardingPage.clickSkipOnboardingButton() + await signUpPage.fillDisplayName(googleAccountTwo.display_name) + await signUpPage.fillUsername(googleAccountTwo.username) + await signUpPage.clickNextButton() + await signUpPage.clickNextButton() //Skip optional information + await profilePage.clickCloseButton() + await onboardingPage.clickRefineProfileButton() - //Verify displayed information is correct - await profilePage.verifyDisplayName(googleAccountTwo.display_name) + //Verify displayed information is correct + await profilePage.verifyDisplayName(googleAccountTwo.display_name) - //Verify database info - const dbInfo = await userInformationFromDb(googleAccountTwo) + //Verify database info + const dbInfo = await userInformationFromDb(googleAccountTwo) - await expect(dbInfo.user.name).toContain(googleAccountTwo.display_name) - await expect(dbInfo.user.username).toContain(googleAccountTwo.username) + await expect(dbInfo.user.name).toContain(googleAccountTwo.display_name) + await expect(dbInfo.user.username).toContain(googleAccountTwo.username) - await homePage.clickSettingsLink() - await settingsPage.clickDeleteAccountButton() - await settingsPage.fillDeleteAccountSurvey('Delete me') - await settingsPage.clickDeleteAccountButton() - await homePage.verifyHomePageLinks() - }) + await homePage.clickSettingsLink() + await settingsPage.clickDeleteAccountButton() + await settingsPage.fillDeleteAccountSurvey('Delete me') + await settingsPage.clickDeleteAccountButton() + await homePage.verifyHomePageLinks() + }) test('should successfully enter optional information after completing flow', async ({ app, @@ -347,15 +347,15 @@ test.describe('when given valid input', () => { fakerAccount.age, ) - //Verify database info - const dbInfo = await userInformationFromDb(fakerAccount) + //Verify database info + const dbInfo = await userInformationFromDb(fakerAccount) - await expect(dbInfo.user.name).toContain(fakerAccount.display_name) - await expect(dbInfo.user.username).toContain(fakerAccount.username) - await expect(dbInfo.profile.gender).toEqual(fakerAccount.gender?.[1]) - await expect(String(dbInfo.profile.age)).toEqual(fakerAccount.age) - await expect(dbInfo.profile.height_in_inches).toEqual(Number(fakerAccount.height?.feet) * 12) - }) + await expect(dbInfo.user.name).toContain(fakerAccount.display_name) + await expect(dbInfo.user.username).toContain(fakerAccount.username) + await expect(dbInfo.profile.gender).toEqual(fakerAccount.gender?.[1]) + await expect(String(dbInfo.profile.age)).toEqual(fakerAccount.age) + await expect(dbInfo.profile.height_in_inches).toEqual(Number(fakerAccount.height?.feet) * 12) + }) test('should successfully use the start answering option', async ({ app, @@ -380,12 +380,12 @@ test.describe('when given valid input', () => { await app.profile.verifyDisplayName(fakerAccount.display_name) await app.profile.verifyCompatibilityAnswers(compatTwoQuestionOne) - //Verify database info - const dbInfo = await userInformationFromDb(fakerAccount) + //Verify database info + const dbInfo = await userInformationFromDb(fakerAccount) - await expect(dbInfo.user.name).toContain(fakerAccount.display_name) - await expect(dbInfo.user.username).toContain(fakerAccount.username) - }) + await expect(dbInfo.user.name).toContain(fakerAccount.display_name) + await expect(dbInfo.user.username).toContain(fakerAccount.username) + }) test.describe('should successfully complete the onboarding flow after using the back button', () => { test("the first time it's an option", async ({app, fakerAccount}) => { @@ -405,12 +405,12 @@ test.describe('when given valid input', () => { //Verify displayed information is correct await app.profile.verifyDisplayName(fakerAccount.display_name) - //Verify database info - const dbInfo = await userInformationFromDb(fakerAccount) + //Verify database info + const dbInfo = await userInformationFromDb(fakerAccount) - await expect(dbInfo.user.name).toContain(fakerAccount.display_name) - await expect(dbInfo.user.username).toContain(fakerAccount.username) - }) + await expect(dbInfo.user.name).toContain(fakerAccount.display_name) + await expect(dbInfo.user.username).toContain(fakerAccount.username) + }) test("the second time it's an option", async ({app, fakerAccount}) => { await app.registerWithEmail(fakerAccount) @@ -429,14 +429,14 @@ test.describe('when given valid input', () => { //Verify displayed information is correct await app.profile.verifyDisplayName(fakerAccount.display_name) - //Verify database info - const dbInfo = await userInformationFromDb(fakerAccount) + //Verify database info + const dbInfo = await userInformationFromDb(fakerAccount) - await expect(dbInfo.user.name).toContain(fakerAccount.display_name) - await expect(dbInfo.user.username).toContain(fakerAccount.username) + await expect(dbInfo.user.name).toContain(fakerAccount.display_name) + await expect(dbInfo.user.username).toContain(fakerAccount.username) + }) }) }) -}) // test.describe('when an error occurs', () => { // test('placeholder', async ({}) => {}) From 9cbf87c4484684a5816ed6f1e337fa9ad8eee3d7 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Thu, 2 Apr 2026 16:58:26 +0100 Subject: [PATCH 18/39] . --- .env.test | 5 ++++- playwright.config.ts | 10 ++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.env.test b/.env.test index 517612ef..447439e3 100644 --- a/.env.test +++ b/.env.test @@ -16,4 +16,7 @@ NEXT_PUBLIC_FIREBASE_EMULATOR=true NODE_ENV=test PORT=8088 -ENVIRONMENT=DEV \ No newline at end of file +ENVIRONMENT=DEV + +# Playwright +DIRECT_SUPABASE_SETUP_IN_PLAYWRIGHT=true \ No newline at end of file diff --git a/playwright.config.ts b/playwright.config.ts index 4d0416a5..2522ddeb 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -25,10 +25,12 @@ function getSupabaseEnv() { } } -const supabaseEnv = getSupabaseEnv() - -// Inject into process.env so Playwright and your app code can read them -// Object.assign(process.env, supabaseEnv) +if (process.env.DIRECT_SUPABASE_SETUP_IN_PLAYWRIGHT !== 'true') { + const supabaseEnv = getSupabaseEnv() + + // Inject into process.env so Playwright and your app code can read them + Object.assign(process.env, supabaseEnv) +} export default defineConfig({ testDir: './tests/e2e', From 6529a88cfb6c30187259e7d7a7cc4ec890566d1b Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Thu, 2 Apr 2026 17:00:33 +0100 Subject: [PATCH 19/39] . --- playwright.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright.config.ts b/playwright.config.ts index 2522ddeb..59ab836c 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -25,7 +25,7 @@ function getSupabaseEnv() { } } -if (process.env.DIRECT_SUPABASE_SETUP_IN_PLAYWRIGHT !== 'true') { +if (process.env.DIRECT_SUPABASE_SETUP_IN_PLAYWRIGHT !== 'false') { const supabaseEnv = getSupabaseEnv() // Inject into process.env so Playwright and your app code can read them From 316e1f9373884dfece5e852d860f5bd7fd4b6245 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Thu, 2 Apr 2026 17:02:56 +0100 Subject: [PATCH 20/39] . --- .env.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.test b/.env.test index 447439e3..cb1fcaa3 100644 --- a/.env.test +++ b/.env.test @@ -19,4 +19,4 @@ PORT=8088 ENVIRONMENT=DEV # Playwright -DIRECT_SUPABASE_SETUP_IN_PLAYWRIGHT=true \ No newline at end of file +DIRECT_SUPABASE_SETUP_IN_PLAYWRIGHT=false \ No newline at end of file From 89d392f0acfb84b441f7f55b1e47703b36400703 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Thu, 2 Apr 2026 23:10:31 +0100 Subject: [PATCH 21/39] Coderabbitai fix's --- playwright.config.ts | 2 +- tests/e2e/web/specs/onboardingFlow.spec.ts | 332 ++++++++++----------- 2 files changed, 167 insertions(+), 167 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index 59ab836c..cfc503d9 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -27,7 +27,7 @@ function getSupabaseEnv() { if (process.env.DIRECT_SUPABASE_SETUP_IN_PLAYWRIGHT !== 'false') { const supabaseEnv = getSupabaseEnv() - + // Inject into process.env so Playwright and your app code can read them Object.assign(process.env, supabaseEnv) } diff --git a/tests/e2e/web/specs/onboardingFlow.spec.ts b/tests/e2e/web/specs/onboardingFlow.spec.ts index 7df2d9fe..a9a5cc5c 100644 --- a/tests/e2e/web/specs/onboardingFlow.spec.ts +++ b/tests/e2e/web/specs/onboardingFlow.spec.ts @@ -129,89 +129,89 @@ test.describe('when given valid input', () => { await app.profile.verifyBio(onboardingAccount.bio) await app.profile.verifyCompatibilityAnswers(compatQuestionOne) - //Verify Database Information - const dbInfo = await userInformationFromDb(onboardingAccount) - console.log(dbInfo.profile) - - await expect(dbInfo.user.name).toBe(onboardingAccount.display_name) - await expect(dbInfo.user.username).toBe(onboardingAccount.username) - await expect(dbInfo.profile.bio_text).toBe(onboardingAccount.bio) - await expect(dbInfo.profile.gender).toEqual(onboardingAccount.gender?.[1]) - await expect(dbInfo.profile.headline).toEqual(onboardingAccount.headline) - await expect(dbInfo.profile.keywords).toEqual( - expect.arrayContaining(onboardingAccount.keywords?.split(', ') ?? []), - ) - await expect(String(dbInfo.profile.age)).toEqual(onboardingAccount.age) - await expect(dbInfo.profile.height_in_inches).toEqual( - Number(onboardingAccount.height?.feet) * 12, - ) - await expect(dbInfo.profile.ethnicity).toContain(onboardingAccount.ethnicity_origin?.[1]) - await expect(dbInfo.profile.pref_gender).toContain(onboardingAccount.interested_in?.[1]) - await expect(String(dbInfo.profile.pref_age_min)).toContain( - onboardingAccount.Interested_in_ages?.min, - ) - await expect(String(dbInfo.profile.pref_age_max)).toContain( - onboardingAccount.Interested_in_ages?.max, - ) - await expect(dbInfo.profile.pref_relation_styles).toContain( - `${onboardingAccount.connection_type?.[1]}`.toLowerCase(), - ) - await expect(dbInfo.profile.relationship_status).toContain( - onboardingAccount.relationship_status?.[1], - ) - await expect(dbInfo.profile.pref_romantic_styles).toContain( - onboardingAccount.relationship_style?.[1], - ) - await expect(dbInfo.profile.has_kids).toEqual(Number(onboardingAccount.number_of_kids)) - await expect(dbInfo.profile.wants_kids_strength).toEqual( - onboardingAccount.children_expectation?.[1], - ) - await expect(dbInfo.profile.education_level).toContain( - `${onboardingAccount.education_level?.[1]}`.toLowerCase(), - ) - await expect(dbInfo.profile.university).toContain(onboardingAccount.university) - await expect(dbInfo.profile.occupation_title).toContain(onboardingAccount.job_title) - await expect(dbInfo.profile.company).toContain(onboardingAccount.company) - await expect(dbInfo.profile.political_beliefs).toContain( - onboardingAccount.beliefs?.political?.belief?.[1], - ) - await expect(dbInfo.profile.political_details).toContain( - onboardingAccount.beliefs?.political?.details, - ) - await expect(dbInfo.profile.religion).toContain( - onboardingAccount.beliefs?.religious?.belief?.[1], - ) - await expect(dbInfo.profile.religious_beliefs).toContain( - onboardingAccount.beliefs?.religious?.details, - ) - await expect(dbInfo.profile.mbti).toContain( - `${onboardingAccount.personality_type}`.toLowerCase(), - ) - await expect(dbInfo.profile.big5_openness).toEqual( - onboardingAccount.big_five_personality_traits?.openness, - ) - await expect(dbInfo.profile.big5_conscientiousness).toEqual( - onboardingAccount.big_five_personality_traits?.conscientiousness, - ) - await expect(dbInfo.profile.big5_extraversion).toEqual( - onboardingAccount.big_five_personality_traits?.extraversion, - ) - await expect(dbInfo.profile.big5_agreeableness).toEqual( - onboardingAccount.big_five_personality_traits?.agreeableness, - ) - await expect(dbInfo.profile.big5_neuroticism).toEqual( - onboardingAccount.big_five_personality_traits?.neuroticism, - ) - await expect(dbInfo.profile.diet).toContain(onboardingAccount.diet?.[1].toLowerCase()) - await expect(dbInfo.profile.is_smoker).toEqual(onboardingAccount.is_smoker) - await expect(dbInfo.profile.languages).toHaveLength(2) - await expect(dbInfo.profile.languages).toEqual( - expect.arrayContaining(onboardingAccount.languages?.map(([_, l]) => l.toLowerCase()) ?? []), - ) - await expect(String(dbInfo.profile.drinks_per_month)).toEqual( - onboardingAccount.alcohol_consumed_per_month, - ) - }) + //Verify Database Information + const dbInfo = await userInformationFromDb(onboardingAccount) + console.log(dbInfo.profile) + + await expect(dbInfo.user.name).toBe(onboardingAccount.display_name) + await expect(dbInfo.user.username).toBe(onboardingAccount.username) + await expect(dbInfo.profile.bio_text).toBe(onboardingAccount.bio) + await expect(dbInfo.profile.gender).toEqual(onboardingAccount.gender?.[1]) + await expect(dbInfo.profile.headline).toEqual(onboardingAccount.headline) + await expect(dbInfo.profile.keywords).toEqual( + expect.arrayContaining(onboardingAccount.keywords?.split(', ') ?? []), + ) + await expect(String(dbInfo.profile.age)).toEqual(onboardingAccount.age) + await expect(dbInfo.profile.height_in_inches).toEqual( + Number(onboardingAccount.height?.feet) * 12, + ) + await expect(dbInfo.profile.ethnicity).toContain(onboardingAccount.ethnicity_origin?.[1]) + await expect(dbInfo.profile.pref_gender).toContain(onboardingAccount.interested_in?.[1]) + await expect(String(dbInfo.profile.pref_age_min)).toContain( + onboardingAccount.Interested_in_ages?.min, + ) + await expect(String(dbInfo.profile.pref_age_max)).toContain( + onboardingAccount.Interested_in_ages?.max, + ) + await expect(dbInfo.profile.pref_relation_styles).toContain( + `${onboardingAccount.connection_type?.[1]}`.toLowerCase(), + ) + await expect(dbInfo.profile.relationship_status).toContain( + onboardingAccount.relationship_status?.[1], + ) + await expect(dbInfo.profile.pref_romantic_styles).toContain( + onboardingAccount.relationship_style?.[1], + ) + await expect(dbInfo.profile.has_kids).toEqual(Number(onboardingAccount.number_of_kids)) + await expect(dbInfo.profile.wants_kids_strength).toEqual( + onboardingAccount.children_expectation?.[1], + ) + await expect(dbInfo.profile.education_level).toContain( + `${onboardingAccount.education_level?.[1]}`.toLowerCase(), + ) + await expect(dbInfo.profile.university).toContain(onboardingAccount.university) + await expect(dbInfo.profile.occupation_title).toContain(onboardingAccount.job_title) + await expect(dbInfo.profile.company).toContain(onboardingAccount.company) + await expect(dbInfo.profile.political_beliefs).toContain( + onboardingAccount.beliefs?.political?.belief?.[1], + ) + await expect(dbInfo.profile.political_details).toContain( + onboardingAccount.beliefs?.political?.details, + ) + await expect(dbInfo.profile.religion).toContain( + onboardingAccount.beliefs?.religious?.belief?.[1], + ) + await expect(dbInfo.profile.religious_beliefs).toContain( + onboardingAccount.beliefs?.religious?.details, + ) + await expect(dbInfo.profile.mbti).toContain( + `${onboardingAccount.personality_type}`.toLowerCase(), + ) + await expect(dbInfo.profile.big5_openness).toEqual( + onboardingAccount.big_five_personality_traits?.openness, + ) + await expect(dbInfo.profile.big5_conscientiousness).toEqual( + onboardingAccount.big_five_personality_traits?.conscientiousness, + ) + await expect(dbInfo.profile.big5_extraversion).toEqual( + onboardingAccount.big_five_personality_traits?.extraversion, + ) + await expect(dbInfo.profile.big5_agreeableness).toEqual( + onboardingAccount.big_five_personality_traits?.agreeableness, + ) + await expect(dbInfo.profile.big5_neuroticism).toEqual( + onboardingAccount.big_five_personality_traits?.neuroticism, + ) + await expect(dbInfo.profile.diet).toContain(onboardingAccount.diet?.[1].toLowerCase()) + await expect(dbInfo.profile.is_smoker).toEqual(onboardingAccount.is_smoker) + await expect(dbInfo.profile.languages).toHaveLength(2) + await expect(dbInfo.profile.languages).toEqual( + expect.arrayContaining(onboardingAccount.languages?.map(([_, l]) => l.toLowerCase()) ?? []), + ) + await expect(String(dbInfo.profile.drinks_per_month)).toEqual( + onboardingAccount.alcohol_consumed_per_month, + ) + }) test('should successfully complete the onboarding flow with google account', async ({ app, @@ -230,12 +230,12 @@ test.describe('when given valid input', () => { //Verify displayed information is correct await app.profile.verifyDisplayName(googleAccountOne.display_name) - //Verify database info - const dbInfo = await userInformationFromDb(googleAccountOne) + //Verify database info + const dbInfo = await userInformationFromDb(googleAccountOne) - await expect(dbInfo.user.name).toContain(googleAccountOne.display_name) - await expect(dbInfo.user.username).toContain(googleAccountOne.username) - }) + await expect(dbInfo.user.name).toContain(googleAccountOne.display_name) + await expect(dbInfo.user.username).toContain(googleAccountOne.username) + }) test('should successfully skip the onboarding flow', async ({app, fakerAccount}) => { await app.registerWithEmail(fakerAccount) @@ -244,12 +244,12 @@ test.describe('when given valid input', () => { //Verify displayed information is correct await app.profile.verifyDisplayName(fakerAccount.display_name) - //Verify database info - const dbInfo = await userInformationFromDb(fakerAccount) + //Verify database info + const dbInfo = await userInformationFromDb(fakerAccount) - await expect(dbInfo.user.name).toContain(fakerAccount.display_name) - await expect(dbInfo.user.username).toContain(fakerAccount.username) - }) + await expect(dbInfo.user.name).toContain(fakerAccount.display_name) + await expect(dbInfo.user.username).toContain(fakerAccount.username) + }) test('should successfully delete an account created via email and password', async ({ homePage, @@ -263,64 +263,64 @@ test.describe('when given valid input', () => { await registerWithEmail(homePage, authPage, fakerAccount) await skipOnboardingHeadToProfile(onboardingPage, signUpPage, profilePage, fakerAccount) - //Verify displayed information is correct - await profilePage.verifyDisplayName(fakerAccount.display_name) + //Verify displayed information is correct + await profilePage.verifyDisplayName(fakerAccount.display_name) - //Verify database info - const dbInfo = await userInformationFromDb(fakerAccount) + //Verify database info + const dbInfo = await userInformationFromDb(fakerAccount) - await expect(dbInfo.user.name).toContain(fakerAccount.display_name) - await expect(dbInfo.user.username).toContain(fakerAccount.username) + await expect(dbInfo.user.name).toContain(fakerAccount.display_name) + await expect(dbInfo.user.username).toContain(fakerAccount.username) - await homePage.clickSettingsLink() - await settingsPage.clickDeleteAccountButton() - await settingsPage.fillDeleteAccountSurvey('Delete me') - await settingsPage.clickDeleteAccountButton() - await homePage.verifyHomePageLinks() - }) + await homePage.clickSettingsLink() + await settingsPage.clickDeleteAccountButton() + await settingsPage.fillDeleteAccountSurvey('Delete me') + await settingsPage.clickDeleteAccountButton() + await homePage.verifyHomePageLinks() + }) - test('should successfully delete an account created via google auth', async ({ - homePage, - onboardingPage, - signUpPage, - authPage, - profilePage, - settingsPage, - googleAccountTwo, - }) => { - console.log( - `Starting "should successfully delete an account created via google auth" with ${googleAccountTwo.username}`, - ) - await homePage.gotToRegisterPage() - await authPage.fillPasswordField('') //The test only passes when this is added...something is weird here - await authPage.signInToGoogleAccount( - googleAccountTwo.email, - googleAccountTwo.display_name, - googleAccountTwo.username, - ) - await onboardingPage.clickSkipOnboardingButton() - await signUpPage.fillDisplayName(googleAccountTwo.display_name) - await signUpPage.fillUsername(googleAccountTwo.username) - await signUpPage.clickNextButton() - await signUpPage.clickNextButton() //Skip optional information - await profilePage.clickCloseButton() - await onboardingPage.clickRefineProfileButton() + test('should successfully delete an account created via google auth', async ({ + homePage, + onboardingPage, + signUpPage, + authPage, + profilePage, + settingsPage, + googleAccountTwo, + }) => { + console.log( + `Starting "should successfully delete an account created via google auth" with ${googleAccountTwo.username}`, + ) + await homePage.goToRegisterPage() + await authPage.fillPasswordField('') //The test only passes when this is added...something is weird here + await authPage.signInToGoogleAccount( + googleAccountTwo.email, + googleAccountTwo.display_name, + googleAccountTwo.username, + ) + await onboardingPage.clickSkipOnboardingButton() + await signUpPage.fillDisplayName(googleAccountTwo.display_name) + await signUpPage.fillUsername(googleAccountTwo.username) + await signUpPage.clickNextButton() + await signUpPage.clickNextButton() //Skip optional information + await profilePage.clickCloseButton() + await onboardingPage.clickRefineProfileButton() - //Verify displayed information is correct - await profilePage.verifyDisplayName(googleAccountTwo.display_name) + //Verify displayed information is correct + await profilePage.verifyDisplayName(googleAccountTwo.display_name) - //Verify database info - const dbInfo = await userInformationFromDb(googleAccountTwo) + //Verify database info + const dbInfo = await userInformationFromDb(googleAccountTwo) - await expect(dbInfo.user.name).toContain(googleAccountTwo.display_name) - await expect(dbInfo.user.username).toContain(googleAccountTwo.username) + await expect(dbInfo.user.name).toContain(googleAccountTwo.display_name) + await expect(dbInfo.user.username).toContain(googleAccountTwo.username) - await homePage.clickSettingsLink() - await settingsPage.clickDeleteAccountButton() - await settingsPage.fillDeleteAccountSurvey('Delete me') - await settingsPage.clickDeleteAccountButton() - await homePage.verifyHomePageLinks() - }) + await homePage.clickSettingsLink() + await settingsPage.clickDeleteAccountButton() + await settingsPage.fillDeleteAccountSurvey('Delete me') + await settingsPage.clickDeleteAccountButton() + await homePage.verifyHomePageLinks() + }) test('should successfully enter optional information after completing flow', async ({ app, @@ -347,15 +347,15 @@ test.describe('when given valid input', () => { fakerAccount.age, ) - //Verify database info - const dbInfo = await userInformationFromDb(fakerAccount) + //Verify database info + const dbInfo = await userInformationFromDb(fakerAccount) - await expect(dbInfo.user.name).toContain(fakerAccount.display_name) - await expect(dbInfo.user.username).toContain(fakerAccount.username) - await expect(dbInfo.profile.gender).toEqual(fakerAccount.gender?.[1]) - await expect(String(dbInfo.profile.age)).toEqual(fakerAccount.age) - await expect(dbInfo.profile.height_in_inches).toEqual(Number(fakerAccount.height?.feet) * 12) - }) + await expect(dbInfo.user.name).toContain(fakerAccount.display_name) + await expect(dbInfo.user.username).toContain(fakerAccount.username) + await expect(dbInfo.profile.gender).toEqual(fakerAccount.gender?.[1]) + await expect(String(dbInfo.profile.age)).toEqual(fakerAccount.age) + await expect(dbInfo.profile.height_in_inches).toEqual(Number(fakerAccount.height?.feet) * 12) + }) test('should successfully use the start answering option', async ({ app, @@ -380,12 +380,12 @@ test.describe('when given valid input', () => { await app.profile.verifyDisplayName(fakerAccount.display_name) await app.profile.verifyCompatibilityAnswers(compatTwoQuestionOne) - //Verify database info - const dbInfo = await userInformationFromDb(fakerAccount) + //Verify database info + const dbInfo = await userInformationFromDb(fakerAccount) - await expect(dbInfo.user.name).toContain(fakerAccount.display_name) - await expect(dbInfo.user.username).toContain(fakerAccount.username) - }) + await expect(dbInfo.user.name).toContain(fakerAccount.display_name) + await expect(dbInfo.user.username).toContain(fakerAccount.username) + }) test.describe('should successfully complete the onboarding flow after using the back button', () => { test("the first time it's an option", async ({app, fakerAccount}) => { @@ -405,12 +405,12 @@ test.describe('when given valid input', () => { //Verify displayed information is correct await app.profile.verifyDisplayName(fakerAccount.display_name) - //Verify database info - const dbInfo = await userInformationFromDb(fakerAccount) + //Verify database info + const dbInfo = await userInformationFromDb(fakerAccount) - await expect(dbInfo.user.name).toContain(fakerAccount.display_name) - await expect(dbInfo.user.username).toContain(fakerAccount.username) - }) + await expect(dbInfo.user.name).toContain(fakerAccount.display_name) + await expect(dbInfo.user.username).toContain(fakerAccount.username) + }) test("the second time it's an option", async ({app, fakerAccount}) => { await app.registerWithEmail(fakerAccount) @@ -429,14 +429,14 @@ test.describe('when given valid input', () => { //Verify displayed information is correct await app.profile.verifyDisplayName(fakerAccount.display_name) - //Verify database info - const dbInfo = await userInformationFromDb(fakerAccount) + //Verify database info + const dbInfo = await userInformationFromDb(fakerAccount) - await expect(dbInfo.user.name).toContain(fakerAccount.display_name) - await expect(dbInfo.user.username).toContain(fakerAccount.username) - }) + await expect(dbInfo.user.name).toContain(fakerAccount.display_name) + await expect(dbInfo.user.username).toContain(fakerAccount.username) }) }) +}) // test.describe('when an error occurs', () => { // test('placeholder', async ({}) => {}) From 14f32e6c64303c871dd0226afc27dac3fd68ce86 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Fri, 3 Apr 2026 16:21:16 +0200 Subject: [PATCH 22/39] Fix --- .env.test | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.env.test b/.env.test index cb1fcaa3..517612ef 100644 --- a/.env.test +++ b/.env.test @@ -16,7 +16,4 @@ NEXT_PUBLIC_FIREBASE_EMULATOR=true NODE_ENV=test PORT=8088 -ENVIRONMENT=DEV - -# Playwright -DIRECT_SUPABASE_SETUP_IN_PLAYWRIGHT=false \ No newline at end of file +ENVIRONMENT=DEV \ No newline at end of file From 8329ed0be463fe588d446112fd693336ff21574b Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Fri, 3 Apr 2026 16:55:28 +0200 Subject: [PATCH 23/39] Improve test utilities and stabilize onboarding flow tests --- tests/e2e/web/pages/authPage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/web/pages/authPage.ts b/tests/e2e/web/pages/authPage.ts index c4f82b94..e1874122 100644 --- a/tests/e2e/web/pages/authPage.ts +++ b/tests/e2e/web/pages/authPage.ts @@ -56,7 +56,7 @@ export class AuthPage { if (display_name) await popup.getByLabel('Display name').fill(display_name) if (username) await popup.getByLabel('Screen name', {exact: true}).fill(username) await Promise.all([ - popup.waitForEvent('close'), + // popup.waitForEvent('close'), popup.getByText('Sign in with Google.com', {exact: true}).click(), ]) } From 576d4c01202f460b835a603dc45f809e95391e7e Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Fri, 3 Apr 2026 20:57:40 +0100 Subject: [PATCH 24/39] Changes requested --- playwright.config.ts | 9 ++++---- tests/e2e/web/pages/authPage.ts | 6 ++---- tests/e2e/web/specs/onboardingFlow.spec.ts | 24 ++++++---------------- tests/e2e/web/utils/deleteUser.ts | 17 ++++++++++----- 4 files changed, 24 insertions(+), 32 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index cfc503d9..a2a6726c 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -25,12 +25,11 @@ function getSupabaseEnv() { } } -if (process.env.DIRECT_SUPABASE_SETUP_IN_PLAYWRIGHT !== 'false') { - const supabaseEnv = getSupabaseEnv() - // Inject into process.env so Playwright and your app code can read them - Object.assign(process.env, supabaseEnv) -} +const supabaseEnv = getSupabaseEnv() + +// Inject into process.env so Playwright and your app code can read them +Object.assign(process.env, supabaseEnv) export default defineConfig({ testDir: './tests/e2e', diff --git a/tests/e2e/web/pages/authPage.ts b/tests/e2e/web/pages/authPage.ts index e1874122..7bccdf38 100644 --- a/tests/e2e/web/pages/authPage.ts +++ b/tests/e2e/web/pages/authPage.ts @@ -55,10 +55,8 @@ export class AuthPage { await popup.getByLabel('Email').fill(email) if (display_name) await popup.getByLabel('Display name').fill(display_name) if (username) await popup.getByLabel('Screen name', {exact: true}).fill(username) - await Promise.all([ - // popup.waitForEvent('close'), - popup.getByText('Sign in with Google.com', {exact: true}).click(), - ]) + await popup.getByText('Sign in with Google.com', {exact: true}).click() + await popup.waitForEvent('close') } async clickSignUpWithEmailButton() { diff --git a/tests/e2e/web/specs/onboardingFlow.spec.ts b/tests/e2e/web/specs/onboardingFlow.spec.ts index a9a5cc5c..3f49f522 100644 --- a/tests/e2e/web/specs/onboardingFlow.spec.ts +++ b/tests/e2e/web/specs/onboardingFlow.spec.ts @@ -212,7 +212,7 @@ test.describe('when given valid input', () => { onboardingAccount.alcohol_consumed_per_month, ) }) - + test('should successfully complete the onboarding flow with google account', async ({ app, googleAccountOne, @@ -272,11 +272,7 @@ test.describe('when given valid input', () => { await expect(dbInfo.user.name).toContain(fakerAccount.display_name) await expect(dbInfo.user.username).toContain(fakerAccount.username) - await homePage.clickSettingsLink() - await settingsPage.clickDeleteAccountButton() - await settingsPage.fillDeleteAccountSurvey('Delete me') - await settingsPage.clickDeleteAccountButton() - await homePage.verifyHomePageLinks() + await deleteProfileFromSettings(homePage, settingsPage) }) test('should successfully delete an account created via google auth', async ({ @@ -287,10 +283,12 @@ test.describe('when given valid input', () => { profilePage, settingsPage, googleAccountTwo, + headless, }) => { console.log( `Starting "should successfully delete an account created via google auth" with ${googleAccountTwo.username}`, ) + test.skip(headless, 'Google popup auth test requires headed mode') await homePage.goToRegisterPage() await authPage.fillPasswordField('') //The test only passes when this is added...something is weird here await authPage.signInToGoogleAccount( @@ -298,13 +296,7 @@ test.describe('when given valid input', () => { googleAccountTwo.display_name, googleAccountTwo.username, ) - await onboardingPage.clickSkipOnboardingButton() - await signUpPage.fillDisplayName(googleAccountTwo.display_name) - await signUpPage.fillUsername(googleAccountTwo.username) - await signUpPage.clickNextButton() - await signUpPage.clickNextButton() //Skip optional information - await profilePage.clickCloseButton() - await onboardingPage.clickRefineProfileButton() + await skipOnboardingHeadToProfile(onboardingPage, signUpPage, profilePage, googleAccountTwo) //Verify displayed information is correct await profilePage.verifyDisplayName(googleAccountTwo.display_name) @@ -315,11 +307,7 @@ test.describe('when given valid input', () => { await expect(dbInfo.user.name).toContain(googleAccountTwo.display_name) await expect(dbInfo.user.username).toContain(googleAccountTwo.username) - await homePage.clickSettingsLink() - await settingsPage.clickDeleteAccountButton() - await settingsPage.fillDeleteAccountSurvey('Delete me') - await settingsPage.clickDeleteAccountButton() - await homePage.verifyHomePageLinks() + await deleteProfileFromSettings(homePage, settingsPage) }) test('should successfully enter optional information after completing flow', async ({ diff --git a/tests/e2e/web/utils/deleteUser.ts b/tests/e2e/web/utils/deleteUser.ts index d7376fe3..ed088fac 100644 --- a/tests/e2e/web/utils/deleteUser.ts +++ b/tests/e2e/web/utils/deleteUser.ts @@ -1,5 +1,5 @@ -import {deleteFromDb} from '../../utils/databaseUtils' -import {deleteAccount, firebaseLoginEmailPassword} from '../../utils/firebaseUtils' +import {deleteFromDb, userInformationFromDb} from '../../utils/databaseUtils' +import {deleteAccount, firebaseLoginEmailPassword, findUser} from '../../utils/firebaseUtils' import {UserAccountInformation} from './accountInformation' import {AuthObject} from './networkUtils' @@ -13,9 +13,16 @@ export async function deleteUser( let loginInfo if (authType === 'Email/Password') { loginInfo = await firebaseLoginEmailPassword(account?.email, account?.password) - await deleteAccount(loginInfo?.data.idToken) - await deleteFromDb(loginInfo?.data.localId) - } else if (authType === 'Google' && authInfo) { + try { + await deleteAccount(loginInfo?.data.idToken) + const userDbCheck = await userInformationFromDb(account) + if (userDbCheck) { + await deleteFromDb(loginInfo?.data.localId) + } + } catch (dbError) {} + }else if (authType === 'Google' && authInfo) { + const googleAuthUser = await findUser(authInfo.idToken) + if (!googleAuthUser) return await deleteAccount(authInfo.idToken) await deleteFromDb(authInfo.localId) } From a0e4794ff0e8b5989394e39c19384ae340911dac Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Sat, 4 Apr 2026 19:17:45 +0100 Subject: [PATCH 25/39] Changed POM/Fixture structure to use an app class to instantiate the page objects --- tests/e2e/web/specs/onboardingFlow.spec.ts | 59 ---------------------- 1 file changed, 59 deletions(-) diff --git a/tests/e2e/web/specs/onboardingFlow.spec.ts b/tests/e2e/web/specs/onboardingFlow.spec.ts index 3f49f522..9a3561be 100644 --- a/tests/e2e/web/specs/onboardingFlow.spec.ts +++ b/tests/e2e/web/specs/onboardingFlow.spec.ts @@ -251,65 +251,6 @@ test.describe('when given valid input', () => { await expect(dbInfo.user.username).toContain(fakerAccount.username) }) - test('should successfully delete an account created via email and password', async ({ - homePage, - onboardingPage, - signUpPage, - authPage, - profilePage, - settingsPage, - fakerAccount, - }) => { - await registerWithEmail(homePage, authPage, fakerAccount) - await skipOnboardingHeadToProfile(onboardingPage, signUpPage, profilePage, fakerAccount) - - //Verify displayed information is correct - await profilePage.verifyDisplayName(fakerAccount.display_name) - - //Verify database info - const dbInfo = await userInformationFromDb(fakerAccount) - - await expect(dbInfo.user.name).toContain(fakerAccount.display_name) - await expect(dbInfo.user.username).toContain(fakerAccount.username) - - await deleteProfileFromSettings(homePage, settingsPage) - }) - - test('should successfully delete an account created via google auth', async ({ - homePage, - onboardingPage, - signUpPage, - authPage, - profilePage, - settingsPage, - googleAccountTwo, - headless, - }) => { - console.log( - `Starting "should successfully delete an account created via google auth" with ${googleAccountTwo.username}`, - ) - test.skip(headless, 'Google popup auth test requires headed mode') - await homePage.goToRegisterPage() - await authPage.fillPasswordField('') //The test only passes when this is added...something is weird here - await authPage.signInToGoogleAccount( - googleAccountTwo.email, - googleAccountTwo.display_name, - googleAccountTwo.username, - ) - await skipOnboardingHeadToProfile(onboardingPage, signUpPage, profilePage, googleAccountTwo) - - //Verify displayed information is correct - await profilePage.verifyDisplayName(googleAccountTwo.display_name) - - //Verify database info - const dbInfo = await userInformationFromDb(googleAccountTwo) - - await expect(dbInfo.user.name).toContain(googleAccountTwo.display_name) - await expect(dbInfo.user.username).toContain(googleAccountTwo.username) - - await deleteProfileFromSettings(homePage, settingsPage) - }) - test('should successfully enter optional information after completing flow', async ({ app, fakerAccount, From 35f3e2ac2a1b3afc36ec904a459e01d3e98a707f Mon Sep 17 00:00:00 2001 From: Martin Braquet Date: Sat, 4 Apr 2026 20:37:38 +0200 Subject: [PATCH 26/39] Apply suggestion from @MartinBraquet --- playwright.config.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/playwright.config.ts b/playwright.config.ts index a2a6726c..ec94cf50 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -25,7 +25,6 @@ function getSupabaseEnv() { } } - const supabaseEnv = getSupabaseEnv() // Inject into process.env so Playwright and your app code can read them From dcbb7d34b2137d81fcae41b81c2c26082c0262c3 Mon Sep 17 00:00:00 2001 From: Martin Braquet Date: Sat, 4 Apr 2026 20:38:36 +0200 Subject: [PATCH 27/39] Delete .vscode/settings.json --- .vscode/settings.json | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index db1ed83a..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "codium.codeCompletion.enable": false -} \ No newline at end of file From e2f1bc87f0a6a8875f3b7768be87c502d88c6700 Mon Sep 17 00:00:00 2001 From: Martin Braquet Date: Sat, 4 Apr 2026 20:43:22 +0200 Subject: [PATCH 28/39] Apply suggestion from @MartinBraquet --- tests/e2e/web/utils/deleteUser.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/tests/e2e/web/utils/deleteUser.ts b/tests/e2e/web/utils/deleteUser.ts index ed088fac..5aa6a965 100644 --- a/tests/e2e/web/utils/deleteUser.ts +++ b/tests/e2e/web/utils/deleteUser.ts @@ -13,16 +13,9 @@ export async function deleteUser( let loginInfo if (authType === 'Email/Password') { loginInfo = await firebaseLoginEmailPassword(account?.email, account?.password) - try { - await deleteAccount(loginInfo?.data.idToken) - const userDbCheck = await userInformationFromDb(account) - if (userDbCheck) { - await deleteFromDb(loginInfo?.data.localId) - } - } catch (dbError) {} - }else if (authType === 'Google' && authInfo) { - const googleAuthUser = await findUser(authInfo.idToken) - if (!googleAuthUser) return + await deleteAccount(loginInfo?.data.idToken) + await deleteFromDb(loginInfo?.data.localId) + } else if (authType === 'Google' && authInfo) { await deleteAccount(authInfo.idToken) await deleteFromDb(authInfo.localId) } From cc3d85fead0e600ad9561c24f50c82cd5740d9ce Mon Sep 17 00:00:00 2001 From: Martin Braquet Date: Sat, 4 Apr 2026 20:54:03 +0200 Subject: [PATCH 29/39] Apply suggestion from @MartinBraquet --- tests/e2e/web/utils/deleteUser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/web/utils/deleteUser.ts b/tests/e2e/web/utils/deleteUser.ts index 5aa6a965..a2cc229f 100644 --- a/tests/e2e/web/utils/deleteUser.ts +++ b/tests/e2e/web/utils/deleteUser.ts @@ -13,7 +13,7 @@ export async function deleteUser( let loginInfo if (authType === 'Email/Password') { loginInfo = await firebaseLoginEmailPassword(account?.email, account?.password) - await deleteAccount(loginInfo?.data.idToken) + await deleteAccount(loginInfo?.data.idToken) await deleteFromDb(loginInfo?.data.localId) } else if (authType === 'Google' && authInfo) { await deleteAccount(authInfo.idToken) From 946bfeac3db45350833641ac408c8264ba653f11 Mon Sep 17 00:00:00 2001 From: Martin Braquet Date: Sat, 4 Apr 2026 20:55:14 +0200 Subject: [PATCH 30/39] Apply suggestion from @MartinBraquet --- tests/e2e/web/utils/deleteUser.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/web/utils/deleteUser.ts b/tests/e2e/web/utils/deleteUser.ts index a2cc229f..d7376fe3 100644 --- a/tests/e2e/web/utils/deleteUser.ts +++ b/tests/e2e/web/utils/deleteUser.ts @@ -1,5 +1,5 @@ -import {deleteFromDb, userInformationFromDb} from '../../utils/databaseUtils' -import {deleteAccount, firebaseLoginEmailPassword, findUser} from '../../utils/firebaseUtils' +import {deleteFromDb} from '../../utils/databaseUtils' +import {deleteAccount, firebaseLoginEmailPassword} from '../../utils/firebaseUtils' import {UserAccountInformation} from './accountInformation' import {AuthObject} from './networkUtils' From 11cf0c77c44d19399def276bbe41b083a2264ef3 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Sat, 4 Apr 2026 19:57:07 +0100 Subject: [PATCH 31/39] Linting and Prettier --- tests/e2e/web/specs/onboardingFlow.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/web/specs/onboardingFlow.spec.ts b/tests/e2e/web/specs/onboardingFlow.spec.ts index 9a3561be..0466074c 100644 --- a/tests/e2e/web/specs/onboardingFlow.spec.ts +++ b/tests/e2e/web/specs/onboardingFlow.spec.ts @@ -212,7 +212,7 @@ test.describe('when given valid input', () => { onboardingAccount.alcohol_consumed_per_month, ) }) - + test('should successfully complete the onboarding flow with google account', async ({ app, googleAccountOne, From d6e165f094780c83a1173219476d2cc57f00636c Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Mon, 11 May 2026 13:11:47 +0100 Subject: [PATCH 32/39] Updated People page --- tests/e2e/web/pages/peoplePage.ts | 6 +-- tests/e2e/web/specs/onboardingFlow.spec.ts | 15 ++++-- tests/e2e/web/specs/signIn.spec.ts | 61 ++++++++++++++++++++++ 3 files changed, 76 insertions(+), 6 deletions(-) diff --git a/tests/e2e/web/pages/peoplePage.ts b/tests/e2e/web/pages/peoplePage.ts index 8c620f4d..3dec2a04 100644 --- a/tests/e2e/web/pages/peoplePage.ts +++ b/tests/e2e/web/pages/peoplePage.ts @@ -427,8 +427,8 @@ export class PeoplePage { async verifyNumberOfMatchingProfiles(count: number) { await expect(this.profileCount).toBeVisible() - const test = await this.profileCount.textContent() - if (!test) return - expect(actual).toStrictEqual(expected) + const actualCount = await this.profileCount.textContent() + if (!actualCount) return + expect(parseInt(actualCount)).toStrictEqual(count) } } diff --git a/tests/e2e/web/specs/onboardingFlow.spec.ts b/tests/e2e/web/specs/onboardingFlow.spec.ts index 0466074c..97fba1fd 100644 --- a/tests/e2e/web/specs/onboardingFlow.spec.ts +++ b/tests/e2e/web/specs/onboardingFlow.spec.ts @@ -237,7 +237,10 @@ test.describe('when given valid input', () => { await expect(dbInfo.user.username).toContain(googleAccountOne.username) }) - test('should successfully skip the onboarding flow', async ({app, fakerAccount}) => { + test('should successfully skip the onboarding flow', async ({ + app, + fakerAccount + }) => { await app.registerWithEmail(fakerAccount) await app.skipOnboardingHeadToProfile(fakerAccount) @@ -317,7 +320,10 @@ test.describe('when given valid input', () => { }) test.describe('should successfully complete the onboarding flow after using the back button', () => { - test("the first time it's an option", async ({app, fakerAccount}) => { + test("the first time it's an option", async ({ + app, + fakerAccount + }) => { await app.registerWithEmail(fakerAccount) await app.onboarding.clickContinueButton() await app.onboarding.clickBackButton() @@ -341,7 +347,10 @@ test.describe('when given valid input', () => { await expect(dbInfo.user.username).toContain(fakerAccount.username) }) - test("the second time it's an option", async ({app, fakerAccount}) => { + test("the second time it's an option", async ({ + app, + fakerAccount + }) => { await app.registerWithEmail(fakerAccount) await app.onboarding.clickContinueButton() await app.onboarding.clickContinueButton() diff --git a/tests/e2e/web/specs/signIn.spec.ts b/tests/e2e/web/specs/signIn.spec.ts index 771f84a8..1ed0994c 100644 --- a/tests/e2e/web/specs/signIn.spec.ts +++ b/tests/e2e/web/specs/signIn.spec.ts @@ -3,11 +3,72 @@ import {expect, test} from '../fixtures/signInFixture' test.describe('when given valid input', () => { test('should be able to sign in to an available account', async ({ app, +<<<<<<< HEAD signedOutAccount: account, }) => { await app.signinWithEmail(account) await app.home.goToHomePage() await app.home.verifySignedInHomePage(account.display_name) +======= + dev_one_account + }) => { + await app.signinWithEmail(dev_one_account) + await app.home.goToHomePage() + await app.home.verifySignedInHomePage(dev_one_account.display_name) + }) + + // test('Trial', async ({ + // app, + // dev_one_account + // }) => { + // await app.signinWithEmail(dev_one_account) + // await app.home.clickPeopleLink() + // }) + + test('should successfully delete an account created via email and password', async ({ + app, + signedOutAccount: account, + }) => { + await app.registerWithEmail(fakerAccount) + await app.skipOnboardingHeadToProfile(fakerAccount) + + //Verify displayed information is correct + await app.profile.verifyDisplayName(fakerAccount.display_name) + + //Verify database info + const dbInfo = await userInformationFromDb(fakerAccount) + + await expect(dbInfo.user.name).toContain(fakerAccount.display_name) + await expect(dbInfo.user.username).toContain(fakerAccount.username) + + await app.deleteProfileFromSettings() + }) + + test('should successfully delete an account created via google auth', async ({ + app, + googleAccountTwo, + headless, + }) => { + test.skip(headless, 'Google popup auth test requires headed mode') + await app.home.goToRegisterPage() + await app.auth.signInToGoogleAccount( + googleAccountTwo.email, + googleAccountTwo.display_name, + googleAccountTwo.username, + ) + await app.skipOnboardingHeadToProfile(googleAccountTwo) + + //Verify displayed information is correct + await app.profile.verifyDisplayName(googleAccountTwo.display_name) + + //Verify database info + const dbInfo = await userInformationFromDb(googleAccountTwo) + + await expect(dbInfo.user.name).toContain(googleAccountTwo.display_name) + await expect(dbInfo.user.username).toContain(googleAccountTwo.username) + + await app.deleteProfileFromSettings() +>>>>>>> 35402a77 (Updated People page) }) test('the profile count should update sucessfully when applying a filter', async ({ From 2920e810b1af02b4e7f7008ff9f63d567a271868 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Mon, 11 May 2026 13:32:14 +0100 Subject: [PATCH 33/39] Fix app.ts --- tests/e2e/web/specs/signIn.spec.ts | 67 ++---------------------------- 1 file changed, 3 insertions(+), 64 deletions(-) diff --git a/tests/e2e/web/specs/signIn.spec.ts b/tests/e2e/web/specs/signIn.spec.ts index 1ed0994c..d378bdc2 100644 --- a/tests/e2e/web/specs/signIn.spec.ts +++ b/tests/e2e/web/specs/signIn.spec.ts @@ -3,72 +3,11 @@ import {expect, test} from '../fixtures/signInFixture' test.describe('when given valid input', () => { test('should be able to sign in to an available account', async ({ app, -<<<<<<< HEAD - signedOutAccount: account, - }) => { - await app.signinWithEmail(account) - await app.home.goToHomePage() - await app.home.verifySignedInHomePage(account.display_name) -======= - dev_one_account + signedOutAccount, }) => { - await app.signinWithEmail(dev_one_account) + await app.signinWithEmail(signedOutAccount) await app.home.goToHomePage() - await app.home.verifySignedInHomePage(dev_one_account.display_name) - }) - - // test('Trial', async ({ - // app, - // dev_one_account - // }) => { - // await app.signinWithEmail(dev_one_account) - // await app.home.clickPeopleLink() - // }) - - test('should successfully delete an account created via email and password', async ({ - app, - signedOutAccount: account, - }) => { - await app.registerWithEmail(fakerAccount) - await app.skipOnboardingHeadToProfile(fakerAccount) - - //Verify displayed information is correct - await app.profile.verifyDisplayName(fakerAccount.display_name) - - //Verify database info - const dbInfo = await userInformationFromDb(fakerAccount) - - await expect(dbInfo.user.name).toContain(fakerAccount.display_name) - await expect(dbInfo.user.username).toContain(fakerAccount.username) - - await app.deleteProfileFromSettings() - }) - - test('should successfully delete an account created via google auth', async ({ - app, - googleAccountTwo, - headless, - }) => { - test.skip(headless, 'Google popup auth test requires headed mode') - await app.home.goToRegisterPage() - await app.auth.signInToGoogleAccount( - googleAccountTwo.email, - googleAccountTwo.display_name, - googleAccountTwo.username, - ) - await app.skipOnboardingHeadToProfile(googleAccountTwo) - - //Verify displayed information is correct - await app.profile.verifyDisplayName(googleAccountTwo.display_name) - - //Verify database info - const dbInfo = await userInformationFromDb(googleAccountTwo) - - await expect(dbInfo.user.name).toContain(googleAccountTwo.display_name) - await expect(dbInfo.user.username).toContain(googleAccountTwo.username) - - await app.deleteProfileFromSettings() ->>>>>>> 35402a77 (Updated People page) + await app.home.verifySignedInHomePage(signedOutAccount.display_name) }) test('the profile count should update sucessfully when applying a filter', async ({ From e7ae4931c775fb9338ed39dfc0876b21a988c675 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Tue, 12 May 2026 18:48:32 +0100 Subject: [PATCH 34/39] Updated peoplePage.ts: continued adding functions to use filters Updated filters.tsx: added data testid --- tests/e2e/web/specs/signIn.spec.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/e2e/web/specs/signIn.spec.ts b/tests/e2e/web/specs/signIn.spec.ts index d378bdc2..a43fb749 100644 --- a/tests/e2e/web/specs/signIn.spec.ts +++ b/tests/e2e/web/specs/signIn.spec.ts @@ -3,11 +3,11 @@ import {expect, test} from '../fixtures/signInFixture' test.describe('when given valid input', () => { test('should be able to sign in to an available account', async ({ app, - signedOutAccount, + signedOutAccount: account, }) => { - await app.signinWithEmail(signedOutAccount) + await app.signinWithEmail(account) await app.home.goToHomePage() - await app.home.verifySignedInHomePage(signedOutAccount.display_name) + await app.home.verifySignedInHomePage(account.display_name) }) test('the profile count should update sucessfully when applying a filter', async ({ @@ -45,5 +45,13 @@ test.describe('when given invalid input', () => { }) test.describe('when an error occurs', () => { - test('placeholder', async () => {}) + test('placeholder', async () => { }) + test('Trial', async ({ + app, + signedOutAccount: account + }) => { + await app.signinWithEmail(account) + await app.home.clickPeopleLink() + await app.people.setDisplayFilter({cardSize: "Large", filters: [["Gender", true]]}) + }) }) From 5aa8a546fd4c2d98b6608e818d6066750c9d6ce0 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Thu, 2 Apr 2026 23:10:31 +0100 Subject: [PATCH 35/39] Coderabbitai fix's --- tests/e2e/web/pages/authPage.ts | 6 ++-- tests/e2e/web/utils/testCleanupHelpers.ts | 34 +++++++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 tests/e2e/web/utils/testCleanupHelpers.ts diff --git a/tests/e2e/web/pages/authPage.ts b/tests/e2e/web/pages/authPage.ts index 7bccdf38..c4f82b94 100644 --- a/tests/e2e/web/pages/authPage.ts +++ b/tests/e2e/web/pages/authPage.ts @@ -55,8 +55,10 @@ export class AuthPage { await popup.getByLabel('Email').fill(email) if (display_name) await popup.getByLabel('Display name').fill(display_name) if (username) await popup.getByLabel('Screen name', {exact: true}).fill(username) - await popup.getByText('Sign in with Google.com', {exact: true}).click() - await popup.waitForEvent('close') + await Promise.all([ + popup.waitForEvent('close'), + popup.getByText('Sign in with Google.com', {exact: true}).click(), + ]) } async clickSignUpWithEmailButton() { diff --git a/tests/e2e/web/utils/testCleanupHelpers.ts b/tests/e2e/web/utils/testCleanupHelpers.ts new file mode 100644 index 00000000..cff9f47a --- /dev/null +++ b/tests/e2e/web/utils/testCleanupHelpers.ts @@ -0,0 +1,34 @@ +import {AuthPage} from '../pages/AuthPage' +import {HomePage} from '../pages/homePage' +import {UserAccountInformation} from '../utils/accountInformation' + +export async function registerWithEmail( + homePage: HomePage, + authPage: AuthPage, + account: UserAccountInformation, +) { + await homePage.goToRegisterPage() + await authPage.fillEmailField(account.email) + await authPage.fillPasswordField(account.password) + await authPage.clickSignUpWithEmailButton() +} + +export async function signinWithEmail( + homePage: HomePage, + authPage: AuthPage, + accountOrEmail: UserAccountInformation | string, + password?: string, +) { + const email = typeof accountOrEmail === 'string' ? accountOrEmail : accountOrEmail.email + + const resolvedPassword = typeof accountOrEmail === 'string' ? password : accountOrEmail.password + + if (!email || !resolvedPassword) { + throw new Error('Provide either an `account` or `email` and `password`.') + } + + await homePage.goToSigninPage() + await authPage.fillEmailField(email) + await authPage.fillPasswordField(resolvedPassword) + await authPage.clickSignInWithEmailButton() +} From 9d48633392c8d40331a9c06732e15438327b0905 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Tue, 12 May 2026 18:59:26 +0100 Subject: [PATCH 36/39] . --- tests/e2e/web/utils/testCleanupHelpers.ts | 34 ----------------------- 1 file changed, 34 deletions(-) delete mode 100644 tests/e2e/web/utils/testCleanupHelpers.ts diff --git a/tests/e2e/web/utils/testCleanupHelpers.ts b/tests/e2e/web/utils/testCleanupHelpers.ts deleted file mode 100644 index cff9f47a..00000000 --- a/tests/e2e/web/utils/testCleanupHelpers.ts +++ /dev/null @@ -1,34 +0,0 @@ -import {AuthPage} from '../pages/AuthPage' -import {HomePage} from '../pages/homePage' -import {UserAccountInformation} from '../utils/accountInformation' - -export async function registerWithEmail( - homePage: HomePage, - authPage: AuthPage, - account: UserAccountInformation, -) { - await homePage.goToRegisterPage() - await authPage.fillEmailField(account.email) - await authPage.fillPasswordField(account.password) - await authPage.clickSignUpWithEmailButton() -} - -export async function signinWithEmail( - homePage: HomePage, - authPage: AuthPage, - accountOrEmail: UserAccountInformation | string, - password?: string, -) { - const email = typeof accountOrEmail === 'string' ? accountOrEmail : accountOrEmail.email - - const resolvedPassword = typeof accountOrEmail === 'string' ? password : accountOrEmail.password - - if (!email || !resolvedPassword) { - throw new Error('Provide either an `account` or `email` and `password`.') - } - - await homePage.goToSigninPage() - await authPage.fillEmailField(email) - await authPage.fillPasswordField(resolvedPassword) - await authPage.clickSignInWithEmailButton() -} From c1c9eee57aacc85369b3a9c3b2ddc362bc47a29d Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Wed, 20 May 2026 15:43:10 +0100 Subject: [PATCH 37/39] Updated People page Added data test attributes to search.tsx and profile-grid.tsx --- tests/e2e/web/specs/signIn.spec.ts | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/tests/e2e/web/specs/signIn.spec.ts b/tests/e2e/web/specs/signIn.spec.ts index a43fb749..537853fb 100644 --- a/tests/e2e/web/specs/signIn.spec.ts +++ b/tests/e2e/web/specs/signIn.spec.ts @@ -38,20 +38,4 @@ test.describe('when given invalid input', () => { page.getByText('Failed to sign in with your email and password', {exact: true}), ).toBeVisible() }) - - test('login check', async ({}) => { - - }); -}) - -test.describe('when an error occurs', () => { - test('placeholder', async () => { }) - test('Trial', async ({ - app, - signedOutAccount: account - }) => { - await app.signinWithEmail(account) - await app.home.clickPeopleLink() - await app.people.setDisplayFilter({cardSize: "Large", filters: [["Gender", true]]}) - }) }) From 07c0eca4d011df11bc133418030edd0b9d52ce03 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Wed, 20 May 2026 15:45:57 +0100 Subject: [PATCH 38/39] Lint and Prettier --- tests/e2e/web/specs/onboardingFlow.spec.ts | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/tests/e2e/web/specs/onboardingFlow.spec.ts b/tests/e2e/web/specs/onboardingFlow.spec.ts index 97fba1fd..0466074c 100644 --- a/tests/e2e/web/specs/onboardingFlow.spec.ts +++ b/tests/e2e/web/specs/onboardingFlow.spec.ts @@ -237,10 +237,7 @@ test.describe('when given valid input', () => { await expect(dbInfo.user.username).toContain(googleAccountOne.username) }) - test('should successfully skip the onboarding flow', async ({ - app, - fakerAccount - }) => { + test('should successfully skip the onboarding flow', async ({app, fakerAccount}) => { await app.registerWithEmail(fakerAccount) await app.skipOnboardingHeadToProfile(fakerAccount) @@ -320,10 +317,7 @@ test.describe('when given valid input', () => { }) test.describe('should successfully complete the onboarding flow after using the back button', () => { - test("the first time it's an option", async ({ - app, - fakerAccount - }) => { + test("the first time it's an option", async ({app, fakerAccount}) => { await app.registerWithEmail(fakerAccount) await app.onboarding.clickContinueButton() await app.onboarding.clickBackButton() @@ -347,10 +341,7 @@ test.describe('when given valid input', () => { await expect(dbInfo.user.username).toContain(fakerAccount.username) }) - test("the second time it's an option", async ({ - app, - fakerAccount - }) => { + test("the second time it's an option", async ({app, fakerAccount}) => { await app.registerWithEmail(fakerAccount) await app.onboarding.clickContinueButton() await app.onboarding.clickContinueButton() From 410f2a1c73b1fc82feed4e993550edb109d2179c Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Thu, 21 May 2026 16:40:11 +0100 Subject: [PATCH 39/39] . --- tests/e2e/web/specs/signIn.spec.ts | 2 +- tests/e2e/web/specs/signUp.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/web/specs/signIn.spec.ts b/tests/e2e/web/specs/signIn.spec.ts index 537853fb..262b3cf9 100644 --- a/tests/e2e/web/specs/signIn.spec.ts +++ b/tests/e2e/web/specs/signIn.spec.ts @@ -38,4 +38,4 @@ test.describe('when given invalid input', () => { page.getByText('Failed to sign in with your email and password', {exact: true}), ).toBeVisible() }) -}) +}) \ No newline at end of file diff --git a/tests/e2e/web/specs/signUp.spec.ts b/tests/e2e/web/specs/signUp.spec.ts index 53562129..a266bb17 100644 --- a/tests/e2e/web/specs/signUp.spec.ts +++ b/tests/e2e/web/specs/signUp.spec.ts @@ -28,4 +28,4 @@ test.describe('when an error occurs', () => { await app.signUp.verifyUsernameError() await expect(app.signUp.nextButtonLocator).toBeDisabled() }) -}) +}) \ No newline at end of file