RecreationBench / web /mendova.example /tests /static /structure.scripted.spec.ts
VoyagerXHF's picture
Upload folder using huggingface_hub (part 47)
599ae0c verified
Raw History Blame Contribute Delete
97.9 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 - about_us', () => {
test('about_us: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/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('about_us: heading hierarchy is valid', async ({ page }) => {
await page.goto('/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('about_us: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/about-us/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - blog', () => {
test('blog: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/blog/');
expect(await page.locator('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('blog: heading hierarchy is valid', async ({ page }) => {
await page.goto('/blog/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('blog: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/blog/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - businesses', () => {
test('businesses: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/businesses/');
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('businesses: heading hierarchy is valid', async ({ page }) => {
await page.goto('/businesses/');
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('businesses: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/businesses/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - clinicians', () => {
test('clinicians: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/clinicians/');
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('clinicians: heading hierarchy is valid', async ({ page }) => {
await page.goto('/clinicians/');
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('clinicians: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/clinicians/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - cognitive_behavioral_therapy', () => {
test('cognitive_behavioral_therapy: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/cognitive-behavioral-therapy/');
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('cognitive_behavioral_therapy: heading hierarchy is valid', async ({ page }) => {
await page.goto('/cognitive-behavioral-therapy/');
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('cognitive_behavioral_therapy: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/cognitive-behavioral-therapy/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - doctors_note', () => {
test('doctors_note: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/doctors-note/');
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('doctors_note: heading hierarchy is valid', async ({ page }) => {
await page.goto('/doctors-note/');
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('doctors_note: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/doctors-note/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - emdr_therapy', () => {
test('emdr_therapy: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/emdr-therapy/');
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('emdr_therapy: heading hierarchy is valid', async ({ page }) => {
await page.goto('/emdr-therapy/');
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('emdr_therapy: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/emdr-therapy/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - faqs', () => {
test('faqs: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/faqs/');
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('faqs: heading hierarchy is valid', async ({ page }) => {
await page.goto('/faqs/');
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('faqs: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/faqs/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - get_the_app', () => {
test('get_the_app: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/get-the-app/');
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('get_the_app: heading hierarchy is valid', async ({ page }) => {
await page.goto('/get-the-app/');
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('get_the_app: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/get-the-app/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - how_it_works', () => {
test('how_it_works: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/how-it-works/');
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('how_it_works: heading hierarchy is valid', async ({ page }) => {
await page.goto('/how-it-works/');
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('how_it_works: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/how-it-works/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - how_to_contact_us', () => {
test('how_to_contact_us: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/how-to-contact-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('how_to_contact_us: heading hierarchy is valid', async ({ page }) => {
await page.goto('/how-to-contact-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('how_to_contact_us: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/how-to-contact-us/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - mental_health', () => {
test('mental_health: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/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('mental_health: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/mental-health/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - online_couples_therapy', () => {
test('online_couples_therapy: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/online-couples-therapy/');
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('online_couples_therapy: heading hierarchy is valid', async ({ page }) => {
await page.goto('/online-couples-therapy/');
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('online_couples_therapy: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/online-couples-therapy/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - online_prescriptions', () => {
test('online_prescriptions: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/online-prescriptions/');
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('online_prescriptions: heading hierarchy is valid', async ({ page }) => {
await page.goto('/online-prescriptions/');
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('online_prescriptions: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/online-prescriptions/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - online_psychiatry', () => {
test('online_psychiatry: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/online-psychiatry/');
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('online_psychiatry: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/online-psychiatry/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - online_therapy', () => {
test('online_therapy: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/online-therapy/');
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('online_therapy: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/online-therapy/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - sitemap', () => {
test('sitemap: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/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('sitemap: heading hierarchy is valid', async ({ page }) => {
await page.goto('/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('sitemap: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/sitemap/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - skin_care', () => {
test('skin_care: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/skin-care/');
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('skin_care: heading hierarchy is valid', async ({ page }) => {
await page.goto('/skin-care/');
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('skin_care: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/skin-care/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - urgent_care', () => {
test('urgent_care: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/urgent-care/');
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('urgent_care: heading hierarchy is valid', async ({ page }) => {
await page.goto('/urgent-care/');
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('urgent_care: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/urgent-care/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - virtual_primary_care', () => {
test('virtual_primary_care: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/virtual-primary-care/');
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('virtual_primary_care: heading hierarchy is valid', async ({ page }) => {
await page.goto('/virtual-primary-care/');
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('virtual_primary_care: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/virtual-primary-care/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat', () => {
test('what_we_treat: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/');
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('what_we_treat: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/');
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('what_we_treat: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - about_us_cost_insurance', () => {
test('about_us_cost_insurance: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/about-us/cost-insurance/');
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('about_us_cost_insurance: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/about-us/cost-insurance/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - microsite_anglehealth', () => {
test('microsite_anglehealth: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/microsite/anglehealth/');
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('microsite_anglehealth: heading hierarchy is valid', async ({ page }) => {
await page.goto('/microsite/anglehealth/');
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('microsite_anglehealth: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/microsite/anglehealth/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - microsite_bcbsmn', () => {
test('microsite_bcbsmn: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/microsite/bcbsmn/');
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('microsite_bcbsmn: heading hierarchy is valid', async ({ page }) => {
await page.goto('/microsite/bcbsmn/');
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('microsite_bcbsmn: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/microsite/bcbsmn/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - microsite_healthy_ohio', () => {
test('microsite_healthy_ohio: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/microsite/healthy-ohio/');
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('microsite_healthy_ohio: heading hierarchy is valid', async ({ page }) => {
await page.goto('/microsite/healthy-ohio/');
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('microsite_healthy_ohio: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/microsite/healthy-ohio/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - microsite_optum', () => {
test('microsite_optum: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/microsite/optum/');
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('microsite_optum: heading hierarchy is valid', async ({ page }) => {
await page.goto('/microsite/optum/');
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('microsite_optum: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/microsite/optum/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - microsite_scan', () => {
test('microsite_scan: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/microsite/scan/');
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('microsite_scan: heading hierarchy is valid', async ({ page }) => {
await page.goto('/microsite/scan/');
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('microsite_scan: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/microsite/scan/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - microsite_tricare_east', () => {
test('microsite_tricare_east: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/microsite/tricare-east/');
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('microsite_tricare_east: heading hierarchy is valid', async ({ page }) => {
await page.goto('/microsite/tricare-east/');
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('microsite_tricare_east: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/microsite/tricare-east/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - virtual_primary_care_chronic_care', () => {
test('virtual_primary_care_chronic_care: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/virtual-primary-care/chronic-care/');
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('virtual_primary_care_chronic_care: heading hierarchy is valid', async ({ page }) => {
await page.goto('/virtual-primary-care/chronic-care/');
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('virtual_primary_care_chronic_care: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/virtual-primary-care/chronic-care/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - virtual_primary_care_preventive_care', () => {
test('virtual_primary_care_preventive_care: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/virtual-primary-care/preventive-care/');
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('virtual_primary_care_preventive_care: heading hierarchy is valid', async ({ page }) => {
await page.goto('/virtual-primary-care/preventive-care/');
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('virtual_primary_care_preventive_care: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/virtual-primary-care/preventive-care/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_acne', () => {
test('what_we_treat_acne: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/acne/');
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('what_we_treat_acne: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/acne/');
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('what_we_treat_acne: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/acne/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_adhd', () => {
test('what_we_treat_adhd: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/adhd/');
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('what_we_treat_adhd: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/adhd/');
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('what_we_treat_adhd: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/adhd/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_allergies', () => {
test('what_we_treat_allergies: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/allergies/');
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('what_we_treat_allergies: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/allergies/');
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('what_we_treat_allergies: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/allergies/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_anxiety', () => {
test('what_we_treat_anxiety: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/anxiety/');
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('what_we_treat_anxiety: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/anxiety/');
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('what_we_treat_anxiety: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/anxiety/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_asthma', () => {
test('what_we_treat_asthma: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/asthma/');
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('what_we_treat_asthma: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/asthma/');
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('what_we_treat_asthma: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/asthma/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_bronchitis_treatment_online', () => {
test('what_we_treat_bronchitis_treatment_online: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/bronchitis-treatment-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);
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('what_we_treat_bronchitis_treatment_online: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/bronchitis-treatment-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('what_we_treat_bronchitis_treatment_online: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/bronchitis-treatment-online/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_bv_treatment_online', () => {
test('what_we_treat_bv_treatment_online: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/bv-treatment-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);
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('what_we_treat_bv_treatment_online: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/bv-treatment-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('what_we_treat_bv_treatment_online: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/bv-treatment-online/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_cold_flu', () => {
test('what_we_treat_cold_flu: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/cold-flu/');
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('what_we_treat_cold_flu: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/cold-flu/');
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('what_we_treat_cold_flu: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/cold-flu/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_covid', () => {
test('what_we_treat_covid: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/covid/');
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('what_we_treat_covid: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/covid/');
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('what_we_treat_covid: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/covid/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_depression', () => {
test('what_we_treat_depression: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/depression/');
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('what_we_treat_depression: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/depression/');
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('what_we_treat_depression: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/depression/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_diarrhea', () => {
test('what_we_treat_diarrhea: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/diarrhea/');
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('what_we_treat_diarrhea: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/diarrhea/');
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('what_we_treat_diarrhea: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/diarrhea/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_ear_infections', () => {
test('what_we_treat_ear_infections: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/ear-infections/');
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('what_we_treat_ear_infections: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/ear-infections/');
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('what_we_treat_ear_infections: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/ear-infections/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_grief_loss', () => {
test('what_we_treat_grief_loss: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/grief-loss/');
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('what_we_treat_grief_loss: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/grief-loss/');
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('what_we_treat_grief_loss: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/grief-loss/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_high_blood_pressure_treatment_online', () => {
test('what_we_treat_high_blood_pressure_treatment_online: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/high-blood-pressure-treatment-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);
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('what_we_treat_high_blood_pressure_treatment_online: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/high-blood-pressure-treatment-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('what_we_treat_high_blood_pressure_treatment_online: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/high-blood-pressure-treatment-online/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_ibs', () => {
test('what_we_treat_ibs: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/ibs/');
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('what_we_treat_ibs: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/ibs/');
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('what_we_treat_ibs: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/ibs/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_migraine_headache', () => {
test('what_we_treat_migraine_headache: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/migraine-headache/');
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('what_we_treat_migraine_headache: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/migraine-headache/');
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('what_we_treat_migraine_headache: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/migraine-headache/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_nausea_vomiting', () => {
test('what_we_treat_nausea_vomiting: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/nausea-vomiting/');
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('what_we_treat_nausea_vomiting: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/nausea-vomiting/');
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('what_we_treat_nausea_vomiting: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/nausea-vomiting/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_pink_eye', () => {
test('what_we_treat_pink_eye: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/pink-eye/');
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('what_we_treat_pink_eye: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/pink-eye/');
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('what_we_treat_pink_eye: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/pink-eye/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_postpartum', () => {
test('what_we_treat_postpartum: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/postpartum/');
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('what_we_treat_postpartum: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/postpartum/');
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('what_we_treat_postpartum: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/postpartum/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_ptsd', () => {
test('what_we_treat_ptsd: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/ptsd/');
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('what_we_treat_ptsd: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/ptsd/');
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('what_we_treat_ptsd: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/ptsd/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_sinus_infections', () => {
test('what_we_treat_sinus_infections: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/sinus-infections/');
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('what_we_treat_sinus_infections: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/sinus-infections/');
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('what_we_treat_sinus_infections: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/sinus-infections/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_std_treatment_online', () => {
test('what_we_treat_std_treatment_online: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/std-treatment-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);
expect(await page.locator('footer, [role="contentinfo"]').first().count(), 'footer landmark present in GT').toBeGreaterThan(0);
});
test('what_we_treat_std_treatment_online: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/std-treatment-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('what_we_treat_std_treatment_online: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/std-treatment-online/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_strep_throat', () => {
test('what_we_treat_strep_throat: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/strep-throat/');
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('what_we_treat_strep_throat: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/strep-throat/');
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('what_we_treat_strep_throat: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/strep-throat/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_stress', () => {
test('what_we_treat_stress: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/stress/');
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('what_we_treat_stress: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/stress/');
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('what_we_treat_stress: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/stress/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_uti', () => {
test('what_we_treat_uti: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/uti/');
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('what_we_treat_uti: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/uti/');
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('what_we_treat_uti: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/uti/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - what_we_treat_yeast_infections', () => {
test('what_we_treat_yeast_infections: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/what-we-treat/yeast-infections/');
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('what_we_treat_yeast_infections: heading hierarchy is valid', async ({ page }) => {
await page.goto('/what-we-treat/yeast-infections/');
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('what_we_treat_yeast_infections: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/what-we-treat/yeast-infections/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - blog_cold_and_flu_5_things_to_do_in_the_first_24_hours_of_a_cold_or_flu', () => {
test('blog_cold_and_flu_5_things_to_do_in_the_first_24_hours_of_a_cold_or_flu: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/blog/cold-and-flu/5-things-to-do-in-the-first-24-hours-of-a-cold-or-flu/');
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('blog_cold_and_flu_5_things_to_do_in_the_first_24_hours_of_a_cold_or_flu: heading hierarchy is valid', async ({ page }) => {
await page.goto('/blog/cold-and-flu/5-things-to-do-in-the-first-24-hours-of-a-cold-or-flu/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('blog_cold_and_flu_5_things_to_do_in_the_first_24_hours_of_a_cold_or_flu: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/blog/cold-and-flu/5-things-to-do-in-the-first-24-hours-of-a-cold-or-flu/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - blog_cold_and_flu_cold_vs_flu_whats_the_difference', () => {
test('blog_cold_and_flu_cold_vs_flu_whats_the_difference: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/blog/cold-and-flu/cold-vs-flu-whats-the-difference/');
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('blog_cold_and_flu_cold_vs_flu_whats_the_difference: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/blog/cold-and-flu/cold-vs-flu-whats-the-difference/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - blog_cold_and_flu_how_long_is_a_cold_or_flu_contagious', () => {
test('blog_cold_and_flu_how_long_is_a_cold_or_flu_contagious: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/blog/cold-and-flu/how-long-is-a-cold-or-flu-contagious/');
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('blog_cold_and_flu_how_long_is_a_cold_or_flu_contagious: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/blog/cold-and-flu/how-long-is-a-cold-or-flu-contagious/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - blog_cold_and_flu_the_ultimate_cold_flu_season_readiness_guide', () => {
test('blog_cold_and_flu_the_ultimate_cold_flu_season_readiness_guide: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/blog/cold-and-flu/the-ultimate-cold-flu-season-readiness-guide/');
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('blog_cold_and_flu_the_ultimate_cold_flu_season_readiness_guide: heading hierarchy is valid', async ({ page }) => {
await page.goto('/blog/cold-and-flu/the-ultimate-cold-flu-season-readiness-guide/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('blog_cold_and_flu_the_ultimate_cold_flu_season_readiness_guide: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/blog/cold-and-flu/the-ultimate-cold-flu-season-readiness-guide/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - blog_cold_and_flu_top_mistakes_when_self_treating_the_cold_or_flu', () => {
test('blog_cold_and_flu_top_mistakes_when_self_treating_the_cold_or_flu: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/blog/cold-and-flu/top-mistakes-when-self-treating-the-cold-or-flu/');
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('blog_cold_and_flu_top_mistakes_when_self_treating_the_cold_or_flu: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/blog/cold-and-flu/top-mistakes-when-self-treating-the-cold-or-flu/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - blog_covid_is_it_a_cold_the_flu_or_covid', () => {
test('blog_covid_is_it_a_cold_the_flu_or_covid: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/blog/covid/is-it-a-cold-the-flu-or-covid/');
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('blog_covid_is_it_a_cold_the_flu_or_covid: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/blog/covid/is-it-a-cold-the-flu-or-covid/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - blog_health_allergies_symptoms_and_types', () => {
test('blog_health_allergies_symptoms_and_types: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/blog/health/allergies-symptoms-and-types/');
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('blog_health_allergies_symptoms_and_types: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/blog/health/allergies-symptoms-and-types/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - blog_health_how_to_control_your_seasonal_allergies', () => {
test('blog_health_how_to_control_your_seasonal_allergies: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/blog/health/how-to-control-your-seasonal-allergies/');
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('blog_health_how_to_control_your_seasonal_allergies: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/blog/health/how-to-control-your-seasonal-allergies/');
await page.waitForTimeout(500);
const scrollWidth = await page.evaluate(() => document.documentElement.scrollWidth);
expect(scrollWidth).toBeLessThanOrEqual(385);
});
});
test.describe('Structural - blog_health_when_to_see_a_doctor_for_allergies', () => {
test('blog_health_when_to_see_a_doctor_for_allergies: reproduces GT semantic landmarks', async ({ page }) => {
await page.goto('/blog/health/when-to-see-a-doctor-for-allergies/');
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('blog_health_when_to_see_a_doctor_for_allergies: heading hierarchy is valid', async ({ page }) => {
await page.goto('/blog/health/when-to-see-a-doctor-for-allergies/');
const headingLevels = await page.evaluate(() => {
const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
return Array.from(headings).map(h => parseInt(h.tagName.substring(1)));
});
if (headingLevels.length > 1) {
for (let i = 1; i < headingLevels.length; i++) {
const jump = headingLevels[i] - headingLevels[i-1];
expect(jump).toBeLessThanOrEqual(2);
}
}
});
test('blog_health_when_to_see_a_doctor_for_allergies: no horizontal overflow at 375px', async ({ page }) => {
await page.setViewportSize({ width: 375, height: 812 });
await page.goto('/blog/health/when-to-see-a-doctor-for-allergies/');
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('/about-us/');
const links = await page.locator('header a, nav a').allTextContents();
headerLinksByPage.push(links.map(l => l.trim()).filter(l => l.length > 0));
}
{
await page.goto('/blog/');
const links = await page.locator('header a, nav a').allTextContents();
headerLinksByPage.push(links.map(l => l.trim()).filter(l => l.length > 0));
}
{
await page.goto('/businesses/');
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);
}
}
}
});
});