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