Reorganize repo structure and standards references
This commit is contained in:
1 parent
3cb93a81be
commit
be2054274d
5885 files changed
+2588
-195
No files matched your search
+56
@@ -0,0 +1,56 @@
|
||||
import { expect, test } from "./utils/test";
|
||||
import { expectNoCriticalA11yViolations } from "./utils/axe";
|
||||
import { getTenantCredentials, loginAsTenantUser, tenantSettingsLogEventsPath, tenantSettingsLogsPath } from "./utils/auth";
|
||||
import { compactMobileViewport, expectNoHorizontalOverflow, narrowMobileViewport } from "./utils/mobile";
|
||||
import { escapeRegExp, skipIfUnavailable } from "./utils/navigation";
|
||||
import { skipOrFailWhenE2eFixtureMissing, skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
|
||||
const credentials = getTenantCredentials();
|
||||
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH;
|
||||
const logsPath = process.env.E2E_TENANT_LOGS_PATH ?? (dashboardPath ? tenantSettingsLogsPath(dashboardPath) : undefined);
|
||||
const logEventsPath = process.env.E2E_TENANT_LOG_EVENTS_PATH ?? (dashboardPath ? tenantSettingsLogEventsPath(dashboardPath) : undefined);
|
||||
|
||||
test.describe("tenant audit logs mobile a11y", () => {
|
||||
test.use({ isMobile: true, hasTouch: true });
|
||||
|
||||
test.beforeEach(() => {
|
||||
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD", "E2E_TENANT_DASHBOARD_PATH"], "Tenant audit logs E2E inputs not configured");
|
||||
if (!logsPath || !logEventsPath) {
|
||||
skipOrFailWhenE2eFixtureMissing("Tenant audit logs paths could not be derived; set E2E_TENANT_LOGS_PATH and E2E_TENANT_LOG_EVENTS_PATH");
|
||||
}
|
||||
});
|
||||
|
||||
for (const viewport of [narrowMobileViewport, compactMobileViewport]) {
|
||||
test(`keeps audit logs usable at ${viewport.width}px`, async ({ page }) => {
|
||||
await page.setViewportSize(viewport);
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const response = await page.goto(logsPath!, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, `Tenant audit logs path ${logsPath}`);
|
||||
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(logsPath!)}(?:[?#].*)?$`, "u"));
|
||||
await expect(page.locator('[data-ui-id="ui.settings.logs.page"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.logs.tabs"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.logs.filters"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.logs.table"]').first()).toBeVisible();
|
||||
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
});
|
||||
}
|
||||
|
||||
test("keeps audit event filters and table reachable on mobile", async ({ page }) => {
|
||||
await page.setViewportSize(narrowMobileViewport);
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const response = await page.goto(logEventsPath!, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, `Tenant audit events path ${logEventsPath}`);
|
||||
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(logEventsPath!)}(?:[?#].*)?$`, "u"));
|
||||
await expect(page.locator('[data-ui-id="ui.settings.logs.events.page"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.logs.tabs"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.logs.filters"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.logs.events.table"]').first()).toBeVisible();
|
||||
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user