import { test, expect } from '@playwright/test'; test.describe('Functional - homepage', () => { test('homepage: title matches GT', async ({ page }) => { await page.goto('/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('astrovia space agency'); }); test('homepage: h1 "Astrovia"', async ({ page }) => { await page.goto('/'); const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Astrovia' || t.startsWith('Astrovia'))).toBeTruthy(); }); test('homepage: h2 "Agence spatiale d\'Astrovia"', async ({ page }) => { await page.goto('/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Agence spatiale d\'Astrovia' || t.startsWith('Agence spatiale d\'Astrovia'))).toBeTruthy(); }); test('homepage: h2 "Astrovia Space Agency"', async ({ page }) => { await page.goto('/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Astrovia Space Agency' || t.startsWith('Astrovia Space Agency'))).toBeTruthy(); }); }); test.describe('Functional - eng', () => { test('eng: title matches GT', async ({ page }) => { await page.goto('/eng/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('astrovia space agency (asa)'); }); test('eng: h2 "Language selection"', async ({ page }) => { await page.goto('/eng/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Language selection' || t.startsWith('Language selection'))).toBeTruthy(); }); test('eng: h2 "Search"', async ({ page }) => { await page.goto('/eng/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Search' || t.startsWith('Search'))).toBeTruthy(); }); test('eng: h2 "Menu Astrovia.ca"', async ({ page }) => { await page.goto('/eng/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia.ca' || t.startsWith('Menu Astrovia.ca'))).toBeTruthy(); }); test('eng: header link "Français fr"', async ({ page }) => { await page.goto('/eng/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Français fr' || t.startsWith('Français fr')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('fra')), 'href fragment present').toBeTruthy(); }); test('eng: nav link "Astrovia Space Agency"', async ({ page }) => { await page.goto('/eng/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Astrovia Space Agency' || t.startsWith('Astrovia Space Agency')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('eng')), 'href fragment present').toBeTruthy(); }); test('eng: nav link "Contact the ASA"', async ({ page }) => { await page.goto('/eng/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Contact the ASA' || t.startsWith('Contact the ASA')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('contact.asp')), 'href fragment present').toBeTruthy(); }); test('eng: nav link "About the ASA"', async ({ page }) => { await page.goto('/eng/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'About the ASA' || t.startsWith('About the ASA')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('about')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - fra', () => { test('fra: title matches GT', async ({ page }) => { await page.goto('/fra/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('astrovia'); }); test('fra: h2 "Sélection de la langue"', async ({ page }) => { await page.goto('/fra/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Sélection de la langue' || t.startsWith('Sélection de la langue'))).toBeTruthy(); }); test('fra: h2 "Recherche"', async ({ page }) => { await page.goto('/fra/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Recherche' || t.startsWith('Recherche'))).toBeTruthy(); }); test('fra: h2 "Menu Astrovia.ca"', async ({ page }) => { await page.goto('/fra/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia.ca' || t.startsWith('Menu Astrovia.ca'))).toBeTruthy(); }); test('fra: header link "English en"', async ({ page }) => { await page.goto('/fra/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'English en' || t.startsWith('English en')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('eng')), 'href fragment present').toBeTruthy(); }); test('fra: nav link "Agence spatiale Astrovia"', async ({ page }) => { await page.goto('/fra/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Agence spatiale Astrovia' || t.startsWith('Agence spatiale Astrovia')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('fra')), 'href fragment present').toBeTruthy(); }); test('fra: nav link "Contactez l\'ASA"', async ({ page }) => { await page.goto('/fra/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Contactez l\'ASA' || t.startsWith('Contactez l\'ASA')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('contact.asp')), 'href fragment present').toBeTruthy(); }); test('fra: nav link "À propos de l\'ASA"', async ({ page }) => { await page.goto('/fra/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'À propos de l\'ASA' || t.startsWith('À propos de l\'ASA')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('a-propos')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - eng_about', () => { test('eng_about: title matches GT', async ({ page }) => { await page.goto('/eng/about/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('astrovia space agency'); }); test('eng_about: h1 "Astrovia Space Agency"', async ({ page }) => { await page.goto('/eng/about/'); const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Astrovia Space Agency' || t.startsWith('Astrovia Space Agency'))).toBeTruthy(); }); test('eng_about: h2 "Language selection"', async ({ page }) => { await page.goto('/eng/about/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Language selection' || t.startsWith('Language selection'))).toBeTruthy(); }); test('eng_about: h2 "Search"', async ({ page }) => { await page.goto('/eng/about/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Search' || t.startsWith('Search'))).toBeTruthy(); }); test('eng_about: h2 "Menu Astrovia.ca"', async ({ page }) => { await page.goto('/eng/about/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia.ca' || t.startsWith('Menu Astrovia.ca'))).toBeTruthy(); }); test('eng_about: header link "Français fr"', async ({ page }) => { await page.goto('/eng/about/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Français fr' || t.startsWith('Français fr')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('a-propos')), 'href fragment present').toBeTruthy(); }); test('eng_about: nav link "Astrovia Space Agency"', async ({ page }) => { await page.goto('/eng/about/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Astrovia Space Agency' || t.startsWith('Astrovia Space Agency')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('eng')), 'href fragment present').toBeTruthy(); }); test('eng_about: nav link "Contact the ASA"', async ({ page }) => { await page.goto('/eng/about/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Contact the ASA' || t.startsWith('Contact the ASA')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('contact.asp')), 'href fragment present').toBeTruthy(); }); test('eng_about: nav link "About the ASA"', async ({ page }) => { await page.goto('/eng/about/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'About the ASA' || t.startsWith('About the ASA')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('about')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - eng_accessibility', () => { test('eng_accessibility: title matches GT', async ({ page }) => { await page.goto('/eng/accessibility/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('accessibility at the astrovia space agen'); }); test('eng_accessibility: h2 "Language selection"', async ({ page }) => { await page.goto('/eng/accessibility/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Language selection' || t.startsWith('Language selection'))).toBeTruthy(); }); test('eng_accessibility: h2 "Search"', async ({ page }) => { await page.goto('/eng/accessibility/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Search' || t.startsWith('Search'))).toBeTruthy(); }); test('eng_accessibility: h2 "Menu Astrovia"', async ({ page }) => { await page.goto('/eng/accessibility/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia' || t.startsWith('Menu Astrovia'))).toBeTruthy(); }); test('eng_accessibility: header link "Français fr"', async ({ page }) => { await page.goto('/eng/accessibility/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Français fr' || t.startsWith('Français fr')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('accessibilite')), 'href fragment present').toBeTruthy(); }); test('eng_accessibility: nav link "Astrovia Space Agency"', async ({ page }) => { await page.goto('/eng/accessibility/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Astrovia Space Agency' || t.startsWith('Astrovia Space Agency')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('eng')), 'href fragment present').toBeTruthy(); }); test('eng_accessibility: nav link "Contact the ASA"', async ({ page }) => { await page.goto('/eng/accessibility/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Contact the ASA' || t.startsWith('Contact the ASA')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('contact.asp')), 'href fragment present').toBeTruthy(); }); test('eng_accessibility: nav link "About the ASA"', async ({ page }) => { await page.goto('/eng/accessibility/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'About the ASA' || t.startsWith('About the ASA')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('about')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - eng_astronauts', () => { test('eng_astronauts: title matches GT', async ({ page }) => { await page.goto('/eng/astronauts/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('astronauts'); }); test('eng_astronauts: h2 "Language selection"', async ({ page }) => { await page.goto('/eng/astronauts/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Language selection' || t.startsWith('Language selection'))).toBeTruthy(); }); test('eng_astronauts: h2 "Search"', async ({ page }) => { await page.goto('/eng/astronauts/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Search' || t.startsWith('Search'))).toBeTruthy(); }); test('eng_astronauts: h2 "Menu Astrovia.ca"', async ({ page }) => { await page.goto('/eng/astronauts/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia.ca' || t.startsWith('Menu Astrovia.ca'))).toBeTruthy(); }); test('eng_astronauts: header link "Français fr"', async ({ page }) => { await page.goto('/eng/astronauts/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Français fr' || t.startsWith('Français fr')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('astronautes')), 'href fragment present').toBeTruthy(); }); test('eng_astronauts: nav link "Discover the themes"', async ({ page }) => { await page.goto('/eng/astronauts/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Discover the themes' || t.startsWith('Discover the themes')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('discover-the-themes.asp')), 'href fragment present').toBeTruthy(); }); test('eng_astronauts: nav link "Contact the ASA"', async ({ page }) => { await page.goto('/eng/astronauts/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Contact the ASA' || t.startsWith('Contact the ASA')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('contact.asp')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - eng_astronomy', () => { test('eng_astronomy: title matches GT', async ({ page }) => { await page.goto('/eng/astronomy/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('astronomy'); }); test('eng_astronomy: h2 "Language selection"', async ({ page }) => { await page.goto('/eng/astronomy/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Language selection' || t.startsWith('Language selection'))).toBeTruthy(); }); test('eng_astronomy: h2 "Search"', async ({ page }) => { await page.goto('/eng/astronomy/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Search' || t.startsWith('Search'))).toBeTruthy(); }); test('eng_astronomy: h2 "Menu Astrovia.ca"', async ({ page }) => { await page.goto('/eng/astronomy/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia.ca' || t.startsWith('Menu Astrovia.ca'))).toBeTruthy(); }); test('eng_astronomy: header link "Français fr"', async ({ page }) => { await page.goto('/eng/astronomy/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Français fr' || t.startsWith('Français fr')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('astronomie')), 'href fragment present').toBeTruthy(); }); test('eng_astronomy: nav link "Discover the themes"', async ({ page }) => { await page.goto('/eng/astronomy/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Discover the themes' || t.startsWith('Discover the themes')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('discover-the-themes.asp')), 'href fragment present').toBeTruthy(); }); test('eng_astronomy: nav link "Science"', async ({ page }) => { await page.goto('/eng/astronomy/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Science' || t.startsWith('Science')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('sciences')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - eng_events', () => { test('eng_events: title matches GT', async ({ page }) => { await page.goto('/eng/events/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('events'); }); test('eng_events: h2 "Language selection"', async ({ page }) => { await page.goto('/eng/events/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Language selection' || t.startsWith('Language selection'))).toBeTruthy(); }); test('eng_events: h2 "Search"', async ({ page }) => { await page.goto('/eng/events/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Search' || t.startsWith('Search'))).toBeTruthy(); }); test('eng_events: h2 "Menu Astrovia"', async ({ page }) => { await page.goto('/eng/events/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia' || t.startsWith('Menu Astrovia'))).toBeTruthy(); }); test('eng_events: header link "Français fr"', async ({ page }) => { await page.goto('/eng/events/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Français fr' || t.startsWith('Français fr')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('evenements')), 'href fragment present').toBeTruthy(); }); test('eng_events: nav link "Resources"', async ({ page }) => { await page.goto('/eng/events/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Resources' || t.startsWith('Resources')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('resources.asp')), 'href fragment present').toBeTruthy(); }); test('eng_events: nav link "Contact the ASA"', async ({ page }) => { await page.goto('/eng/events/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Contact the ASA' || t.startsWith('Contact the ASA')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('contact.asp')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - eng_funding_programs', () => { test('eng_funding_programs: title matches GT', async ({ page }) => { await page.goto('/eng/funding-programs/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('funding programs and opportunities'); }); test('eng_funding_programs: h2 "Language selection"', async ({ page }) => { await page.goto('/eng/funding-programs/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Language selection' || t.startsWith('Language selection'))).toBeTruthy(); }); test('eng_funding_programs: h2 "Search"', async ({ page }) => { await page.goto('/eng/funding-programs/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Search' || t.startsWith('Search'))).toBeTruthy(); }); test('eng_funding_programs: h2 "Menu Astrovia.ca"', async ({ page }) => { await page.goto('/eng/funding-programs/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia.ca' || t.startsWith('Menu Astrovia.ca'))).toBeTruthy(); }); test('eng_funding_programs: header link "Français fr"', async ({ page }) => { await page.goto('/eng/funding-programs/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Français fr' || t.startsWith('Français fr')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('programmes-financement')), 'href fragment present').toBeTruthy(); }); test('eng_funding_programs: nav link "Contact the ASA"', async ({ page }) => { await page.goto('/eng/funding-programs/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Contact the ASA' || t.startsWith('Contact the ASA')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('contact.asp')), 'href fragment present').toBeTruthy(); }); test('eng_funding_programs: nav link "About the ASA"', async ({ page }) => { await page.goto('/eng/funding-programs/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'About the ASA' || t.startsWith('About the ASA')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('about')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - eng_iss', () => { test('eng_iss: title matches GT', async ({ page }) => { await page.goto('/eng/iss/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('orbital research station'); }); test('eng_iss: h2 "Language selection"', async ({ page }) => { await page.goto('/eng/iss/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Language selection' || t.startsWith('Language selection'))).toBeTruthy(); }); test('eng_iss: h2 "Search"', async ({ page }) => { await page.goto('/eng/iss/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Search' || t.startsWith('Search'))).toBeTruthy(); }); test('eng_iss: h2 "Menu Astrovia.ca"', async ({ page }) => { await page.goto('/eng/iss/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia.ca' || t.startsWith('Menu Astrovia.ca'))).toBeTruthy(); }); test('eng_iss: header link "Français fr"', async ({ page }) => { await page.goto('/eng/iss/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Français fr' || t.startsWith('Français fr')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('iss')), 'href fragment present').toBeTruthy(); }); test('eng_iss: nav link "Discover the themes"', async ({ page }) => { await page.goto('/eng/iss/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Discover the themes' || t.startsWith('Discover the themes')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('discover-the-themes.asp')), 'href fragment present').toBeTruthy(); }); test('eng_iss: nav link "Satellites"', async ({ page }) => { await page.goto('/eng/iss/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Satellites' || t.startsWith('Satellites')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('satellites')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - eng_jobs', () => { test('eng_jobs: title matches GT', async ({ page }) => { await page.goto('/eng/jobs/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('careers, jobs and internships in the spa'); }); test('eng_jobs: h2 "Language selection"', async ({ page }) => { await page.goto('/eng/jobs/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Language selection' || t.startsWith('Language selection'))).toBeTruthy(); }); test('eng_jobs: h2 "Search"', async ({ page }) => { await page.goto('/eng/jobs/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Search' || t.startsWith('Search'))).toBeTruthy(); }); test('eng_jobs: h2 "Menu Astrovia.ca"', async ({ page }) => { await page.goto('/eng/jobs/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia.ca' || t.startsWith('Menu Astrovia.ca'))).toBeTruthy(); }); test('eng_jobs: header link "Français fr"', async ({ page }) => { await page.goto('/eng/jobs/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Français fr' || t.startsWith('Français fr')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('emplois')), 'href fragment present').toBeTruthy(); }); test('eng_jobs: nav link "Resources"', async ({ page }) => { await page.goto('/eng/jobs/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Resources' || t.startsWith('Resources')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('resources.asp')), 'href fragment present').toBeTruthy(); }); test('eng_jobs: nav link "Contact the ASA"', async ({ page }) => { await page.goto('/eng/jobs/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Contact the ASA' || t.startsWith('Contact the ASA')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('contact.asp')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - eng_laboratories_and_warehouse', () => { test('eng_laboratories_and_warehouse: title matches GT', async ({ page }) => { await page.goto('/eng/laboratories-and-warehouse/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('laboratories and warehouse'); }); test('eng_laboratories_and_warehouse: h2 "Language selection"', async ({ page }) => { await page.goto('/eng/laboratories-and-warehouse/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Language selection' || t.startsWith('Language selection'))).toBeTruthy(); }); test('eng_laboratories_and_warehouse: h2 "Search"', async ({ page }) => { await page.goto('/eng/laboratories-and-warehouse/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Search' || t.startsWith('Search'))).toBeTruthy(); }); test('eng_laboratories_and_warehouse: h2 "Menu Astrovia.ca"', async ({ page }) => { await page.goto('/eng/laboratories-and-warehouse/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia.ca' || t.startsWith('Menu Astrovia.ca'))).toBeTruthy(); }); test('eng_laboratories_and_warehouse: header link "Français fr"', async ({ page }) => { await page.goto('/eng/laboratories-and-warehouse/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Français fr' || t.startsWith('Français fr')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('laboratoires-et-entrepot')), 'href fragment present').toBeTruthy(); }); test('eng_laboratories_and_warehouse: nav link "About"', async ({ page }) => { await page.goto('/eng/laboratories-and-warehouse/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'About' || t.startsWith('About')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('about')), 'href fragment present').toBeTruthy(); }); test('eng_laboratories_and_warehouse: nav link "Contact the ASA"', async ({ page }) => { await page.goto('/eng/laboratories-and-warehouse/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Contact the ASA' || t.startsWith('Contact the ASA')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('contact.asp')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - eng_media', () => { test('eng_media: title matches GT', async ({ page }) => { await page.goto('/eng/media/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('press room'); }); test('eng_media: h1 "Media room"', async ({ page }) => { await page.goto('/eng/media/'); const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Media room' || t.startsWith('Media room'))).toBeTruthy(); }); test('eng_media: h2 "Select your language"', async ({ page }) => { await page.goto('/eng/media/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Select your language' || t.startsWith('Select your language'))).toBeTruthy(); }); test('eng_media: h2 "Search"', async ({ page }) => { await page.goto('/eng/media/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Search' || t.startsWith('Search'))).toBeTruthy(); }); test('eng_media: h2 "Menu Astrovia.ca"', async ({ page }) => { await page.goto('/eng/media/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia.ca' || t.startsWith('Menu Astrovia.ca'))).toBeTruthy(); }); test('eng_media: header link "Français fr"', async ({ page }) => { await page.goto('/eng/media/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Français fr' || t.startsWith('Français fr')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('media')), 'href fragment present').toBeTruthy(); }); test('eng_media: nav link "Audiences"', async ({ page }) => { await page.goto('/eng/media/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Audiences' || t.startsWith('Audiences')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('audiences.asp')), 'href fragment present').toBeTruthy(); }); test('eng_media: nav link "Contact the ASA"', async ({ page }) => { await page.goto('/eng/media/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Contact the ASA' || t.startsWith('Contact the ASA')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('contact.asp')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - eng_missions', () => { test('eng_missions: title matches GT', async ({ page }) => { await page.goto('/eng/missions/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('human space missions'); }); test('eng_missions: h2 "Language selection"', async ({ page }) => { await page.goto('/eng/missions/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Language selection' || t.startsWith('Language selection'))).toBeTruthy(); }); test('eng_missions: h2 "Search"', async ({ page }) => { await page.goto('/eng/missions/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Search' || t.startsWith('Search'))).toBeTruthy(); }); test('eng_missions: h2 "Menu Astrovia"', async ({ page }) => { await page.goto('/eng/missions/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia' || t.startsWith('Menu Astrovia'))).toBeTruthy(); }); test('eng_missions: header link "Français fr"', async ({ page }) => { await page.goto('/eng/missions/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Français fr' || t.startsWith('Français fr')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('missions')), 'href fragment present').toBeTruthy(); }); test('eng_missions: nav link "Discover the themes"', async ({ page }) => { await page.goto('/eng/missions/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Discover the themes' || t.startsWith('Discover the themes')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('discover-the-themes.asp')), 'href fragment present').toBeTruthy(); }); test('eng_missions: nav link "Astronauts"', async ({ page }) => { await page.goto('/eng/missions/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Astronauts' || t.startsWith('Astronauts')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('astronauts')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - eng_multimedia', () => { test('eng_multimedia: title matches GT', async ({ page }) => { await page.goto('/eng/multimedia/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('multimedia'); }); test('eng_multimedia: h2 "Language selection"', async ({ page }) => { await page.goto('/eng/multimedia/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Language selection' || t.startsWith('Language selection'))).toBeTruthy(); }); test('eng_multimedia: h2 "Search"', async ({ page }) => { await page.goto('/eng/multimedia/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Search' || t.startsWith('Search'))).toBeTruthy(); }); test('eng_multimedia: h2 "Menu Astrovia.ca"', async ({ page }) => { await page.goto('/eng/multimedia/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia.ca' || t.startsWith('Menu Astrovia.ca'))).toBeTruthy(); }); test('eng_multimedia: header link "Français fr"', async ({ page }) => { await page.goto('/eng/multimedia/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Français fr' || t.startsWith('Français fr')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('multimedia')), 'href fragment present').toBeTruthy(); }); test('eng_multimedia: nav link "Astrovia Space Agency"', async ({ page }) => { await page.goto('/eng/multimedia/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Astrovia Space Agency' || t.startsWith('Astrovia Space Agency')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('eng')), 'href fragment present').toBeTruthy(); }); test('eng_multimedia: nav link "Contact the ASA"', async ({ page }) => { await page.goto('/eng/multimedia/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Contact the ASA' || t.startsWith('Contact the ASA')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('contact.asp')), 'href fragment present').toBeTruthy(); }); test('eng_multimedia: nav link "About the ASA"', async ({ page }) => { await page.goto('/eng/multimedia/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'About the ASA' || t.startsWith('About the ASA')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('about')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - eng_publications', () => { test('eng_publications: title matches GT', async ({ page }) => { await page.goto('/eng/publications/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('publications'); }); test('eng_publications: h2 "Language selection"', async ({ page }) => { await page.goto('/eng/publications/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Language selection' || t.startsWith('Language selection'))).toBeTruthy(); }); test('eng_publications: h2 "Search"', async ({ page }) => { await page.goto('/eng/publications/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Search' || t.startsWith('Search'))).toBeTruthy(); }); test('eng_publications: h2 "Menu Astrovia.ca"', async ({ page }) => { await page.goto('/eng/publications/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia.ca' || t.startsWith('Menu Astrovia.ca'))).toBeTruthy(); }); test('eng_publications: header link "Français fr"', async ({ page }) => { await page.goto('/eng/publications/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Français fr' || t.startsWith('Français fr')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('publications')), 'href fragment present').toBeTruthy(); }); test('eng_publications: nav link "About"', async ({ page }) => { await page.goto('/eng/publications/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'About' || t.startsWith('About')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('about')), 'href fragment present').toBeTruthy(); }); test('eng_publications: nav link "Contact the ASA"', async ({ page }) => { await page.goto('/eng/publications/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Contact the ASA' || t.startsWith('Contact the ASA')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('contact.asp')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - eng_transparency', () => { test('eng_transparency: title matches GT', async ({ page }) => { await page.goto('/eng/transparency/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('transparency'); }); test('eng_transparency: h2 "Select your language"', async ({ page }) => { await page.goto('/eng/transparency/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Select your language' || t.startsWith('Select your language'))).toBeTruthy(); }); test('eng_transparency: h2 "Search"', async ({ page }) => { await page.goto('/eng/transparency/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Search' || t.startsWith('Search'))).toBeTruthy(); }); test('eng_transparency: h2 "Menu Astrovia.ca"', async ({ page }) => { await page.goto('/eng/transparency/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia.ca' || t.startsWith('Menu Astrovia.ca'))).toBeTruthy(); }); test('eng_transparency: header link "Français fr"', async ({ page }) => { await page.goto('/eng/transparency/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Français fr' || t.startsWith('Français fr')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('transparence')), 'href fragment present').toBeTruthy(); }); test('eng_transparency: nav link "Resources"', async ({ page }) => { await page.goto('/eng/transparency/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Resources' || t.startsWith('Resources')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('resources.asp')), 'href fragment present').toBeTruthy(); }); test('eng_transparency: nav link "Contact the ASA"', async ({ page }) => { await page.goto('/eng/transparency/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Contact the ASA' || t.startsWith('Contact the ASA')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('contact.asp')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - eng_youth_educators', () => { test('eng_youth_educators: title matches GT', async ({ page }) => { await page.goto('/eng/youth-educators/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('space activities for youth and educators'); }); test('eng_youth_educators: h1 "Youth and educators"', async ({ page }) => { await page.goto('/eng/youth-educators/'); const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Youth and educators' || t.startsWith('Youth and educators'))).toBeTruthy(); }); test('eng_youth_educators: h2 "Language selection"', async ({ page }) => { await page.goto('/eng/youth-educators/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Language selection' || t.startsWith('Language selection'))).toBeTruthy(); }); test('eng_youth_educators: h2 "Search"', async ({ page }) => { await page.goto('/eng/youth-educators/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Search' || t.startsWith('Search'))).toBeTruthy(); }); test('eng_youth_educators: h2 "Menu Astrovia.ca"', async ({ page }) => { await page.goto('/eng/youth-educators/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia.ca' || t.startsWith('Menu Astrovia.ca'))).toBeTruthy(); }); test('eng_youth_educators: header link "Français fr"', async ({ page }) => { await page.goto('/eng/youth-educators/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Français fr' || t.startsWith('Français fr')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('jeunes-educateurs')), 'href fragment present').toBeTruthy(); }); test('eng_youth_educators: nav link "Audiences"', async ({ page }) => { await page.goto('/eng/youth-educators/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Audiences' || t.startsWith('Audiences')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('audiences.asp')), 'href fragment present').toBeTruthy(); }); test('eng_youth_educators: nav link "Contact the ASA"', async ({ page }) => { await page.goto('/eng/youth-educators/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Contact the ASA' || t.startsWith('Contact the ASA')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('contact.asp')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - fra_iss', () => { test('fra_iss: title matches GT', async ({ page }) => { await page.goto('/fra/iss/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('la station de recherche orbitale'); }); test('fra_iss: h2 "Choix de votre langue"', async ({ page }) => { await page.goto('/fra/iss/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Choix de votre langue' || t.startsWith('Choix de votre langue'))).toBeTruthy(); }); test('fra_iss: h2 "Rechercher"', async ({ page }) => { await page.goto('/fra/iss/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Rechercher' || t.startsWith('Rechercher'))).toBeTruthy(); }); test('fra_iss: h2 "Menu Astrovia.ca"', async ({ page }) => { await page.goto('/fra/iss/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia.ca' || t.startsWith('Menu Astrovia.ca'))).toBeTruthy(); }); test('fra_iss: header link "English en"', async ({ page }) => { await page.goto('/fra/iss/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'English en' || t.startsWith('English en')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('iss')), 'href fragment present').toBeTruthy(); }); test('fra_iss: nav link "Astrovia, agence spatiale"', async ({ page }) => { await page.goto('/fra/iss/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Astrovia, agence spatiale' || t.startsWith('Astrovia, agence spatiale')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('fra')), 'href fragment present').toBeTruthy(); }); test('fra_iss: nav link "Explorez les thématiques"', async ({ page }) => { await page.goto('/fra/iss/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Explorez les thématiques' || t.startsWith('Explorez les thématiques')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('decouvrez-les-thematiques.asp')), 'href fragment present').toBeTruthy(); }); test('fra_iss: nav link "Satellites"', async ({ page }) => { await page.goto('/fra/iss/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Satellites' || t.startsWith('Satellites')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('satellites')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - eng_about_everyday_benefits_of_space_exploration', () => { test('eng_about_everyday_benefits_of_space_exploration: page loads without error', async ({ page }) => { const response = await page.goto('/eng/about/everyday-benefits-of-space-exploration/'); expect(response?.status()).toBeLessThan(400); await expect(page.locator('body')).toBeVisible(); }); test('eng_about_everyday_benefits_of_space_exploration: title matches GT', async ({ page }) => { await page.goto('/eng/about/everyday-benefits-of-space-exploration/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('everyday benefits of space exploration'); }); test('eng_about_everyday_benefits_of_space_exploration: h1 "Everyday benefits of space exp"', async ({ page }) => { await page.goto('/eng/about/everyday-benefits-of-space-exploration/'); const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Everyday benefits of space exploration' || t.startsWith('Everyday benefits of space exploration'))).toBeTruthy(); }); test('eng_about_everyday_benefits_of_space_exploration: h2 "Language selection"', async ({ page }) => { await page.goto('/eng/about/everyday-benefits-of-space-exploration/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Language selection' || t.startsWith('Language selection'))).toBeTruthy(); }); test('eng_about_everyday_benefits_of_space_exploration: h2 "Search"', async ({ page }) => { await page.goto('/eng/about/everyday-benefits-of-space-exploration/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Search' || t.startsWith('Search'))).toBeTruthy(); }); test('eng_about_everyday_benefits_of_space_exploration: h2 "Menu Astrovia.ca"', async ({ page }) => { await page.goto('/eng/about/everyday-benefits-of-space-exploration/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia.ca' || t.startsWith('Menu Astrovia.ca'))).toBeTruthy(); }); test('eng_about_everyday_benefits_of_space_exploration: header link "Français fr"', async ({ page }) => { await page.goto('/eng/about/everyday-benefits-of-space-exploration/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Français fr' || t.startsWith('Français fr')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('retombees-de-l-exploration-spatiale-au-quotidien')), 'href fragment present').toBeTruthy(); }); test('eng_about_everyday_benefits_of_space_exploration: nav link "Astrovia Space Agency"', async ({ page }) => { await page.goto('/eng/about/everyday-benefits-of-space-exploration/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Astrovia Space Agency' || t.startsWith('Astrovia Space Agency')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('eng')), 'href fragment present').toBeTruthy(); }); test('eng_about_everyday_benefits_of_space_exploration: nav link "About"', async ({ page }) => { await page.goto('/eng/about/everyday-benefits-of-space-exploration/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'About' || t.startsWith('About')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('about')), 'href fragment present').toBeTruthy(); }); test('eng_about_everyday_benefits_of_space_exploration: nav link "Contact the ASA"', async ({ page }) => { await page.goto('/eng/about/everyday-benefits-of-space-exploration/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Contact the ASA' || t.startsWith('Contact the ASA')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('contact.asp')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - eng_astronauts_about_the_job', () => { test('eng_astronauts_about_the_job: title matches GT', async ({ page }) => { await page.goto('/eng/astronauts/about-the-job/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('about life as an astronaut'); }); test('eng_astronauts_about_the_job: h1 "About the astronaut\'s role"', async ({ page }) => { await page.goto('/eng/astronauts/about-the-job/'); const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'About the astronaut\'s role' || t.startsWith('About the astronaut\'s role'))).toBeTruthy(); }); test('eng_astronauts_about_the_job: h2 "Language selection"', async ({ page }) => { await page.goto('/eng/astronauts/about-the-job/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Language selection' || t.startsWith('Language selection'))).toBeTruthy(); }); test('eng_astronauts_about_the_job: h2 "Search"', async ({ page }) => { await page.goto('/eng/astronauts/about-the-job/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Search' || t.startsWith('Search'))).toBeTruthy(); }); test('eng_astronauts_about_the_job: h2 "Menu Astrovia.ca"', async ({ page }) => { await page.goto('/eng/astronauts/about-the-job/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia.ca' || t.startsWith('Menu Astrovia.ca'))).toBeTruthy(); }); test('eng_astronauts_about_the_job: header link "Français fr"', async ({ page }) => { await page.goto('/eng/astronauts/about-the-job/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Français fr' || t.startsWith('Français fr')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('que-font-les-astronautes')), 'href fragment present').toBeTruthy(); }); test('eng_astronauts_about_the_job: nav link "Discover the themes"', async ({ page }) => { await page.goto('/eng/astronauts/about-the-job/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Discover the themes' || t.startsWith('Discover the themes')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('discover-the-themes.asp')), 'href fragment present').toBeTruthy(); }); test('eng_astronauts_about_the_job: nav link "Astronauts"', async ({ page }) => { await page.goto('/eng/astronauts/about-the-job/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Astronauts' || t.startsWith('Astronauts')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('astronauts')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - eng_astronauts_canadian', () => { test('eng_astronauts_canadian: title matches GT', async ({ page }) => { await page.goto('/eng/astronauts/canadian/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('astrovian astronauts'); }); test('eng_astronauts_canadian: h2 "Language selection"', async ({ page }) => { await page.goto('/eng/astronauts/canadian/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Language selection' || t.startsWith('Language selection'))).toBeTruthy(); }); test('eng_astronauts_canadian: h2 "Search"', async ({ page }) => { await page.goto('/eng/astronauts/canadian/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Search' || t.startsWith('Search'))).toBeTruthy(); }); test('eng_astronauts_canadian: h2 "Menu Astrovia.ca"', async ({ page }) => { await page.goto('/eng/astronauts/canadian/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia.ca' || t.startsWith('Menu Astrovia.ca'))).toBeTruthy(); }); test('eng_astronauts_canadian: header link "Français fr"', async ({ page }) => { await page.goto('/eng/astronauts/canadian/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Français fr' || t.startsWith('Français fr')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('canadiens')), 'href fragment present').toBeTruthy(); }); test('eng_astronauts_canadian: nav link "Explore the themes"', async ({ page }) => { await page.goto('/eng/astronauts/canadian/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Explore the themes' || t.startsWith('Explore the themes')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('discover-the-themes.asp')), 'href fragment present').toBeTruthy(); }); test('eng_astronauts_canadian: nav link "Astronauts"', async ({ page }) => { await page.goto('/eng/astronauts/canadian/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Astronauts' || t.startsWith('Astronauts')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('astronauts')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - eng_astronauts_living_in_space', () => { test('eng_astronauts_living_in_space: title matches GT', async ({ page }) => { await page.goto('/eng/astronauts/living-in-space/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('living in orbit'); }); test('eng_astronauts_living_in_space: h2 "Language selection"', async ({ page }) => { await page.goto('/eng/astronauts/living-in-space/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Language selection' || t.startsWith('Language selection'))).toBeTruthy(); }); test('eng_astronauts_living_in_space: h2 "Search"', async ({ page }) => { await page.goto('/eng/astronauts/living-in-space/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Search' || t.startsWith('Search'))).toBeTruthy(); }); test('eng_astronauts_living_in_space: h2 "Menu Astrovia.ca"', async ({ page }) => { await page.goto('/eng/astronauts/living-in-space/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia.ca' || t.startsWith('Menu Astrovia.ca'))).toBeTruthy(); }); test('eng_astronauts_living_in_space: header link "Français fr"', async ({ page }) => { await page.goto('/eng/astronauts/living-in-space/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Français fr' || t.startsWith('Français fr')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('vivre-dans-l-espace')), 'href fragment present').toBeTruthy(); }); test('eng_astronauts_living_in_space: nav link "Discover the themes"', async ({ page }) => { await page.goto('/eng/astronauts/living-in-space/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Discover the themes' || t.startsWith('Discover the themes')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('discover-the-themes.asp')), 'href fragment present').toBeTruthy(); }); test('eng_astronauts_living_in_space: nav link "Astronauts"', async ({ page }) => { await page.goto('/eng/astronauts/living-in-space/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Astronauts' || t.startsWith('Astronauts')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('astronauts')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - eng_astronauts_space_medicine', () => { test('eng_astronauts_space_medicine: title matches GT', async ({ page }) => { await page.goto('/eng/astronauts/space-medicine/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('space medicine'); }); test('eng_astronauts_space_medicine: h2 "Choose a language"', async ({ page }) => { await page.goto('/eng/astronauts/space-medicine/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Choose a language' || t.startsWith('Choose a language'))).toBeTruthy(); }); test('eng_astronauts_space_medicine: h2 "Search"', async ({ page }) => { await page.goto('/eng/astronauts/space-medicine/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Search' || t.startsWith('Search'))).toBeTruthy(); }); test('eng_astronauts_space_medicine: h2 "Menu Astrovia"', async ({ page }) => { await page.goto('/eng/astronauts/space-medicine/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia' || t.startsWith('Menu Astrovia'))).toBeTruthy(); }); test('eng_astronauts_space_medicine: header link "Français fr"', async ({ page }) => { await page.goto('/eng/astronauts/space-medicine/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Français fr' || t.startsWith('Français fr')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('medecine-spatiale')), 'href fragment present').toBeTruthy(); }); test('eng_astronauts_space_medicine: nav link "Explore the themes"', async ({ page }) => { await page.goto('/eng/astronauts/space-medicine/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Explore the themes' || t.startsWith('Explore the themes')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('discover-the-themes.asp')), 'href fragment present').toBeTruthy(); }); test('eng_astronauts_space_medicine: nav link "Astronauts"', async ({ page }) => { await page.goto('/eng/astronauts/space-medicine/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Astronauts' || t.startsWith('Astronauts')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('astronauts')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - eng_astronomy_beyond_our_solar_system', () => { test('eng_astronomy_beyond_our_solar_system: title matches GT', async ({ page }) => { await page.goto('/eng/astronomy/beyond-our-solar-system/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('beyond our solar system'); }); test('eng_astronomy_beyond_our_solar_system: h2 "Language selection"', async ({ page }) => { await page.goto('/eng/astronomy/beyond-our-solar-system/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Language selection' || t.startsWith('Language selection'))).toBeTruthy(); }); test('eng_astronomy_beyond_our_solar_system: h2 "Search"', async ({ page }) => { await page.goto('/eng/astronomy/beyond-our-solar-system/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Search' || t.startsWith('Search'))).toBeTruthy(); }); test('eng_astronomy_beyond_our_solar_system: h2 "Menu Astrovia.ca"', async ({ page }) => { await page.goto('/eng/astronomy/beyond-our-solar-system/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia.ca' || t.startsWith('Menu Astrovia.ca'))).toBeTruthy(); }); test('eng_astronomy_beyond_our_solar_system: header link "Français fr"', async ({ page }) => { await page.goto('/eng/astronomy/beyond-our-solar-system/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Français fr' || t.startsWith('Français fr')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('au-dela-systeme-solaire')), 'href fragment present').toBeTruthy(); }); test('eng_astronomy_beyond_our_solar_system: nav link "Explore the themes"', async ({ page }) => { await page.goto('/eng/astronomy/beyond-our-solar-system/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Explore the themes' || t.startsWith('Explore the themes')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('discover-the-themes.asp')), 'href fragment present').toBeTruthy(); }); test('eng_astronomy_beyond_our_solar_system: nav link "Science"', async ({ page }) => { await page.goto('/eng/astronomy/beyond-our-solar-system/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Science' || t.startsWith('Science')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('sciences')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - eng_astronomy_solar_system', () => { test('eng_astronomy_solar_system: title matches GT', async ({ page }) => { await page.goto('/eng/astronomy/solar-system/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('our solar system'); }); test('eng_astronomy_solar_system: h2 "Language selection"', async ({ page }) => { await page.goto('/eng/astronomy/solar-system/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Language selection' || t.startsWith('Language selection'))).toBeTruthy(); }); test('eng_astronomy_solar_system: h2 "Search"', async ({ page }) => { await page.goto('/eng/astronomy/solar-system/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Search' || t.startsWith('Search'))).toBeTruthy(); }); test('eng_astronomy_solar_system: h2 "Menu Astrovia"', async ({ page }) => { await page.goto('/eng/astronomy/solar-system/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia' || t.startsWith('Menu Astrovia'))).toBeTruthy(); }); test('eng_astronomy_solar_system: header link "Français fr"', async ({ page }) => { await page.goto('/eng/astronomy/solar-system/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Français fr' || t.startsWith('Français fr')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('systeme-solaire')), 'href fragment present').toBeTruthy(); }); test('eng_astronomy_solar_system: nav link "Discover the themes"', async ({ page }) => { await page.goto('/eng/astronomy/solar-system/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Discover the themes' || t.startsWith('Discover the themes')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('discover-the-themes.asp')), 'href fragment present').toBeTruthy(); }); test('eng_astronomy_solar_system: nav link "Science"', async ({ page }) => { await page.goto('/eng/astronomy/solar-system/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Science' || t.startsWith('Science')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('sciences')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - eng_astronomy_tips_tricks', () => { test('eng_astronomy_tips_tricks: title matches GT', async ({ page }) => { await page.goto('/eng/astronomy/tips-tricks/'); const t = (await page.title()).toLowerCase(); expect(t).toContain('tips and tricks for amateur astronomers'); }); test('eng_astronomy_tips_tricks: h1 "Advice and tricks for amateur "', async ({ page }) => { await page.goto('/eng/astronomy/tips-tricks/'); const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Advice and tricks for amateur stargazers' || t.startsWith('Advice and tricks for amateur stargazers'))).toBeTruthy(); }); test('eng_astronomy_tips_tricks: h2 "Language selection"', async ({ page }) => { await page.goto('/eng/astronomy/tips-tricks/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Language selection' || t.startsWith('Language selection'))).toBeTruthy(); }); test('eng_astronomy_tips_tricks: h2 "Search"', async ({ page }) => { await page.goto('/eng/astronomy/tips-tricks/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Search' || t.startsWith('Search'))).toBeTruthy(); }); test('eng_astronomy_tips_tricks: h2 "Menu Astrovia"', async ({ page }) => { await page.goto('/eng/astronomy/tips-tricks/'); const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Menu Astrovia' || t.startsWith('Menu Astrovia'))).toBeTruthy(); }); test('eng_astronomy_tips_tricks: header link "Français fr"', async ({ page }) => { await page.goto('/eng/astronomy/tips-tricks/'); const links = page.locator('header a, [role="banner"] a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Français fr' || t.startsWith('Français fr')), 'link text in header').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('conseils-astuces')), 'href fragment present').toBeTruthy(); }); test('eng_astronomy_tips_tricks: nav link "Discover the themes"', async ({ page }) => { await page.goto('/eng/astronomy/tips-tricks/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Discover the themes' || t.startsWith('Discover the themes')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('discover-the-themes.asp')), 'href fragment present').toBeTruthy(); }); test('eng_astronomy_tips_tricks: nav link "Science"', async ({ page }) => { await page.goto('/eng/astronomy/tips-tricks/'); const links = page.locator('nav a'); const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); expect(texts.some(t => t === 'Science' || t.startsWith('Science')), 'link text in nav').toBeTruthy(); const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); expect(hrefs.some(h => h.includes('sciences')), 'href fragment present').toBeTruthy(); }); }); test.describe('Functional - Routing', () => { });