From 3a1dd4c2f15afb1d6a0ad2a6753e6d2b0d0f3cb2 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Sun, 22 Feb 2026 18:34:09 +0000 Subject: [PATCH 01/43] 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 f49cd0e7f10b4aa007cbc6c7d38e2dbe98033757 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Wed, 25 Feb 2026 15:19:06 +0000 Subject: [PATCH 02/43] 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 bd4b52c76854fbfa6ce9032df35579b140af3a35 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Wed, 4 Mar 2026 01:30:41 +0000 Subject: [PATCH 03/43] 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 bbb6b81f..edd37261 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/43] . --- 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 edd37261..bbb6b81f 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 f4fe14668189dd4f36251a837137c2463a2cd22e Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Wed, 11 Mar 2026 17:04:54 +0000 Subject: [PATCH 05/43] 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/43] . --- 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 714dec9cbb142de9e44d2bfd6af2d6c750f8b06e Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Sun, 15 Mar 2026 17:57:48 +0000 Subject: [PATCH 07/43] 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 ba32fb9a7b77c1e9190ca2e9200564342df5ee79 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Sun, 15 Mar 2026 19:48:29 +0000 Subject: [PATCH 08/43] 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 282dfea1531b385f69495a0a55759478a50b62a3 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Sun, 15 Mar 2026 23:11:08 +0100 Subject: [PATCH 09/43] 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 f9f79b771592c8a2aacdae850fecef1185a71976 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Mon, 16 Mar 2026 14:51:03 +0000 Subject: [PATCH 10/43] 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 8b210148494f83a79b786042100de087c25b2420 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Tue, 17 Mar 2026 18:38:32 +0000 Subject: [PATCH 11/43] 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 7b07107cf948fc5a6259860f6e041834b3d1bb97 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Wed, 18 Mar 2026 18:18:56 +0000 Subject: [PATCH 12/43] 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 8ecdbcc0f19d5f08593c85d57c3315d2ebfbd5e9 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Wed, 25 Mar 2026 00:59:08 +0000 Subject: [PATCH 13/43] 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 dee657dad44ae8de497016558f0726e4018c5a96 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Wed, 25 Mar 2026 01:09:24 +0000 Subject: [PATCH 14/43] 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 40c4cdd08a2cd2e297cbe6ec3d9d486b1bb8ef7b Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Thu, 26 Mar 2026 15:13:11 +0000 Subject: [PATCH 15/43] 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 9501062f..79f54428 100644 --- a/tests/e2e/web/specs/signIn.spec.ts +++ b/tests/e2e/web/specs/signIn.spec.ts @@ -22,4 +22,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 2745c3ce7adc85826c595051bb6fea905eb2833c Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Thu, 26 Mar 2026 15:14:57 +0000 Subject: [PATCH 16/43] 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 a191eb50d283e7430b49cfebd825f53f0b401125 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Thu, 2 Apr 2026 14:44:41 +0100 Subject: [PATCH 17/43] 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 64c41045f35e138be2c73536b55bbf49fec23883 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Thu, 2 Apr 2026 16:58:26 +0100 Subject: [PATCH 18/43] . --- .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 d9d9bedc73f6ca023af2a4a828ce76b0525ec3b2 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Thu, 2 Apr 2026 17:00:33 +0100 Subject: [PATCH 19/43] . --- 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 6c6a5922fd4768858d16bb2455bf9d36ac16400b Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Thu, 2 Apr 2026 17:02:56 +0100 Subject: [PATCH 20/43] . --- .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 fde2e7170083ba1b9c862b43809b64a2a7cb07c5 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Thu, 2 Apr 2026 23:10:31 +0100 Subject: [PATCH 21/43] Coderabbitai fix's --- playwright.config.ts | 2 +- tests/e2e/web/pages/authPage.ts | 6 +- tests/e2e/web/specs/onboardingFlow.spec.ts | 332 ++++++++++----------- 3 files changed, 171 insertions(+), 169 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/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/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 4ba866337979571339160dbed740fd92cac375e2 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Fri, 3 Apr 2026 16:21:16 +0200 Subject: [PATCH 22/43] 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 2dd3e87e9883be442f3c5f87cbbc00254a5d98e1 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Fri, 3 Apr 2026 16:55:28 +0200 Subject: [PATCH 23/43] 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 e0e4b3b0271df9adc1d9a48e3b788c062d1742c6 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Fri, 3 Apr 2026 20:57:40 +0100 Subject: [PATCH 24/43] 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 4dd30513fe8835389cfa1f78ff22ae45c595ac52 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Sat, 4 Apr 2026 19:17:45 +0100 Subject: [PATCH 25/43] 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 dedc199fda78b2f524aac84a4051bdf74fdd6b93 Mon Sep 17 00:00:00 2001 From: Martin Braquet Date: Sat, 4 Apr 2026 20:37:38 +0200 Subject: [PATCH 26/43] 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 8b082bf6e8a5dcfc48fae3af9cba1c2401245be9 Mon Sep 17 00:00:00 2001 From: Martin Braquet Date: Sat, 4 Apr 2026 20:38:36 +0200 Subject: [PATCH 27/43] 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 b80d401ff26eb0aa8ed4ed3d964f56c3cc9e561a Mon Sep 17 00:00:00 2001 From: Martin Braquet Date: Sat, 4 Apr 2026 20:43:22 +0200 Subject: [PATCH 28/43] 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 2a8f3aada7b5e8a10ae4aa5c6791bfe8cabd49c2 Mon Sep 17 00:00:00 2001 From: Martin Braquet Date: Sat, 4 Apr 2026 20:54:03 +0200 Subject: [PATCH 29/43] 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 02e91eaa9307d64e588255f6c42863fa52fbfbb5 Mon Sep 17 00:00:00 2001 From: Martin Braquet Date: Sat, 4 Apr 2026 20:55:14 +0200 Subject: [PATCH 30/43] 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 4a75de461db11de6aa068a4c1e9545bdaa15f69d Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Sat, 4 Apr 2026 19:57:07 +0100 Subject: [PATCH 31/43] 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 704f3a92417f50d00a29d4284651b8af223b60fd Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Mon, 11 May 2026 13:11:47 +0100 Subject: [PATCH 32/43] Updated People page --- .github/workflows/ci.yml | 4 +- tests/e2e/web/pages/app.ts | 2 + tests/e2e/web/pages/peoplePage.ts | 302 +++++++++++++++++++++ tests/e2e/web/specs/onboardingFlow.spec.ts | 15 +- tests/e2e/web/specs/signIn.spec.ts | 61 +++++ tests/e2e/web/utils/accountInformation.ts | 6 +- web/components/filters/big5-filter.tsx | 2 +- web/components/filters/filters.tsx | 5 +- web/components/page-base.tsx | 14 +- 9 files changed, 399 insertions(+), 12 deletions(-) create mode 100644 tests/e2e/web/pages/peoplePage.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d57b393..41a35e36 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,9 @@ name: CI on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] jobs: lint: diff --git a/tests/e2e/web/pages/app.ts b/tests/e2e/web/pages/app.ts index a5f25a1b..79a1ce45 100644 --- a/tests/e2e/web/pages/app.ts +++ b/tests/e2e/web/pages/app.ts @@ -21,6 +21,7 @@ export class App { readonly settings: SettingsPage readonly signUp: SignUpPage readonly social: SocialPage + readonly people: PeoplePage constructor(public readonly page: Page) { this.auth = new AuthPage(page) @@ -32,6 +33,7 @@ export class App { this.settings = new SettingsPage(page) this.signUp = new SignUpPage(page) this.social = new SocialPage(page) + this.people = new PeoplePage(page) } async deleteProfileFromSettings() { diff --git a/tests/e2e/web/pages/peoplePage.ts b/tests/e2e/web/pages/peoplePage.ts new file mode 100644 index 00000000..7ee1f348 --- /dev/null +++ b/tests/e2e/web/pages/peoplePage.ts @@ -0,0 +1,302 @@ +import { expect, Locator, Page } from "@playwright/test"; +import { ConnectionTypeTuple, GenderTuple, EducationTuple, DietTuple, PsychedelicsTuple, CannabisTuple, LanguageTuple, PoliticalTuple, ReligionTuple, PersonalityKey } from "common/choices"; +import { MinMaxNumbers } from "../utils/accountInformation"; + +export type Background = { + location?: string + education?: EducationTuple + work?: string +} + +export type Lifestyle = { + interest?: string + cause?: string + diet?: DietTuple + alcohol?: MinMaxNumbers + smoker?: string + psychedelics?: PsychedelicsTuple + cannabis?: CannabisTuple + language?: LanguageTuple +} + +export type Beliefs = { + political?: PoliticalTuple + religious?: ReligionTuple +} + +export type Personality = { + mbti?: PersonalityKey + bigFive?: BigFive +} + +type BigFive = { + openness?: MinMaxNumbers + conscientiousness?: MinMaxNumbers + extraversion?: MinMaxNumbers + agreeableness?: MinMaxNumbers + neuroticism?: MinMaxNumbers +} + +export class PeoplePage { + private readonly peopleHeading: Locator + private readonly yourFiltersCheckbox: Locator + private readonly incompleteProfilesCheckbox: Locator + private readonly connectionTypeDropdown: Locator + private readonly locationDropdown: Locator + private readonly ageRangeDropdown: Locator + private readonly genderDropdown: Locator + private readonly backgroundDropdown: Locator + private readonly backgroundLocation: Locator + private readonly backgroundEducation: Locator + private readonly backgroundWork: Locator + private readonly lifestyleDropdown: Locator + private readonly lifestyleInterests: Locator + private readonly lifestyleCauses: Locator + private readonly lifestyleDiet: Locator + private readonly lifestyleAlcohol: Locator + private readonly lifestyleSmoker: Locator + private readonly lifestylePsychedelics: Locator + private readonly lifestyleCannabis: Locator + private readonly lifestyleLanguages: Locator + private readonly valuesAndBeliefsDropdown: Locator + private readonly valuesAndBeliefsPolitics: Locator + private readonly valuesAndBeliefsReligion: Locator + private readonly personalityDropdown: Locator + private readonly personalityMbti: Locator + private readonly personalityBigFive: Locator + private readonly advancedDropdown: Locator + private readonly displayDropdown: Locator + + constructor (public readonly page: Page) { + this.peopleHeading = page.getByRole('heading', { name: 'People' }) + this.yourFiltersCheckbox = page.getByText('Your filters', { exact: true }) + this.incompleteProfilesCheckbox = page.getByText('Include incomplete profiles', { exact: true }) + this.connectionTypeDropdown = page.getByRole('button', { name: 'Any connection' }) + this.locationDropdown = page.getByRole('button', { name: 'Living anywhere' }) + this.ageRangeDropdown = page.getByRole('button', { name: 'Any age' }) + this.genderDropdown = page.getByRole('button', { name: 'Any gender' }) + this.backgroundDropdown = page.getByRole('button', { name: 'Background' }) + this.backgroundLocation = page.getByRole('button', { name: 'Grew up anywhere' }) + this.backgroundEducation = page.getByText('Any education', { exact: true }) + this.backgroundWork = page.getByText('Any work', { exact: true }) + this.lifestyleDropdown = page.getByRole('button', { name: 'Lifestyle' }) + this.lifestyleInterests = page.getByRole('button', { name: 'Any interests' }) + this.lifestyleCauses = page.getByRole('button', { name: 'Any causes' }) + this.lifestyleDiet = page.getByRole('button', { name: 'Any diet' }) + this.lifestyleAlcohol = page.getByRole('button', { name: 'Any drinks' }) + this.lifestyleSmoker = page.getByTestId('lifestyle-smoker') + this.lifestylePsychedelics = page.getByRole('button', { name: 'Any psychedelics' }) + this.lifestyleCannabis = page.getByRole('button', { name: 'Any cannabis' }) + this.lifestyleLanguages = page.getByRole('button', { name: 'Any language' }) + this.valuesAndBeliefsDropdown = page.getByRole('button', { name: 'Values & Beliefs' }) + this.valuesAndBeliefsPolitics = page.getByRole('button', { name: 'Any politics' }) + this.valuesAndBeliefsReligion = page.getByRole('button', { name: 'Any religion' }) + this.personalityDropdown = page.getByRole('button', { name: 'Personality' }) + this.personalityMbti = page.getByRole('button', { name: 'Any MBTI' }) + this.personalityBigFive = page.getByRole('button', { name: 'Any Big 5' }) + this.advancedDropdown = page.getByRole('button', { name: 'Advanced' }) + this.displayDropdown = page.getByRole('button', { name: 'Display' }) + } + + async sliderHelper(range: MinMaxNumbers, locator?: Locator){ + let minSlider + let maxSlider + if (locator) { + minSlider = await locator.getByRole('slider', { name: 'Minimum' }) + maxSlider = await locator.getByRole('slider', { name: 'Maximum' }) + } else { + minSlider = await this.page.getByRole('slider', { name: 'Minimum' }) + maxSlider = await this.page.getByRole('slider', { name: 'Maximum' }) + } + + await expect(minSlider).toBeVisible() + await expect(maxSlider).toBeVisible() + if (range.min === null || range.max === null) return + + const minRange = Number(range.min) + const maxRange = Number(range.max) + const currentMinValue = Number(await minSlider.getAttribute('aria-valuenow')) + const currentMaxValue = Number(await maxSlider.getAttribute('aria-valuenow')) + + if (isNaN(currentMinValue) || isNaN(currentMaxValue)) return + + if (minRange > currentMinValue) { + await minSlider.click() + while (true) { + const changedMinValue = Number(await minSlider.getAttribute('aria-valuenow')) + + if (changedMinValue === null ) break + if (minRange <= changedMinValue) break + await this.page.keyboard.press('ArrowRight') + } + } + + if (maxRange < currentMaxValue) { + await maxSlider.click() + while (true) { + const changedMaxValue = Number(await maxSlider.getAttribute('aria-valuenow')) + if (changedMaxValue === null ) break + if (maxRange >= changedMaxValue) break + await this.page.keyboard.press('ArrowLeft') + } + } + } + + async selectOption(trigger: Locator, label: string) { + await expect(trigger).toBeVisible() + await trigger.click() + await this.page.getByLabel(label, { exact: true }).isVisible() + await this.page.getByLabel(label, { exact: true }).click() + } + + async verifyPeoplePage() { + await expect(this.peopleHeading).toBeVisible() + } + + async setYourFilters() { + await expect(this.yourFiltersCheckbox).toBeVisible() + await this.yourFiltersCheckbox.click() + } + + async setIncludeIncompleteProfiles() { + await expect(this.incompleteProfilesCheckbox).toBeVisible() + await this.incompleteProfilesCheckbox.click() + } + + async setConnectionTypeFilter(connectionType: ConnectionTypeTuple) { + await this.selectOption(this.connectionTypeDropdown, connectionType[0]) + // await expect(this.connectionTypeDropdown).toBeVisible() + // await this.connectionTypeDropdown.click() + // await expect(this.page.getByLabel(connectionType[0])).toBeVisible() + // await this.page.getByLabel(connectionType[0]).click() + } + + async setLocationFilter(location: string) { + await expect(this.locationDropdown).toBeVisible() + await this.locationDropdown.click() + await expect(this.page.getByRole('textbox', { name: 'Search city...' })).toBeVisible() + await this.page.getByRole('textbox', { name: 'Search city...' }).fill(location) + } + + async setAgeRangeFilter(ageRange: MinMaxNumbers) { + await expect(this.ageRangeDropdown).toBeVisible() + await this.ageRangeDropdown.click() + await this.sliderHelper(ageRange) + } + + async setGenderTypeFilter(genderType: GenderTuple) { + await this.selectOption(this.genderDropdown, genderType[0]) + // await expect(this.genderDropdown).toBeVisible() + // await this.genderDropdown.click() + // await expect(this.page.getByLabel(genderType[0], {exact: true})).toBeVisible() + // await this.page.getByLabel(genderType[0], {exact: true}).click() + } + + async setBackground(background: Background) { + await expect(this.backgroundDropdown).toBeVisible() + await this.backgroundDropdown.click() + if (background.location) { + await expect(this.backgroundLocation).toBeVisible() + await this.backgroundLocation.click() + await this.page.getByPlaceholder('Search city...', { exact: true }).fill(background.location) + } + + if (background.education) { + await expect(this.backgroundEducation).toBeVisible() + await this.backgroundEducation.click() + await expect(this.page.getByLabel(background.education[0], { exact: true })).toBeVisible() + await this.page.getByLabel(background.education[0], { exact: true }).click() + } + + if (background.work) { + await expect(this.backgroundWork).toBeVisible() + await this.backgroundWork.click() + await expect(this.page.getByLabel(background.work, { exact: true })).toBeVisible() + await this.page.getByLabel(background.work, { exact: true }).click() + } + } + + async setLifestyle(lifestyle: Lifestyle) { + await expect(this.lifestyleDropdown).toBeVisible() + await this.lifestyleDropdown.click() + + if(lifestyle.interest) await this.selectOption(this.lifestyleInterests, lifestyle.interest) + if(lifestyle.cause) await this.selectOption(this.lifestyleCauses, lifestyle.cause) + if(lifestyle.diet) await this.selectOption(this.lifestyleDiet, lifestyle.diet[0]) + + if(lifestyle.alcohol) { + await expect(this.lifestyleAlcohol).toBeVisible() + await this.lifestyleAlcohol.click() + await this.sliderHelper(lifestyle.alcohol) + } + + if(lifestyle.smoker) { + await expect(this.lifestyleSmoker).toBeVisible() + await this.lifestyleSmoker.click() + await expect(this.page.getByText(lifestyle.smoker, { exact: true })).toBeVisible() + await this.page.getByText(lifestyle.smoker, { exact: true }).click() + } + + if(lifestyle.psychedelics) await this.selectOption(this.lifestylePsychedelics, lifestyle.psychedelics[0]) + if(lifestyle.cannabis) await this.selectOption(this.lifestyleCannabis, lifestyle.cannabis[0]) + if(lifestyle.language) await this.selectOption(this.lifestyleLanguages, lifestyle.language[0]) + } + + async setValuesAndBeliefs(values: Beliefs) { + await expect(this.valuesAndBeliefsDropdown).toBeVisible() + await this.valuesAndBeliefsDropdown.click() + + if(values.political) await this.selectOption(this.valuesAndBeliefsPolitics, values.political[0]) + if(values.religious) await this.selectOption(this.valuesAndBeliefsReligion, values.religious[0]) + } + + async setPersonality(personality: Personality) { + await expect(this.personalityDropdown).toBeVisible() + await this.personalityDropdown.click() + + await this.personalityBigFive.click() + await this.sliderHelper( + {min: "20", max: "50"}, + this.page.getByTestId('big-five-agreeableness') + ) + + if(personality.mbti) { + await this.personalityMbti.click() + await this.selectOption(this.personalityMbti, personality.mbti) + } + + if(personality.bigFive) { + await this.personalityBigFive.click() + if(personality.bigFive?.openness) { + await this.sliderHelper( + personality.bigFive.openness, + this.page.getByTestId('big-five-openness') + ) + } + if(personality.bigFive?.conscientiousness) { + await this.sliderHelper( + personality.bigFive.conscientiousness, + this.page.getByTestId('big-five-conscientiousness') + ) + } + if(personality.bigFive?.extraversion) { + await this.sliderHelper( + personality.bigFive.extraversion, + this.page.getByTestId('big-five-extraversion') + ) + } + if(personality.bigFive?.agreeableness) { + await this.sliderHelper( + personality.bigFive.agreeableness, + this.page.getByTestId('big-five-agreeableness') + ) + } + if(personality.bigFive?.neuroticism) { + await this.sliderHelper( + personality.bigFive.neuroticism, + this.page.getByTestId('big-five-neuroticism') + ) + } + } + } +} \ 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 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 79f54428..70c7c083 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) }) }) diff --git a/tests/e2e/web/utils/accountInformation.ts b/tests/e2e/web/utils/accountInformation.ts index bbb6b81f..2d2c4134 100644 --- a/tests/e2e/web/utils/accountInformation.ts +++ b/tests/e2e/web/utils/accountInformation.ts @@ -32,7 +32,7 @@ export type UserAccountInformation = { height?: Height ethnicity_origin?: EthnicityTuple interested_in?: InterestedInGenderTuple - Interested_in_ages?: InterestedInAges + Interested_in_ages?: MinMaxNumbers connection_type?: ConnectionTypeTuple relationship_status?: RelationshipStatusTuple relationship_style?: RelationshipStyleTuple @@ -62,7 +62,7 @@ type Height = { centimeters: string } -type InterestedInAges = { +export type MinMaxNumbers = { min: string max?: string } @@ -89,7 +89,7 @@ export type Socials = { urlOrUsername: string } -type FiveBigPersonalityTraits = { +export type FiveBigPersonalityTraits = { openness?: number conscientiousness?: number extraversion?: number diff --git a/web/components/filters/big5-filter.tsx b/web/components/filters/big5-filter.tsx index 169a1446..3932f447 100644 --- a/web/components/filters/big5-filter.tsx +++ b/web/components/filters/big5-filter.tsx @@ -70,7 +70,7 @@ export function Big5SliderRow(props: { const {label, minValue, maxValue, onChange} = props return ( -
+
{label} diff --git a/web/components/filters/filters.tsx b/web/components/filters/filters.tsx index 5953c6a4..32b65351 100644 --- a/web/components/filters/filters.tsx +++ b/web/components/filters/filters.tsx @@ -586,6 +586,7 @@ function Filters(props: { +