Files
Compass/tests/e2e/web/pages/AuthPage.ts
Nicholas Chamberlain ef7665c7da Add firebase emulator, Add registration script, Add signup spec (#22)
* add firebase emulator, add registration script, add signup spec

* Upgrade firebase emulator and make it pass the E2E tests

---------

Co-authored-by: MartinBraquet <martin.braquet@gmail.com>
2025-12-06 23:43:46 +01:00

55 lines
1.6 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 this.signInLink.click();
}
async clickSignUpButton() {
await this.signUpButton.click();
}
async clickSignInWithEmailButton() {
await this.signInWithEmailButton.click();
}
async clickSignInWithGoogleButton() {
await this.signInWithGoogleButton.click();
}
async clickSignUpWithEmailButton() {
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);
}
}