RecreationBench / web /breezel.example /tests /static /structure.scripted.spec.ts
VoyagerXHF's picture
Upload folder using huggingface_hub (part 21)
98a0e53 verified
Raw History Blame Contribute Delete
135 kB
import { test, expect } from '@playwright/test';
test.describe('Structural - homepage', () => {
test('homepage: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('homepage: heading hierarchy is valid', async ({ page }) => {
await page.goto('/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('homepage: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - blog', () => {
test('blog: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/blog/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('blog: heading hierarchy is valid', async ({ page }) => {
await page.goto('/blog/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('blog: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/blog/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - brand', () => {
test('brand: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/brand/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('brand: heading hierarchy is valid', async ({ page }) => {
await page.goto('/brand/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('brand: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/brand/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - build_uis_that_dont_suck', () => {
test('build_uis_that_dont_suck: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/build-uis-that-dont-suck/');
expect(await page.locator('header, [role="banner"]').first().count(), 'header landmark present in GT').toBeGreaterThan(0);
expect(await page.locator('main, [role="main"]').first().count(), 'main landmark present in GT').toBeGreaterThan(0);
});
test('build_uis_that_dont_suck: heading hierarchy is valid', async ({ page }) => {
await page.goto('/build-uis-that-dont-suck/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('build_uis_that_dont_suck: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/build-uis-that-dont-suck/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs', () => {
test('docs: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - plus', () => {
test('plus: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/plus/');
expect(await page.locator('header, [role="banner"]').first().count(), 'header landmark present in GT').toBeGreaterThan(0);
expect(await page.locator('main, [role="main"]').first().count(), 'main landmark present in GT').toBeGreaterThan(0);
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('plus: heading hierarchy is valid', async ({ page }) => {
await page.goto('/plus/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('plus: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/plus/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - plus_templates', () => {
test('plus_templates: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/plus/templates/');
expect(await page.locator('header, [role="banner"]').first().count(), 'header landmark present in GT').toBeGreaterThan(0);
expect(await page.locator('main, [role="main"]').first().count(), 'main landmark present in GT').toBeGreaterThan(0);
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('plus_templates: heading hierarchy is valid', async ({ page }) => {
await page.goto('/plus/templates/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
});
test.describe('Structural - plus_ui_blocks', () => {
test('plus_ui_blocks: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/plus/ui-blocks/');
expect(await page.locator('header, [role="banner"]').first().count(), 'header landmark present in GT').toBeGreaterThan(0);
expect(await page.locator('main, [role="main"]').first().count(), 'main landmark present in GT').toBeGreaterThan(0);
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('plus_ui_blocks: heading hierarchy is valid', async ({ page }) => {
await page.goto('/plus/ui-blocks/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('plus_ui_blocks: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/plus/ui-blocks/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - plus_ui_kit', () => {
test('plus_ui_kit: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/plus/ui-kit/');
expect(await page.locator('header, [role="banner"]').first().count(), 'header landmark present in GT').toBeGreaterThan(0);
expect(await page.locator('main, [role="main"]').first().count(), 'main landmark present in GT').toBeGreaterThan(0);
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('plus_ui_kit: heading hierarchy is valid', async ({ page }) => {
await page.goto('/plus/ui-kit/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('plus_ui_kit: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/plus/ui-kit/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - showcase', () => {
test('showcase: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/showcase/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('showcase: heading hierarchy is valid', async ({ page }) => {
await page.goto('/showcase/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('showcase: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/showcase/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - sponsor', () => {
test('sponsor: heading hierarchy is valid', async ({ page }) => {
await page.goto('/sponsor/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('sponsor: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/sponsor/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_accent_color', () => {
test('docs_accent_color: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/accent-color/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_accent_color: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/accent-color/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_accent_color: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/accent-color/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_adding_custom_styles', () => {
test('docs_adding_custom_styles: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/adding-custom-styles/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_adding_custom_styles: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/adding-custom-styles/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_adding_custom_styles: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/adding-custom-styles/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_align_content', () => {
test('docs_align_content: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/align-content/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_align_content: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/align-content/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_align_content: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/align-content/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_animation', () => {
test('docs_animation: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/animation/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_animation: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/animation/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_animation: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/animation/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_appearance', () => {
test('docs_appearance: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/appearance/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_appearance: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/appearance/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_appearance: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/appearance/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_backface_visibility', () => {
test('docs_backface_visibility: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/backface-visibility/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_backface_visibility: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/backface-visibility/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_backface_visibility: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/backface-visibility/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_background_attachment', () => {
test('docs_background_attachment: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/background-attachment/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_background_attachment: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/background-attachment/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_background_attachment: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/background-attachment/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_background_blend_mode', () => {
test('docs_background_blend_mode: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/background-blend-mode/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_background_blend_mode: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/background-blend-mode/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_background_blend_mode: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/background-blend-mode/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_background_clip', () => {
test('docs_background_clip: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/background-clip/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_background_clip: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/background-clip/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_background_clip: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/background-clip/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_background_color', () => {
test('docs_background_color: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/background-color/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_background_color: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/background-color/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_background_color: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/background-color/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_background_image', () => {
test('docs_background_image: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/background-image/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_background_image: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/background-image/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_background_image: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/background-image/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_background_origin', () => {
test('docs_background_origin: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/background-origin/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_background_origin: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/background-origin/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_background_origin: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/background-origin/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_background_repeat', () => {
test('docs_background_repeat: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/background-repeat/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_background_repeat: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/background-repeat/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_background_repeat: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/background-repeat/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_background_size', () => {
test('docs_background_size: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/background-size/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_background_size: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/background-size/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_background_size: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/background-size/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_block_size', () => {
test('docs_block_size: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/block-size/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_block_size: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/block-size/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_block_size: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/block-size/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_border_collapse', () => {
test('docs_border_collapse: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/border-collapse/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_border_collapse: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/border-collapse/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_border_collapse: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/border-collapse/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_border_color', () => {
test('docs_border_color: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/border-color/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_border_color: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/border-color/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_border_color: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/border-color/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_border_radius', () => {
test('docs_border_radius: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/border-radius/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_border_radius: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/border-radius/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_border_radius: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/border-radius/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_border_spacing', () => {
test('docs_border_spacing: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/border-spacing/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_border_spacing: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/border-spacing/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_border_spacing: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/border-spacing/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_border_style', () => {
test('docs_border_style: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/border-style/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_border_style: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/border-style/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_border_style: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/border-style/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_border_width', () => {
test('docs_border_width: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/border-width/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_border_width: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/border-width/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_border_width: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/border-width/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_box_decoration_break', () => {
test('docs_box_decoration_break: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/box-decoration-break/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_box_decoration_break: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/box-decoration-break/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_box_decoration_break: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/box-decoration-break/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_box_shadow', () => {
test('docs_box_shadow: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/box-shadow/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_box_shadow: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/box-shadow/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_box_shadow: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/box-shadow/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_box_sizing', () => {
test('docs_box_sizing: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/box-sizing/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_box_sizing: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/box-sizing/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_box_sizing: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/box-sizing/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_break_after', () => {
test('docs_break_after: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/break-after/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_break_after: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/break-after/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_break_after: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/break-after/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_break_before', () => {
test('docs_break_before: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/break-before/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_break_before: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/break-before/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_break_before: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/break-before/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_break_inside', () => {
test('docs_break_inside: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/break-inside/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_break_inside: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/break-inside/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_break_inside: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/break-inside/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_caption_side', () => {
test('docs_caption_side: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/caption-side/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_caption_side: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/caption-side/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_caption_side: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/caption-side/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_caret_color', () => {
test('docs_caret_color: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/caret-color/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_caret_color: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/caret-color/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_caret_color: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/caret-color/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_color', () => {
test('docs_color: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/color/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_color: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/color/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_color: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/color/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_color_scheme', () => {
test('docs_color_scheme: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/color-scheme/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_color_scheme: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/color-scheme/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_color_scheme: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/color-scheme/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_colors', () => {
test('docs_colors: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/colors/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_colors: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/colors/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_colors: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/colors/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_compatibility', () => {
test('docs_compatibility: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/compatibility/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_compatibility: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/compatibility/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_compatibility: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/compatibility/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_content', () => {
test('docs_content: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/content/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_content: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/content/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_content: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/content/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_cursor', () => {
test('docs_cursor: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/cursor/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_cursor: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/cursor/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_cursor: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/cursor/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_dark_mode', () => {
test('docs_dark_mode: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/dark-mode/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_dark_mode: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/dark-mode/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_dark_mode: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/dark-mode/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_detecting_classes_in_source_files', () => {
test('docs_detecting_classes_in_source_files: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/detecting-classes-in-source-files/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_detecting_classes_in_source_files: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/detecting-classes-in-source-files/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_detecting_classes_in_source_files: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/detecting-classes-in-source-files/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_editor_setup', () => {
test('docs_editor_setup: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/editor-setup/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_editor_setup: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/editor-setup/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_editor_setup: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/editor-setup/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_field_sizing', () => {
test('docs_field_sizing: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/field-sizing/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_field_sizing: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/field-sizing/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_field_sizing: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/field-sizing/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_filter_drop_shadow', () => {
test('docs_filter_drop_shadow: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/filter-drop-shadow/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_filter_drop_shadow: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/filter-drop-shadow/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_filter_drop_shadow: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/filter-drop-shadow/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_flex', () => {
test('docs_flex: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/flex/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_flex: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/flex/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_flex: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/flex/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_flex_basis', () => {
test('docs_flex_basis: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/flex-basis/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_flex_basis: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/flex-basis/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_flex_basis: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/flex-basis/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_flex_direction', () => {
test('docs_flex_direction: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/flex-direction/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_flex_direction: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/flex-direction/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_flex_direction: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/flex-direction/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_flex_grow', () => {
test('docs_flex_grow: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/flex-grow/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_flex_grow: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/flex-grow/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_flex_grow: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/flex-grow/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_flex_shrink', () => {
test('docs_flex_shrink: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/flex-shrink/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_flex_shrink: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/flex-shrink/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_flex_shrink: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/flex-shrink/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_flex_wrap', () => {
test('docs_flex_wrap: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/flex-wrap/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_flex_wrap: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/flex-wrap/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_flex_wrap: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/flex-wrap/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_font_family', () => {
test('docs_font_family: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/font-family/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_font_family: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/font-family/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_font_family: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/font-family/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_font_feature_settings', () => {
test('docs_font_feature_settings: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/font-feature-settings/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_font_feature_settings: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/font-feature-settings/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_font_feature_settings: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/font-feature-settings/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_font_size', () => {
test('docs_font_size: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/font-size/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_font_size: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/font-size/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_font_size: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/font-size/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_font_smoothing', () => {
test('docs_font_smoothing: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/font-smoothing/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_font_smoothing: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/font-smoothing/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_font_smoothing: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/font-smoothing/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_font_stretch', () => {
test('docs_font_stretch: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/font-stretch/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_font_stretch: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/font-stretch/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_font_stretch: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/font-stretch/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_font_style', () => {
test('docs_font_style: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/font-style/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_font_style: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/font-style/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_font_style: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/font-style/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_font_variant_numeric', () => {
test('docs_font_variant_numeric: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/font-variant-numeric/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_font_variant_numeric: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/font-variant-numeric/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_font_variant_numeric: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/font-variant-numeric/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_font_weight', () => {
test('docs_font_weight: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/font-weight/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_font_weight: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/font-weight/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_font_weight: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/font-weight/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_gap', () => {
test('docs_gap: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/gap/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_gap: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/gap/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_gap: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/gap/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_grid_auto_columns', () => {
test('docs_grid_auto_columns: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/grid-auto-columns/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_grid_auto_columns: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/grid-auto-columns/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_grid_auto_columns: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/grid-auto-columns/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_grid_auto_flow', () => {
test('docs_grid_auto_flow: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/grid-auto-flow/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_grid_auto_flow: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/grid-auto-flow/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_grid_auto_flow: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/grid-auto-flow/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_grid_auto_rows', () => {
test('docs_grid_auto_rows: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/grid-auto-rows/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_grid_auto_rows: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/grid-auto-rows/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_grid_auto_rows: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/grid-auto-rows/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_grid_column', () => {
test('docs_grid_column: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/grid-column/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_grid_column: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/grid-column/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_grid_column: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/grid-column/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_grid_row', () => {
test('docs_grid_row: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/grid-row/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_grid_row: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/grid-row/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_grid_row: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/grid-row/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_grid_template_columns', () => {
test('docs_grid_template_columns: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/grid-template-columns/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_grid_template_columns: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/grid-template-columns/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_grid_template_columns: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/grid-template-columns/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_grid_template_rows', () => {
test('docs_grid_template_rows: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/grid-template-rows/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_grid_template_rows: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/grid-template-rows/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_grid_template_rows: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/grid-template-rows/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_height', () => {
test('docs_height: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/height/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_height: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/height/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_height: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/height/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_hyphens', () => {
test('docs_hyphens: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/hyphens/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_hyphens: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/hyphens/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_hyphens: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/hyphens/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_inline_size', () => {
test('docs_inline_size: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/inline-size/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_inline_size: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/inline-size/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_inline_size: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/inline-size/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_installation', () => {
test('docs_installation: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/installation/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_installation: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/installation/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_installation: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/installation/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_isolation', () => {
test('docs_isolation: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/isolation/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_isolation: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/isolation/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_isolation: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/isolation/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_justify_content', () => {
test('docs_justify_content: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/justify-content/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_justify_content: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/justify-content/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_justify_content: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/justify-content/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_justify_items', () => {
test('docs_justify_items: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/justify-items/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_justify_items: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/justify-items/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_justify_items: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/justify-items/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_justify_self', () => {
test('docs_justify_self: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/justify-self/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_justify_self: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/justify-self/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_justify_self: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/justify-self/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_letter_spacing', () => {
test('docs_letter_spacing: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/letter-spacing/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_letter_spacing: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/letter-spacing/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_letter_spacing: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/letter-spacing/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_line_height', () => {
test('docs_line_height: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/line-height/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_line_height: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/line-height/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_line_height: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/line-height/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_list_style_image', () => {
test('docs_list_style_image: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/list-style-image/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_list_style_image: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/list-style-image/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_list_style_image: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/list-style-image/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_list_style_position', () => {
test('docs_list_style_position: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/list-style-position/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_list_style_position: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/list-style-position/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_list_style_position: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/list-style-position/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_list_style_type', () => {
test('docs_list_style_type: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/list-style-type/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_list_style_type: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/list-style-type/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_list_style_type: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/list-style-type/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_margin', () => {
test('docs_margin: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/margin/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_margin: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/margin/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_margin: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/margin/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_max_block_size', () => {
test('docs_max_block_size: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/max-block-size/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_max_block_size: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/max-block-size/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_max_block_size: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/max-block-size/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_max_height', () => {
test('docs_max_height: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/max-height/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_max_height: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/max-height/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_max_height: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/max-height/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_min_block_size', () => {
test('docs_min_block_size: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/min-block-size/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_min_block_size: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/min-block-size/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_min_block_size: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/min-block-size/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_min_height', () => {
test('docs_min_height: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/min-height/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_min_height: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/min-height/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_min_height: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/min-height/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_min_inline_size', () => {
test('docs_min_inline_size: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/min-inline-size/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_min_inline_size: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/min-inline-size/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_min_inline_size: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/min-inline-size/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_min_width', () => {
test('docs_min_width: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/min-width/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_min_width: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/min-width/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_min_width: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/min-width/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_order', () => {
test('docs_order: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/order/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_order: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/order/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_order: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/order/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_overscroll_behavior', () => {
test('docs_overscroll_behavior: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/overscroll-behavior/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_overscroll_behavior: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/overscroll-behavior/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_overscroll_behavior: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/overscroll-behavior/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_padding', () => {
test('docs_padding: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/padding/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_padding: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/padding/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_padding: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/padding/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_place_content', () => {
test('docs_place_content: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/place-content/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_place_content: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/place-content/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_place_content: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/place-content/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_place_items', () => {
test('docs_place_items: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/place-items/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_place_items: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/place-items/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_place_items: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/place-items/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_place_self', () => {
test('docs_place_self: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/place-self/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_place_self: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/place-self/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_place_self: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/place-self/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_preflight', () => {
test('docs_preflight: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/preflight/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_preflight: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/preflight/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_preflight: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/preflight/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_text_align', () => {
test('docs_text_align: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/text-align/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_text_align: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/text-align/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_text_align: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/text-align/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_theme', () => {
test('docs_theme: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/theme/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_theme: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/theme/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_theme: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/theme/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_top_right_bottom_left', () => {
test('docs_top_right_bottom_left: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/top-right-bottom-left/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_top_right_bottom_left: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/top-right-bottom-left/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_top_right_bottom_left: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/top-right-bottom-left/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_visibility', () => {
test('docs_visibility: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/visibility/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_visibility: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/visibility/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_visibility: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/visibility/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_width', () => {
test('docs_width: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/width/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_width: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/width/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_width: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/width/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - docs_z_index', () => {
test('docs_z_index: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/docs/z-index/');
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('docs_z_index: heading hierarchy is valid', async ({ page }) => {
await page.goto('/docs/z-index/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('docs_z_index: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/docs/z-index/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - insiders', () => {
test('insiders: heading hierarchy is valid', async ({ page }) => {
await page.goto('/insiders/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('insiders: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/insiders/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - Consistency', () => {
test('header links are consistent across pages', async ({ page }) => {
const headerLinksByPage: string[][] = [];
{
await page.goto('/');
const links = await page.locator('header a, nav a').allTextContents();
headerLinksByPage.push(links.map(l => l.trim()).filter(l => l.length > 0));
}
{
await page.goto('/blog/');
const links = await page.locator('header a, nav a').allTextContents();
headerLinksByPage.push(links.map(l => l.trim()).filter(l => l.length > 0));
}
{
await page.goto('/brand/');
const links = await page.locator('header a, nav a').allTextContents();
headerLinksByPage.push(links.map(l => l.trim()).filter(l => l.length > 0));
}
{
await page.goto('/build-uis-that-dont-suck/');
const links = await page.locator('header a, nav a').allTextContents();
headerLinksByPage.push(links.map(l => l.trim()).filter(l => l.length > 0));
}
if (headerLinksByPage.length >= 2 && headerLinksByPage[0].length > 0) {
const first = new Set(headerLinksByPage[0]);
for (let i = 1; i < headerLinksByPage.length; i++) {
const current = new Set(headerLinksByPage[i]);
const overlap = [...first].filter(l => current.has(l));
if (first.size > 0) {
expect(overlap.length / first.size).toBeGreaterThanOrEqual(0.5);
}
}
}
});
});