🐛 Display error message on register form (#6797)

This commit is contained in:
Juanfran 2025-06-27 10:01:54 +02:00 committed by GitHub
parent daca26e54f
commit 24e78e6a10
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 70 additions and 2 deletions

View file

@ -0,0 +1,35 @@
import { BasePage } from "./BasePage";
export class RegisterPage extends BasePage {
constructor(page) {
super(page);
this.registerButton = page.getByRole("button", { name: "Create an account" });
this.password = page.getByLabel("Password");
this.email = page.getByLabel("Work email");
this.fullName = page.getByLabel("Full name");
}
async fillRegisterFormInputs(name, email, password) {
await this.fullName.fill(name);
await this.email.fill(email);
await this.password.fill(password);
}
async clickRegisterButton() {
await this.registerButton.click();
}
async setupMismatchedEmailError() {
await this.mockRPC(
"prepare-register-profile",
"register/prepare-register-profile-email-mismatch.json",
{ status: 400 },
);
}
static async initWithLoggedOutUser(page) {
await this.mockRPC(page, "get-profile", "get-profile-anonymous.json");
}
}
export default RegisterPage;