chore: add accessibility tests for various pages including certificates, dashboard, dns providers, login, proxy hosts, and settings
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { test } from '../fixtures/a11y';
|
||||
import { waitForLoadingComplete } from '../utils/wait-helpers';
|
||||
import { expectNoA11yViolations } from '../utils/a11y-helpers';
|
||||
import { getBaselinedRuleIds } from './a11y-baseline';
|
||||
|
||||
test.describe('Accessibility: Certificates', () => {
|
||||
test.describe.configure({ mode: 'parallel' });
|
||||
|
||||
test('certificates page has no critical a11y violations', async ({ page, makeAxeBuilder }) => {
|
||||
await test.step('Navigate to certificates', async () => {
|
||||
await page.goto('/certificates');
|
||||
await waitForLoadingComplete(page);
|
||||
});
|
||||
|
||||
await test.step('Run axe accessibility scan', async () => {
|
||||
const results = await makeAxeBuilder().analyze();
|
||||
|
||||
test.info().attach('a11y-results', {
|
||||
body: JSON.stringify(results.violations, null, 2),
|
||||
contentType: 'application/json',
|
||||
});
|
||||
|
||||
expectNoA11yViolations(results, {
|
||||
knownViolations: getBaselinedRuleIds('/certificates'),
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,28 @@
|
||||
import { test } from '../fixtures/a11y';
|
||||
import { waitForLoadingComplete } from '../utils/wait-helpers';
|
||||
import { expectNoA11yViolations } from '../utils/a11y-helpers';
|
||||
import { getBaselinedRuleIds } from './a11y-baseline';
|
||||
|
||||
test.describe('Accessibility: Dashboard', () => {
|
||||
test.describe.configure({ mode: 'parallel' });
|
||||
|
||||
test('dashboard has no critical a11y violations', async ({ page, makeAxeBuilder }) => {
|
||||
await test.step('Navigate to dashboard', async () => {
|
||||
await page.goto('/');
|
||||
await waitForLoadingComplete(page);
|
||||
});
|
||||
|
||||
await test.step('Run axe accessibility scan', async () => {
|
||||
const results = await makeAxeBuilder().analyze();
|
||||
|
||||
test.info().attach('a11y-results', {
|
||||
body: JSON.stringify(results.violations, null, 2),
|
||||
contentType: 'application/json',
|
||||
});
|
||||
|
||||
expectNoA11yViolations(results, {
|
||||
knownViolations: getBaselinedRuleIds('/'),
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,28 @@
|
||||
import { test } from '../fixtures/a11y';
|
||||
import { waitForLoadingComplete } from '../utils/wait-helpers';
|
||||
import { expectNoA11yViolations } from '../utils/a11y-helpers';
|
||||
import { getBaselinedRuleIds } from './a11y-baseline';
|
||||
|
||||
test.describe('Accessibility: DNS Providers', () => {
|
||||
test.describe.configure({ mode: 'parallel' });
|
||||
|
||||
test('DNS providers page has no critical a11y violations', async ({ page, makeAxeBuilder }) => {
|
||||
await test.step('Navigate to DNS providers', async () => {
|
||||
await page.goto('/dns/providers');
|
||||
await waitForLoadingComplete(page);
|
||||
});
|
||||
|
||||
await test.step('Run axe accessibility scan', async () => {
|
||||
const results = await makeAxeBuilder().analyze();
|
||||
|
||||
test.info().attach('a11y-results', {
|
||||
body: JSON.stringify(results.violations, null, 2),
|
||||
contentType: 'application/json',
|
||||
});
|
||||
|
||||
expectNoA11yViolations(results, {
|
||||
knownViolations: getBaselinedRuleIds('/dns/providers'),
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,30 @@
|
||||
import { test } from '../fixtures/a11y';
|
||||
import { waitForLoadingComplete } from '../utils/wait-helpers';
|
||||
import { expectNoA11yViolations } from '../utils/a11y-helpers';
|
||||
import { getBaselinedRuleIds } from './a11y-baseline';
|
||||
|
||||
test.use({ storageState: { cookies: [], origins: [] } });
|
||||
|
||||
test.describe('Accessibility: Login', () => {
|
||||
test.describe.configure({ mode: 'parallel' });
|
||||
|
||||
test('login page has no critical a11y violations', async ({ page, makeAxeBuilder }) => {
|
||||
await test.step('Navigate to login page', async () => {
|
||||
await page.goto('/login');
|
||||
await waitForLoadingComplete(page);
|
||||
});
|
||||
|
||||
await test.step('Run axe accessibility scan', async () => {
|
||||
const results = await makeAxeBuilder().analyze();
|
||||
|
||||
test.info().attach('a11y-results', {
|
||||
body: JSON.stringify(results.violations, null, 2),
|
||||
contentType: 'application/json',
|
||||
});
|
||||
|
||||
expectNoA11yViolations(results, {
|
||||
knownViolations: getBaselinedRuleIds('/login'),
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,28 @@
|
||||
import { test } from '../fixtures/a11y';
|
||||
import { waitForLoadingComplete } from '../utils/wait-helpers';
|
||||
import { expectNoA11yViolations } from '../utils/a11y-helpers';
|
||||
import { getBaselinedRuleIds } from './a11y-baseline';
|
||||
|
||||
test.describe('Accessibility: Proxy Hosts', () => {
|
||||
test.describe.configure({ mode: 'parallel' });
|
||||
|
||||
test('proxy hosts page has no critical a11y violations', async ({ page, makeAxeBuilder }) => {
|
||||
await test.step('Navigate to proxy hosts', async () => {
|
||||
await page.goto('/proxy-hosts');
|
||||
await waitForLoadingComplete(page);
|
||||
});
|
||||
|
||||
await test.step('Run axe accessibility scan', async () => {
|
||||
const results = await makeAxeBuilder().analyze();
|
||||
|
||||
test.info().attach('a11y-results', {
|
||||
body: JSON.stringify(results.violations, null, 2),
|
||||
contentType: 'application/json',
|
||||
});
|
||||
|
||||
expectNoA11yViolations(results, {
|
||||
knownViolations: getBaselinedRuleIds('/proxy-hosts'),
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,48 @@
|
||||
import { test } from '../fixtures/a11y';
|
||||
import { waitForLoadingComplete } from '../utils/wait-helpers';
|
||||
import { expectNoA11yViolations } from '../utils/a11y-helpers';
|
||||
import { getBaselinedRuleIds } from './a11y-baseline';
|
||||
|
||||
test.describe('Accessibility: Settings', () => {
|
||||
test.describe.configure({ mode: 'parallel' });
|
||||
|
||||
test('settings page has no critical a11y violations', async ({ page, makeAxeBuilder }) => {
|
||||
await test.step('Navigate to settings', async () => {
|
||||
await page.goto('/settings');
|
||||
await waitForLoadingComplete(page);
|
||||
});
|
||||
|
||||
await test.step('Run axe accessibility scan', async () => {
|
||||
const results = await makeAxeBuilder().analyze();
|
||||
|
||||
test.info().attach('a11y-results', {
|
||||
body: JSON.stringify(results.violations, null, 2),
|
||||
contentType: 'application/json',
|
||||
});
|
||||
|
||||
expectNoA11yViolations(results, {
|
||||
knownViolations: getBaselinedRuleIds('/settings'),
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('users page has no critical a11y violations', async ({ page, makeAxeBuilder }) => {
|
||||
await test.step('Navigate to users', async () => {
|
||||
await page.goto('/settings/users');
|
||||
await waitForLoadingComplete(page);
|
||||
});
|
||||
|
||||
await test.step('Run axe accessibility scan', async () => {
|
||||
const results = await makeAxeBuilder().analyze();
|
||||
|
||||
test.info().attach('a11y-results', {
|
||||
body: JSON.stringify(results.violations, null, 2),
|
||||
contentType: 'application/json',
|
||||
});
|
||||
|
||||
expectNoA11yViolations(results, {
|
||||
knownViolations: getBaselinedRuleIds('/settings/users'),
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user