feat: login e2e spec improved by testing login

This commit is contained in:
2025-09-16 20:07:11 +02:00
parent dc4948e45b
commit 3f2c7c1d4a
2 changed files with 13 additions and 2 deletions

View File

@@ -28,4 +28,15 @@ describe("Login form", () => {
await expect(page.getByText(/^Wrong credentials.*$/)).toBeVisible();
})
test("log in redirects to another page if credentials are correct", async ({ page }) => {
await page.goto('http://localhost:3016/');
await page.getByRole("textbox", { name: "username" }).fill("dqnid");
await page.getByRole("textbox", { name: "password" }).fill("1234");
const button_element = page.getByRole("button", { name: /Log-in/ })
button_element.click();
await expect(page.getByAltText("Main logo")).toBeVisible();
})
});