From 590b047b2a8aa3b0161d34c9296269497b9b4624 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Sun, 22 Feb 2026 18:34:09 +0000 Subject: [PATCH 01/36] 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 d0debad3dcedf50bdefa3d8ffdf9938b07af230a Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Wed, 25 Feb 2026 15:19:06 +0000 Subject: [PATCH 02/36] 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 e6eef8cb..c2dd4020 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 543d5e512bd186afa634e23060427ee809cdfb0c Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Wed, 4 Mar 2026 01:30:41 +0000 Subject: [PATCH 03/36] 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 ++++++++++++++ .../answers/compatibility-questions-display.tsx | 4 ++-- 3 files changed, 17 insertions(+), 3 deletions(-) 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 4b4ae371..c2dc63c1 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 ( {question.question} @@ -534,7 +534,7 @@ export function CompatibilityAnswerBlock(props: { {answerText && ( {answerText} From 42936064985f81ad39334ae138a36127ec73f7bd Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Wed, 4 Mar 2026 15:44:07 +0000 Subject: [PATCH 04/36] . --- 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 c2dd4020..e6eef8cb 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 03d957a59788619b385bded0301bb3a5684f325f Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Wed, 11 Mar 2026 17:04:54 +0000 Subject: [PATCH 05/36] 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 c2dc63c1..4b4ae371 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/36] . --- 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 f4b10145f1b02a6dce12c4bd7daac7cdaff3be79 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Sun, 15 Mar 2026 17:57:48 +0000 Subject: [PATCH 07/36] 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 d3bd1cb4e57ac2d343e25e7a7008068c42c79dfa Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Sun, 15 Mar 2026 19:48:29 +0000 Subject: [PATCH 08/36] 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 45fc0e84b3ed2143ed4e63c7bae733e916490435 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Sun, 15 Mar 2026 23:11:08 +0100 Subject: [PATCH 09/36] Minor cleaning --- playwright.config.ts | 2 +- tests/e2e/web/specs/signUp.spec.ts | 14 ++++++++++++++ .../answers/compatibility-questions-display.tsx | 4 ++-- 3 files changed, 17 insertions(+), 3 deletions(-) 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 65f2afbe..2bd417ce 100644 --- a/tests/e2e/web/specs/signUp.spec.ts +++ b/tests/e2e/web/specs/signUp.spec.ts @@ -36,3 +36,17 @@ test.describe('when an error occurs', () => { await expect(signUpPage.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() +} diff --git a/web/components/answers/compatibility-questions-display.tsx b/web/components/answers/compatibility-questions-display.tsx index d45cd74b..35eb2839 100644 --- a/web/components/answers/compatibility-questions-display.tsx +++ b/web/components/answers/compatibility-questions-display.tsx @@ -456,7 +456,7 @@ export function CompatibilityAnswerBlock(props: { } > {question.question} @@ -534,7 +534,7 @@ export function CompatibilityAnswerBlock(props: { {answerText && ( {answerText} From dbca7687f4b1b0b4e95440848de63282548177dd Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Mon, 16 Mar 2026 14:51:03 +0000 Subject: [PATCH 10/36] 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 2bd417ce..65f2afbe 100644 --- a/tests/e2e/web/specs/signUp.spec.ts +++ b/tests/e2e/web/specs/signUp.spec.ts @@ -36,17 +36,3 @@ test.describe('when an error occurs', () => { await expect(signUpPage.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 53c048a4928a65ca74fd7c339e9532c2b09519b1 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Tue, 17 Mar 2026 18:38:32 +0000 Subject: [PATCH 11/36] 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 bd27bf0c9a8daa4a8ec6440268fde367439e75ab Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Wed, 18 Mar 2026 18:18:56 +0000 Subject: [PATCH 12/36] Added account cleanup for google accounts --- tests/e2e/utils/firebaseUtils.ts | 3 +-- tests/e2e/web/fixtures/base.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/e2e/utils/firebaseUtils.ts b/tests/e2e/utils/firebaseUtils.ts index a7c8f0ef..b9c32d79 100644 --- a/tests/e2e/utils/firebaseUtils.ts +++ b/tests/e2e/utils/firebaseUtils.ts @@ -1,5 +1,4 @@ import axios from 'axios' - import {config} from '../web/SPEC_CONFIG' export async function firebaseLoginEmailPassword( @@ -73,4 +72,4 @@ export async function deleteAccount(idToken: any) { } throw err } -} +} \ No newline at end of file diff --git a/tests/e2e/web/fixtures/base.ts b/tests/e2e/web/fixtures/base.ts index fcd40d17..b9c4eb1c 100644 --- a/tests/e2e/web/fixtures/base.ts +++ b/tests/e2e/web/fixtures/base.ts @@ -1,5 +1,4 @@ import {test as base} from '@playwright/test' - import {AuthPage} from '../pages/AuthPage' import {ComatibilityPage} from '../pages/compatibilityPage' import {HomePage} from '../pages/homePage' @@ -53,6 +52,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 b7057e237bb81a05c7e57a55c033fbd8b66b6081 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Wed, 25 Mar 2026 00:59:08 +0000 Subject: [PATCH 13/36] 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 | 2 +- tests/e2e/web/specs/postSignIn.spec.ts | 19 +++++++++++++++++++ 3 files changed, 23 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 b9c4eb1c..e732bebf 100644 --- a/tests/e2e/web/fixtures/base.ts +++ b/tests/e2e/web/fixtures/base.ts @@ -1,4 +1,5 @@ import {test as base} from '@playwright/test' +import { getAuthAccountInfo } from "../utils/networkUtils"; import {AuthPage} from '../pages/AuthPage' import {ComatibilityPage} from '../pages/compatibilityPage' import {HomePage} from '../pages/homePage' @@ -52,7 +53,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 b6e0c222ed98ba992b192e788f75119f4d6a7893 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Wed, 25 Mar 2026 01:09:24 +0000 Subject: [PATCH 14/36] Linting and Prettier --- tests/e2e/web/fixtures/base.ts | 2 +- tests/e2e/web/specs/postSignIn.spec.ts | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/tests/e2e/web/fixtures/base.ts b/tests/e2e/web/fixtures/base.ts index e732bebf..d802c828 100644 --- a/tests/e2e/web/fixtures/base.ts +++ b/tests/e2e/web/fixtures/base.ts @@ -1,5 +1,5 @@ import {test as base} from '@playwright/test' -import { getAuthAccountInfo } from "../utils/networkUtils"; +import {getAuthAccountInfo} from '../utils/networkUtils' import {AuthPage} from '../pages/AuthPage' import {ComatibilityPage} from '../pages/compatibilityPage' import {HomePage} from '../pages/homePage' 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 992db24f3ba4826f86be3078d6640dcce613fad0 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Thu, 26 Mar 2026 15:13:11 +0000 Subject: [PATCH 15/36] Added checks to the deleteUser func to check if the accout exists Added account deletion checks --- tests/e2e/web/fixtures/signInFixture.ts | 1 + tests/e2e/web/specs/onboardingFlow.spec.ts | 71 ++++++++++++++++++++++ tests/e2e/web/specs/postSignIn.spec.ts | 15 ----- tests/e2e/web/specs/signIn.spec.ts | 25 ++++++++ web/components/nav/sidebar.tsx | 2 +- 5 files changed, 98 insertions(+), 16 deletions(-) delete mode 100644 tests/e2e/web/specs/postSignIn.spec.ts diff --git a/tests/e2e/web/fixtures/signInFixture.ts b/tests/e2e/web/fixtures/signInFixture.ts index 47c5b727..43a66830 100644 --- a/tests/e2e/web/fixtures/signInFixture.ts +++ b/tests/e2e/web/fixtures/signInFixture.ts @@ -43,6 +43,7 @@ export const test = base.extend<{ const authPage = new AuthPage(page) await use(authPage) }, + dev_one_account: async ({}, use) => { const account = testAccounts.dev_one_account() await use(account) diff --git a/tests/e2e/web/specs/onboardingFlow.spec.ts b/tests/e2e/web/specs/onboardingFlow.spec.ts index a433ee85..e94d0c2d 100644 --- a/tests/e2e/web/specs/onboardingFlow.spec.ts +++ b/tests/e2e/web/specs/onboardingFlow.spec.ts @@ -268,6 +268,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 ({ homePage, onboardingPage, 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 a2755816..72225a5a 100644 --- a/tests/e2e/web/specs/signIn.spec.ts +++ b/tests/e2e/web/specs/signIn.spec.ts @@ -1,3 +1,4 @@ +<<<<<<< HEAD import {userInformationFromDb} from '../../utils/databaseUtils' import {seedUser} from '../../utils/seedDatabase' import {expect, test} from '../fixtures/signInFixture' @@ -8,6 +9,11 @@ import { signinWithEmail, skipOnboardingHeadToProfile, } from '../utils/testCleanupHelpers' +======= +import {test, expect} from '../fixtures/signInFixture' +import { seedUser } from "../../utils/seedDatabase"; +import { testAccounts } from "../utils/accountInformation"; +>>>>>>> c092182d (Added checks to the deleteUser func to check if the accout exists) //Seed the account test.beforeAll(async () => { @@ -29,13 +35,23 @@ test.describe('when given valid input', () => { test('should be able to sign in to an available account', async ({ homePage, authPage, +<<<<<<< HEAD dev_one_account, }) => { await signinWithEmail(homePage, authPage, dev_one_account) +======= + dev_one_account + }) => { + await homePage.gotToSigninPage() + await authPage.fillEmailField(dev_one_account.email) + await authPage.fillPasswordField(dev_one_account.password) + await authPage.clickSignInWithEmailButton() +>>>>>>> c092182d (Added checks to the deleteUser func to check if the accout exists) await homePage.goToHomePage() await homePage.verifySignedInHomePage(dev_one_account.display_name) }) +<<<<<<< HEAD test('should successfully delete an account created via email and password', async ({ homePage, onboardingPage, @@ -105,4 +121,13 @@ 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 () => {}) +>>>>>>> c092182d (Added checks to the deleteUser func to check if the accout exists) }) diff --git a/web/components/nav/sidebar.tsx b/web/components/nav/sidebar.tsx index 7ba3e5a0..932ecaa8 100644 --- a/web/components/nav/sidebar.tsx +++ b/web/components/nav/sidebar.tsx @@ -53,7 +53,7 @@ export default function Sidebar(props: { {user && !isMobile && } -
+
{navOptions.map((item) => ( ))} From 064bbfb24083972de5fa74d575a968dc84ab4db3 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Thu, 26 Mar 2026 15:14:57 +0000 Subject: [PATCH 16/36] 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 e94d0c2d..9ad91aa1 100644 --- a/tests/e2e/web/specs/onboardingFlow.spec.ts +++ b/tests/e2e/web/specs/onboardingFlow.spec.ts @@ -285,13 +285,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() }) @@ -331,10 +331,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 de476bd77e9369121e322bd445bad61e99065a1e Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Tue, 31 Mar 2026 17:57:29 +0100 Subject: [PATCH 17/36] Added POM's for social and organisation page Updated settings POM --- tests/e2e/web/specs/signUp.spec.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/e2e/web/specs/signUp.spec.ts b/tests/e2e/web/specs/signUp.spec.ts index 65f2afbe..8a0cfee8 100644 --- a/tests/e2e/web/specs/signUp.spec.ts +++ b/tests/e2e/web/specs/signUp.spec.ts @@ -13,6 +13,9 @@ test.describe('when an error occurs', () => { onboardingPage, signUpPage, }) => { + console.log( + `Starting "should disable the button "Next" when the display name field is empty" with ${specAccount.username}`, + ) await registerWithEmail(homePage, authPage, specAccount) await onboardingPage.clickSkipOnboardingButton() await signUpPage.fillDisplayName('') @@ -28,6 +31,9 @@ test.describe('when an error occurs', () => { onboardingPage, signUpPage, }) => { + console.log( + `Starting "should disable the button "Next" when the username field is empty" with ${specAccount.username}`, + ) await registerWithEmail(homePage, authPage, specAccount) await onboardingPage.clickSkipOnboardingButton() await signUpPage.fillDisplayName(specAccount.display_name) From 6b1dec0a10e658f8c38e625d6fb37140fff73d1c Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Thu, 2 Apr 2026 14:44:41 +0100 Subject: [PATCH 18/36] Formatting update, fixed homePage locator for signin --- tests/e2e/web/specs/onboardingFlow.spec.ts | 470 +++++++++++---------- tests/e2e/web/specs/signUp.spec.ts | 36 +- 2 files changed, 254 insertions(+), 252 deletions(-) diff --git a/tests/e2e/web/specs/onboardingFlow.spec.ts b/tests/e2e/web/specs/onboardingFlow.spec.ts index 9ad91aa1..9b94aae4 100644 --- a/tests/e2e/web/specs/onboardingFlow.spec.ts +++ b/tests/e2e/web/specs/onboardingFlow.spec.ts @@ -85,138 +85,140 @@ test.describe('when given valid input', () => { await profilePage.clickSkipCompatibilityQuestionButton() await profilePage.clickSkipCompatibilityQuestionButton() - await profilePage.clickCloseButton() + await profilePage.clickCloseButton() - //Verify information is correct - await profilePage.verifyDisplayName(onboardingAccount.display_name) - await profilePage.verifyHeadline(onboardingAccount.headline) - await profilePage.verifyKeywords(onboardingAccount.keywords) - await profilePage.verifyGenderLocationHeightAge( - onboardingAccount.gender, - undefined, - onboardingAccount.height?.feet, - onboardingAccount.height?.inches, - onboardingAccount.age, - ) - await profilePage.verifySeeking( - onboardingAccount.interested_in, - onboardingAccount.Interested_in_ages?.min, - onboardingAccount.Interested_in_ages?.max, - onboardingAccount.connection_type, - onboardingAccount.relationship_style, - ) - await profilePage.verifyRelationshipStatus(onboardingAccount.relationship_status) - await profilePage.verifyCurrentNumberOfKids(onboardingAccount.number_of_kids) - await profilePage.verifyWantChildrenExpectation(onboardingAccount.children_expectation) - await profilePage.verifyInterests(onboardingAccount.interests) - await profilePage.verifyCauses(onboardingAccount.causes) - await profilePage.verifyEducationLevelAndUniversity( - onboardingAccount.education_level, - onboardingAccount.university, - ) - await profilePage.verifyJobInformation(onboardingAccount.job_title, onboardingAccount.company) - await profilePage.verifyWorkArea(onboardingAccount.work_area) - await profilePage.verifyPoliticalBeliefs( - onboardingAccount.beliefs?.political?.belief, - onboardingAccount.beliefs?.political?.details, - ) - await profilePage.verifyReligiousBeliefs( - onboardingAccount.beliefs?.religious?.belief, - onboardingAccount.beliefs?.religious?.details, - ) - await profilePage.verifyPersonalityType(onboardingAccount.personality_type) - await profilePage.verifyBigFivePersonalitySection(onboardingAccount.big_five_personality_traits) - await profilePage.verifyDiet(onboardingAccount.diet) - await profilePage.verifySmoker(onboardingAccount.is_smoker) - await profilePage.verifyDrinksPerMonth(onboardingAccount.alcohol_consumed_per_month) - await profilePage.verifyLanguages(onboardingAccount.languages) - await profilePage.verifySocialMedia(onboardingAccount.social_media) - await profilePage.verifyBio(onboardingAccount.bio) - await profilePage.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 information is correct + await profilePage.verifyDisplayName(onboardingAccount.display_name) + await profilePage.verifyHeadline(onboardingAccount.headline) + await profilePage.verifyKeywords(onboardingAccount.keywords) + await profilePage.verifyGenderLocationHeightAge( + onboardingAccount.gender, + undefined, + onboardingAccount.height?.feet, + onboardingAccount.height?.inches, + onboardingAccount.age, + ) + await profilePage.verifySeeking( + onboardingAccount.interested_in, + onboardingAccount.Interested_in_ages?.min, + onboardingAccount.Interested_in_ages?.max, + onboardingAccount.connection_type, + onboardingAccount.relationship_style, + ) + await profilePage.verifyRelationshipStatus(onboardingAccount.relationship_status) + await profilePage.verifyCurrentNumberOfKids(onboardingAccount.number_of_kids) + await profilePage.verifyWantChildrenExpectation(onboardingAccount.children_expectation) + await profilePage.verifyInterests(onboardingAccount.interests) + await profilePage.verifyCauses(onboardingAccount.causes) + await profilePage.verifyEducationLevelAndUniversity( + onboardingAccount.education_level, + onboardingAccount.university, + ) + await profilePage.verifyJobInformation(onboardingAccount.job_title, onboardingAccount.company) + await profilePage.verifyWorkArea(onboardingAccount.work_area) + await profilePage.verifyPoliticalBeliefs( + onboardingAccount.beliefs?.political?.belief, + onboardingAccount.beliefs?.political?.details, + ) + await profilePage.verifyReligiousBeliefs( + onboardingAccount.beliefs?.religious?.belief, + onboardingAccount.beliefs?.religious?.details, + ) + await profilePage.verifyPersonalityType(onboardingAccount.personality_type) + await profilePage.verifyBigFivePersonalitySection( + onboardingAccount.big_five_personality_traits, + ) + await profilePage.verifyDiet(onboardingAccount.diet) + await profilePage.verifySmoker(onboardingAccount.is_smoker) + await profilePage.verifyDrinksPerMonth(onboardingAccount.alcohol_consumed_per_month) + await profilePage.verifyLanguages(onboardingAccount.languages) + await profilePage.verifySocialMedia(onboardingAccount.social_media) + await profilePage.verifyBio(onboardingAccount.bio) + await profilePage.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, + ) + }) test('should successfully complete the onboarding flow with google account', async ({ homePage, @@ -237,15 +239,15 @@ test.describe('when given valid input', () => { ) await skipOnboardingHeadToProfile(onboardingPage, signUpPage, profilePage, googleAccountOne) - //Verify displayed information is correct - await profilePage.verifyDisplayName(googleAccountOne.display_name) + //Verify displayed information is correct + await profilePage.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 ({ homePage, @@ -258,15 +260,15 @@ 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) + }) test('should successfully delete an account created via email and password', async ({ homePage, @@ -280,64 +282,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 ({ homePage, @@ -358,25 +360,25 @@ test.describe('when given valid input', () => { }) await signUpPage.saveProfileChanges() - //Verify displayed information is correct - await profilePage.verifyDisplayName(fakerAccount.display_name) - await profilePage.verifyGenderLocationHeightAge( - fakerAccount.gender, - undefined, - fakerAccount.height?.feet, - fakerAccount.height?.inches, - fakerAccount.age, - ) + //Verify displayed information is correct + await profilePage.verifyDisplayName(fakerAccount.display_name) + await profilePage.verifyGenderLocationHeightAge( + fakerAccount.gender, + undefined, + fakerAccount.height?.feet, + fakerAccount.height?.inches, + 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 ({ homePage, @@ -401,16 +403,16 @@ test.describe('when given valid input', () => { await profilePage.clickCloseButton() await onboardingPage.clickRefineProfileButton() - //Verify displayed information is correct - await profilePage.verifyDisplayName(fakerAccount.display_name) - await profilePage.verifyCompatibilityAnswers(compatTwoQuestionOne) + //Verify displayed information is correct + await profilePage.verifyDisplayName(fakerAccount.display_name) + await profilePage.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 ({ @@ -434,15 +436,15 @@ test.describe('when given valid input', () => { await profilePage.clickCloseButton() await onboardingPage.clickRefineProfileButton() - //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) + }) test("the second time it's an option", async ({ homePage, @@ -465,17 +467,17 @@ test.describe('when given valid input', () => { await profilePage.clickCloseButton() await onboardingPage.clickRefineProfileButton() - //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) + }) }) }) -}) // test.describe('when an error occurs', () => { // test('placeholder', async ({}) => {}) diff --git a/tests/e2e/web/specs/signUp.spec.ts b/tests/e2e/web/specs/signUp.spec.ts index 8a0cfee8..9042ad93 100644 --- a/tests/e2e/web/specs/signUp.spec.ts +++ b/tests/e2e/web/specs/signUp.spec.ts @@ -5,24 +5,24 @@ import {registerWithEmail} from '../utils/testCleanupHelpers' // test('placeholder', async () => {}) // }) -test.describe('when an error occurs', () => { - test('should disable the button "Next" when the display name field is empty', async ({ - specAccount, - homePage, - authPage, - onboardingPage, - signUpPage, - }) => { - console.log( - `Starting "should disable the button "Next" when the display name field is empty" with ${specAccount.username}`, - ) - await registerWithEmail(homePage, authPage, specAccount) - await onboardingPage.clickSkipOnboardingButton() - await signUpPage.fillDisplayName('') - await signUpPage.fillUsername(specAccount.username) - await signUpPage.verifyDisplayNameError() - await expect(signUpPage.nextButtonLocator).toBeDisabled() - }) + test.describe('when an error occurs', () => { + test('should disable the button "Next" when the display name field is empty', async ({ + specAccount, + homePage, + authPage, + onboardingPage, + signUpPage, + }) => { + console.log( + `Starting "should disable the button "Next" when the display name field is empty" with ${specAccount.username}`, + ) + await registerWithEmail(homePage, authPage, specAccount) + await onboardingPage.clickSkipOnboardingButton() + await signUpPage.fillDisplayName('') + await signUpPage.fillUsername(specAccount.username) + await signUpPage.verifyDisplayNameError() + await expect(signUpPage.nextButtonLocator).toBeDisabled() + }) test('should disable the button "Next" when the username field is empty', async ({ specAccount, From a7507767a0e52b167d7dc82947dfbcf374c1a0fd Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Thu, 2 Apr 2026 16:58:26 +0100 Subject: [PATCH 19/36] . --- .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 e21de9360b6e11a6a841ba390a2ff997c371f251 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Thu, 2 Apr 2026 17:00:33 +0100 Subject: [PATCH 20/36] . --- 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 851992bf6eece1f3260f6367a1554b0e7b579b67 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Thu, 2 Apr 2026 17:02:56 +0100 Subject: [PATCH 21/36] . --- .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 c4fc76d9c14106224d04c1268e1152fb73d5ccc1 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Thu, 2 Apr 2026 23:10:31 +0100 Subject: [PATCH 22/36] Coderabbitai fix's --- playwright.config.ts | 2 +- tests/e2e/web/pages/AuthPage.ts | 6 +- tests/e2e/web/specs/onboardingFlow.spec.ts | 470 ++++++++++----------- tests/e2e/web/specs/signUp.spec.ts | 36 +- web/components/nav/sidebar.tsx | 2 +- 5 files changed, 258 insertions(+), 258 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 9b94aae4..818aebe6 100644 --- a/tests/e2e/web/specs/onboardingFlow.spec.ts +++ b/tests/e2e/web/specs/onboardingFlow.spec.ts @@ -85,140 +85,138 @@ test.describe('when given valid input', () => { await profilePage.clickSkipCompatibilityQuestionButton() await profilePage.clickSkipCompatibilityQuestionButton() - await profilePage.clickCloseButton() + await profilePage.clickCloseButton() - //Verify information is correct - await profilePage.verifyDisplayName(onboardingAccount.display_name) - await profilePage.verifyHeadline(onboardingAccount.headline) - await profilePage.verifyKeywords(onboardingAccount.keywords) - await profilePage.verifyGenderLocationHeightAge( - onboardingAccount.gender, - undefined, - onboardingAccount.height?.feet, - onboardingAccount.height?.inches, - onboardingAccount.age, - ) - await profilePage.verifySeeking( - onboardingAccount.interested_in, - onboardingAccount.Interested_in_ages?.min, - onboardingAccount.Interested_in_ages?.max, - onboardingAccount.connection_type, - onboardingAccount.relationship_style, - ) - await profilePage.verifyRelationshipStatus(onboardingAccount.relationship_status) - await profilePage.verifyCurrentNumberOfKids(onboardingAccount.number_of_kids) - await profilePage.verifyWantChildrenExpectation(onboardingAccount.children_expectation) - await profilePage.verifyInterests(onboardingAccount.interests) - await profilePage.verifyCauses(onboardingAccount.causes) - await profilePage.verifyEducationLevelAndUniversity( - onboardingAccount.education_level, - onboardingAccount.university, - ) - await profilePage.verifyJobInformation(onboardingAccount.job_title, onboardingAccount.company) - await profilePage.verifyWorkArea(onboardingAccount.work_area) - await profilePage.verifyPoliticalBeliefs( - onboardingAccount.beliefs?.political?.belief, - onboardingAccount.beliefs?.political?.details, - ) - await profilePage.verifyReligiousBeliefs( - onboardingAccount.beliefs?.religious?.belief, - onboardingAccount.beliefs?.religious?.details, - ) - await profilePage.verifyPersonalityType(onboardingAccount.personality_type) - await profilePage.verifyBigFivePersonalitySection( - onboardingAccount.big_five_personality_traits, - ) - await profilePage.verifyDiet(onboardingAccount.diet) - await profilePage.verifySmoker(onboardingAccount.is_smoker) - await profilePage.verifyDrinksPerMonth(onboardingAccount.alcohol_consumed_per_month) - await profilePage.verifyLanguages(onboardingAccount.languages) - await profilePage.verifySocialMedia(onboardingAccount.social_media) - await profilePage.verifyBio(onboardingAccount.bio) - await profilePage.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 information is correct + await profilePage.verifyDisplayName(onboardingAccount.display_name) + await profilePage.verifyHeadline(onboardingAccount.headline) + await profilePage.verifyKeywords(onboardingAccount.keywords) + await profilePage.verifyGenderLocationHeightAge( + onboardingAccount.gender, + undefined, + onboardingAccount.height?.feet, + onboardingAccount.height?.inches, + onboardingAccount.age, + ) + await profilePage.verifySeeking( + onboardingAccount.interested_in, + onboardingAccount.Interested_in_ages?.min, + onboardingAccount.Interested_in_ages?.max, + onboardingAccount.connection_type, + onboardingAccount.relationship_style, + ) + await profilePage.verifyRelationshipStatus(onboardingAccount.relationship_status) + await profilePage.verifyCurrentNumberOfKids(onboardingAccount.number_of_kids) + await profilePage.verifyWantChildrenExpectation(onboardingAccount.children_expectation) + await profilePage.verifyInterests(onboardingAccount.interests) + await profilePage.verifyCauses(onboardingAccount.causes) + await profilePage.verifyEducationLevelAndUniversity( + onboardingAccount.education_level, + onboardingAccount.university, + ) + await profilePage.verifyJobInformation(onboardingAccount.job_title, onboardingAccount.company) + await profilePage.verifyWorkArea(onboardingAccount.work_area) + await profilePage.verifyPoliticalBeliefs( + onboardingAccount.beliefs?.political?.belief, + onboardingAccount.beliefs?.political?.details, + ) + await profilePage.verifyReligiousBeliefs( + onboardingAccount.beliefs?.religious?.belief, + onboardingAccount.beliefs?.religious?.details, + ) + await profilePage.verifyPersonalityType(onboardingAccount.personality_type) + await profilePage.verifyBigFivePersonalitySection(onboardingAccount.big_five_personality_traits) + await profilePage.verifyDiet(onboardingAccount.diet) + await profilePage.verifySmoker(onboardingAccount.is_smoker) + await profilePage.verifyDrinksPerMonth(onboardingAccount.alcohol_consumed_per_month) + await profilePage.verifyLanguages(onboardingAccount.languages) + await profilePage.verifySocialMedia(onboardingAccount.social_media) + await profilePage.verifyBio(onboardingAccount.bio) + await profilePage.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, + ) + }) test('should successfully complete the onboarding flow with google account', async ({ homePage, @@ -239,15 +237,15 @@ test.describe('when given valid input', () => { ) await skipOnboardingHeadToProfile(onboardingPage, signUpPage, profilePage, googleAccountOne) - //Verify displayed information is correct - await profilePage.verifyDisplayName(googleAccountOne.display_name) + //Verify displayed information is correct + await profilePage.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 ({ homePage, @@ -260,15 +258,15 @@ 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) + }) test('should successfully delete an account created via email and password', async ({ homePage, @@ -282,64 +280,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 ({ homePage, @@ -360,25 +358,25 @@ test.describe('when given valid input', () => { }) await signUpPage.saveProfileChanges() - //Verify displayed information is correct - await profilePage.verifyDisplayName(fakerAccount.display_name) - await profilePage.verifyGenderLocationHeightAge( - fakerAccount.gender, - undefined, - fakerAccount.height?.feet, - fakerAccount.height?.inches, - fakerAccount.age, - ) + //Verify displayed information is correct + await profilePage.verifyDisplayName(fakerAccount.display_name) + await profilePage.verifyGenderLocationHeightAge( + fakerAccount.gender, + undefined, + fakerAccount.height?.feet, + fakerAccount.height?.inches, + 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 ({ homePage, @@ -403,16 +401,16 @@ test.describe('when given valid input', () => { await profilePage.clickCloseButton() await onboardingPage.clickRefineProfileButton() - //Verify displayed information is correct - await profilePage.verifyDisplayName(fakerAccount.display_name) - await profilePage.verifyCompatibilityAnswers(compatTwoQuestionOne) + //Verify displayed information is correct + await profilePage.verifyDisplayName(fakerAccount.display_name) + await profilePage.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 ({ @@ -436,15 +434,15 @@ test.describe('when given valid input', () => { await profilePage.clickCloseButton() await onboardingPage.clickRefineProfileButton() - //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) + }) test("the second time it's an option", async ({ homePage, @@ -467,17 +465,17 @@ test.describe('when given valid input', () => { await profilePage.clickCloseButton() await onboardingPage.clickRefineProfileButton() - //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) }) }) +}) // test.describe('when an error occurs', () => { // test('placeholder', async ({}) => {}) diff --git a/tests/e2e/web/specs/signUp.spec.ts b/tests/e2e/web/specs/signUp.spec.ts index 9042ad93..8a0cfee8 100644 --- a/tests/e2e/web/specs/signUp.spec.ts +++ b/tests/e2e/web/specs/signUp.spec.ts @@ -5,24 +5,24 @@ import {registerWithEmail} from '../utils/testCleanupHelpers' // test('placeholder', async () => {}) // }) - test.describe('when an error occurs', () => { - test('should disable the button "Next" when the display name field is empty', async ({ - specAccount, - homePage, - authPage, - onboardingPage, - signUpPage, - }) => { - console.log( - `Starting "should disable the button "Next" when the display name field is empty" with ${specAccount.username}`, - ) - await registerWithEmail(homePage, authPage, specAccount) - await onboardingPage.clickSkipOnboardingButton() - await signUpPage.fillDisplayName('') - await signUpPage.fillUsername(specAccount.username) - await signUpPage.verifyDisplayNameError() - await expect(signUpPage.nextButtonLocator).toBeDisabled() - }) +test.describe('when an error occurs', () => { + test('should disable the button "Next" when the display name field is empty', async ({ + specAccount, + homePage, + authPage, + onboardingPage, + signUpPage, + }) => { + console.log( + `Starting "should disable the button "Next" when the display name field is empty" with ${specAccount.username}`, + ) + await registerWithEmail(homePage, authPage, specAccount) + await onboardingPage.clickSkipOnboardingButton() + await signUpPage.fillDisplayName('') + await signUpPage.fillUsername(specAccount.username) + await signUpPage.verifyDisplayNameError() + await expect(signUpPage.nextButtonLocator).toBeDisabled() + }) test('should disable the button "Next" when the username field is empty', async ({ specAccount, diff --git a/web/components/nav/sidebar.tsx b/web/components/nav/sidebar.tsx index 932ecaa8..7ba3e5a0 100644 --- a/web/components/nav/sidebar.tsx +++ b/web/components/nav/sidebar.tsx @@ -53,7 +53,7 @@ export default function Sidebar(props: { {user && !isMobile && } -
+
{navOptions.map((item) => ( ))} From 615f64d832a40ae5bfc3f68e86ce343caca0ea41 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Fri, 3 Apr 2026 16:21:16 +0200 Subject: [PATCH 23/36] 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 dcd7e060a95a75cd439cf48be9c152d2c7d78f40 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Fri, 3 Apr 2026 16:55:28 +0200 Subject: [PATCH 24/36] Improve test utilities and stabilize onboarding flow tests --- tests/e2e/web/fixtures/base.ts | 2 +- tests/e2e/web/pages/AuthPage.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/web/fixtures/base.ts b/tests/e2e/web/fixtures/base.ts index d802c828..fcd40d17 100644 --- a/tests/e2e/web/fixtures/base.ts +++ b/tests/e2e/web/fixtures/base.ts @@ -1,5 +1,5 @@ import {test as base} from '@playwright/test' -import {getAuthAccountInfo} from '../utils/networkUtils' + import {AuthPage} from '../pages/AuthPage' import {ComatibilityPage} from '../pages/compatibilityPage' import {HomePage} from '../pages/homePage' 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 bdec007677431c0003ca03c3c5099887bfa5a0f7 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Fri, 3 Apr 2026 20:57:40 +0100 Subject: [PATCH 25/36] 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 818aebe6..4da89b43 100644 --- a/tests/e2e/web/specs/onboardingFlow.spec.ts +++ b/tests/e2e/web/specs/onboardingFlow.spec.ts @@ -217,7 +217,7 @@ test.describe('when given valid input', () => { onboardingAccount.alcohol_consumed_per_month, ) }) - + test('should successfully complete the onboarding flow with google account', async ({ homePage, onboardingPage, @@ -289,11 +289,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 ({ @@ -304,10 +300,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( @@ -315,13 +313,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) @@ -332,11 +324,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 213757cc9e5a72fa43321c4beb5912ba626726cc Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Fri, 3 Apr 2026 22:52:34 +0100 Subject: [PATCH 26/36] Seperated deletion tests from onboarding --- tests/e2e/web/fixtures/signInFixture.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/e2e/web/fixtures/signInFixture.ts b/tests/e2e/web/fixtures/signInFixture.ts index 43a66830..47c5b727 100644 --- a/tests/e2e/web/fixtures/signInFixture.ts +++ b/tests/e2e/web/fixtures/signInFixture.ts @@ -43,7 +43,6 @@ export const test = base.extend<{ const authPage = new AuthPage(page) await use(authPage) }, - dev_one_account: async ({}, use) => { const account = testAccounts.dev_one_account() await use(account) From ada66a2081e3c4c5263d080c62d049b029b5eb91 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Sat, 4 Apr 2026 18:10:37 +0100 Subject: [PATCH 27/36] . --- tests/e2e/web/specs/onboardingFlow.spec.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/e2e/web/specs/onboardingFlow.spec.ts b/tests/e2e/web/specs/onboardingFlow.spec.ts index 4da89b43..6d93350a 100644 --- a/tests/e2e/web/specs/onboardingFlow.spec.ts +++ b/tests/e2e/web/specs/onboardingFlow.spec.ts @@ -1,6 +1,10 @@ import {userInformationFromDb} from '../../utils/databaseUtils' import {expect, test} from '../fixtures/base' -import {registerWithEmail, skipOnboardingHeadToProfile} from '../utils/testCleanupHelpers' +import { + registerWithEmail, + skipOnboardingHeadToProfile, + deleteProfileFromSettings, +} from '../utils/testCleanupHelpers' test.describe('when given valid input', () => { test('should successfully complete the onboarding flow with email', async ({ From 4d2db53109bae2238e1965eb42953579043b6b7e Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Sat, 4 Apr 2026 19:17:45 +0100 Subject: [PATCH 28/36] Changed POM/Fixture structure to use an app class to instantiate the page objects --- .../api/tests/unit/get-profiles.unit.test.ts | 2 +- tests/e2e/tsconfig.json | 1 + tests/e2e/web/fixtures/base.ts | 60 +-- tests/e2e/web/fixtures/signInFixture.ts | 40 +- tests/e2e/web/pages/app.ts | 78 ++++ .../web/pages/{AuthPage.ts => authPage.ts} | 0 tests/e2e/web/specs/onboardingFlow.spec.ts | 366 +++++++----------- tests/e2e/web/specs/signIn.spec.ts | 85 +--- tests/e2e/web/specs/signUp.spec.ts | 35 +- tests/e2e/web/utils/testCleanupHelpers.ts | 64 --- 10 files changed, 259 insertions(+), 472 deletions(-) create mode 100644 tests/e2e/web/pages/app.ts rename tests/e2e/web/pages/{AuthPage.ts => authPage.ts} (100%) delete mode 100644 tests/e2e/web/utils/testCleanupHelpers.ts diff --git a/backend/api/tests/unit/get-profiles.unit.test.ts b/backend/api/tests/unit/get-profiles.unit.test.ts index 2fdc7995..1e1e8139 100644 --- a/backend/api/tests/unit/get-profiles.unit.test.ts +++ b/backend/api/tests/unit/get-profiles.unit.test.ts @@ -316,7 +316,7 @@ describe('loadProfiles', () => { }) describe('when an error occurs', () => { - it('throw if there is no compatability', async () => { + it('throw if there is no compatibility', async () => { const props = { orderBy: 'compatibility_score', } diff --git a/tests/e2e/tsconfig.json b/tests/e2e/tsconfig.json index 6bcaa938..a4583100 100644 --- a/tests/e2e/tsconfig.json +++ b/tests/e2e/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "rootDir": "../../", "module": "commonjs", "jsx": "react-jsx", "moduleResolution": "node", diff --git a/tests/e2e/web/fixtures/base.ts b/tests/e2e/web/fixtures/base.ts index fcd40d17..99e3d8bf 100644 --- a/tests/e2e/web/fixtures/base.ts +++ b/tests/e2e/web/fixtures/base.ts @@ -1,29 +1,11 @@ import {test as base} from '@playwright/test' - -import {AuthPage} from '../pages/AuthPage' -import {ComatibilityPage} from '../pages/compatibilityPage' -import {HomePage} from '../pages/homePage' -import {OnboardingPage} from '../pages/onboardingPage' -import {OrganizationPage} from '../pages/organizationPage' -import {ProfilePage} from '../pages/profilePage' -import {SettingsPage} from '../pages/settingsPage' -import {SignUpPage} from '../pages/signUpPage' -import {SocialPage} from '../pages/socialPage' import {testAccounts, UserAccountInformation} from '../utils/accountInformation' import {deleteUser} from '../utils/deleteUser' import {getAuthAccountInfo} from '../utils/networkUtils' +import { App } from '../pages/app' export const test = base.extend<{ - homePage: HomePage - onboardingPage: OnboardingPage - signUpPage: SignUpPage - profilePage: ProfilePage - authPage: AuthPage - settingsPage: SettingsPage - socialPage: SocialPage - organizationPage: OrganizationPage - compatabilityPage: ComatibilityPage - cleanUpUsers: void + app: App onboardingAccount: UserAccountInformation fakerAccount: UserAccountInformation specAccount: UserAccountInformation @@ -62,41 +44,9 @@ export const test = base.extend<{ console.log('Cleaning up spec account...') await deleteUser('Email/Password', account) }, - onboardingPage: async ({page}, use) => { - const onboardingPage = new OnboardingPage(page) - await use(onboardingPage) - }, - homePage: async ({page}, use) => { - const homePage = new HomePage(page) - await use(homePage) - }, - signUpPage: async ({page}, use) => { - const signUpPage = new SignUpPage(page) - await use(signUpPage) - }, - authPage: async ({page}, use) => { - const authPage = new AuthPage(page) - await use(authPage) - }, - profilePage: async ({page}, use) => { - const profilePage = new ProfilePage(page) - await use(profilePage) - }, - compatabilityPage: async ({page}, use) => { - const compatibilityPage = new ComatibilityPage(page) - await use(compatibilityPage) - }, - settingsPage: async ({page}, use) => { - const settingsPage = new SettingsPage(page) - await use(settingsPage) - }, - socialPage: async ({page}, use) => { - const socialPage = new SocialPage(page) - await use(socialPage) - }, - organizationPage: async ({page}, use) => { - const organizationPage = new OrganizationPage(page) - await use(organizationPage) + app: async ({page}, use) => { + const appPage = new App(page) + await use(appPage) }, }) diff --git a/tests/e2e/web/fixtures/signInFixture.ts b/tests/e2e/web/fixtures/signInFixture.ts index 47c5b727..a0f29430 100644 --- a/tests/e2e/web/fixtures/signInFixture.ts +++ b/tests/e2e/web/fixtures/signInFixture.ts @@ -1,47 +1,17 @@ import {test as base} from '@playwright/test' -import {AuthPage} from '../pages/AuthPage' -import {HomePage} from '../pages/homePage' +import { App } from '../pages/app' import {testAccounts, UserAccountInformation} from '../utils/accountInformation' -import { OnboardingPage } from '../pages/onboardingPage' -import { SignUpPage } from '../pages/signUpPage' -import { ProfilePage } from '../pages/profilePage' -import { SettingsPage } from '../pages/settingsPage' export const test = base.extend<{ - homePage: HomePage - onboardingPage: OnboardingPage - signUpPage: SignUpPage - profilePage: ProfilePage - settingsPage: SettingsPage - authPage: AuthPage + app: App dev_one_account: UserAccountInformation fakerAccount: UserAccountInformation googleAccountOne: UserAccountInformation googleAccountTwo: UserAccountInformation }>({ - homePage: async ({page}, use) => { - const homePage = new HomePage(page) - await use(homePage) - }, - onboardingPage: async ({page}, use) => { - const onboardingPage = new OnboardingPage(page) - await use(onboardingPage) - }, - signUpPage: async ({page}, use) => { - const signUpPage = new SignUpPage(page) - await use(signUpPage) - }, - profilePage: async ({page}, use) => { - const profilePage = new ProfilePage(page) - await use(profilePage) - }, - settingsPage: async ({page}, use) => { - const settingsPage = new SettingsPage(page) - await use(settingsPage) - }, - authPage: async ({page}, use) => { - const authPage = new AuthPage(page) - await use(authPage) + app: async ({page}, use) => { + const appPage = new App(page) + await use(appPage) }, dev_one_account: async ({}, use) => { const account = testAccounts.dev_one_account() diff --git a/tests/e2e/web/pages/app.ts b/tests/e2e/web/pages/app.ts new file mode 100644 index 00000000..423a0507 --- /dev/null +++ b/tests/e2e/web/pages/app.ts @@ -0,0 +1,78 @@ +import { Page } from "@playwright/test"; +import { UserAccountInformation } from "../utils/accountInformation"; +import { AuthPage } from "./authPage"; +import { ComatibilityPage } from "./compatibilityPage"; +import { HomePage } from "./homePage"; +import { OnboardingPage } from "./onboardingPage"; +import { OrganizationPage } from "./organizationPage"; +import { ProfilePage } from "./profilePage"; +import { SettingsPage } from "./settingsPage"; +import { SignUpPage } from "./signUpPage"; +import { SocialPage } from "./socialPage"; + +export class App { + readonly auth: AuthPage + readonly compatibility: ComatibilityPage + readonly home: HomePage + readonly onboarding: OnboardingPage + readonly organization: OrganizationPage + readonly profile: ProfilePage + readonly settings: SettingsPage + readonly signUp: SignUpPage + readonly social: SocialPage + + constructor(public readonly page: Page) { + this.auth = new AuthPage(page) + this.compatibility = new ComatibilityPage(page) + this.home = new HomePage(page) + this.onboarding = new OnboardingPage(page) + this.organization = new OrganizationPage(page) + this.profile = new ProfilePage(page) + this.settings = new SettingsPage(page) + this.signUp = new SignUpPage(page) + this.social = new SocialPage(page) + } + + async deleteProfileFromSettings() { + await this.home.clickSettingsLink() + await this.settings.clickDeleteAccountButton() + await this.settings.fillDeleteAccountSurvey('Delete me') + await this.settings.clickDeleteAccountButton() + await this.home.verifyHomePageLinks() + } + + async skipOnboardingHeadToProfile(account: UserAccountInformation) { + await this.onboarding.clickSkipOnboardingButton() + await this.signUp.fillDisplayName(account.display_name) + await this.signUp.fillUsername(account.username) + await this.signUp.clickNextButton() + await this.signUp.clickNextButton() + await this.profile.clickCloseButton() + await this.onboarding.clickRefineProfileButton() + } + + async registerWithEmail(account: UserAccountInformation) { + await this.home.goToRegisterPage() + await this.auth.fillEmailField(account.email) + await this.auth.fillPasswordField(account.password) + await this.auth.clickSignUpWithEmailButton() + } + + async signinWithEmail( + accountOrEmail: UserAccountInformation | string, + password?: string, + ) { + const email = typeof accountOrEmail === 'string' ? accountOrEmail : accountOrEmail.email + + const resolvedPassword = typeof accountOrEmail === 'string' ? password : accountOrEmail.password + + if (!email || !resolvedPassword) { + throw new Error('Provide either an `account` or `email` and `password`.') + } + + await this.home.goToSigninPage() + await this.auth.fillEmailField(email) + await this.auth.fillPasswordField(resolvedPassword) + await this.auth.clickSignInWithEmailButton() + } +} \ No newline at end of file diff --git a/tests/e2e/web/pages/AuthPage.ts b/tests/e2e/web/pages/authPage.ts similarity index 100% rename from tests/e2e/web/pages/AuthPage.ts rename to tests/e2e/web/pages/authPage.ts diff --git a/tests/e2e/web/specs/onboardingFlow.spec.ts b/tests/e2e/web/specs/onboardingFlow.spec.ts index 6d93350a..ffe3f288 100644 --- a/tests/e2e/web/specs/onboardingFlow.spec.ts +++ b/tests/e2e/web/specs/onboardingFlow.spec.ts @@ -1,142 +1,133 @@ import {userInformationFromDb} from '../../utils/databaseUtils' import {expect, test} from '../fixtures/base' -import { - registerWithEmail, - skipOnboardingHeadToProfile, - deleteProfileFromSettings, -} from '../utils/testCleanupHelpers' test.describe('when given valid input', () => { test('should successfully complete the onboarding flow with email', async ({ - homePage, - onboardingPage, - signUpPage, - authPage, - profilePage, + app, onboardingAccount, }) => { - await registerWithEmail(homePage, authPage, onboardingAccount) - await onboardingPage.clickContinueButton() //First continue - await onboardingPage.clickContinueButton() //Second continue - await onboardingPage.clickGetStartedButton() - await signUpPage.fillDisplayName(onboardingAccount.display_name) - await signUpPage.fillUsername(onboardingAccount.username) - await signUpPage.clickNextButton() - await signUpPage.chooseGender(onboardingAccount.gender) - await signUpPage.fillAge(onboardingAccount.age) - await signUpPage.fillHeight({ + await app.registerWithEmail(onboardingAccount) + await app.onboarding.clickContinueButton() //First continue + await app.onboarding.clickContinueButton() //Second continue + await app.onboarding.clickGetStartedButton() + await app.signUp.fillDisplayName(onboardingAccount.display_name) + await app.signUp.fillUsername(onboardingAccount.username) + await app.signUp.clickNextButton() + await app.signUp.chooseGender(onboardingAccount.gender) + await app.signUp.fillAge(onboardingAccount.age) + await app.signUp.fillHeight({ feet: onboardingAccount.height?.feet, inches: onboardingAccount.height?.inches, }) - await signUpPage.fillEthnicity(onboardingAccount.ethnicity_origin) - await signUpPage.fillHeadline(onboardingAccount.headline) - await signUpPage.fillKeywords(onboardingAccount.keywords) - await signUpPage.fillInterestedInConnectingWith(onboardingAccount.interested_in) - await signUpPage.fillAgeRangeInterest( + await app.signUp.fillEthnicity(onboardingAccount.ethnicity_origin) + await app.signUp.fillHeadline(onboardingAccount.headline) + await app.signUp.fillKeywords(onboardingAccount.keywords) + await app.signUp.fillInterestedInConnectingWith(onboardingAccount.interested_in) + await app.signUp.fillAgeRangeInterest( onboardingAccount.Interested_in_ages?.min, onboardingAccount.Interested_in_ages?.max, ) - await signUpPage.setConnectionType(onboardingAccount.connection_type) - await signUpPage.setRelationshipStatus(onboardingAccount.relationship_status) - await signUpPage.setRelationshipStyle(onboardingAccount.relationship_style) - await signUpPage.fillCurrentNumberOfChildren(onboardingAccount.number_of_kids) - await signUpPage.setWantChildrenExpectation(onboardingAccount.children_expectation) - await signUpPage.setInterests(onboardingAccount.interests) - await signUpPage.setCauses(onboardingAccount.causes) - await signUpPage.setHighestEducationLevel(onboardingAccount.education_level) - await signUpPage.fillUniversity(onboardingAccount.university) - await signUpPage.fillJobTitle(onboardingAccount.job_title) - await signUpPage.fillCompany(onboardingAccount.company) - await signUpPage.setWorkArea(onboardingAccount.work_area) - await signUpPage.setPoliticalBeliefs( + await app.signUp.setConnectionType(onboardingAccount.connection_type) + await app.signUp.setRelationshipStatus(onboardingAccount.relationship_status) + await app.signUp.setRelationshipStyle(onboardingAccount.relationship_style) + await app.signUp.fillCurrentNumberOfChildren(onboardingAccount.number_of_kids) + await app.signUp.setWantChildrenExpectation(onboardingAccount.children_expectation) + await app.signUp.setInterests(onboardingAccount.interests) + await app.signUp.setCauses(onboardingAccount.causes) + await app.signUp.setHighestEducationLevel(onboardingAccount.education_level) + await app.signUp.fillUniversity(onboardingAccount.university) + await app.signUp.fillJobTitle(onboardingAccount.job_title) + await app.signUp.fillCompany(onboardingAccount.company) + await app.signUp.setWorkArea(onboardingAccount.work_area) + await app.signUp.setPoliticalBeliefs( onboardingAccount.beliefs?.political?.belief, onboardingAccount.beliefs?.political?.details, ) - await signUpPage.setReligiousBeliefs( + await app.signUp.setReligiousBeliefs( onboardingAccount.beliefs?.religious?.belief, onboardingAccount.beliefs?.religious?.details, ) - await signUpPage.setPersonalityType(onboardingAccount.personality_type) - await signUpPage.setOpennessPersonalityValue( + await app.signUp.setPersonalityType(onboardingAccount.personality_type) + await app.signUp.setOpennessPersonalityValue( onboardingAccount.big_five_personality_traits?.openness, ) - await signUpPage.setAgreeablenessPersonalityValue( + await app.signUp.setAgreeablenessPersonalityValue( onboardingAccount.big_five_personality_traits?.agreeableness, ) - await signUpPage.setConscientiousnessPersonalityValue( + await app.signUp.setConscientiousnessPersonalityValue( onboardingAccount.big_five_personality_traits?.conscientiousness, ) - await signUpPage.setExtraversionPersonalityValue( + await app.signUp.setExtraversionPersonalityValue( onboardingAccount.big_five_personality_traits?.extraversion, ) - await signUpPage.setNeuroticismPersonalityValue( + await app.signUp.setNeuroticismPersonalityValue( onboardingAccount.big_five_personality_traits?.neuroticism, ) - await signUpPage.setDietType(onboardingAccount.diet) - await signUpPage.setIsSmoker(onboardingAccount.is_smoker) - await signUpPage.fillAlcoholPerMonth(onboardingAccount.alcohol_consumed_per_month) - await signUpPage.setLanguages(onboardingAccount.languages) - await signUpPage.addSocialMediaPlatform(onboardingAccount.social_media) - await signUpPage.fillBio(onboardingAccount.bio) - await signUpPage.clickNextButton() - await profilePage.clickCloseButton() - await onboardingPage.clickRefineProfileButton() - await profilePage.clickAnswerQuestionsButton() - const compatQuestionOne = await profilePage.answerCompatibilityQuestion( + await app.signUp.setDietType(onboardingAccount.diet) + await app.signUp.setIsSmoker(onboardingAccount.is_smoker) + await app.signUp.fillAlcoholPerMonth(onboardingAccount.alcohol_consumed_per_month) + await app.signUp.setLanguages(onboardingAccount.languages) + await app.signUp.addSocialMediaPlatform(onboardingAccount.social_media) + await app.signUp.fillBio(onboardingAccount.bio) + await app.signUp.clickNextButton() + await app.profile.clickCloseButton() + await app.onboarding.clickRefineProfileButton() + await app.profile.clickAnswerQuestionsButton() + const compatQuestionOne = await app.profile.answerCompatibilityQuestion( onboardingAccount.compatibility, ) - await profilePage.clickNextCompatibilityQuestionButton() - await profilePage.clickSkipCompatibilityQuestionButton() - await profilePage.clickSkipCompatibilityQuestionButton() + await app.profile.clickNextCompatibilityQuestionButton() + await app.profile.clickSkipCompatibilityQuestionButton() + await app.profile.clickSkipCompatibilityQuestionButton() - await profilePage.clickCloseButton() + await app.profile.clickCloseButton() //Verify information is correct - await profilePage.verifyDisplayName(onboardingAccount.display_name) - await profilePage.verifyHeadline(onboardingAccount.headline) - await profilePage.verifyKeywords(onboardingAccount.keywords) - await profilePage.verifyGenderLocationHeightAge( + await app.profile.verifyDisplayName(onboardingAccount.display_name) + await app.profile.verifyHeadline(onboardingAccount.headline) + await app.profile.verifyKeywords(onboardingAccount.keywords) + await app.profile.verifyGenderLocationHeightAge( onboardingAccount.gender, undefined, onboardingAccount.height?.feet, onboardingAccount.height?.inches, onboardingAccount.age, ) - await profilePage.verifySeeking( + await app.profile.verifySeeking( onboardingAccount.interested_in, onboardingAccount.Interested_in_ages?.min, onboardingAccount.Interested_in_ages?.max, onboardingAccount.connection_type, onboardingAccount.relationship_style, ) - await profilePage.verifyRelationshipStatus(onboardingAccount.relationship_status) - await profilePage.verifyCurrentNumberOfKids(onboardingAccount.number_of_kids) - await profilePage.verifyWantChildrenExpectation(onboardingAccount.children_expectation) - await profilePage.verifyInterests(onboardingAccount.interests) - await profilePage.verifyCauses(onboardingAccount.causes) - await profilePage.verifyEducationLevelAndUniversity( + await app.profile.verifyRelationshipStatus(onboardingAccount.relationship_status) + await app.profile.verifyCurrentNumberOfKids(onboardingAccount.number_of_kids) + await app.profile.verifyWantChildrenExpectation(onboardingAccount.children_expectation) + await app.profile.verifyInterests(onboardingAccount.interests) + await app.profile.verifyCauses(onboardingAccount.causes) + await app.profile.verifyEducationLevelAndUniversity( onboardingAccount.education_level, onboardingAccount.university, ) - await profilePage.verifyJobInformation(onboardingAccount.job_title, onboardingAccount.company) - await profilePage.verifyWorkArea(onboardingAccount.work_area) - await profilePage.verifyPoliticalBeliefs( + await app.profile.verifyJobInformation(onboardingAccount.job_title, onboardingAccount.company) + await app.profile.verifyWorkArea(onboardingAccount.work_area) + await app.profile.verifyPoliticalBeliefs( onboardingAccount.beliefs?.political?.belief, onboardingAccount.beliefs?.political?.details, ) - await profilePage.verifyReligiousBeliefs( + await app.profile.verifyReligiousBeliefs( onboardingAccount.beliefs?.religious?.belief, onboardingAccount.beliefs?.religious?.details, ) - await profilePage.verifyPersonalityType(onboardingAccount.personality_type) - await profilePage.verifyBigFivePersonalitySection(onboardingAccount.big_five_personality_traits) - await profilePage.verifyDiet(onboardingAccount.diet) - await profilePage.verifySmoker(onboardingAccount.is_smoker) - await profilePage.verifyDrinksPerMonth(onboardingAccount.alcohol_consumed_per_month) - await profilePage.verifyLanguages(onboardingAccount.languages) - await profilePage.verifySocialMedia(onboardingAccount.social_media) - await profilePage.verifyBio(onboardingAccount.bio) - await profilePage.verifyCompatibilityAnswers(compatQuestionOne) + await app.profile.verifyPersonalityType(onboardingAccount.personality_type) + await app.profile.verifyBigFivePersonalitySection(onboardingAccount.big_five_personality_traits) + await app.profile.verifyDiet(onboardingAccount.diet) + await app.profile.verifySmoker(onboardingAccount.is_smoker) + await app.profile.verifyDrinksPerMonth(onboardingAccount.alcohol_consumed_per_month) + await app.profile.verifyLanguages(onboardingAccount.languages) + await app.profile.verifySocialMedia(onboardingAccount.social_media) + await app.profile.verifyBio(onboardingAccount.bio) + await app.profile.verifyCompatibilityAnswers(compatQuestionOne) //Verify Database Information const dbInfo = await userInformationFromDb(onboardingAccount) @@ -223,26 +214,22 @@ test.describe('when given valid input', () => { }) test('should successfully complete the onboarding flow with google account', async ({ - homePage, - onboardingPage, - signUpPage, - authPage, - profilePage, + app, googleAccountOne, headless, }) => { 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( + await app.home.goToRegisterPage() + await app.auth.fillPasswordField('') //The test only passes when this is added...something is weird here + await app.auth.signInToGoogleAccount( googleAccountOne.email, googleAccountOne.display_name, googleAccountOne.username, ) - await skipOnboardingHeadToProfile(onboardingPage, signUpPage, profilePage, googleAccountOne) + await app.skipOnboardingHeadToProfile(googleAccountOne) //Verify displayed information is correct - await profilePage.verifyDisplayName(googleAccountOne.display_name) + await app.profile.verifyDisplayName(googleAccountOne.display_name) //Verify database info const dbInfo = await userInformationFromDb(googleAccountOne) @@ -252,18 +239,14 @@ test.describe('when given valid input', () => { }) test('should successfully skip the onboarding flow', async ({ - homePage, - onboardingPage, - signUpPage, - authPage, - profilePage, + app, fakerAccount, }) => { - await registerWithEmail(homePage, authPage, fakerAccount) - await skipOnboardingHeadToProfile(onboardingPage, signUpPage, profilePage, fakerAccount) + await app.registerWithEmail(fakerAccount) + await app.skipOnboardingHeadToProfile(fakerAccount) //Verify displayed information is correct - await profilePage.verifyDisplayName(fakerAccount.display_name) + await app.profile.verifyDisplayName(fakerAccount.display_name) //Verify database info const dbInfo = await userInformationFromDb(fakerAccount) @@ -272,87 +255,24 @@ 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 ({ - homePage, - onboardingPage, - signUpPage, - authPage, - profilePage, + app, fakerAccount, }) => { - await registerWithEmail(homePage, authPage, fakerAccount) - await skipOnboardingHeadToProfile(onboardingPage, signUpPage, profilePage, fakerAccount) - await profilePage.clickEditProfileButton() - await signUpPage.chooseGender(fakerAccount.gender) - await signUpPage.fillAge(fakerAccount.age) - await signUpPage.fillHeight({ + await app.registerWithEmail(fakerAccount) + await app.skipOnboardingHeadToProfile(fakerAccount) + await app.profile.clickEditProfileButton() + await app.signUp.chooseGender(fakerAccount.gender) + await app.signUp.fillAge(fakerAccount.age) + await app.signUp.fillHeight({ feet: fakerAccount.height?.feet, inches: fakerAccount.height?.inches, }) - await signUpPage.saveProfileChanges() + await app.signUp.saveProfileChanges() //Verify displayed information is correct - await profilePage.verifyDisplayName(fakerAccount.display_name) - await profilePage.verifyGenderLocationHeightAge( + await app.profile.verifyDisplayName(fakerAccount.display_name) + await app.profile.verifyGenderLocationHeightAge( fakerAccount.gender, undefined, fakerAccount.height?.feet, @@ -371,31 +291,27 @@ test.describe('when given valid input', () => { }) test('should successfully use the start answering option', async ({ - homePage, - onboardingPage, - signUpPage, - authPage, - profilePage, + app, fakerAccount, onboardingAccount, }) => { - await registerWithEmail(homePage, authPage, fakerAccount) - await onboardingPage.clickSkipOnboardingButton() - await signUpPage.fillDisplayName(fakerAccount.display_name) - await signUpPage.fillUsername(fakerAccount.username) - await signUpPage.clickNextButton() - await signUpPage.clickNextButton() //Skip optional information - await profilePage.clickStartAnsweringButton() - const compatTwoQuestionOne = await profilePage.answerCompatibilityQuestion( + await app.registerWithEmail(fakerAccount) + await app.onboarding.clickSkipOnboardingButton() + await app.signUp.fillDisplayName(fakerAccount.display_name) + await app.signUp.fillUsername(fakerAccount.username) + await app.signUp.clickNextButton() + await app.signUp.clickNextButton() //Skip optional information + await app.profile.clickStartAnsweringButton() + const compatTwoQuestionOne = await app.profile.answerCompatibilityQuestion( onboardingAccount.compatibility, ) - await profilePage.clickNextCompatibilityQuestionButton() - await profilePage.clickCloseButton() - await onboardingPage.clickRefineProfileButton() + await app.profile.clickNextCompatibilityQuestionButton() + await app.profile.clickCloseButton() + await app.onboarding.clickRefineProfileButton() //Verify displayed information is correct - await profilePage.verifyDisplayName(fakerAccount.display_name) - await profilePage.verifyCompatibilityAnswers(compatTwoQuestionOne) + await app.profile.verifyDisplayName(fakerAccount.display_name) + await app.profile.verifyCompatibilityAnswers(compatTwoQuestionOne) //Verify database info const dbInfo = await userInformationFromDb(fakerAccount) @@ -406,28 +322,24 @@ 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 ({ - homePage, - authPage, - onboardingPage, - signUpPage, - profilePage, + app, fakerAccount, }) => { - await registerWithEmail(homePage, authPage, fakerAccount) - await onboardingPage.clickContinueButton() - await onboardingPage.clickBackButton() - await onboardingPage.clickContinueButton() - await onboardingPage.clickContinueButton() - await onboardingPage.clickGetStartedButton() - await signUpPage.fillDisplayName(fakerAccount.display_name) - await signUpPage.fillUsername(fakerAccount.username) - await signUpPage.clickNextButton() - await signUpPage.clickNextButton() //Skip optional information - await profilePage.clickCloseButton() - await onboardingPage.clickRefineProfileButton() + await app.registerWithEmail(fakerAccount) + await app.onboarding.clickContinueButton() + await app.onboarding.clickBackButton() + await app.onboarding.clickContinueButton() + await app.onboarding.clickContinueButton() + await app.onboarding.clickGetStartedButton() + await app.signUp.fillDisplayName(fakerAccount.display_name) + await app.signUp.fillUsername(fakerAccount.username) + await app.signUp.clickNextButton() + await app.signUp.clickNextButton() //Skip optional information + await app.profile.clickCloseButton() + await app.onboarding.clickRefineProfileButton() //Verify displayed information is correct - await profilePage.verifyDisplayName(fakerAccount.display_name) + await app.profile.verifyDisplayName(fakerAccount.display_name) //Verify database info const dbInfo = await userInformationFromDb(fakerAccount) @@ -437,28 +349,24 @@ test.describe('when given valid input', () => { }) test("the second time it's an option", async ({ - homePage, - authPage, - onboardingPage, - signUpPage, - profilePage, + app, fakerAccount, }) => { - await registerWithEmail(homePage, authPage, fakerAccount) - await onboardingPage.clickContinueButton() - await onboardingPage.clickContinueButton() - await onboardingPage.clickBackButton() - await onboardingPage.clickContinueButton() - await onboardingPage.clickGetStartedButton() - await signUpPage.fillDisplayName(fakerAccount.display_name) - await signUpPage.fillUsername(fakerAccount.username) - await signUpPage.clickNextButton() - await signUpPage.clickNextButton() //Skip optional information - await profilePage.clickCloseButton() - await onboardingPage.clickRefineProfileButton() + await app.registerWithEmail(fakerAccount) + await app.onboarding.clickContinueButton() + await app.onboarding.clickContinueButton() + await app.onboarding.clickBackButton() + await app.onboarding.clickContinueButton() + await app.onboarding.clickGetStartedButton() + await app.signUp.fillDisplayName(fakerAccount.display_name) + await app.signUp.fillUsername(fakerAccount.username) + await app.signUp.clickNextButton() + await app.signUp.clickNextButton() //Skip optional information + await app.profile.clickCloseButton() + await app.onboarding.clickRefineProfileButton() //Verify displayed information is correct - await profilePage.verifyDisplayName(fakerAccount.display_name) + await app.profile.verifyDisplayName(fakerAccount.display_name) //Verify database info const dbInfo = await userInformationFromDb(fakerAccount) diff --git a/tests/e2e/web/specs/signIn.spec.ts b/tests/e2e/web/specs/signIn.spec.ts index 72225a5a..445a6601 100644 --- a/tests/e2e/web/specs/signIn.spec.ts +++ b/tests/e2e/web/specs/signIn.spec.ts @@ -1,19 +1,7 @@ -<<<<<<< HEAD import {userInformationFromDb} from '../../utils/databaseUtils' import {seedUser} from '../../utils/seedDatabase' import {expect, test} from '../fixtures/signInFixture' import {testAccounts} from '../utils/accountInformation' -import { - deleteProfileFromSettings, - registerWithEmail, - signinWithEmail, - skipOnboardingHeadToProfile, -} from '../utils/testCleanupHelpers' -======= -import {test, expect} from '../fixtures/signInFixture' -import { seedUser } from "../../utils/seedDatabase"; -import { testAccounts } from "../utils/accountInformation"; ->>>>>>> c092182d (Added checks to the deleteUser func to check if the accout exists) //Seed the account test.beforeAll(async () => { @@ -32,40 +20,18 @@ test.beforeAll(async () => { }) test.describe('when given valid input', () => { - test('should be able to sign in to an available account', async ({ - homePage, - authPage, -<<<<<<< HEAD - dev_one_account, - }) => { - await signinWithEmail(homePage, authPage, dev_one_account) -======= - dev_one_account - }) => { - await homePage.gotToSigninPage() - await authPage.fillEmailField(dev_one_account.email) - await authPage.fillPasswordField(dev_one_account.password) - await authPage.clickSignInWithEmailButton() ->>>>>>> c092182d (Added checks to the deleteUser func to check if the accout exists) - await homePage.goToHomePage() - await homePage.verifySignedInHomePage(dev_one_account.display_name) + test('should be able to sign in to an available account', async ({app,dev_one_account,}) => { + await app.signinWithEmail(dev_one_account) + await app.home.goToHomePage() + await app.home.verifySignedInHomePage(dev_one_account.display_name) }) -<<<<<<< HEAD - 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) + test('should successfully delete an account created via email and password', async ({app,fakerAccount,}) => { + await app.registerWithEmail(fakerAccount) + await app.skipOnboardingHeadToProfile(fakerAccount) //Verify displayed information is correct - await profilePage.verifyDisplayName(fakerAccount.display_name) + await app.profile.verifyDisplayName(fakerAccount.display_name) //Verify database info const dbInfo = await userInformationFromDb(fakerAccount) @@ -73,31 +39,26 @@ test.describe('when given valid input', () => { await expect(dbInfo.user.name).toContain(fakerAccount.display_name) await expect(dbInfo.user.username).toContain(fakerAccount.username) - await deleteProfileFromSettings(homePage, settingsPage) + await app.deleteProfileFromSettings() }) test('should successfully delete an account created via google auth', async ({ - homePage, - onboardingPage, - signUpPage, - authPage, - profilePage, - settingsPage, + app, googleAccountTwo, headless, }) => { 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( + await app.home.goToRegisterPage() + await app.auth.fillPasswordField('') //The test only passes when this is added...something is weird here + await app.auth.signInToGoogleAccount( googleAccountTwo.email, googleAccountTwo.display_name, googleAccountTwo.username, ) - await skipOnboardingHeadToProfile(onboardingPage, signUpPage, profilePage, googleAccountTwo) + await app.skipOnboardingHeadToProfile(googleAccountTwo) //Verify displayed information is correct - await profilePage.verifyDisplayName(googleAccountTwo.display_name) + await app.profile.verifyDisplayName(googleAccountTwo.display_name) //Verify database info const dbInfo = await userInformationFromDb(googleAccountTwo) @@ -105,29 +66,19 @@ test.describe('when given valid input', () => { await expect(dbInfo.user.name).toContain(googleAccountTwo.display_name) await expect(dbInfo.user.username).toContain(googleAccountTwo.username) - await deleteProfileFromSettings(homePage, settingsPage) + await app.deleteProfileFromSettings() }) }) test.describe('when given invalid input', () => { test('should not be able to sign in to an available account', async ({ - homePage, - authPage, + app, dev_one_account, page, }) => { - await signinWithEmail(homePage, authPage, dev_one_account.email, 'ThisPassword') + await app.signinWithEmail(dev_one_account.email, 'ThisPassword') await expect( 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 () => {}) ->>>>>>> c092182d (Added checks to the deleteUser func to check if the accout exists) }) diff --git a/tests/e2e/web/specs/signUp.spec.ts b/tests/e2e/web/specs/signUp.spec.ts index 8a0cfee8..7bb4e84e 100644 --- a/tests/e2e/web/specs/signUp.spec.ts +++ b/tests/e2e/web/specs/signUp.spec.ts @@ -1,5 +1,4 @@ import {expect, test} from '../fixtures/base' -import {registerWithEmail} from '../utils/testCleanupHelpers' // test.describe('when given valid input', () => { // test('placeholder', async () => {}) @@ -8,37 +7,31 @@ import {registerWithEmail} from '../utils/testCleanupHelpers' test.describe('when an error occurs', () => { test('should disable the button "Next" when the display name field is empty', async ({ specAccount, - homePage, - authPage, - onboardingPage, - signUpPage, + app }) => { console.log( `Starting "should disable the button "Next" when the display name field is empty" with ${specAccount.username}`, ) - await registerWithEmail(homePage, authPage, specAccount) - await onboardingPage.clickSkipOnboardingButton() - await signUpPage.fillDisplayName('') - await signUpPage.fillUsername(specAccount.username) - await signUpPage.verifyDisplayNameError() - await expect(signUpPage.nextButtonLocator).toBeDisabled() + await app.registerWithEmail(specAccount) + await app.onboarding.clickSkipOnboardingButton() + await app.signUp.fillDisplayName('') + await app.signUp.fillUsername(specAccount.username) + await app.signUp.verifyDisplayNameError() + await expect(app.signUp.nextButtonLocator).toBeDisabled() }) test('should disable the button "Next" when the username field is empty', async ({ specAccount, - homePage, - authPage, - onboardingPage, - signUpPage, + app }) => { console.log( `Starting "should disable the button "Next" when the username field is empty" with ${specAccount.username}`, ) - await registerWithEmail(homePage, authPage, specAccount) - await onboardingPage.clickSkipOnboardingButton() - await signUpPage.fillDisplayName(specAccount.display_name) - await signUpPage.fillUsername('') - await signUpPage.verifyUsernameError() - await expect(signUpPage.nextButtonLocator).toBeDisabled() + await app.registerWithEmail(specAccount) + await app.onboarding.clickSkipOnboardingButton() + await app.signUp.fillDisplayName(specAccount.display_name) + await app.signUp.fillUsername('') + await app.signUp.verifyUsernameError() + await expect(app.signUp.nextButtonLocator).toBeDisabled() }) }) diff --git a/tests/e2e/web/utils/testCleanupHelpers.ts b/tests/e2e/web/utils/testCleanupHelpers.ts deleted file mode 100644 index c022028d..00000000 --- a/tests/e2e/web/utils/testCleanupHelpers.ts +++ /dev/null @@ -1,64 +0,0 @@ -import {AuthPage} from '../pages/AuthPage' -import {HomePage} from '../pages/homePage' -import { OnboardingPage } from '../pages/onboardingPage' -import { ProfilePage } from '../pages/profilePage' -import { SettingsPage } from '../pages/settingsPage' -import { SignUpPage } from '../pages/signUpPage' -import {UserAccountInformation} from '../utils/accountInformation' - -export async function registerWithEmail( - homePage: HomePage, - authPage: AuthPage, - account: UserAccountInformation, -) { - await homePage.goToRegisterPage() - await authPage.fillEmailField(account.email) - await authPage.fillPasswordField(account.password) - await authPage.clickSignUpWithEmailButton() -} - -export async function signinWithEmail( - homePage: HomePage, - authPage: AuthPage, - accountOrEmail: UserAccountInformation | string, - password?: string, -) { - const email = typeof accountOrEmail === 'string' ? accountOrEmail : accountOrEmail.email - - const resolvedPassword = typeof accountOrEmail === 'string' ? password : accountOrEmail.password - - if (!email || !resolvedPassword) { - throw new Error('Provide either an `account` or `email` and `password`.') - } - - await homePage.goToSigninPage() - await authPage.fillEmailField(email) - await authPage.fillPasswordField(resolvedPassword) - await authPage.clickSignInWithEmailButton() -} - -export async function skipOnboardingHeadToProfile( - onboardingPage: OnboardingPage, - signUpPage: SignUpPage, - profilePage: ProfilePage, - account: UserAccountInformation, -) { - await onboardingPage.clickSkipOnboardingButton() - await signUpPage.fillDisplayName(account.display_name) - await signUpPage.fillUsername(account.username) - await signUpPage.clickNextButton() - await signUpPage.clickNextButton() - await profilePage.clickCloseButton() - await onboardingPage.clickRefineProfileButton() -} - -export async function deleteProfileFromSettings( - homePage: HomePage, - settingsPage: SettingsPage, -) { - await homePage.clickSettingsLink() - await settingsPage.clickDeleteAccountButton() - await settingsPage.fillDeleteAccountSurvey('Delete me') - await settingsPage.clickDeleteAccountButton() - await homePage.verifyHomePageLinks() -} \ No newline at end of file From 9fbff671e9eacacc2684f760bc4272df4ec99aeb Mon Sep 17 00:00:00 2001 From: Martin Braquet Date: Sat, 4 Apr 2026 20:27:37 +0200 Subject: [PATCH 29/36] Apply suggestion from @MartinBraquet --- tests/e2e/web/specs/signUp.spec.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/e2e/web/specs/signUp.spec.ts b/tests/e2e/web/specs/signUp.spec.ts index 7bb4e84e..a0118d32 100644 --- a/tests/e2e/web/specs/signUp.spec.ts +++ b/tests/e2e/web/specs/signUp.spec.ts @@ -9,9 +9,6 @@ test.describe('when an error occurs', () => { specAccount, app }) => { - console.log( - `Starting "should disable the button "Next" when the display name field is empty" with ${specAccount.username}`, - ) await app.registerWithEmail(specAccount) await app.onboarding.clickSkipOnboardingButton() await app.signUp.fillDisplayName('') From ebba02c6037dd7f1e64a9ce113461e81b502a8a1 Mon Sep 17 00:00:00 2001 From: Martin Braquet Date: Sat, 4 Apr 2026 20:37:38 +0200 Subject: [PATCH 30/36] 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 071c0467c002d34a97d414b49c05bf796b957ebe Mon Sep 17 00:00:00 2001 From: Martin Braquet Date: Sat, 4 Apr 2026 20:38:36 +0200 Subject: [PATCH 31/36] 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 4a452bd9a7c493d59f53fe4ab1f574214cd78d8d Mon Sep 17 00:00:00 2001 From: Martin Braquet Date: Sat, 4 Apr 2026 20:43:22 +0200 Subject: [PATCH 32/36] 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 b0b0c9ad9d911fb6ad01af165f54ea0c37982009 Mon Sep 17 00:00:00 2001 From: Martin Braquet Date: Sat, 4 Apr 2026 20:44:44 +0200 Subject: [PATCH 33/36] Apply suggestions from code review Co-authored-by: Martin Braquet --- tests/e2e/web/specs/signUp.spec.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/e2e/web/specs/signUp.spec.ts b/tests/e2e/web/specs/signUp.spec.ts index a0118d32..b2d3d85d 100644 --- a/tests/e2e/web/specs/signUp.spec.ts +++ b/tests/e2e/web/specs/signUp.spec.ts @@ -21,9 +21,6 @@ test.describe('when an error occurs', () => { specAccount, app }) => { - console.log( - `Starting "should disable the button "Next" when the username field is empty" with ${specAccount.username}`, - ) await app.registerWithEmail(specAccount) await app.onboarding.clickSkipOnboardingButton() await app.signUp.fillDisplayName(specAccount.display_name) From 8c781120c60af114edcc8532b0bc800a5d2aa658 Mon Sep 17 00:00:00 2001 From: Martin Braquet Date: Sat, 4 Apr 2026 20:54:03 +0200 Subject: [PATCH 34/36] 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 b33931102efcedc387ea0749c6dbef35852328ae Mon Sep 17 00:00:00 2001 From: Martin Braquet Date: Sat, 4 Apr 2026 20:55:14 +0200 Subject: [PATCH 35/36] 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 d432f2c6eb917df49db547b037a61b0360261671 Mon Sep 17 00:00:00 2001 From: Okechi Jones-Williams Date: Sat, 4 Apr 2026 19:57:07 +0100 Subject: [PATCH 36/36] Linting and Prettier --- .coderabbit.yaml | 20 ++-- docs/TESTING.md | 1 - tests/e2e/utils/firebaseUtils.ts | 2 +- tests/e2e/web/fixtures/base.ts | 2 +- tests/e2e/web/fixtures/signInFixture.ts | 2 +- tests/e2e/web/pages/app.ts | 133 ++++++++++----------- tests/e2e/web/specs/onboardingFlow.spec.ts | 17 +-- tests/e2e/web/specs/signIn.spec.ts | 7 +- tests/e2e/web/specs/signUp.spec.ts | 4 +- 9 files changed, 89 insertions(+), 99 deletions(-) diff --git a/.coderabbit.yaml b/.coderabbit.yaml index 5f1a5f5a..65f5a936 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -17,7 +17,7 @@ reviews: enabled: true # Skip auto-review if PR title contains these keywords ignore_title_keywords: - - "WIP" + - 'WIP' # Don't auto-review draft PRs drafts: false # Only auto-review PRs targeting these branches @@ -57,17 +57,17 @@ reviews: # Exclude these paths from reviews (build artifacts and dependencies) path_filters: - - "!**/node_modules/**" # npm dependencies - - "!**/android/**" # Native Android build files - - "!**/ios/**" # Native iOS build files - - "!**/.expo/**" # Expo build cache - - "!**/.expo-shared/**" # Expo shared config - - "!**/dist/**" # Build output + - '!**/node_modules/**' # npm dependencies + - '!**/android/**' # Native Android build files + - '!**/ios/**' # Native iOS build files + - '!**/.expo/**' # Expo build cache + - '!**/.expo-shared/**' # Expo shared config + - '!**/dist/**' # Build output # Custom review instructions for specific file patterns path_instructions: # TypeScript/JavaScript files - main app code - - path: "**/*.{ts,tsx,js,jsx}" + - path: '**/*.{ts,tsx,js,jsx}' instructions: | General practices: - Summarize the changes clearly. @@ -78,7 +78,7 @@ reviews: - Flag any hardcoded strings; they should be in the constants file. - Check for edge cases like null values or empty arrays. - Suggest performance optimizations where appropriate. - + Mobile best practices: - Proper use of hooks (useRouter, useFonts, useAssets) - Accessibility: touch targets min 44x44, screen reader support @@ -105,7 +105,7 @@ reviews: const message = t('key', 'english string') ``` - - path: "tests/e2e/**/*.ts" + - path: 'tests/e2e/**/*.ts' instructions: | Playwright E2E test guidelines for this repo: - Page objects live in `tests/e2e/web/pages/`. Each class wraps one page/route, holds only `private readonly` Locators, and exposes action methods. diff --git a/docs/TESTING.md b/docs/TESTING.md index 7a71f563..e84955b2 100644 --- a/docs/TESTING.md +++ b/docs/TESTING.md @@ -348,7 +348,6 @@ jest.mock('path/to/module') * This creates an object containing all named exports from ./path/to/module */ import * as mockModule from 'path/to/module' - ;(mockModule.module as jest.Mock).mockResolvedValue(mockReturnValue) ``` diff --git a/tests/e2e/utils/firebaseUtils.ts b/tests/e2e/utils/firebaseUtils.ts index b9c32d79..a68d468c 100644 --- a/tests/e2e/utils/firebaseUtils.ts +++ b/tests/e2e/utils/firebaseUtils.ts @@ -72,4 +72,4 @@ export async function deleteAccount(idToken: any) { } throw err } -} \ No newline at end of file +} diff --git a/tests/e2e/web/fixtures/base.ts b/tests/e2e/web/fixtures/base.ts index 99e3d8bf..4fe2f1dd 100644 --- a/tests/e2e/web/fixtures/base.ts +++ b/tests/e2e/web/fixtures/base.ts @@ -2,7 +2,7 @@ import {test as base} from '@playwright/test' import {testAccounts, UserAccountInformation} from '../utils/accountInformation' import {deleteUser} from '../utils/deleteUser' import {getAuthAccountInfo} from '../utils/networkUtils' -import { App } from '../pages/app' +import {App} from '../pages/app' export const test = base.extend<{ app: App diff --git a/tests/e2e/web/fixtures/signInFixture.ts b/tests/e2e/web/fixtures/signInFixture.ts index a0f29430..4167054f 100644 --- a/tests/e2e/web/fixtures/signInFixture.ts +++ b/tests/e2e/web/fixtures/signInFixture.ts @@ -1,5 +1,5 @@ import {test as base} from '@playwright/test' -import { App } from '../pages/app' +import {App} from '../pages/app' import {testAccounts, UserAccountInformation} from '../utils/accountInformation' export const test = base.extend<{ diff --git a/tests/e2e/web/pages/app.ts b/tests/e2e/web/pages/app.ts index 423a0507..d8ed56c3 100644 --- a/tests/e2e/web/pages/app.ts +++ b/tests/e2e/web/pages/app.ts @@ -1,78 +1,75 @@ -import { Page } from "@playwright/test"; -import { UserAccountInformation } from "../utils/accountInformation"; -import { AuthPage } from "./authPage"; -import { ComatibilityPage } from "./compatibilityPage"; -import { HomePage } from "./homePage"; -import { OnboardingPage } from "./onboardingPage"; -import { OrganizationPage } from "./organizationPage"; -import { ProfilePage } from "./profilePage"; -import { SettingsPage } from "./settingsPage"; -import { SignUpPage } from "./signUpPage"; -import { SocialPage } from "./socialPage"; +import {Page} from '@playwright/test' +import {UserAccountInformation} from '../utils/accountInformation' +import {AuthPage} from './authPage' +import {ComatibilityPage} from './compatibilityPage' +import {HomePage} from './homePage' +import {OnboardingPage} from './onboardingPage' +import {OrganizationPage} from './organizationPage' +import {ProfilePage} from './profilePage' +import {SettingsPage} from './settingsPage' +import {SignUpPage} from './signUpPage' +import {SocialPage} from './socialPage' export class App { - readonly auth: AuthPage - readonly compatibility: ComatibilityPage - readonly home: HomePage - readonly onboarding: OnboardingPage - readonly organization: OrganizationPage - readonly profile: ProfilePage - readonly settings: SettingsPage - readonly signUp: SignUpPage - readonly social: SocialPage + readonly auth: AuthPage + readonly compatibility: ComatibilityPage + readonly home: HomePage + readonly onboarding: OnboardingPage + readonly organization: OrganizationPage + readonly profile: ProfilePage + readonly settings: SettingsPage + readonly signUp: SignUpPage + readonly social: SocialPage - constructor(public readonly page: Page) { - this.auth = new AuthPage(page) - this.compatibility = new ComatibilityPage(page) - this.home = new HomePage(page) - this.onboarding = new OnboardingPage(page) - this.organization = new OrganizationPage(page) - this.profile = new ProfilePage(page) - this.settings = new SettingsPage(page) - this.signUp = new SignUpPage(page) - this.social = new SocialPage(page) - } - - async deleteProfileFromSettings() { - await this.home.clickSettingsLink() - await this.settings.clickDeleteAccountButton() - await this.settings.fillDeleteAccountSurvey('Delete me') - await this.settings.clickDeleteAccountButton() - await this.home.verifyHomePageLinks() - } + constructor(public readonly page: Page) { + this.auth = new AuthPage(page) + this.compatibility = new ComatibilityPage(page) + this.home = new HomePage(page) + this.onboarding = new OnboardingPage(page) + this.organization = new OrganizationPage(page) + this.profile = new ProfilePage(page) + this.settings = new SettingsPage(page) + this.signUp = new SignUpPage(page) + this.social = new SocialPage(page) + } - async skipOnboardingHeadToProfile(account: UserAccountInformation) { - await this.onboarding.clickSkipOnboardingButton() - await this.signUp.fillDisplayName(account.display_name) - await this.signUp.fillUsername(account.username) - await this.signUp.clickNextButton() - await this.signUp.clickNextButton() - await this.profile.clickCloseButton() - await this.onboarding.clickRefineProfileButton() - } + async deleteProfileFromSettings() { + await this.home.clickSettingsLink() + await this.settings.clickDeleteAccountButton() + await this.settings.fillDeleteAccountSurvey('Delete me') + await this.settings.clickDeleteAccountButton() + await this.home.verifyHomePageLinks() + } - async registerWithEmail(account: UserAccountInformation) { - await this.home.goToRegisterPage() - await this.auth.fillEmailField(account.email) - await this.auth.fillPasswordField(account.password) - await this.auth.clickSignUpWithEmailButton() - } + async skipOnboardingHeadToProfile(account: UserAccountInformation) { + await this.onboarding.clickSkipOnboardingButton() + await this.signUp.fillDisplayName(account.display_name) + await this.signUp.fillUsername(account.username) + await this.signUp.clickNextButton() + await this.signUp.clickNextButton() + await this.profile.clickCloseButton() + await this.onboarding.clickRefineProfileButton() + } - async signinWithEmail( - accountOrEmail: UserAccountInformation | string, - password?: string, - ) { - const email = typeof accountOrEmail === 'string' ? accountOrEmail : accountOrEmail.email + async registerWithEmail(account: UserAccountInformation) { + await this.home.goToRegisterPage() + await this.auth.fillEmailField(account.email) + await this.auth.fillPasswordField(account.password) + await this.auth.clickSignUpWithEmailButton() + } - const resolvedPassword = typeof accountOrEmail === 'string' ? password : accountOrEmail.password + async signinWithEmail(accountOrEmail: UserAccountInformation | string, password?: string) { + const email = typeof accountOrEmail === 'string' ? accountOrEmail : accountOrEmail.email - if (!email || !resolvedPassword) { - throw new Error('Provide either an `account` or `email` and `password`.') - } + const resolvedPassword = typeof accountOrEmail === 'string' ? password : accountOrEmail.password - await this.home.goToSigninPage() - await this.auth.fillEmailField(email) - await this.auth.fillPasswordField(resolvedPassword) - await this.auth.clickSignInWithEmailButton() + if (!email || !resolvedPassword) { + throw new Error('Provide either an `account` or `email` and `password`.') } -} \ No newline at end of file + + await this.home.goToSigninPage() + await this.auth.fillEmailField(email) + await this.auth.fillPasswordField(resolvedPassword) + await this.auth.clickSignInWithEmailButton() + } +} diff --git a/tests/e2e/web/specs/onboardingFlow.spec.ts b/tests/e2e/web/specs/onboardingFlow.spec.ts index ffe3f288..f26d490c 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, @@ -238,10 +238,7 @@ test.describe('when given valid input', () => { await expect(dbInfo.user.username).toContain(googleAccountOne.username) }) - test('should successfully skip the onboarding flow', async ({ - app, - fakerAccount, - }) => { + test('should successfully skip the onboarding flow', async ({app, fakerAccount}) => { await app.registerWithEmail(fakerAccount) await app.skipOnboardingHeadToProfile(fakerAccount) @@ -321,10 +318,7 @@ test.describe('when given valid input', () => { }) test.describe('should successfully complete the onboarding flow after using the back button', () => { - test("the first time it's an option", async ({ - app, - fakerAccount, - }) => { + test("the first time it's an option", async ({app, fakerAccount}) => { await app.registerWithEmail(fakerAccount) await app.onboarding.clickContinueButton() await app.onboarding.clickBackButton() @@ -348,10 +342,7 @@ test.describe('when given valid input', () => { await expect(dbInfo.user.username).toContain(fakerAccount.username) }) - test("the second time it's an option", async ({ - app, - fakerAccount, - }) => { + test("the second time it's an option", async ({app, fakerAccount}) => { await app.registerWithEmail(fakerAccount) await app.onboarding.clickContinueButton() await app.onboarding.clickContinueButton() diff --git a/tests/e2e/web/specs/signIn.spec.ts b/tests/e2e/web/specs/signIn.spec.ts index 445a6601..2c602ac2 100644 --- a/tests/e2e/web/specs/signIn.spec.ts +++ b/tests/e2e/web/specs/signIn.spec.ts @@ -20,13 +20,16 @@ test.beforeAll(async () => { }) test.describe('when given valid input', () => { - test('should be able to sign in to an available account', async ({app,dev_one_account,}) => { + test('should be able to sign in to an available account', async ({app, dev_one_account}) => { await app.signinWithEmail(dev_one_account) await app.home.goToHomePage() await app.home.verifySignedInHomePage(dev_one_account.display_name) }) - test('should successfully delete an account created via email and password', async ({app,fakerAccount,}) => { + test('should successfully delete an account created via email and password', async ({ + app, + fakerAccount, + }) => { await app.registerWithEmail(fakerAccount) await app.skipOnboardingHeadToProfile(fakerAccount) diff --git a/tests/e2e/web/specs/signUp.spec.ts b/tests/e2e/web/specs/signUp.spec.ts index b2d3d85d..53562129 100644 --- a/tests/e2e/web/specs/signUp.spec.ts +++ b/tests/e2e/web/specs/signUp.spec.ts @@ -7,7 +7,7 @@ import {expect, test} from '../fixtures/base' test.describe('when an error occurs', () => { test('should disable the button "Next" when the display name field is empty', async ({ specAccount, - app + app, }) => { await app.registerWithEmail(specAccount) await app.onboarding.clickSkipOnboardingButton() @@ -19,7 +19,7 @@ test.describe('when an error occurs', () => { test('should disable the button "Next" when the username field is empty', async ({ specAccount, - app + app, }) => { await app.registerWithEmail(specAccount) await app.onboarding.clickSkipOnboardingButton()