feature/IO-3181-Test-Framework-Selection - Skeletons complete
This commit is contained in:
28
client/tests/e2e/signin.e2e.js
Normal file
28
client/tests/e2e/signin.e2e.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import { test, expect } from "@playwright/test";
|
||||
import { login } from "./utils/login";
|
||||
|
||||
test.describe("SignInComponent", () => {
|
||||
test("successfully logs in with valid credentials", async ({ page }) => {
|
||||
const email = "dave@imex.dev";
|
||||
const password = "dave123";
|
||||
|
||||
await login(page, { email, password });
|
||||
|
||||
// Additional assertions after login (optional)
|
||||
await expect(page).toHaveURL(/\/manage\//);
|
||||
});
|
||||
|
||||
test("displays error on invalid credentials", async ({ page }) => {
|
||||
await page.goto("/"); // Adjust if login route differs
|
||||
|
||||
// Fill form with invalid credentials
|
||||
await page.fill('input[placeholder="Username"]', "wronguser@example.com");
|
||||
await page.fill('input[placeholder="Password"]', "wrongpassword");
|
||||
await page.click("button.login-btn");
|
||||
|
||||
// Check for error alert
|
||||
const alert = page.locator(".ant-alert-error");
|
||||
await expect(alert).toBeVisible();
|
||||
await expect(alert).toContainText("A user with this email does not exist.");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user