-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
e2e: the accessibility tests now cover the logged in page too.
- Loading branch information
Showing
9 changed files
with
105 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { expect, type Page } from "@playwright/test"; | ||
import { switchBar } from "lib/e2e/switchBar"; | ||
|
||
export async function login(page: Page, { email, pass }: { email: string; pass: string }) { | ||
await page.goto("./"); | ||
await expect(page).toHaveTitle(/WordBook - Internet redefined/); | ||
await expect(page.getByText(/WordBook - the Internet redefined/i)).toBeVisible(); | ||
await switchBar(page); | ||
const loc = page.getByText(/Log in/i).filter({ hasNotText: /account/ }); | ||
await expect(loc).toBeVisible(); | ||
await loc.click(); | ||
await expect(page).toHaveTitle(/WordBook \| Log in to WordBook/); | ||
await (await page.$("#email"))?.fill(email); | ||
await (await page.$("#password"))?.fill(pass); | ||
await page.getByText(/submit/i).click(); | ||
await expect(page.locator(".w-md-editor")).toBeVisible(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { expect, type Page } from "@playwright/test"; | ||
|
||
export async function signup(page: Page, { email, name, pass }: { email: string; name: string; pass: string }) { | ||
await page.goto("./"); | ||
await expect(page).toHaveTitle(/WordBook - Internet redefined/); | ||
await expect(page.getByText(/Sign up/)).toBeVisible(); | ||
await page.getByText(/Sign up/).click(); | ||
await expect(page).toHaveTitle(/WordBook \| Sign up to WordBook/); | ||
await (await page.$("#email"))?.fill(email); | ||
await page.getByText("2").click(); | ||
await (await page.$("#name"))?.fill(name); | ||
await page.getByText("3").click(); | ||
await (await page.$("#pass"))?.fill(pass); | ||
await (await page.$("#rpass"))?.fill(pass); | ||
await page.getByText("4").click(); | ||
await page.getByText(/submit/i).click(); | ||
await expect(page.getByText(/account created/i)).toBeVisible(); | ||
} |