test: e2e cypress testing replaced by playwright

This commit is contained in:
2025-09-16 13:27:53 +02:00
parent 7ebffe9655
commit dc4948e45b
35 changed files with 302 additions and 4440 deletions

View File

@@ -0,0 +1,31 @@
import { test, expect } from '@playwright/test';
import { describe } from 'node:test';
describe("Login form", () => {
test('has title', async ({ page }) => {
await page.goto('http://localhost:3016/');
await expect(page.getByRole("heading", { name: /Welcome/ })).toBeVisible();
});
test('has login form', async ({ page }) => {
await page.goto('http://localhost:3016/');
const name_input = page.getByRole("textbox", { name: "username" });
const password_input = page.getByRole("textbox", { name: "username" });
await expect(page.getByTestId("login-form")).toBeVisible();
await expect(name_input).toBeVisible();
await expect(password_input).toBeVisible();
});
test("log in form displays error if credentials are wrogn", async ({ page }) => {
await page.goto('http://localhost:3016/');
await page.getByRole("textbox", { name: "username" }).fill("Test_User");
await page.getByRole("textbox", { name: "password" }).fill("Test_Passwd");
const button_element = page.getByRole("button", { name: /Log-in/ })
button_element.click();
await expect(page.getByText(/^Wrong credentials.*$/)).toBeVisible();
})
});