1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-31 00:33:33 +00:00

Fix registration test

This commit is contained in:
Matt Gibson
2026-01-26 16:56:08 -08:00
parent ab8d2b05d1
commit 1d551501b7

View File

@@ -1,14 +1,16 @@
import { expect } from "@playwright/test";
import { Play, test } from "@bitwarden/playwright-helpers";
import { Play, test, expectUnlockedAs } from "@bitwarden/playwright-helpers";
test("registration", async ({ page }) => {
const name = "John Doe";
test.only("test", async ({ page }) => {
await page.goto("https://localhost:8080/#/signup");
await page
.getByRole("textbox", { name: "Email address (required)" })
.fill(Play.mangleEmail("create@test.com"));
await page.getByRole("textbox", { name: "Name" }).fill("John Doe");
await page.getByRole("textbox", { name: "Name" }).fill(name);
await page.getByRole("button", { name: "Continue" }).click();
await page
.getByRole("textbox", { name: "Master password (required)", exact: true })
@@ -26,10 +28,14 @@ test.only("test", async ({ page }) => {
await page.getByRole("checkbox", { name: "Check known data breaches for" }).uncheck();
await page.getByRole("button", { name: "Create account" }).click();
await expect(page.locator("#bit-dialog-title-0")).toContainText(
"Weak password identified. Use a strong password to protect your account. Are you sure you want to use a weak password?",
);
await expect(page.locator("#bit-dialog-title-0")).toContainText("Weak master password");
await page.getByRole("button", { name: "Yes" }).click();
await page.getByRole("button", { name: "Add it later" }).click();
await page.getByRole("link", { name: "Skip to web app" }).click();
// continue through welcome screen
await page.getByRole("button", { name: "Continue without upgrading" }).click();
// assert our user is created
await expectUnlockedAs(name, page);
});