Files
Compass/tests/e2e/web/pages/AuthPage.ts
Okechi Jones-Williams cfeab0278c [Housekeeping] Organizing the test structure and files, adding fix for issue #36 (None descriptive error) (#38)
* Added Database checks to the onboarding flow

* Added compatibility page setup
Added more compatibility questions

* 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

* Fix: Added 'tsconfig-paths/register' to playwright config so it applies tsconfig/ts-node to test files and imported modules....there was a syntax error:

SyntaxError: tests/e2e/web/pages/homePage.ts: Unexpected token (2:0)

* .

* Updated ProfilePage: In some cases removed the use of "one shot grabs" using .textContent() to prevent flaky tests
Added test for entering profile information post signup flow

* Linting and Prettier

* Fix: Merge conflict

* Fix: Modified sortedAndFilteredAnswers to use "UseMemo" so that it doesnt run every time something changes

* .

* .

* Merged "verifyInterestedInConnectingWith" and "verifyRelationShipTypeAndInterest" into "verifySeeking" to match ui changes

* Added error message outlining the minimum character requirement for display names and usernames

* Updated displayName error message to show when editing the user profile post signup

* 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

* Linting and Prettier

* Minor cleaning

* Organizing helper func

* Linting and Prettier

---------

Co-authored-by: MartinBraquet <martin.braquet@gmail.com>
2026-03-16 16:02:48 +01:00

58 lines
1.9 KiB
TypeScript

import {expect, Locator, Page} from '@playwright/test'
//sets up of all the functions that signin tests will use.
export class AuthPage {
private readonly signInLink: Locator
private readonly signUpButton: Locator
private readonly emailField: Locator
private readonly passwordField: Locator
private readonly signInWithEmailButton: Locator
private readonly signInWithGoogleButton: Locator
private readonly signUpWithEmailButton: Locator
constructor(public readonly page: Page) {
this.signInLink = page.getByRole('link', {name: 'Sign in'})
this.signUpButton = page.getByRole('button', {name: 'Sign up'})
this.emailField = page.getByLabel('Email')
this.passwordField = page.getByLabel('Password')
this.signInWithEmailButton = page.getByRole('button', {name: 'Sign in with Email'})
this.signInWithGoogleButton = page.getByRole('button', {name: 'Google'})
this.signUpWithEmailButton = page.getByRole('button', {name: 'Sign up with Email'})
}
async clickSignInLink() {
await expect(this.signInLink).toBeVisible()
await this.signInLink.click()
}
async clickSignUpButton() {
await expect(this.signUpButton).toBeVisible()
await this.signUpButton.click()
}
async clickSignInWithEmailButton() {
await expect(this.signInWithEmailButton).toBeVisible()
await this.signInWithEmailButton.click()
}
async clickSignInWithGoogleButton() {
await expect(this.signInWithGoogleButton).toBeVisible()
await this.signInWithGoogleButton.click()
}
async clickSignUpWithEmailButton() {
await expect(this.signUpWithEmailButton).toBeVisible()
await this.signUpWithEmailButton.click()
}
async fillEmailField(email: string) {
await expect(this.emailField).toBeVisible()
await this.emailField.fill(email)
}
async fillPasswordField(password: string) {
await expect(this.passwordField).toBeVisible()
await this.passwordField.fill(password)
}
}