feat: add frontend e2e coverage

This commit is contained in:
a.tolmachev
2026-04-05 22:22:44 +03:00
parent d33c52d51d
commit 0bd47d9944
18 changed files with 623 additions and 7 deletions
+19
View File
@@ -0,0 +1,19 @@
const { test, expect } = require('@playwright/test');
const { ADMIN_EMAIL, ADMIN_PASSWORD, localized } = require('./helpers');
test('login page rejects invalid credentials', async ({ page }) => {
await page.goto('/login');
await page.locator('#email').fill(ADMIN_EMAIL);
await page.locator('#password').fill('wrong-password');
await page.locator('.btn-signin').click();
await expect(page.locator('#login-error')).toBeVisible();
});
test('login page signs in and redirects to operations', async ({ page }) => {
await page.goto('/login');
await page.locator('#email').fill(ADMIN_EMAIL);
await page.locator('#password').fill(ADMIN_PASSWORD);
await page.locator('.btn-signin').click();
await expect(page).toHaveURL(/\/$/);
await expect(page.locator('.page-title, .page-heading').first()).toHaveText(localized('Operations', 'Операции'));
});