feat(admin): E2E content/system mock-сьюты, row testids, IFT smoke. Refs EventHub/EventHubFrontAdmin#33 #37 #38 #39

This commit is contained in:
2026-07-14 22:44:22 +03:00
parent a3468518b3
commit 836e4a7eea
23 changed files with 831 additions and 223 deletions
+59
View File
@@ -0,0 +1,59 @@
import { test, expect } from '@playwright/test';
import { seedAuthenticatedSession } from '../helpers/session';
test.describe('system / overview (mock)', () => {
test.beforeEach(async ({ page }) => {
await seedAuthenticatedSession(page);
});
test('admins: список, create dialog, detail', async ({ page }) => {
await page.goto('/admins');
await expect(page.getByTestId('page-admins')).toBeVisible();
await expect(page.getByTestId('row-admin-e2e-2')).toBeVisible();
await page.getByTestId('btn-create-admin').click();
await expect(page.getByTestId('dialog-create-admin')).toBeVisible();
await page.goto('/admins/admin-e2e-2');
await expect(page.getByTestId('page-admin-detail')).toBeVisible();
await expect(page.getByTestId('btn-edit-admin')).toBeVisible();
});
test('audit: страница и фильтры', async ({ page }) => {
await page.goto('/audit');
await expect(page.getByTestId('page-audit')).toBeVisible();
await expect(page.getByTestId('filter-audit')).toBeVisible();
await expect(page.getByTestId('row-audit-e2e-1')).toBeVisible();
});
test('monitoring: страница и range', async ({ page }) => {
await page.goto('/monitoring');
await expect(page.getByTestId('page-monitoring')).toBeVisible();
await page.getByTestId('filter-monitoring-range-30').click();
await expect(page.getByTestId('filter-monitoring-range-30')).toBeVisible();
});
test('profile: view и edit', async ({ page }) => {
await page.goto('/profile');
await expect(page.getByTestId('page-profile')).toBeVisible();
await page.getByTestId('btn-edit-profile').click();
await expect(page.getByTestId('btn-save-profile')).toBeVisible();
await page.getByTestId('btn-cancel-profile').click();
await expect(page.getByTestId('btn-edit-profile')).toBeVisible();
});
test('dashboard остаётся доступен', async ({ page }) => {
await page.goto('/dashboard');
await expect(page.getByTestId('page-dashboard')).toBeVisible();
});
});
test.describe('i18n (mock)', () => {
test('переключение языка через меню', async ({ page }) => {
await seedAuthenticatedSession(page);
await page.goto('/dashboard');
await page.getByTestId('menu-user').click();
await page.getByTestId('lang-en').click();
// profile language mutation returns user with language=en; menu stays open or reopens
await page.getByTestId('menu-user').click().catch(() => undefined);
await expect(page.getByTestId('lang-en')).toBeVisible();
});
});