import { test, expect } from '@playwright/test'; test.describe('Functional - homepage', () => { test('homepage: h1 "A framework for teams who buil"', async ({ page }) => { await page.goto('/'); const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'A framework for teams who build to last.' || t.startsWith('A framework for teams who build to last.'))).toBeTruthy(); }); }); test.describe('Functional - builds', () => { test('builds: title matches GT', async ({ page }) => { await page.goto('/builds/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('releases'); }); test('builds: h2 "Latest Release: 6.11.0"', async ({ page }) => { await page.goto('/builds/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Latest Release: 6.11.0' || t.startsWith('Latest Release: 6.11.0'))).toBeTruthy(); }); }); test.describe('Functional - editions', () => { test('editions: title matches GT', async ({ page }) => { await page.goto('/editions/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('editions'); }); }); test.describe('Functional - guidelines', () => { test('guidelines: title matches GT', async ({ page }) => { await page.goto('/guidelines/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('community guidelines'); }); }); test.describe('Functional - logos', () => { test('logos: title matches GT', async ({ page }) => { await page.goto('/logos/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('branding'); }); test('logos: h2 "The Bramble Mascots"', async ({ page }) => { await page.goto('/logos/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'The Bramble Mascots' || t.startsWith('The Bramble Mascots'))).toBeTruthy(); }); test('logos: h2 "Company Technology Pages"', async ({ page }) => { await page.goto('/logos/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Company Technology Pages' || t.startsWith('Company Technology Pages'))).toBeTruthy(); }); }); test.describe('Functional - security', () => { test('security: title matches GT', async ({ page }) => { await page.goto('/security/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('security'); }); test('security: h1 "Bramble Security Policy"', async ({ page }) => { await page.goto('/security/'); const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Bramble Security Policy' || t.startsWith('Bramble Security Policy'))).toBeTruthy(); }); test('security: h2 "Reporting a Bug"', async ({ page }) => { await page.goto('/security/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Reporting a Bug' || t.startsWith('Reporting a Bug'))).toBeTruthy(); }); test('security: h2 "Disclosure Policy"', async ({ page }) => { await page.goto('/security/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Disclosure Policy' || t.startsWith('Disclosure Policy'))).toBeTruthy(); }); test('security: h2 "Receiving Security Updates"', async ({ page }) => { await page.goto('/security/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Receiving Security Updates' || t.startsWith('Receiving Security Updates'))).toBeTruthy(); }); test('security: footer link "Team"', async ({ page }) => { await page.goto('/security/'); const links = page.locator('footer a, [role="contentinfo"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Team' || t.startsWith('Team')), 'link text in footer').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('teams')), 'href fragment present').toBeTruthy(); }); test('security: footer link "Sponsors"', async ({ page }) => { await page.goto('/security/'); const links = page.locator('footer a, [role="contentinfo"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Sponsors' || t.startsWith('Sponsors')), 'link text in footer').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('sponsors')), 'href fragment present').toBeTruthy(); }); test('security: footer link "Security"', async ({ page }) => { await page.goto('/security/'); const links = page.locator('footer a, [role="contentinfo"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Security' || t.startsWith('Security')), 'link text in footer').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('security')), 'href fragment present').toBeTruthy(); }); test('security: footer link "Legal"', async ({ page }) => { await page.goto('/security/'); const links = page.locator('footer a, [role="contentinfo"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Legal' || t.startsWith('Legal')), 'link text in footer').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('legal')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - sponsors', () => { test('sponsors: title matches GT', async ({ page }) => { await page.goto('/sponsors/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('sponsors'); }); }); test.describe('Functional - team', () => { test('team: title matches GT', async ({ page }) => { await page.goto('/team/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('team'); }); }); test.describe('Functional - teams', () => { test('teams: title matches GT', async ({ page }) => { await page.goto('/teams/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('team'); }); }); test.describe('Functional - about_legal', () => { test('about_legal: title matches GT', async ({ page }) => { await page.goto('/about/legal/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('legal'); }); }); test.describe('Functional - community_meetups', () => { test('community_meetups: title matches GT', async ({ page }) => { await page.goto('/community/meetups/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('meetups'); }); test('community_meetups: h2 "Find a meetup in your city"', async ({ page }) => { await page.goto('/community/meetups/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Find a meetup in your city' || t.startsWith('Find a meetup in your city'))).toBeTruthy(); }); test('community_meetups: h3 "North America"', async ({ page }) => { await page.goto('/community/meetups/'); const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'North America' || t.startsWith('North America'))).toBeTruthy(); }); }); test.describe('Functional - community_meetups_assets', () => { test('community_meetups_assets: title matches GT', async ({ page }) => { await page.goto('/community/meetups/assets/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('assets'); }); test('community_meetups_assets: h2 "Recording Your Meetup"', async ({ page }) => { await page.goto('/community/meetups/assets/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Recording Your Meetup' || t.startsWith('Recording Your Meetup'))).toBeTruthy(); }); test('community_meetups_assets: h2 "Organizers Network"', async ({ page }) => { await page.goto('/community/meetups/assets/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Organizers Network' || t.startsWith('Organizers Network'))).toBeTruthy(); }); }); test.describe('Functional - community_meetups_getting_started', () => { test('community_meetups_getting_started: title matches GT', async ({ page }) => { await page.goto('/community/meetups-getting-started/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('getting started'); }); }); test.describe('Functional - mascots_commission', () => { }); test.describe('Functional - mascots_faq', () => { }); test.describe('Functional - releases_beta', () => { test('releases_beta: title matches GT', async ({ page }) => { await page.goto('/releases/beta/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('beta'); }); test('releases_beta: h3 "Bramble"', async ({ page }) => { await page.goto('/releases/beta/'); const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Bramble' || t.startsWith('Bramble'))).toBeTruthy(); }); }); test.describe('Functional - releases_canary', () => { test('releases_canary: title matches GT', async ({ page }) => { await page.goto('/releases/canary/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('canary'); }); test('releases_canary: h2 "What is canary?"', async ({ page }) => { await page.goto('/releases/canary/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'What is canary?' || t.startsWith('What is canary?'))).toBeTruthy(); }); test('releases_canary: h3 "Bramble"', async ({ page }) => { await page.goto('/releases/canary/'); const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Bramble' || t.startsWith('Bramble'))).toBeTruthy(); }); }); test.describe('Functional - releases_lts', () => { test('releases_lts: title matches GT', async ({ page }) => { await page.goto('/releases/lts/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('lts'); }); test('releases_lts: h2 "What is an LTS release?"', async ({ page }) => { await page.goto('/releases/lts/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'What is an LTS release?' || t.startsWith('What is an LTS release?'))).toBeTruthy(); }); }); test.describe('Functional - releases_release', () => { test('releases_release: title matches GT', async ({ page }) => { await page.goto('/releases/release/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('stable'); }); test('releases_release: h2 "What is a stable release?"', async ({ page }) => { await page.goto('/releases/release/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'What is a stable release?' || t.startsWith('What is a stable release?'))).toBeTruthy(); }); test('releases_release: h3 "Bramble"', async ({ page }) => { await page.goto('/releases/release/'); const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Bramble' || t.startsWith('Bramble'))).toBeTruthy(); }); }); test.describe('Functional - teams_emeritus', () => { test('teams_emeritus: title matches GT', async ({ page }) => { await page.goto('/teams/emeritus/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('emeritus'); }); }); test.describe('Functional - Routing', () => { });