forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiBc35a83aBurak Boduroğlu4 months ago440 commits

auth-shell.spec.ts24 lines, 1.2 KiBHistoryRawDownload
1import { expect, test } from "@playwright/test";
2
3const username = process.env.E2E_ADMIN_USERNAME ?? "admin";
4const password = process.env.E2E_ADMIN_PASSWORD ?? "admin123";
5
6test("sign-in reaches the authenticated shell with keyboard-accessible navigation", async ({ page }) => {
7 await page.goto("/login");
8 await expect(page.locator("#login-username")).toBeVisible();
9 await page.locator("#login-username").fill(username);
10 await page.locator("#login-password").fill(password);
11 await page.locator("form").getByRole("button", { name: /log in|sign in|giriş yap/i }).click();
12
13 await expect(page).toHaveURL(/\/$/);
14 await expect(page.getByRole("main")).toBeVisible();
15
16 // The mobile tab bar is absent on desktop but must be reachable and named on
17 // a touch viewport. This catches accidental removal of its accessible nav.
18 if (test.info().project.name === "mobile") {
19 const navigation = page.getByRole("navigation", { name: /menu|menü/i });
20 await expect(navigation).toBeVisible();
21 await navigation.getByRole("button", { name: /account|hesap/i }).focus();
22 await expect(navigation.getByRole("button", { name: /account|hesap/i })).toBeFocused();
23 }
24});