Datasets:
Download web/aperlio.example/tests/static/structure.scripted.spec.ts from Qwen/RecreationBench: direct link, hf CLI and curl.
- Browser
- Download file 176 kB
-
https://huggingface.co/datasets/Qwen/RecreationBench/resolve/main/web/aperlio.example/tests/static/structure.scripted.spec.ts
- Command line
-
hf download hf://datasets/Qwen/RecreationBench/web/aperlio.example/tests/static/structure.scripted.spec.ts
-
curl -L -o structure.scripted.spec.ts https://huggingface.co/datasets/Qwen/RecreationBench/resolve/main/web/aperlio.example/tests/static/structure.scripted.spec.ts
176 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('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('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 - stock_photos', () => { | |
| test('stock_photos: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/'); | |
| 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('stock_photos: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/'); | |
| 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('stock_photos: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_photos_prairie_woman_at_sunset', () => { | |
| test('stock_photos_photos_prairie_woman_at_sunset: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/prairie-woman-at-sunset/'); | |
| 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('stock_photos_photos_prairie_woman_at_sunset: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/prairie-woman-at-sunset/'); | |
| 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('stock_photos_photos_prairie_woman_at_sunset: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/photos/prairie-woman-at-sunset/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_photos_train_travels_across_the_frame_with_tracks_and_wires', () => { | |
| test('stock_photos_photos_train_travels_across_the_frame_with_tracks_and_wires: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/train-travels-across-the-frame-with-tracks-and-wires/'); | |
| 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('stock_photos_photos_train_travels_across_the_frame_with_tracks_and_wires: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/train-travels-across-the-frame-with-tracks-and-wires/'); | |
| 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('stock_photos_photos_train_travels_across_the_frame_with_tracks_and_wires: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/photos/train-travels-across-the-frame-with-tracks-and-wires/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_photos_two_customized_cars_rolling_through_a_city_street', () => { | |
| test('stock_photos_photos_two_customized_cars_rolling_through_a_city_street: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/two-customized-cars-rolling-through-a-city-street/'); | |
| 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('stock_photos_photos_two_customized_cars_rolling_through_a_city_street: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/two-customized-cars-rolling-through-a-city-street/'); | |
| 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('stock_photos_photos_two_customized_cars_rolling_through_a_city_street: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/photos/two-customized-cars-rolling-through-a-city-street/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_photos_two_people_in_a_car_look_at_a_map_while_smiling', () => { | |
| test('stock_photos_photos_two_people_in_a_car_look_at_a_map_while_smiling: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/two-people-in-a-car-look-at-a-map-while-smiling/'); | |
| 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('stock_photos_photos_two_people_in_a_car_look_at_a_map_while_smiling: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/two-people-in-a-car-look-at-a-map-while-smiling/'); | |
| 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('stock_photos_photos_two_people_in_a_car_look_at_a_map_while_smiling: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/photos/two-people-in-a-car-look-at-a-map-while-smiling/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_photos_woman_dressed_in_white_leans_against_a_wall', () => { | |
| test('stock_photos_photos_woman_dressed_in_white_leans_against_a_wall: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/woman-dressed-in-white-leans-against-a-wall/'); | |
| 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('stock_photos_photos_woman_dressed_in_white_leans_against_a_wall: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/woman-dressed-in-white-leans-against-a-wall/'); | |
| 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('stock_photos_photos_woman_dressed_in_white_leans_against_a_wall: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/photos/woman-dressed-in-white-leans-against-a-wall/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_photos_wooden_toothbrushes_lined_up_against_a_green_background', () => { | |
| test('stock_photos_photos_wooden_toothbrushes_lined_up_against_a_green_background: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/wooden-toothbrushes-lined-up-against-a-green-background/'); | |
| 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('stock_photos_photos_wooden_toothbrushes_lined_up_against_a_green_background: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/wooden-toothbrushes-lined-up-against-a-green-background/'); | |
| 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('stock_photos_photos_wooden_toothbrushes_lined_up_against_a_green_background: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/photos/wooden-toothbrushes-lined-up-against-a-green-background/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_portraits', () => { | |
| test('stock_photos_portraits: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/portraits/'); | |
| 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('stock_photos_portraits: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/portraits/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_product', () => { | |
| test('stock_photos_product: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/product/'); | |
| 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('stock_photos_product: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/product/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_recreation', () => { | |
| test('stock_photos_recreation: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/recreation/'); | |
| 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('stock_photos_recreation: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/recreation/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_retail', () => { | |
| test('stock_photos_retail: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/retail/'); | |
| 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('stock_photos_retail: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/retail/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_seasons', () => { | |
| test('stock_photos_seasons: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/seasons/'); | |
| 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('stock_photos_seasons: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/seasons/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_shirt', () => { | |
| test('stock_photos_shirt: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/shirt/'); | |
| 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('stock_photos_shirt: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/shirt/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_shop_local', () => { | |
| test('stock_photos_shop_local: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/shop-local/'); | |
| 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('stock_photos_shop_local: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/shop-local/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_shopify_hardware', () => { | |
| test('stock_photos_shopify_hardware: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/shopify-hardware/'); | |
| 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('stock_photos_shopify_hardware: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/shopify-hardware/'); | |
| 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('stock_photos_shopify_hardware: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/shopify-hardware/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_sitemap', () => { | |
| test('stock_photos_sitemap: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/sitemap/'); | |
| 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('stock_photos_sitemap: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/sitemap/'); | |
| 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('stock_photos_sitemap: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/sitemap/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_spring', () => { | |
| test('stock_photos_spring: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/spring/'); | |
| 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('stock_photos_spring: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/spring/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_summer', () => { | |
| test('stock_photos_summer: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/summer/'); | |
| 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('stock_photos_summer: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/summer/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_tea_cup', () => { | |
| test('stock_photos_tea_cup: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/tea-cup/'); | |
| 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('stock_photos_tea_cup: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/tea-cup/'); | |
| 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('stock_photos_tea_cup: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/tea-cup/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_technology', () => { | |
| test('stock_photos_technology: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/technology/'); | |
| 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('stock_photos_technology: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/technology/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_tips_20_best_free_zoom_background_images_to_brighten_up_your_virtual_meetings', () => { | |
| test('stock_photos_tips_20_best_free_zoom_background_images_to_brighten_up_your_virtual_meetings: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/tips/20-best-free-zoom-background-images-to-brighten-up-your-virtual-meetings/'); | |
| 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('stock_photos_tips_20_best_free_zoom_background_images_to_brighten_up_your_virtual_meetings: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/tips/20-best-free-zoom-background-images-to-brighten-up-your-virtual-meetings/'); | |
| 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('stock_photos_tips_20_best_free_zoom_background_images_to_brighten_up_your_virtual_meetings: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/tips/20-best-free-zoom-background-images-to-brighten-up-your-virtual-meetings/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_tips_aperlio_photos_not_stock_photos', () => { | |
| test('stock_photos_tips_aperlio_photos_not_stock_photos: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/tips/aperlio-photos-not-stock-photos/'); | |
| 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('stock_photos_tips_aperlio_photos_not_stock_photos: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/tips/aperlio-photos-not-stock-photos/'); | |
| 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('stock_photos_tips_aperlio_photos_not_stock_photos: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/tips/aperlio-photos-not-stock-photos/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_tips_facebook_ads_how_to_get_started', () => { | |
| test('stock_photos_tips_facebook_ads_how_to_get_started: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/tips/facebook-ads-how-to-get-started/'); | |
| 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('stock_photos_tips_facebook_ads_how_to_get_started: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/tips/facebook-ads-how-to-get-started/'); | |
| 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('stock_photos_tips_facebook_ads_how_to_get_started: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/tips/facebook-ads-how-to-get-started/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_tips_facebook_cover_photo_size_1', () => { | |
| test('stock_photos_tips_facebook_cover_photo_size_1: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/tips/facebook-cover-photo-size-1/'); | |
| 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('stock_photos_tips_facebook_cover_photo_size_1: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/tips/facebook-cover-photo-size-1/'); | |
| 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('stock_photos_tips_facebook_cover_photo_size_1: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/tips/facebook-cover-photo-size-1/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_tips_facebook_posts_how_to_get_the_most_out_of_your_business_page', () => { | |
| test('stock_photos_tips_facebook_posts_how_to_get_the_most_out_of_your_business_page: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/tips/facebook-posts-how-to-get-the-most-out-of-your-business-page/'); | |
| 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('stock_photos_tips_facebook_posts_how_to_get_the_most_out_of_your_business_page: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/tips/facebook-posts-how-to-get-the-most-out-of-your-business-page/'); | |
| 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('stock_photos_tips_facebook_posts_how_to_get_the_most_out_of_your_business_page: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/tips/facebook-posts-how-to-get-the-most-out-of-your-business-page/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_tips_how_to_master_flat_lay_photography_in_2020', () => { | |
| test('stock_photos_tips_how_to_master_flat_lay_photography_in_2020: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/tips/how-to-master-flat-lay-photography-in-2020/'); | |
| 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('stock_photos_tips_how_to_master_flat_lay_photography_in_2020: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/tips/how-to-master-flat-lay-photography-in-2020/'); | |
| 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('stock_photos_tips_how_to_master_flat_lay_photography_in_2020: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/tips/how-to-master-flat-lay-photography-in-2020/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_tips_how_to_take_product_photos_at_home_with_almost_no_equipment', () => { | |
| test('stock_photos_tips_how_to_take_product_photos_at_home_with_almost_no_equipment: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/tips/how-to-take-product-photos-at-home-with-almost-no-equipment/'); | |
| 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('stock_photos_tips_how_to_take_product_photos_at_home_with_almost_no_equipment: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/tips/how-to-take-product-photos-at-home-with-almost-no-equipment/'); | |
| 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('stock_photos_tips_how_to_take_product_photos_at_home_with_almost_no_equipment: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/tips/how-to-take-product-photos-at-home-with-almost-no-equipment/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_transportation', () => { | |
| test('stock_photos_transportation: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/transportation/'); | |
| 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('stock_photos_transportation: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/transportation/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_travel', () => { | |
| test('stock_photos_travel: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/travel/'); | |
| 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('stock_photos_travel: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/travel/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_video_call_backgrounds', () => { | |
| test('stock_photos_video_call_backgrounds: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/video-call-backgrounds/'); | |
| 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('stock_photos_video_call_backgrounds: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/video-call-backgrounds/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_village', () => { | |
| test('stock_photos_village: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/village/'); | |
| 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('stock_photos_village: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/village/'); | |
| 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('stock_photos_village: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/village/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_weather', () => { | |
| test('stock_photos_weather: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/weather/'); | |
| 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('stock_photos_weather: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/weather/'); | |
| 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('stock_photos_weather: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/weather/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_winter', () => { | |
| test('stock_photos_winter: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/winter/'); | |
| 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('stock_photos_winter: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/winter/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_woman', () => { | |
| test('stock_photos_woman: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/woman/'); | |
| 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('stock_photos_woman: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/woman/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_work', () => { | |
| test('stock_photos_work: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/work/'); | |
| 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('stock_photos_work: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/work/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_work_from_home', () => { | |
| test('stock_photos_work_from_home: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/work-from-home/'); | |
| 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('stock_photos_work_from_home: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/work-from-home/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_yoga', () => { | |
| test('stock_photos_yoga: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/yoga/'); | |
| 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('stock_photos_yoga: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/yoga/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - legal_terms', () => { | |
| test('legal_terms: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/legal/terms/'); | |
| 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('legal_terms: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/legal/terms/'); | |
| 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('legal_terms: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/legal/terms/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_about_us', () => { | |
| test('stock_photos_about_us: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/about-us/'); | |
| 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('stock_photos_about_us: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/about-us/'); | |
| 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('stock_photos_about_us: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/about-us/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_airport', () => { | |
| test('stock_photos_airport: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/airport/'); | |
| 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('stock_photos_airport: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/airport/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_animal', () => { | |
| test('stock_photos_animal: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/animal/'); | |
| 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('stock_photos_animal: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/animal/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_around_the_world', () => { | |
| test('stock_photos_around_the_world: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/around-the-world/'); | |
| 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('stock_photos_around_the_world: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/around-the-world/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_arrow', () => { | |
| test('stock_photos_arrow: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/arrow/'); | |
| 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('stock_photos_arrow: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/arrow/'); | |
| 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('stock_photos_arrow: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/arrow/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_arts', () => { | |
| test('stock_photos_arts: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/arts/'); | |
| 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('stock_photos_arts: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/arts/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_baby', () => { | |
| test('stock_photos_baby: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/baby/'); | |
| 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('stock_photos_baby: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/baby/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_background', () => { | |
| test('stock_photos_background: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/background/'); | |
| 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('stock_photos_background: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/background/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_banana', () => { | |
| test('stock_photos_banana: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/banana/'); | |
| 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('stock_photos_banana: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/banana/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_beauty', () => { | |
| test('stock_photos_beauty: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/beauty/'); | |
| 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('stock_photos_beauty: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/beauty/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_bible', () => { | |
| test('stock_photos_bible: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/bible/'); | |
| 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('stock_photos_bible: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/bible/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_black_and_white', () => { | |
| test('stock_photos_black_and_white: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/black-and-white/'); | |
| 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('stock_photos_black_and_white: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/black-and-white/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_black_backgrounds', () => { | |
| test('stock_photos_black_backgrounds: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/black-backgrounds/'); | |
| 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('stock_photos_black_backgrounds: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/black-backgrounds/'); | |
| 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('stock_photos_black_backgrounds: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/black-backgrounds/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_blue_background', () => { | |
| test('stock_photos_blue_background: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/blue-background/'); | |
| 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('stock_photos_blue_background: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/blue-background/'); | |
| 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('stock_photos_blue_background: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/blue-background/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_blur_background', () => { | |
| test('stock_photos_blur_background: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/blur-background/'); | |
| 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('stock_photos_blur_background: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/blur-background/'); | |
| 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('stock_photos_blur_background: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/blur-background/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_business', () => { | |
| test('stock_photos_business: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/business/'); | |
| 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('stock_photos_business: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/business/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_business_ideas', () => { | |
| test('stock_photos_business_ideas: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/business-ideas/'); | |
| 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('stock_photos_business_ideas: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/business-ideas/'); | |
| 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('stock_photos_business_ideas: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/business-ideas/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_butterfly', () => { | |
| test('stock_photos_butterfly: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/butterfly/'); | |
| 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('stock_photos_butterfly: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/butterfly/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_cat', () => { | |
| test('stock_photos_cat: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/cat/'); | |
| 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('stock_photos_cat: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/cat/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_celebrate', () => { | |
| test('stock_photos_celebrate: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/celebrate/'); | |
| 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('stock_photos_celebrate: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/celebrate/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_children', () => { | |
| test('stock_photos_children: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/children/'); | |
| 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('stock_photos_children: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/children/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_cinemagraphs', () => { | |
| test('stock_photos_cinemagraphs: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/cinemagraphs/'); | |
| 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('stock_photos_cinemagraphs: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/cinemagraphs/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_city', () => { | |
| test('stock_photos_city: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/city/'); | |
| 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('stock_photos_city: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/city/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_classroom', () => { | |
| test('stock_photos_classroom: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/classroom/'); | |
| 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('stock_photos_classroom: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/classroom/'); | |
| 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('stock_photos_classroom: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/classroom/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_coffee', () => { | |
| test('stock_photos_coffee: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/coffee/'); | |
| 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('stock_photos_coffee: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/coffee/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_color_backgrounds', () => { | |
| test('stock_photos_color_backgrounds: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/color-backgrounds/'); | |
| 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('stock_photos_color_backgrounds: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/color-backgrounds/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_computer', () => { | |
| test('stock_photos_computer: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/computer/'); | |
| 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('stock_photos_computer: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/computer/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_cool_background', () => { | |
| test('stock_photos_cool_background: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/cool-background/'); | |
| 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('stock_photos_cool_background: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/cool-background/'); | |
| 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('stock_photos_cool_background: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/cool-background/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_cute', () => { | |
| test('stock_photos_cute: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/cute/'); | |
| 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('stock_photos_cute: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/cute/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_dark', () => { | |
| test('stock_photos_dark: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/dark/'); | |
| 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('stock_photos_dark: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/dark/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_dog', () => { | |
| test('stock_photos_dog: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/dog/'); | |
| 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('stock_photos_dog: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/dog/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_education', () => { | |
| test('stock_photos_education: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/education/'); | |
| 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('stock_photos_education: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/education/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_elephant', () => { | |
| test('stock_photos_elephant: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/elephant/'); | |
| 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('stock_photos_elephant: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/elephant/'); | |
| 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('stock_photos_elephant: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/elephant/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_environment', () => { | |
| test('stock_photos_environment: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/environment/'); | |
| 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('stock_photos_environment: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/environment/'); | |
| 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('stock_photos_environment: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/environment/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_fall', () => { | |
| test('stock_photos_fall: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/fall/'); | |
| 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('stock_photos_fall: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/fall/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_family', () => { | |
| test('stock_photos_family: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/family/'); | |
| 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('stock_photos_family: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/family/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_fashion', () => { | |
| test('stock_photos_fashion: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/fashion/'); | |
| 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('stock_photos_fashion: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/fashion/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_female_photographer', () => { | |
| test('stock_photos_female_photographer: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/female-photographer/'); | |
| 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('stock_photos_female_photographer: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/female-photographer/'); | |
| 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('stock_photos_female_photographer: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/female-photographer/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_fitness', () => { | |
| test('stock_photos_fitness: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/fitness/'); | |
| 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('stock_photos_fitness: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/fitness/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_flatlay', () => { | |
| test('stock_photos_flatlay: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/flatlay/'); | |
| 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('stock_photos_flatlay: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/flatlay/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_flower_background', () => { | |
| test('stock_photos_flower_background: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/flower-background/'); | |
| 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('stock_photos_flower_background: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/flower-background/'); | |
| 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('stock_photos_flower_background: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/flower-background/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_flowers', () => { | |
| test('stock_photos_flowers: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/flowers/'); | |
| 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('stock_photos_flowers: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/flowers/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_food', () => { | |
| test('stock_photos_food: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/food/'); | |
| 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('stock_photos_food: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/food/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_forest_images', () => { | |
| test('stock_photos_forest_images: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/forest-images/'); | |
| 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('stock_photos_forest_images: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/forest-images/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_free_images', () => { | |
| test('stock_photos_free_images: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/free-images/'); | |
| 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('stock_photos_free_images: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/free-images/'); | |
| 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('stock_photos_free_images: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/free-images/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_gardening', () => { | |
| test('stock_photos_gardening: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/gardening/'); | |
| 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('stock_photos_gardening: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/gardening/'); | |
| 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('stock_photos_gardening: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/gardening/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_golf', () => { | |
| test('stock_photos_golf: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/golf/'); | |
| 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('stock_photos_golf: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/golf/'); | |
| 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('stock_photos_golf: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/golf/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_happy_holidays', () => { | |
| test('stock_photos_happy_holidays: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/happy-holidays/'); | |
| 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('stock_photos_happy_holidays: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/happy-holidays/'); | |
| 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('stock_photos_happy_holidays: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/happy-holidays/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_healthcare', () => { | |
| test('stock_photos_healthcare: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/healthcare/'); | |
| 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('stock_photos_healthcare: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/healthcare/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_history', () => { | |
| test('stock_photos_history: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/history/'); | |
| 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('stock_photos_history: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/history/'); | |
| 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('stock_photos_history: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/history/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_holidays', () => { | |
| test('stock_photos_holidays: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/holidays/'); | |
| 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('stock_photos_holidays: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/holidays/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_home', () => { | |
| test('stock_photos_home: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/home/'); | |
| 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('stock_photos_home: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/home/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_home_office', () => { | |
| test('stock_photos_home_office: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/home-office/'); | |
| 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('stock_photos_home_office: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/home-office/'); | |
| 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('stock_photos_home_office: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/home-office/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_ice_cream', () => { | |
| test('stock_photos_ice_cream: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/ice-cream/'); | |
| 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('stock_photos_ice_cream: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/ice-cream/'); | |
| 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('stock_photos_ice_cream: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/ice-cream/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_india', () => { | |
| test('stock_photos_india: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/india/'); | |
| 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('stock_photos_india: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/india/'); | |
| 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('stock_photos_india: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/india/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_internet', () => { | |
| test('stock_photos_internet: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/internet/'); | |
| 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('stock_photos_internet: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/internet/'); | |
| 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('stock_photos_internet: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/internet/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_jewelry', () => { | |
| test('stock_photos_jewelry: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/jewelry/'); | |
| 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('stock_photos_jewelry: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/jewelry/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_kids', () => { | |
| test('stock_photos_kids: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/kids/'); | |
| 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('stock_photos_kids: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/kids/'); | |
| 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('stock_photos_kids: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/kids/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_landscape', () => { | |
| test('stock_photos_landscape: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/landscape/'); | |
| 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('stock_photos_landscape: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/landscape/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_leadership', () => { | |
| test('stock_photos_leadership: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/leadership/'); | |
| 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('stock_photos_leadership: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/leadership/'); | |
| 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('stock_photos_leadership: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/leadership/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_life', () => { | |
| test('stock_photos_life: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/life/'); | |
| 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('stock_photos_life: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/life/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_light_background', () => { | |
| test('stock_photos_light_background: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/light-background/'); | |
| 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('stock_photos_light_background: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/light-background/'); | |
| 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('stock_photos_light_background: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/light-background/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_love', () => { | |
| test('stock_photos_love: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/love/'); | |
| 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('stock_photos_love: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/love/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_love_background', () => { | |
| test('stock_photos_love_background: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/love-background/'); | |
| 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('stock_photos_love_background: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/love-background/'); | |
| 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('stock_photos_love_background: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/love-background/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_makeup', () => { | |
| test('stock_photos_makeup: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/makeup/'); | |
| 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('stock_photos_makeup: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/makeup/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_man', () => { | |
| test('stock_photos_man: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/man/'); | |
| 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('stock_photos_man: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/man/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_mens_fashion', () => { | |
| test('stock_photos_mens_fashion: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/mens-fashion/'); | |
| 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('stock_photos_mens_fashion: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/mens-fashion/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_mental_health', () => { | |
| test('stock_photos_mental_health: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/mental-health/'); | |
| 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('stock_photos_mental_health: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/mental-health/'); | |
| 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('stock_photos_mental_health: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/mental-health/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_mobile_backgrounds', () => { | |
| test('stock_photos_mobile_backgrounds: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/mobile-backgrounds/'); | |
| 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('stock_photos_mobile_backgrounds: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/mobile-backgrounds/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_money', () => { | |
| test('stock_photos_money: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/money/'); | |
| 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('stock_photos_money: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/money/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_moon', () => { | |
| test('stock_photos_moon: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/moon/'); | |
| 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('stock_photos_moon: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/moon/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_nature', () => { | |
| test('stock_photos_nature: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/nature/'); | |
| 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('stock_photos_nature: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/nature/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_office', () => { | |
| test('stock_photos_office: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/office/'); | |
| 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('stock_photos_office: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/office/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_outdoor', () => { | |
| test('stock_photos_outdoor: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/outdoor/'); | |
| 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('stock_photos_outdoor: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/outdoor/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_pants', () => { | |
| test('stock_photos_pants: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/pants/'); | |
| 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('stock_photos_pants: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/pants/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_people', () => { | |
| test('stock_photos_people: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/people/'); | |
| 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('stock_photos_people: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/people/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_photos', () => { | |
| test('stock_photos_photos: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/'); | |
| 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('stock_photos_photos: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/'); | |
| 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('stock_photos_photos: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/photos/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_sun', () => { | |
| test('stock_photos_sun: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/sun/'); | |
| 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('stock_photos_sun: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/sun/'); | |
| 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('stock_photos_sun: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/sun/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_business_ideas_sell_bath_bombs_online', () => { | |
| test('stock_photos_business_ideas_sell_bath_bombs_online: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/business-ideas/sell-bath-bombs-online/'); | |
| 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('stock_photos_business_ideas_sell_bath_bombs_online: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/business-ideas/sell-bath-bombs-online/'); | |
| 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('stock_photos_business_ideas_sell_bath_bombs_online: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/business-ideas/sell-bath-bombs-online/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_business_ideas_sell_candles_online', () => { | |
| test('stock_photos_business_ideas_sell_candles_online: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/business-ideas/sell-candles-online/'); | |
| 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('stock_photos_business_ideas_sell_candles_online: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/business-ideas/sell-candles-online/'); | |
| 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('stock_photos_business_ideas_sell_candles_online: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/business-ideas/sell-candles-online/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_business_ideas_sell_coffee_online', () => { | |
| test('stock_photos_business_ideas_sell_coffee_online: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/business-ideas/sell-coffee-online/'); | |
| 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('stock_photos_business_ideas_sell_coffee_online: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/business-ideas/sell-coffee-online/'); | |
| 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('stock_photos_business_ideas_sell_coffee_online: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/business-ideas/sell-coffee-online/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_business_ideas_sell_enamel_pins_online', () => { | |
| test('stock_photos_business_ideas_sell_enamel_pins_online: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/business-ideas/sell-enamel-pins-online/'); | |
| 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('stock_photos_business_ideas_sell_enamel_pins_online: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/business-ideas/sell-enamel-pins-online/'); | |
| 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('stock_photos_business_ideas_sell_enamel_pins_online: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/business-ideas/sell-enamel-pins-online/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_business_ideas_sell_jewelry_online', () => { | |
| test('stock_photos_business_ideas_sell_jewelry_online: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/business-ideas/sell-jewelry-online/'); | |
| 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('stock_photos_business_ideas_sell_jewelry_online: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/business-ideas/sell-jewelry-online/'); | |
| 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('stock_photos_business_ideas_sell_jewelry_online: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/business-ideas/sell-jewelry-online/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_business_ideas_sell_lip_balm_online', () => { | |
| test('stock_photos_business_ideas_sell_lip_balm_online: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/business-ideas/sell-lip-balm-online/'); | |
| 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('stock_photos_business_ideas_sell_lip_balm_online: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/business-ideas/sell-lip-balm-online/'); | |
| 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('stock_photos_business_ideas_sell_lip_balm_online: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/business-ideas/sell-lip-balm-online/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_business_ideas_sell_t_shirts_online', () => { | |
| test('stock_photos_business_ideas_sell_t_shirts_online: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/business-ideas/sell-t-shirts-online/'); | |
| 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('stock_photos_business_ideas_sell_t_shirts_online: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/business-ideas/sell-t-shirts-online/'); | |
| 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('stock_photos_business_ideas_sell_t_shirts_online: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/business-ideas/sell-t-shirts-online/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_business_ideas_sell_tea_online', () => { | |
| test('stock_photos_business_ideas_sell_tea_online: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/business-ideas/sell-tea-online/'); | |
| 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('stock_photos_business_ideas_sell_tea_online: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/business-ideas/sell-tea-online/'); | |
| 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('stock_photos_business_ideas_sell_tea_online: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/business-ideas/sell-tea-online/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_business_ideas_sell_yoga_products_online', () => { | |
| test('stock_photos_business_ideas_sell_yoga_products_online: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/business-ideas/sell-yoga-products-online/'); | |
| 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('stock_photos_business_ideas_sell_yoga_products_online: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/business-ideas/sell-yoga-products-online/'); | |
| 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('stock_photos_business_ideas_sell_yoga_products_online: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/business-ideas/sell-yoga-products-online/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_photos_a_christmas_package_being_wrapped', () => { | |
| test('stock_photos_photos_a_christmas_package_being_wrapped: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/a-christmas-package-being-wrapped/'); | |
| 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('stock_photos_photos_a_christmas_package_being_wrapped: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/a-christmas-package-being-wrapped/'); | |
| 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('stock_photos_photos_a_christmas_package_being_wrapped: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/photos/a-christmas-package-being-wrapped/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_photos_blue_water_and_white_cliffs_surrounded_by_trees', () => { | |
| test('stock_photos_photos_blue_water_and_white_cliffs_surrounded_by_trees: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/blue-water-and-white-cliffs-surrounded-by-trees/'); | |
| 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('stock_photos_photos_blue_water_and_white_cliffs_surrounded_by_trees: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/blue-water-and-white-cliffs-surrounded-by-trees/'); | |
| 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('stock_photos_photos_blue_water_and_white_cliffs_surrounded_by_trees: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/photos/blue-water-and-white-cliffs-surrounded-by-trees/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_photos_hand_holds_the_bottom_corner_of_a_large_coffee_table_book', () => { | |
| test('stock_photos_photos_hand_holds_the_bottom_corner_of_a_large_coffee_table_book: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/hand-holds-the-bottom-corner-of-a-large-coffee-table-book/'); | |
| 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('stock_photos_photos_hand_holds_the_bottom_corner_of_a_large_coffee_table_book: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/hand-holds-the-bottom-corner-of-a-large-coffee-table-book/'); | |
| 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('stock_photos_photos_hand_holds_the_bottom_corner_of_a_large_coffee_table_book: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/photos/hand-holds-the-bottom-corner-of-a-large-coffee-table-book/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_photos_landscape_of_green_rolling_hills_and_mountain_peaks', () => { | |
| test('stock_photos_photos_landscape_of_green_rolling_hills_and_mountain_peaks: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/landscape-of-green-rolling-hills-and-mountain-peaks/'); | |
| 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('stock_photos_photos_landscape_of_green_rolling_hills_and_mountain_peaks: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/landscape-of-green-rolling-hills-and-mountain-peaks/'); | |
| 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('stock_photos_photos_landscape_of_green_rolling_hills_and_mountain_peaks: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/photos/landscape-of-green-rolling-hills-and-mountain-peaks/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_photos_making_a_budget_tracking_finances', () => { | |
| test('stock_photos_photos_making_a_budget_tracking_finances: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/making-a-budget-tracking-finances/'); | |
| 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('stock_photos_photos_making_a_budget_tracking_finances: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/making-a-budget-tracking-finances/'); | |
| 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('stock_photos_photos_making_a_budget_tracking_finances: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/photos/making-a-budget-tracking-finances/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_photos_man_takes_time_to_ponder', () => { | |
| test('stock_photos_photos_man_takes_time_to_ponder: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/man-takes-time-to-ponder/'); | |
| 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('stock_photos_photos_man_takes_time_to_ponder: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/man-takes-time-to-ponder/'); | |
| 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('stock_photos_photos_man_takes_time_to_ponder: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/photos/man-takes-time-to-ponder/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_photos_painter_working_in_studio', () => { | |
| test('stock_photos_photos_painter_working_in_studio: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/painter-working-in-studio/'); | |
| 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('stock_photos_photos_painter_working_in_studio: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/painter-working-in-studio/'); | |
| 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('stock_photos_photos_painter_working_in_studio: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/photos/painter-working-in-studio/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_photos_person_holds_a_book_over_a_stack_and_turns_the_page', () => { | |
| test('stock_photos_photos_person_holds_a_book_over_a_stack_and_turns_the_page: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/person-holds-a-book-over-a-stack-and-turns-the-page/'); | |
| 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('stock_photos_photos_person_holds_a_book_over_a_stack_and_turns_the_page: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/person-holds-a-book-over-a-stack-and-turns-the-page/'); | |
| 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('stock_photos_photos_person_holds_a_book_over_a_stack_and_turns_the_page: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/photos/person-holds-a-book-over-a-stack-and-turns-the-page/'); | |
| await page.waitForTimeout(500); | |
| const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth); | |
| expect(scrollWidth).toBeLessThanOrEqual(385); | |
| }); | |
| }); | |
| test.describe('Structural - stock_photos_photos_photo_of_a_cityscape_with_a_ferris_wheel', () => { | |
| test('stock_photos_photos_photo_of_a_cityscape_with_a_ferris_wheel: reproduces GT semantic landmarks', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/photo-of-a-cityscape-with-a-ferris-wheel/'); | |
| 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('stock_photos_photos_photo_of_a_cityscape_with_a_ferris_wheel: heading hierarchy is valid', async ({ page }) => { | |
| await page.goto('/stock-photos/photos/photo-of-a-cityscape-with-a-ferris-wheel/'); | |
| 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('stock_photos_photos_photo_of_a_cityscape_with_a_ferris_wheel: no horizontal overflow at 375px', async ({ page }) => { | |
| await page.setViewportSize({ width: 375, height: 812 }); | |
| await page.goto('/stock-photos/photos/photo-of-a-cityscape-with-a-ferris-wheel/'); | |
| 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('/stock-photos/'); | |
| 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('/stock-photos/photos/prairie-woman-at-sunset/'); | |
| 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('/stock-photos/photos/train-travels-across-the-frame-with-tracks-and-wires/'); | |
| 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); | |
| } | |
| } | |
| } | |
| }); | |
| }); | |