fix(e2e): интеграционные тесты на стендах без mocks.
CI / test (push) Has been cancelled
CI / push-image (push) Has been cancelled
CI / ci-done (push) Has been cancelled

ift-ui/stage-ui гоняют stand/integration против живого API; mock-suite остаётся в CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-16 14:11:54 +03:00
parent d200260497
commit 7bd186eace
7 changed files with 109 additions and 28 deletions
+51
View File
@@ -0,0 +1,51 @@
import { test, expect } from '@playwright/test';
import { hasStandCredentials, loginAsStandAdmin } from '../../helpers/standAuth';
/**
* Интеграция UI ↔ admin-api на IFT/stage после деплоя.
* Без page.route mocks — только живой SPA и API стенда.
*/
test.describe('stand integration (live API)', () => {
test.skip(!hasStandCredentials(), 'SMOKE_ADMIN_* / ADMIN_SUPER_* from stand .env required');
test.beforeEach(async ({ page }) => {
await loginAsStandAdmin(page);
});
test('dashboard после login', async ({ page }) => {
await expect(page.getByTestId('page-dashboard')).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.getByText(/Ошибка отображения|Minified React error/i)).toHaveCount(0);
await expect(page.locator('[data-testid="page-audit"] table tbody tr').first()).toBeVisible({
timeout: 20_000,
});
});
test('users: список загружается', async ({ page }) => {
await page.goto('/users');
await expect(page.getByTestId('page-users')).toBeVisible();
await expect(page.getByText(/Ошибка отображения|Minified React error/i)).toHaveCount(0);
});
test('admins: superadmin видит список', async ({ page }) => {
await page.goto('/admins');
await expect(page.getByTestId('page-admins')).toBeVisible();
await expect(page.getByTestId('page-forbidden')).toHaveCount(0);
});
test('monitoring: страница загружается', async ({ page }) => {
await page.goto('/monitoring');
await expect(page.getByTestId('page-monitoring')).toBeVisible();
});
test('logout', async ({ page }) => {
await page.getByTestId('menu-user').click();
await page.getByTestId('btn-logout').click();
await expect(page.getByTestId('page-login')).toBeVisible();
});
});