Datasets:
Download web/webpack.js.org/tests/static/content.scripted.spec.ts from Qwen/RecreationBench: direct link, hf CLI and curl.
- Browser
- Download file 214 kB
-
https://huggingface.co/datasets/Qwen/RecreationBench/resolve/main/web/webpack.js.org/tests/static/content.scripted.spec.ts
- Command line
-
hf download hf://datasets/Qwen/RecreationBench/web/webpack.js.org/tests/static/content.scripted.spec.ts
-
curl -L -o content.scripted.spec.ts https://huggingface.co/datasets/Qwen/RecreationBench/resolve/main/web/webpack.js.org/tests/static/content.scripted.spec.ts
214 kB
| 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('webpack'); | |
| }); | |
| test('homepage: h1 "bundle your assets scripts"', async ({ page }) => { | |
| await page.goto('/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'bundle your assets scripts' || t.startsWith('bundle your assets scripts'))).toBeTruthy(); | |
| }); | |
| test('homepage: h1 "Support the Team"', async ({ page }) => { | |
| await page.goto('/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Support the Team' || t.startsWith('Support the Team'))).toBeTruthy(); | |
| }); | |
| test('homepage: nav link "Documentation"', async ({ page }) => { | |
| await page.goto('/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Documentation' || t.startsWith('Documentation')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('concepts')), 'href fragment present').toBeTruthy(); | |
| }); | |
| test('homepage: nav link "Contribute"', async ({ page }) => { | |
| await page.goto('/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Contribute' || t.startsWith('Contribute')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('contribute')), 'href fragment present').toBeTruthy(); | |
| }); | |
| test('homepage: nav link "Blog"', async ({ page }) => { | |
| await page.goto('/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Blog' || t.startsWith('Blog')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('blog')), 'href fragment present').toBeTruthy(); | |
| }); | |
| test('homepage: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - api', () => { | |
| test('api: title matches GT', async ({ page }) => { | |
| await page.goto('/api/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('introduction'); | |
| }); | |
| test('api: h1 "Introduction"', async ({ page }) => { | |
| await page.goto('/api/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Introduction' || t.startsWith('Introduction'))).toBeTruthy(); | |
| }); | |
| test('api: h2 "CLI"', async ({ page }) => { | |
| await page.goto('/api/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'CLI' || t.startsWith('CLI'))).toBeTruthy(); | |
| }); | |
| test('api: h2 "Module"', async ({ page }) => { | |
| await page.goto('/api/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Module' || t.startsWith('Module'))).toBeTruthy(); | |
| }); | |
| test('api: h2 "Node"', async ({ page }) => { | |
| await page.goto('/api/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Node' || t.startsWith('Node'))).toBeTruthy(); | |
| }); | |
| test('api: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/api/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - blog', () => { | |
| test('blog: title matches GT', async ({ page }) => { | |
| await page.goto('/blog/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('blog'); | |
| }); | |
| test('blog: h2 "Webpack 5.106"', async ({ page }) => { | |
| await page.goto('/blog/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Webpack 5.106' || t.startsWith('Webpack 5.106'))).toBeTruthy(); | |
| }); | |
| test('blog: h2 "Roadmap 2026"', async ({ page }) => { | |
| await page.goto('/blog/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Roadmap 2026' || t.startsWith('Roadmap 2026'))).toBeTruthy(); | |
| }); | |
| test('blog: h2 "Webpack 5.105"', async ({ page }) => { | |
| await page.goto('/blog/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Webpack 5.105' || t.startsWith('Webpack 5.105'))).toBeTruthy(); | |
| }); | |
| test('blog: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/blog/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - branding', () => { | |
| test('branding: title matches GT', async ({ page }) => { | |
| await page.goto('/branding/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('branding guidelines'); | |
| }); | |
| test('branding: h2 "The Name"', async ({ page }) => { | |
| await page.goto('/branding/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'The Name' || t.startsWith('The Name'))).toBeTruthy(); | |
| }); | |
| test('branding: h2 "Logo"', async ({ page }) => { | |
| await page.goto('/branding/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Logo' || t.startsWith('Logo'))).toBeTruthy(); | |
| }); | |
| test('branding: h2 "Icon only"', async ({ page }) => { | |
| await page.goto('/branding/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Icon only' || t.startsWith('Icon only'))).toBeTruthy(); | |
| }); | |
| test('branding: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/branding/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - comparison', () => { | |
| test('comparison: title matches GT', async ({ page }) => { | |
| await page.goto('/comparison/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('comparison'); | |
| }); | |
| test('comparison: h2 "Bundling vs. Loading"', async ({ page }) => { | |
| await page.goto('/comparison/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Bundling vs. Loading' || t.startsWith('Bundling vs. Loading'))).toBeTruthy(); | |
| }); | |
| test('comparison: h2 "Further Reading"', async ({ page }) => { | |
| await page.goto('/comparison/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Further Reading' || t.startsWith('Further Reading'))).toBeTruthy(); | |
| }); | |
| test('comparison: h2 "6 Contributors"', async ({ page }) => { | |
| await page.goto('/comparison/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '6 Contributors' || t.startsWith('6 Contributors'))).toBeTruthy(); | |
| }); | |
| test('comparison: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/comparison/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - concepts', () => { | |
| test('concepts: title matches GT', async ({ page }) => { | |
| await page.goto('/concepts/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('concepts'); | |
| }); | |
| test('concepts: h2 "Entry"', async ({ page }) => { | |
| await page.goto('/concepts/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Entry' || t.startsWith('Entry'))).toBeTruthy(); | |
| }); | |
| test('concepts: h2 "Output"', async ({ page }) => { | |
| await page.goto('/concepts/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Output' || t.startsWith('Output'))).toBeTruthy(); | |
| }); | |
| test('concepts: h2 "Loaders"', async ({ page }) => { | |
| await page.goto('/concepts/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Loaders' || t.startsWith('Loaders'))).toBeTruthy(); | |
| }); | |
| test('concepts: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/concepts/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - configuration', () => { | |
| test('configuration: title matches GT', async ({ page }) => { | |
| await page.goto('/configuration/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('configuration'); | |
| }); | |
| test('configuration: h2 "Use a different configuration "', async ({ page }) => { | |
| await page.goto('/configuration/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Use a different configuration file' || t.startsWith('Use a different configuration file'))).toBeTruthy(); | |
| }); | |
| test('configuration: h2 "Set up a new webpack project"', async ({ page }) => { | |
| await page.goto('/configuration/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Set up a new webpack project' || t.startsWith('Set up a new webpack project'))).toBeTruthy(); | |
| }); | |
| test('configuration: h2 "18 Contributors"', async ({ page }) => { | |
| await page.goto('/configuration/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '18 Contributors' || t.startsWith('18 Contributors'))).toBeTruthy(); | |
| }); | |
| test('configuration: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/configuration/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - contribute', () => { | |
| test('contribute: title matches GT', async ({ page }) => { | |
| await page.goto('/contribute/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('contribute'); | |
| }); | |
| test('contribute: h2 "Developers"', async ({ page }) => { | |
| await page.goto('/contribute/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Developers' || t.startsWith('Developers'))).toBeTruthy(); | |
| }); | |
| test('contribute: h2 "Executives"', async ({ page }) => { | |
| await page.goto('/contribute/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Executives' || t.startsWith('Executives'))).toBeTruthy(); | |
| }); | |
| test('contribute: h2 "Community"', async ({ page }) => { | |
| await page.goto('/contribute/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Community' || t.startsWith('Community'))).toBeTruthy(); | |
| }); | |
| test('contribute: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/contribute/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - glossary', () => { | |
| test('glossary: title matches GT', async ({ page }) => { | |
| await page.goto('/glossary/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('glossary'); | |
| }); | |
| test('glossary: h2 "7 Contributors"', async ({ page }) => { | |
| await page.goto('/glossary/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '7 Contributors' || t.startsWith('7 Contributors'))).toBeTruthy(); | |
| }); | |
| test('glossary: h3 "webpack"', async ({ page }) => { | |
| await page.goto('/glossary/'); | |
| const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'webpack' || t.startsWith('webpack'))).toBeTruthy(); | |
| }); | |
| test('glossary: h3 "Comparison"', async ({ page }) => { | |
| await page.goto('/glossary/'); | |
| const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Comparison' || t.startsWith('Comparison'))).toBeTruthy(); | |
| }); | |
| test('glossary: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/glossary/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - guides', () => { | |
| test('guides: title matches GT', async ({ page }) => { | |
| await page.goto('/guides/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('guides'); | |
| }); | |
| test('guides: h2 "3 Contributors"', async ({ page }) => { | |
| await page.goto('/guides/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '3 Contributors' || t.startsWith('3 Contributors'))).toBeTruthy(); | |
| }); | |
| test('guides: h3 "webpack"', async ({ page }) => { | |
| await page.goto('/guides/'); | |
| const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'webpack' || t.startsWith('webpack'))).toBeTruthy(); | |
| }); | |
| test('guides: h3 "Comparison"', async ({ page }) => { | |
| await page.goto('/guides/'); | |
| const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Comparison' || t.startsWith('Comparison'))).toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - guides_csp', () => { | |
| test('guides_csp: h2 "Examples"', async ({ page }) => { | |
| await page.goto('/guides/csp/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Examples' || t.startsWith('Examples'))).toBeTruthy(); | |
| }); | |
| test('guides_csp: h2 "Enabling CSP"', async ({ page }) => { | |
| await page.goto('/guides/csp/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Enabling CSP' || t.startsWith('Enabling CSP'))).toBeTruthy(); | |
| }); | |
| test('guides_csp: h2 "Trusted Types"', async ({ page }) => { | |
| await page.goto('/guides/csp/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Trusted Types' || t.startsWith('Trusted Types'))).toBeTruthy(); | |
| }); | |
| test('guides_csp: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/guides/csp/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - guides_dependency_management', () => { | |
| test('guides_dependency_management: title matches GT', async ({ page }) => { | |
| await page.goto('/guides/dependency-management/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('dependency management'); | |
| }); | |
| test('guides_dependency_management: h1 "Dependency Management"', async ({ page }) => { | |
| await page.goto('/guides/dependency-management/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Dependency Management' || t.startsWith('Dependency Management'))).toBeTruthy(); | |
| }); | |
| test('guides_dependency_management: h2 "Dynamic expressions in import("', async ({ page }) => { | |
| await page.goto('/guides/dependency-management/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Dynamic expressions in import() or require()' || t.startsWith('Dynamic expressions in import() or require()'))).toBeTruthy(); | |
| }); | |
| test('guides_dependency_management: h2 "import.meta.webpackContext"', async ({ page }) => { | |
| await page.goto('/guides/dependency-management/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'import.meta.webpackContext' || t.startsWith('import.meta.webpackContext'))).toBeTruthy(); | |
| }); | |
| test('guides_dependency_management: h2 "require.context"', async ({ page }) => { | |
| await page.goto('/guides/dependency-management/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'require.context' || t.startsWith('require.context'))).toBeTruthy(); | |
| }); | |
| test('guides_dependency_management: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/guides/dependency-management/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - guides_development', () => { | |
| test('guides_development: title matches GT', async ({ page }) => { | |
| await page.goto('/guides/development/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('development'); | |
| }); | |
| test('guides_development: h2 "Using source maps"', async ({ page }) => { | |
| await page.goto('/guides/development/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Using source maps' || t.startsWith('Using source maps'))).toBeTruthy(); | |
| }); | |
| test('guides_development: h2 "Choosing a Development Tool"', async ({ page }) => { | |
| await page.goto('/guides/development/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Choosing a Development Tool' || t.startsWith('Choosing a Development Tool'))).toBeTruthy(); | |
| }); | |
| test('guides_development: h2 "Adjusting Your Text Editor"', async ({ page }) => { | |
| await page.goto('/guides/development/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Adjusting Your Text Editor' || t.startsWith('Adjusting Your Text Editor'))).toBeTruthy(); | |
| }); | |
| test('guides_development: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/guides/development/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - guides_development_vagrant', () => { | |
| test('guides_development_vagrant: title matches GT', async ({ page }) => { | |
| await page.goto('/guides/development-vagrant/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('development'); | |
| }); | |
| test('guides_development_vagrant: h1 "Development - Vagrant"', async ({ page }) => { | |
| await page.goto('/guides/development-vagrant/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Development - Vagrant' || t.startsWith('Development - Vagrant'))).toBeTruthy(); | |
| }); | |
| test('guides_development_vagrant: h2 "Configuring the Project"', async ({ page }) => { | |
| await page.goto('/guides/development-vagrant/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Configuring the Project' || t.startsWith('Configuring the Project'))).toBeTruthy(); | |
| }); | |
| test('guides_development_vagrant: h2 "Running the Server"', async ({ page }) => { | |
| await page.goto('/guides/development-vagrant/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Running the Server' || t.startsWith('Running the Server'))).toBeTruthy(); | |
| }); | |
| test('guides_development_vagrant: h2 "Advanced Usage with nginx"', async ({ page }) => { | |
| await page.goto('/guides/development-vagrant/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Advanced Usage with nginx' || t.startsWith('Advanced Usage with nginx'))).toBeTruthy(); | |
| }); | |
| test('guides_development_vagrant: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/guides/development-vagrant/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - guides_environment_variables', () => { | |
| test('guides_environment_variables: title matches GT', async ({ page }) => { | |
| await page.goto('/guides/environment-variables/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('environment variables'); | |
| }); | |
| test('guides_environment_variables: h1 "Environment Variables"', async ({ page }) => { | |
| await page.goto('/guides/environment-variables/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Environment Variables' || t.startsWith('Environment Variables'))).toBeTruthy(); | |
| }); | |
| test('guides_environment_variables: h2 "8 Contributors"', async ({ page }) => { | |
| await page.goto('/guides/environment-variables/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '8 Contributors' || t.startsWith('8 Contributors'))).toBeTruthy(); | |
| }); | |
| test('guides_environment_variables: h3 "webpack"', async ({ page }) => { | |
| await page.goto('/guides/environment-variables/'); | |
| const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'webpack' || t.startsWith('webpack'))).toBeTruthy(); | |
| }); | |
| test('guides_environment_variables: h3 "Comparison"', async ({ page }) => { | |
| await page.goto('/guides/environment-variables/'); | |
| const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Comparison' || t.startsWith('Comparison'))).toBeTruthy(); | |
| }); | |
| test('guides_environment_variables: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/guides/environment-variables/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - guides_getting_started', () => { | |
| test('guides_getting_started: title matches GT', async ({ page }) => { | |
| await page.goto('/guides/getting-started/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('getting started'); | |
| }); | |
| test('guides_getting_started: h1 "Getting Started"', async ({ page }) => { | |
| await page.goto('/guides/getting-started/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Getting Started' || t.startsWith('Getting Started'))).toBeTruthy(); | |
| }); | |
| test('guides_getting_started: h2 "Quick Start (Minimal Working E"', async ({ page }) => { | |
| await page.goto('/guides/getting-started/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Quick Start (Minimal Working Example)' || t.startsWith('Quick Start (Minimal Working Example)'))).toBeTruthy(); | |
| }); | |
| test('guides_getting_started: h2 "Basic Setup"', async ({ page }) => { | |
| await page.goto('/guides/getting-started/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Basic Setup' || t.startsWith('Basic Setup'))).toBeTruthy(); | |
| }); | |
| test('guides_getting_started: h2 "Creating a Bundle"', async ({ page }) => { | |
| await page.goto('/guides/getting-started/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Creating a Bundle' || t.startsWith('Creating a Bundle'))).toBeTruthy(); | |
| }); | |
| test('guides_getting_started: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/guides/getting-started/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - guides_hot_module_replacement', () => { | |
| test('guides_hot_module_replacement: title matches GT', async ({ page }) => { | |
| await page.goto('/guides/hot-module-replacement/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('hot module replacement'); | |
| }); | |
| test('guides_hot_module_replacement: h1 "Hot Module Replacement"', async ({ page }) => { | |
| await page.goto('/guides/hot-module-replacement/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Hot Module Replacement' || t.startsWith('Hot Module Replacement'))).toBeTruthy(); | |
| }); | |
| test('guides_hot_module_replacement: h2 "Enabling HMR"', async ({ page }) => { | |
| await page.goto('/guides/hot-module-replacement/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Enabling HMR' || t.startsWith('Enabling HMR'))).toBeTruthy(); | |
| }); | |
| test('guides_hot_module_replacement: h2 "Via the Node.js API"', async ({ page }) => { | |
| await page.goto('/guides/hot-module-replacement/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Via the Node.js API' || t.startsWith('Via the Node.js API'))).toBeTruthy(); | |
| }); | |
| test('guides_hot_module_replacement: h2 "Gotchas"', async ({ page }) => { | |
| await page.goto('/guides/hot-module-replacement/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Gotchas' || t.startsWith('Gotchas'))).toBeTruthy(); | |
| }); | |
| test('guides_hot_module_replacement: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/guides/hot-module-replacement/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - guides_installation', () => { | |
| test('guides_installation: title matches GT', async ({ page }) => { | |
| await page.goto('/guides/installation/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('installation'); | |
| }); | |
| test('guides_installation: h2 "Prerequisites"', async ({ page }) => { | |
| await page.goto('/guides/installation/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Prerequisites' || t.startsWith('Prerequisites'))).toBeTruthy(); | |
| }); | |
| test('guides_installation: h2 "Local Installation"', async ({ page }) => { | |
| await page.goto('/guides/installation/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Local Installation' || t.startsWith('Local Installation'))).toBeTruthy(); | |
| }); | |
| test('guides_installation: h2 "Global Installation"', async ({ page }) => { | |
| await page.goto('/guides/installation/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Global Installation' || t.startsWith('Global Installation'))).toBeTruthy(); | |
| }); | |
| test('guides_installation: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/guides/installation/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - guides_output_management', () => { | |
| test('guides_output_management: title matches GT', async ({ page }) => { | |
| await page.goto('/guides/output-management/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('output management'); | |
| }); | |
| test('guides_output_management: h1 "Output Management"', async ({ page }) => { | |
| await page.goto('/guides/output-management/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Output Management' || t.startsWith('Output Management'))).toBeTruthy(); | |
| }); | |
| test('guides_output_management: h2 "Preparation"', async ({ page }) => { | |
| await page.goto('/guides/output-management/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Preparation' || t.startsWith('Preparation'))).toBeTruthy(); | |
| }); | |
| test('guides_output_management: h2 "Setting up HtmlWebpackPlugin"', async ({ page }) => { | |
| await page.goto('/guides/output-management/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Setting up HtmlWebpackPlugin' || t.startsWith('Setting up HtmlWebpackPlugin'))).toBeTruthy(); | |
| }); | |
| test('guides_output_management: h2 "Cleaning up the /dist folder"', async ({ page }) => { | |
| await page.goto('/guides/output-management/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Cleaning up the /dist folder' || t.startsWith('Cleaning up the /dist folder'))).toBeTruthy(); | |
| }); | |
| test('guides_output_management: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/guides/output-management/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - guides_production', () => { | |
| test('guides_production: title matches GT', async ({ page }) => { | |
| await page.goto('/guides/production/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('production'); | |
| }); | |
| test('guides_production: h2 "Setup"', async ({ page }) => { | |
| await page.goto('/guides/production/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Setup' || t.startsWith('Setup'))).toBeTruthy(); | |
| }); | |
| test('guides_production: h2 "NPM Scripts"', async ({ page }) => { | |
| await page.goto('/guides/production/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'NPM Scripts' || t.startsWith('NPM Scripts'))).toBeTruthy(); | |
| }); | |
| test('guides_production: h2 "Specify the Mode"', async ({ page }) => { | |
| await page.goto('/guides/production/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Specify the Mode' || t.startsWith('Specify the Mode'))).toBeTruthy(); | |
| }); | |
| test('guides_production: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/guides/production/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - guides_tree_shaking', () => { | |
| test('guides_tree_shaking: title matches GT', async ({ page }) => { | |
| await page.goto('/guides/tree-shaking/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('tree shaking'); | |
| }); | |
| test('guides_tree_shaking: h1 "Tree Shaking"', async ({ page }) => { | |
| await page.goto('/guides/tree-shaking/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Tree Shaking' || t.startsWith('Tree Shaking'))).toBeTruthy(); | |
| }); | |
| test('guides_tree_shaking: h2 "Add a Utility"', async ({ page }) => { | |
| await page.goto('/guides/tree-shaking/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Add a Utility' || t.startsWith('Add a Utility'))).toBeTruthy(); | |
| }); | |
| test('guides_tree_shaking: h2 "Mark the file as side-effect-f"', async ({ page }) => { | |
| await page.goto('/guides/tree-shaking/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Mark the file as side-effect-free' || t.startsWith('Mark the file as side-effect-free'))).toBeTruthy(); | |
| }); | |
| test('guides_tree_shaking: h2 "Clarifying tree shaking and si"', async ({ page }) => { | |
| await page.goto('/guides/tree-shaking/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Clarifying tree shaking and sideEffects' || t.startsWith('Clarifying tree shaking and sideEffects'))).toBeTruthy(); | |
| }); | |
| test('guides_tree_shaking: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/guides/tree-shaking/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - license', () => { | |
| test('license: title matches GT', async ({ page }) => { | |
| await page.goto('/license/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('license'); | |
| }); | |
| test('license: h2 "webpack"', async ({ page }) => { | |
| await page.goto('/license/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'webpack' || t.startsWith('webpack'))).toBeTruthy(); | |
| }); | |
| test('license: h2 "webpack logo and icon"', async ({ page }) => { | |
| await page.goto('/license/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'webpack logo and icon' || t.startsWith('webpack logo and icon'))).toBeTruthy(); | |
| }); | |
| test('license: h2 "webpack documentation"', async ({ page }) => { | |
| await page.goto('/license/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'webpack documentation' || t.startsWith('webpack documentation'))).toBeTruthy(); | |
| }); | |
| test('license: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/license/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - api_cli', () => { | |
| test('api_cli: title matches GT', async ({ page }) => { | |
| await page.goto('/api/cli/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('command line interface'); | |
| }); | |
| test('api_cli: h2 "Commands"', async ({ page }) => { | |
| await page.goto('/api/cli/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Commands' || t.startsWith('Commands'))).toBeTruthy(); | |
| }); | |
| test('api_cli: h2 "Flags"', async ({ page }) => { | |
| await page.goto('/api/cli/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Flags' || t.startsWith('Flags'))).toBeTruthy(); | |
| }); | |
| test('api_cli: h2 "Usage"', async ({ page }) => { | |
| await page.goto('/api/cli/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Usage' || t.startsWith('Usage'))).toBeTruthy(); | |
| }); | |
| test('api_cli: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/api/cli/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - api_compilation_hooks', () => { | |
| test('api_compilation_hooks: title matches GT', async ({ page }) => { | |
| await page.goto('/api/compilation-hooks/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('compilation hooks'); | |
| }); | |
| test('api_compilation_hooks: h1 "Compilation Hooks"', async ({ page }) => { | |
| await page.goto('/api/compilation-hooks/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Compilation Hooks' || t.startsWith('Compilation Hooks'))).toBeTruthy(); | |
| }); | |
| test('api_compilation_hooks: h2 "buildModule"', async ({ page }) => { | |
| await page.goto('/api/compilation-hooks/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'buildModule' || t.startsWith('buildModule'))).toBeTruthy(); | |
| }); | |
| test('api_compilation_hooks: h2 "rebuildModule"', async ({ page }) => { | |
| await page.goto('/api/compilation-hooks/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'rebuildModule' || t.startsWith('rebuildModule'))).toBeTruthy(); | |
| }); | |
| test('api_compilation_hooks: h2 "failedModule"', async ({ page }) => { | |
| await page.goto('/api/compilation-hooks/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'failedModule' || t.startsWith('failedModule'))).toBeTruthy(); | |
| }); | |
| test('api_compilation_hooks: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/api/compilation-hooks/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - api_compilation_object', () => { | |
| test('api_compilation_object: title matches GT', async ({ page }) => { | |
| await page.goto('/api/compilation-object/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('compilation object'); | |
| }); | |
| test('api_compilation_object: h1 "Compilation Object"', async ({ page }) => { | |
| await page.goto('/api/compilation-object/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Compilation Object' || t.startsWith('Compilation Object'))).toBeTruthy(); | |
| }); | |
| test('api_compilation_object: h2 "compilation object methods"', async ({ page }) => { | |
| await page.goto('/api/compilation-object/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'compilation object methods' || t.startsWith('compilation object methods'))).toBeTruthy(); | |
| }); | |
| test('api_compilation_object: h2 "4 Contributors"', async ({ page }) => { | |
| await page.goto('/api/compilation-object/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '4 Contributors' || t.startsWith('4 Contributors'))).toBeTruthy(); | |
| }); | |
| test('api_compilation_object: h3 "webpack"', async ({ page }) => { | |
| await page.goto('/api/compilation-object/'); | |
| const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'webpack' || t.startsWith('webpack'))).toBeTruthy(); | |
| }); | |
| test('api_compilation_object: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/api/compilation-object/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - api_compiler_hooks', () => { | |
| test('api_compiler_hooks: title matches GT', async ({ page }) => { | |
| await page.goto('/api/compiler-hooks/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('compiler hooks'); | |
| }); | |
| test('api_compiler_hooks: h1 "Compiler Hooks"', async ({ page }) => { | |
| await page.goto('/api/compiler-hooks/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Compiler Hooks' || t.startsWith('Compiler Hooks'))).toBeTruthy(); | |
| }); | |
| test('api_compiler_hooks: h2 "Watching"', async ({ page }) => { | |
| await page.goto('/api/compiler-hooks/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Watching' || t.startsWith('Watching'))).toBeTruthy(); | |
| }); | |
| test('api_compiler_hooks: h2 "Hooks"', async ({ page }) => { | |
| await page.goto('/api/compiler-hooks/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Hooks' || t.startsWith('Hooks'))).toBeTruthy(); | |
| }); | |
| test('api_compiler_hooks: h2 "8 Contributors"', async ({ page }) => { | |
| await page.goto('/api/compiler-hooks/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '8 Contributors' || t.startsWith('8 Contributors'))).toBeTruthy(); | |
| }); | |
| test('api_compiler_hooks: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/api/compiler-hooks/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - api_contextmodulefactory_hooks', () => { | |
| test('api_contextmodulefactory_hooks: title matches GT', async ({ page }) => { | |
| await page.goto('/api/contextmodulefactory-hooks/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('contextmodulefactory hooks'); | |
| }); | |
| test('api_contextmodulefactory_hooks: h1 "ContextModuleFactory Hooks"', async ({ page }) => { | |
| await page.goto('/api/contextmodulefactory-hooks/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'ContextModuleFactory Hooks' || t.startsWith('ContextModuleFactory Hooks'))).toBeTruthy(); | |
| }); | |
| test('api_contextmodulefactory_hooks: h2 "beforeResolve"', async ({ page }) => { | |
| await page.goto('/api/contextmodulefactory-hooks/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'beforeResolve' || t.startsWith('beforeResolve'))).toBeTruthy(); | |
| }); | |
| test('api_contextmodulefactory_hooks: h2 "afterResolve"', async ({ page }) => { | |
| await page.goto('/api/contextmodulefactory-hooks/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'afterResolve' || t.startsWith('afterResolve'))).toBeTruthy(); | |
| }); | |
| test('api_contextmodulefactory_hooks: h2 "contextModuleFiles"', async ({ page }) => { | |
| await page.goto('/api/contextmodulefactory-hooks/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'contextModuleFiles' || t.startsWith('contextModuleFiles'))).toBeTruthy(); | |
| }); | |
| test('api_contextmodulefactory_hooks: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/api/contextmodulefactory-hooks/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - api_hot_module_replacement', () => { | |
| test('api_hot_module_replacement: title matches GT', async ({ page }) => { | |
| await page.goto('/api/hot-module-replacement/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('hot module replacement'); | |
| }); | |
| test('api_hot_module_replacement: h1 "Hot Module Replacement"', async ({ page }) => { | |
| await page.goto('/api/hot-module-replacement/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Hot Module Replacement' || t.startsWith('Hot Module Replacement'))).toBeTruthy(); | |
| }); | |
| test('api_hot_module_replacement: h2 "Module API"', async ({ page }) => { | |
| await page.goto('/api/hot-module-replacement/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Module API' || t.startsWith('Module API'))).toBeTruthy(); | |
| }); | |
| test('api_hot_module_replacement: h2 "Management API"', async ({ page }) => { | |
| await page.goto('/api/hot-module-replacement/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Management API' || t.startsWith('Management API'))).toBeTruthy(); | |
| }); | |
| test('api_hot_module_replacement: h2 "Further Reading"', async ({ page }) => { | |
| await page.goto('/api/hot-module-replacement/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Further Reading' || t.startsWith('Further Reading'))).toBeTruthy(); | |
| }); | |
| test('api_hot_module_replacement: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/api/hot-module-replacement/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - api_loaders', () => { | |
| test('api_loaders: title matches GT', async ({ page }) => { | |
| await page.goto('/api/loaders/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('loader interface'); | |
| }); | |
| test('api_loaders: h2 "Examples"', async ({ page }) => { | |
| await page.goto('/api/loaders/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Examples' || t.startsWith('Examples'))).toBeTruthy(); | |
| }); | |
| test('api_loaders: h2 "The Loader Context"', async ({ page }) => { | |
| await page.goto('/api/loaders/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'The Loader Context' || t.startsWith('The Loader Context'))).toBeTruthy(); | |
| }); | |
| test('api_loaders: h2 "Webpack specific properties"', async ({ page }) => { | |
| await page.goto('/api/loaders/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Webpack specific properties' || t.startsWith('Webpack specific properties'))).toBeTruthy(); | |
| }); | |
| test('api_loaders: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/api/loaders/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - api_logging', () => { | |
| test('api_logging: title matches GT', async ({ page }) => { | |
| await page.goto('/api/logging/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('logger interface'); | |
| }); | |
| test('api_logging: h2 "Examples of how to get and use"', async ({ page }) => { | |
| await page.goto('/api/logging/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Examples of how to get and use webpack logger in loaders and plugins' || t.startsWith('Examples of how to get and use webpack logger in loaders and plugins'))).toBeTruthy(); | |
| }); | |
| test('api_logging: h2 "Logger methods"', async ({ page }) => { | |
| await page.goto('/api/logging/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Logger methods' || t.startsWith('Logger methods'))).toBeTruthy(); | |
| }); | |
| test('api_logging: h2 "Runtime Logger API"', async ({ page }) => { | |
| await page.goto('/api/logging/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Runtime Logger API' || t.startsWith('Runtime Logger API'))).toBeTruthy(); | |
| }); | |
| test('api_logging: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/api/logging/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - api_module_methods', () => { | |
| test('api_module_methods: title matches GT', async ({ page }) => { | |
| await page.goto('/api/module-methods/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('module methods'); | |
| }); | |
| test('api_module_methods: h1 "Module Methods"', async ({ page }) => { | |
| await page.goto('/api/module-methods/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Module Methods' || t.startsWith('Module Methods'))).toBeTruthy(); | |
| }); | |
| test('api_module_methods: h2 "ES6 (Recommended)"', async ({ page }) => { | |
| await page.goto('/api/module-methods/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'ES6 (Recommended)' || t.startsWith('ES6 (Recommended)'))).toBeTruthy(); | |
| }); | |
| test('api_module_methods: h2 "CommonJS"', async ({ page }) => { | |
| await page.goto('/api/module-methods/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'CommonJS' || t.startsWith('CommonJS'))).toBeTruthy(); | |
| }); | |
| test('api_module_methods: h2 "AMD"', async ({ page }) => { | |
| await page.goto('/api/module-methods/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'AMD' || t.startsWith('AMD'))).toBeTruthy(); | |
| }); | |
| test('api_module_methods: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/api/module-methods/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - api_module_variables', () => { | |
| test('api_module_variables: title matches GT', async ({ page }) => { | |
| await page.goto('/api/module-variables/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('module variables'); | |
| }); | |
| test('api_module_variables: h1 "Module Variables"', async ({ page }) => { | |
| await page.goto('/api/module-variables/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Module Variables' || t.startsWith('Module Variables'))).toBeTruthy(); | |
| }); | |
| test('api_module_variables: h2 "module.loaded (NodeJS)"', async ({ page }) => { | |
| await page.goto('/api/module-variables/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'module.loaded (NodeJS)' || t.startsWith('module.loaded (NodeJS)'))).toBeTruthy(); | |
| }); | |
| test('api_module_variables: h2 "module.hot (webpack-specific)"', async ({ page }) => { | |
| await page.goto('/api/module-variables/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'module.hot (webpack-specific)' || t.startsWith('module.hot (webpack-specific)'))).toBeTruthy(); | |
| }); | |
| test('api_module_variables: h2 "module.id (CommonJS)"', async ({ page }) => { | |
| await page.goto('/api/module-variables/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'module.id (CommonJS)' || t.startsWith('module.id (CommonJS)'))).toBeTruthy(); | |
| }); | |
| test('api_module_variables: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/api/module-variables/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - api_node', () => { | |
| test('api_node: title matches GT', async ({ page }) => { | |
| await page.goto('/api/node/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('node interface'); | |
| }); | |
| test('api_node: h2 "Installation"', async ({ page }) => { | |
| await page.goto('/api/node/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Installation' || t.startsWith('Installation'))).toBeTruthy(); | |
| }); | |
| test('api_node: h2 "webpack()"', async ({ page }) => { | |
| await page.goto('/api/node/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'webpack()' || t.startsWith('webpack()'))).toBeTruthy(); | |
| }); | |
| test('api_node: h2 "Compiler Instance"', async ({ page }) => { | |
| await page.goto('/api/node/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Compiler Instance' || t.startsWith('Compiler Instance'))).toBeTruthy(); | |
| }); | |
| test('api_node: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/api/node/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - api_normalmodulefactory_hooks', () => { | |
| test('api_normalmodulefactory_hooks: title matches GT', async ({ page }) => { | |
| await page.goto('/api/normalmodulefactory-hooks/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('normalmodulefactory hooks'); | |
| }); | |
| test('api_normalmodulefactory_hooks: h1 "NormalModuleFactory Hooks"', async ({ page }) => { | |
| await page.goto('/api/normalmodulefactory-hooks/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'NormalModuleFactory Hooks' || t.startsWith('NormalModuleFactory Hooks'))).toBeTruthy(); | |
| }); | |
| test('api_normalmodulefactory_hooks: h2 "beforeResolve"', async ({ page }) => { | |
| await page.goto('/api/normalmodulefactory-hooks/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'beforeResolve' || t.startsWith('beforeResolve'))).toBeTruthy(); | |
| }); | |
| test('api_normalmodulefactory_hooks: h2 "factorize"', async ({ page }) => { | |
| await page.goto('/api/normalmodulefactory-hooks/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'factorize' || t.startsWith('factorize'))).toBeTruthy(); | |
| }); | |
| test('api_normalmodulefactory_hooks: h2 "resolve"', async ({ page }) => { | |
| await page.goto('/api/normalmodulefactory-hooks/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'resolve' || t.startsWith('resolve'))).toBeTruthy(); | |
| }); | |
| test('api_normalmodulefactory_hooks: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/api/normalmodulefactory-hooks/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - api_parser', () => { | |
| test('api_parser: title matches GT', async ({ page }) => { | |
| await page.goto('/api/parser/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('javascriptparser hooks'); | |
| }); | |
| test('api_parser: h2 "Hooks"', async ({ page }) => { | |
| await page.goto('/api/parser/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Hooks' || t.startsWith('Hooks'))).toBeTruthy(); | |
| }); | |
| test('api_parser: h2 "7 Contributors"', async ({ page }) => { | |
| await page.goto('/api/parser/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '7 Contributors' || t.startsWith('7 Contributors'))).toBeTruthy(); | |
| }); | |
| test('api_parser: h3 "webpack"', async ({ page }) => { | |
| await page.goto('/api/parser/'); | |
| const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'webpack' || t.startsWith('webpack'))).toBeTruthy(); | |
| }); | |
| test('api_parser: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/api/parser/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - api_plugins', () => { | |
| test('api_plugins: title matches GT', async ({ page }) => { | |
| await page.goto('/api/plugins/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('plugin api'); | |
| }); | |
| test('api_plugins: h2 "Tapable"', async ({ page }) => { | |
| await page.goto('/api/plugins/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Tapable' || t.startsWith('Tapable'))).toBeTruthy(); | |
| }); | |
| test('api_plugins: h2 "Plugin Types"', async ({ page }) => { | |
| await page.goto('/api/plugins/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Plugin Types' || t.startsWith('Plugin Types'))).toBeTruthy(); | |
| }); | |
| test('api_plugins: h2 "Custom Hooks"', async ({ page }) => { | |
| await page.goto('/api/plugins/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Custom Hooks' || t.startsWith('Custom Hooks'))).toBeTruthy(); | |
| }); | |
| test('api_plugins: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/api/plugins/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - api_resolvers', () => { | |
| test('api_resolvers: title matches GT', async ({ page }) => { | |
| await page.goto('/api/resolvers/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('resolvers'); | |
| }); | |
| test('api_resolvers: h2 "Types"', async ({ page }) => { | |
| await page.goto('/api/resolvers/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Types' || t.startsWith('Types'))).toBeTruthy(); | |
| }); | |
| test('api_resolvers: h2 "Configuration Options"', async ({ page }) => { | |
| await page.goto('/api/resolvers/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Configuration Options' || t.startsWith('Configuration Options'))).toBeTruthy(); | |
| }); | |
| test('api_resolvers: h2 "2 Contributors"', async ({ page }) => { | |
| await page.goto('/api/resolvers/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '2 Contributors' || t.startsWith('2 Contributors'))).toBeTruthy(); | |
| }); | |
| test('api_resolvers: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/api/resolvers/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - api_stats', () => { | |
| test('api_stats: title matches GT', async ({ page }) => { | |
| await page.goto('/api/stats/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('stats data'); | |
| }); | |
| test('api_stats: h2 "Structure"', async ({ page }) => { | |
| await page.goto('/api/stats/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Structure' || t.startsWith('Structure'))).toBeTruthy(); | |
| }); | |
| test('api_stats: h2 "8 Contributors"', async ({ page }) => { | |
| await page.goto('/api/stats/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '8 Contributors' || t.startsWith('8 Contributors'))).toBeTruthy(); | |
| }); | |
| test('api_stats: h3 "webpack"', async ({ page }) => { | |
| await page.goto('/api/stats/'); | |
| const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'webpack' || t.startsWith('webpack'))).toBeTruthy(); | |
| }); | |
| test('api_stats: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/api/stats/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - api_webpack_dev_server', () => { | |
| test('api_webpack_dev_server: title matches GT', async ({ page }) => { | |
| await page.goto('/api/webpack-dev-server/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('webpack'); | |
| }); | |
| test('api_webpack_dev_server: h1 "webpack-dev-server API"', async ({ page }) => { | |
| await page.goto('/api/webpack-dev-server/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'webpack-dev-server API' || t.startsWith('webpack-dev-server API'))).toBeTruthy(); | |
| }); | |
| test('api_webpack_dev_server: h2 "Installation"', async ({ page }) => { | |
| await page.goto('/api/webpack-dev-server/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Installation' || t.startsWith('Installation'))).toBeTruthy(); | |
| }); | |
| test('api_webpack_dev_server: h2 "start"', async ({ page }) => { | |
| await page.goto('/api/webpack-dev-server/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'start' || t.startsWith('start'))).toBeTruthy(); | |
| }); | |
| test('api_webpack_dev_server: h2 "startCallback(callback)"', async ({ page }) => { | |
| await page.goto('/api/webpack-dev-server/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'startCallback(callback)' || t.startsWith('startCallback(callback)'))).toBeTruthy(); | |
| }); | |
| test('api_webpack_dev_server: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/api/webpack-dev-server/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - blog_2020_10_10_webpack_5_release', () => { | |
| test('blog_2020_10_10_webpack_5_release: title matches GT', async ({ page }) => { | |
| await page.goto('/blog/2020-10-10-webpack-5-release/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('webpack 5 release'); | |
| }); | |
| test('blog_2020_10_10_webpack_5_release: h1 "Webpack 5 release"', async ({ page }) => { | |
| await page.goto('/blog/2020-10-10-webpack-5-release/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Webpack 5 release' || t.startsWith('Webpack 5 release'))).toBeTruthy(); | |
| }); | |
| test('blog_2020_10_10_webpack_5_release: h2 "Common Questions"', async ({ page }) => { | |
| await page.goto('/blog/2020-10-10-webpack-5-release/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Common Questions' || t.startsWith('Common Questions'))).toBeTruthy(); | |
| }); | |
| test('blog_2020_10_10_webpack_5_release: h2 "Sponsoring Update"', async ({ page }) => { | |
| await page.goto('/blog/2020-10-10-webpack-5-release/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Sponsoring Update' || t.startsWith('Sponsoring Update'))).toBeTruthy(); | |
| }); | |
| test('blog_2020_10_10_webpack_5_release: h2 "General direction"', async ({ page }) => { | |
| await page.goto('/blog/2020-10-10-webpack-5-release/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'General direction' || t.startsWith('General direction'))).toBeTruthy(); | |
| }); | |
| test('blog_2020_10_10_webpack_5_release: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/blog/2020-10-10-webpack-5-release/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - blog_2020_12_08_roadmap_2021', () => { | |
| test('blog_2020_12_08_roadmap_2021: title matches GT', async ({ page }) => { | |
| await page.goto('/blog/2020-12-08-roadmap-2021/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('roadmap 2021'); | |
| }); | |
| test('blog_2020_12_08_roadmap_2021: h1 "Roadmap 2021"', async ({ page }) => { | |
| await page.goto('/blog/2020-12-08-roadmap-2021/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Roadmap 2021' || t.startsWith('Roadmap 2021'))).toBeTruthy(); | |
| }); | |
| test('blog_2020_12_08_roadmap_2021: h2 "What happened so far?"', async ({ page }) => { | |
| await page.goto('/blog/2020-12-08-roadmap-2021/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'What happened so far?' || t.startsWith('What happened so far?'))).toBeTruthy(); | |
| }); | |
| test('blog_2020_12_08_roadmap_2021: h2 "Disclaimer"', async ({ page }) => { | |
| await page.goto('/blog/2020-12-08-roadmap-2021/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Disclaimer' || t.startsWith('Disclaimer'))).toBeTruthy(); | |
| }); | |
| test('blog_2020_12_08_roadmap_2021: h2 "1 Contributor"', async ({ page }) => { | |
| await page.goto('/blog/2020-12-08-roadmap-2021/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '1 Contributor' || t.startsWith('1 Contributor'))).toBeTruthy(); | |
| }); | |
| test('blog_2020_12_08_roadmap_2021: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/blog/2020-12-08-roadmap-2021/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - blog_2026_02_03_webpack_5_105', () => { | |
| test('blog_2026_02_03_webpack_5_105: title matches GT', async ({ page }) => { | |
| await page.goto('/blog/2026-02-03-webpack-5-105/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('webpack 5.105'); | |
| }); | |
| test('blog_2026_02_03_webpack_5_105: h2 "Two Low-Severity CVEs Fixed in"', async ({ page }) => { | |
| await page.goto('/blog/2026-02-03-webpack-5-105/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Two Low-Severity CVEs Fixed in Webpack' || t.startsWith('Two Low-Severity CVEs Fixed in Webpack'))).toBeTruthy(); | |
| }); | |
| test('blog_2026_02_03_webpack_5_105: h2 "tsconfig.json Alias Resolution"', async ({ page }) => { | |
| await page.goto('/blog/2026-02-03-webpack-5-105/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'tsconfig.json Alias Resolution Without Requiring plugins' || t.startsWith('tsconfig.json Alias Resolution Without Requiring plugins'))).toBeTruthy(); | |
| }); | |
| test('blog_2026_02_03_webpack_5_105: h2 "Automatic Module Resolution fo"', async ({ page }) => { | |
| await page.goto('/blog/2026-02-03-webpack-5-105/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Automatic Module Resolution for Web Workers' || t.startsWith('Automatic Module Resolution for Web Workers'))).toBeTruthy(); | |
| }); | |
| test('blog_2026_02_03_webpack_5_105: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/blog/2026-02-03-webpack-5-105/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - blog_2026_02_04_roadmap_2026', () => { | |
| test('blog_2026_02_04_roadmap_2026: title matches GT', async ({ page }) => { | |
| await page.goto('/blog/2026-02-04-roadmap-2026/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('roadmap 2026'); | |
| }); | |
| test('blog_2026_02_04_roadmap_2026: h1 "Roadmap 2026"', async ({ page }) => { | |
| await page.goto('/blog/2026-02-04-roadmap-2026/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Roadmap 2026' || t.startsWith('Roadmap 2026'))).toBeTruthy(); | |
| }); | |
| test('blog_2026_02_04_roadmap_2026: h2 "Here’s what we’re excited abou"', async ({ page }) => { | |
| await page.goto('/blog/2026-02-04-roadmap-2026/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Here’s what we’re excited about for 2026' || t.startsWith('Here’s what we’re excited about for 2026'))).toBeTruthy(); | |
| }); | |
| test('blog_2026_02_04_roadmap_2026: h2 "Final remarks"', async ({ page }) => { | |
| await page.goto('/blog/2026-02-04-roadmap-2026/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Final remarks' || t.startsWith('Final remarks'))).toBeTruthy(); | |
| }); | |
| test('blog_2026_02_04_roadmap_2026: h2 "3 Contributors"', async ({ page }) => { | |
| await page.goto('/blog/2026-02-04-roadmap-2026/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '3 Contributors' || t.startsWith('3 Contributors'))).toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - blog_2026_04_08_webpack_5_106', () => { | |
| test('blog_2026_04_08_webpack_5_106: title matches GT', async ({ page }) => { | |
| await page.goto('/blog/2026-04-08-webpack-5-106/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('webpack 5.106'); | |
| }); | |
| test('blog_2026_04_08_webpack_5_106: h1 "Webpack 5.106"', async ({ page }) => { | |
| await page.goto('/blog/2026-04-08-webpack-5-106/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Webpack 5.106' || t.startsWith('Webpack 5.106'))).toBeTruthy(); | |
| }); | |
| test('blog_2026_04_08_webpack_5_106: h2 "Plugin Validation with compile"', async ({ page }) => { | |
| await page.goto('/blog/2026-04-08-webpack-5-106/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Plugin Validation with compiler.hooks.validate' || t.startsWith('Plugin Validation with compiler.hooks.validate'))).toBeTruthy(); | |
| }); | |
| test('blog_2026_04_08_webpack_5_106: h2 "CSS Modules with Runtime Style"', async ({ page }) => { | |
| await page.goto('/blog/2026-04-08-webpack-5-106/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'CSS Modules with Runtime Style Injection' || t.startsWith('CSS Modules with Runtime Style Injection'))).toBeTruthy(); | |
| }); | |
| test('blog_2026_04_08_webpack_5_106: h2 "Better Tree Shaking for Common"', async ({ page }) => { | |
| await page.goto('/blog/2026-04-08-webpack-5-106/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Better Tree Shaking for CommonJS Destructuring' || t.startsWith('Better Tree Shaking for CommonJS Destructuring'))).toBeTruthy(); | |
| }); | |
| test('blog_2026_04_08_webpack_5_106: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/blog/2026-04-08-webpack-5-106/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - blog_printable', () => { | |
| test('blog_printable: title matches GT', async ({ page }) => { | |
| await page.goto('/blog/printable/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('combined printable page'); | |
| }); | |
| test('blog_printable: h1 "Printable"', async ({ page }) => { | |
| await page.goto('/blog/printable/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Printable' || t.startsWith('Printable'))).toBeTruthy(); | |
| }); | |
| test('blog_printable: h1 "Blog"', async ({ page }) => { | |
| await page.goto('/blog/printable/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Blog' || t.startsWith('Blog'))).toBeTruthy(); | |
| }); | |
| test('blog_printable: h1 "Webpack 5 release"', async ({ page }) => { | |
| await page.goto('/blog/printable/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Webpack 5 release' || t.startsWith('Webpack 5 release'))).toBeTruthy(); | |
| }); | |
| test('blog_printable: h1 "Roadmap 2021"', async ({ page }) => { | |
| await page.goto('/blog/printable/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Roadmap 2021' || t.startsWith('Roadmap 2021'))).toBeTruthy(); | |
| }); | |
| test('blog_printable: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/blog/printable/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - concepts_configuration', () => { | |
| test('concepts_configuration: title matches GT', async ({ page }) => { | |
| await page.goto('/concepts/configuration/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('configuration'); | |
| }); | |
| test('concepts_configuration: h2 "Introductory Configuration"', async ({ page }) => { | |
| await page.goto('/concepts/configuration/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Introductory Configuration' || t.startsWith('Introductory Configuration'))).toBeTruthy(); | |
| }); | |
| test('concepts_configuration: h2 "Using multiple configurations"', async ({ page }) => { | |
| await page.goto('/concepts/configuration/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Using multiple configurations' || t.startsWith('Using multiple configurations'))).toBeTruthy(); | |
| }); | |
| test('concepts_configuration: h2 "Multiple Targets"', async ({ page }) => { | |
| await page.goto('/concepts/configuration/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Multiple Targets' || t.startsWith('Multiple Targets'))).toBeTruthy(); | |
| }); | |
| test('concepts_configuration: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/concepts/configuration/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - concepts_dependency_graph', () => { | |
| test('concepts_dependency_graph: title matches GT', async ({ page }) => { | |
| await page.goto('/concepts/dependency-graph/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('dependency graph'); | |
| }); | |
| test('concepts_dependency_graph: h1 "Dependency Graph"', async ({ page }) => { | |
| await page.goto('/concepts/dependency-graph/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Dependency Graph' || t.startsWith('Dependency Graph'))).toBeTruthy(); | |
| }); | |
| test('concepts_dependency_graph: h2 "Further Reading"', async ({ page }) => { | |
| await page.goto('/concepts/dependency-graph/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Further Reading' || t.startsWith('Further Reading'))).toBeTruthy(); | |
| }); | |
| test('concepts_dependency_graph: h2 "2 Contributors"', async ({ page }) => { | |
| await page.goto('/concepts/dependency-graph/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '2 Contributors' || t.startsWith('2 Contributors'))).toBeTruthy(); | |
| }); | |
| test('concepts_dependency_graph: h3 "webpack"', async ({ page }) => { | |
| await page.goto('/concepts/dependency-graph/'); | |
| const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'webpack' || t.startsWith('webpack'))).toBeTruthy(); | |
| }); | |
| test('concepts_dependency_graph: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/concepts/dependency-graph/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - concepts_entry_points', () => { | |
| test('concepts_entry_points: title matches GT', async ({ page }) => { | |
| await page.goto('/concepts/entry-points/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('entry points'); | |
| }); | |
| test('concepts_entry_points: h1 "Entry Points"', async ({ page }) => { | |
| await page.goto('/concepts/entry-points/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Entry Points' || t.startsWith('Entry Points'))).toBeTruthy(); | |
| }); | |
| test('concepts_entry_points: h2 "Single Entry (Shorthand) Synta"', async ({ page }) => { | |
| await page.goto('/concepts/entry-points/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Single Entry (Shorthand) Syntax' || t.startsWith('Single Entry (Shorthand) Syntax'))).toBeTruthy(); | |
| }); | |
| test('concepts_entry_points: h2 "Object Syntax"', async ({ page }) => { | |
| await page.goto('/concepts/entry-points/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Object Syntax' || t.startsWith('Object Syntax'))).toBeTruthy(); | |
| }); | |
| test('concepts_entry_points: h2 "Scenarios"', async ({ page }) => { | |
| await page.goto('/concepts/entry-points/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Scenarios' || t.startsWith('Scenarios'))).toBeTruthy(); | |
| }); | |
| test('concepts_entry_points: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/concepts/entry-points/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - concepts_hot_module_replacement', () => { | |
| test('concepts_hot_module_replacement: title matches GT', async ({ page }) => { | |
| await page.goto('/concepts/hot-module-replacement/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('hot module replacement'); | |
| }); | |
| test('concepts_hot_module_replacement: h1 "Hot Module Replacement"', async ({ page }) => { | |
| await page.goto('/concepts/hot-module-replacement/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Hot Module Replacement' || t.startsWith('Hot Module Replacement'))).toBeTruthy(); | |
| }); | |
| test('concepts_hot_module_replacement: h2 "How It Works"', async ({ page }) => { | |
| await page.goto('/concepts/hot-module-replacement/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'How It Works' || t.startsWith('How It Works'))).toBeTruthy(); | |
| }); | |
| test('concepts_hot_module_replacement: h2 "Get Started"', async ({ page }) => { | |
| await page.goto('/concepts/hot-module-replacement/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Get Started' || t.startsWith('Get Started'))).toBeTruthy(); | |
| }); | |
| test('concepts_hot_module_replacement: h2 "6 Contributors"', async ({ page }) => { | |
| await page.goto('/concepts/hot-module-replacement/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '6 Contributors' || t.startsWith('6 Contributors'))).toBeTruthy(); | |
| }); | |
| test('concepts_hot_module_replacement: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/concepts/hot-module-replacement/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - concepts_loaders', () => { | |
| test('concepts_loaders: title matches GT', async ({ page }) => { | |
| await page.goto('/concepts/loaders/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('loaders'); | |
| }); | |
| test('concepts_loaders: h2 "Using Loaders"', async ({ page }) => { | |
| await page.goto('/concepts/loaders/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Using Loaders' || t.startsWith('Using Loaders'))).toBeTruthy(); | |
| }); | |
| test('concepts_loaders: h2 "Loader Features"', async ({ page }) => { | |
| await page.goto('/concepts/loaders/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Loader Features' || t.startsWith('Loader Features'))).toBeTruthy(); | |
| }); | |
| test('concepts_loaders: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/concepts/loaders/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - concepts_manifest', () => { | |
| test('concepts_manifest: title matches GT', async ({ page }) => { | |
| await page.goto('/concepts/manifest/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('the manifest'); | |
| }); | |
| test('concepts_manifest: h2 "Runtime"', async ({ page }) => { | |
| await page.goto('/concepts/manifest/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Runtime' || t.startsWith('Runtime'))).toBeTruthy(); | |
| }); | |
| test('concepts_manifest: h2 "Manifest"', async ({ page }) => { | |
| await page.goto('/concepts/manifest/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Manifest' || t.startsWith('Manifest'))).toBeTruthy(); | |
| }); | |
| test('concepts_manifest: h2 "The Problem"', async ({ page }) => { | |
| await page.goto('/concepts/manifest/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'The Problem' || t.startsWith('The Problem'))).toBeTruthy(); | |
| }); | |
| test('concepts_manifest: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/concepts/manifest/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - concepts_module_federation', () => { | |
| test('concepts_module_federation: title matches GT', async ({ page }) => { | |
| await page.goto('/concepts/module-federation/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('module federation'); | |
| }); | |
| test('concepts_module_federation: h1 "Module Federation"', async ({ page }) => { | |
| await page.goto('/concepts/module-federation/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Module Federation' || t.startsWith('Module Federation'))).toBeTruthy(); | |
| }); | |
| test('concepts_module_federation: h2 "Motivation"', async ({ page }) => { | |
| await page.goto('/concepts/module-federation/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Motivation' || t.startsWith('Motivation'))).toBeTruthy(); | |
| }); | |
| test('concepts_module_federation: h2 "Low-level concepts"', async ({ page }) => { | |
| await page.goto('/concepts/module-federation/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Low-level concepts' || t.startsWith('Low-level concepts'))).toBeTruthy(); | |
| }); | |
| test('concepts_module_federation: h2 "High-level concepts"', async ({ page }) => { | |
| await page.goto('/concepts/module-federation/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'High-level concepts' || t.startsWith('High-level concepts'))).toBeTruthy(); | |
| }); | |
| test('concepts_module_federation: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/concepts/module-federation/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - concepts_module_resolution', () => { | |
| test('concepts_module_resolution: title matches GT', async ({ page }) => { | |
| await page.goto('/concepts/module-resolution/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('module resolution'); | |
| }); | |
| test('concepts_module_resolution: h1 "Module Resolution"', async ({ page }) => { | |
| await page.goto('/concepts/module-resolution/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Module Resolution' || t.startsWith('Module Resolution'))).toBeTruthy(); | |
| }); | |
| test('concepts_module_resolution: h2 "Resolving rules in webpack"', async ({ page }) => { | |
| await page.goto('/concepts/module-resolution/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Resolving rules in webpack' || t.startsWith('Resolving rules in webpack'))).toBeTruthy(); | |
| }); | |
| test('concepts_module_resolution: h2 "Resolving Loaders"', async ({ page }) => { | |
| await page.goto('/concepts/module-resolution/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Resolving Loaders' || t.startsWith('Resolving Loaders'))).toBeTruthy(); | |
| }); | |
| test('concepts_module_resolution: h2 "Caching"', async ({ page }) => { | |
| await page.goto('/concepts/module-resolution/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Caching' || t.startsWith('Caching'))).toBeTruthy(); | |
| }); | |
| test('concepts_module_resolution: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/concepts/module-resolution/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - concepts_modules', () => { | |
| test('concepts_modules: title matches GT', async ({ page }) => { | |
| await page.goto('/concepts/modules/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('modules'); | |
| }); | |
| test('concepts_modules: h2 "What is a webpack Module"', async ({ page }) => { | |
| await page.goto('/concepts/modules/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'What is a webpack Module' || t.startsWith('What is a webpack Module'))).toBeTruthy(); | |
| }); | |
| test('concepts_modules: h2 "Supported Module Types"', async ({ page }) => { | |
| await page.goto('/concepts/modules/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Supported Module Types' || t.startsWith('Supported Module Types'))).toBeTruthy(); | |
| }); | |
| test('concepts_modules: h2 "Further Reading"', async ({ page }) => { | |
| await page.goto('/concepts/modules/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Further Reading' || t.startsWith('Further Reading'))).toBeTruthy(); | |
| }); | |
| test('concepts_modules: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/concepts/modules/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - concepts_output', () => { | |
| test('concepts_output: title matches GT', async ({ page }) => { | |
| await page.goto('/concepts/output/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('output'); | |
| }); | |
| test('concepts_output: h2 "Usage"', async ({ page }) => { | |
| await page.goto('/concepts/output/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Usage' || t.startsWith('Usage'))).toBeTruthy(); | |
| }); | |
| test('concepts_output: h2 "Multiple Entry Points"', async ({ page }) => { | |
| await page.goto('/concepts/output/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Multiple Entry Points' || t.startsWith('Multiple Entry Points'))).toBeTruthy(); | |
| }); | |
| test('concepts_output: h2 "Advanced"', async ({ page }) => { | |
| await page.goto('/concepts/output/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Advanced' || t.startsWith('Advanced'))).toBeTruthy(); | |
| }); | |
| test('concepts_output: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/concepts/output/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - concepts_plugins', () => { | |
| test('concepts_plugins: title matches GT', async ({ page }) => { | |
| await page.goto('/concepts/plugins/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('plugins'); | |
| }); | |
| test('concepts_plugins: h2 "Anatomy"', async ({ page }) => { | |
| await page.goto('/concepts/plugins/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Anatomy' || t.startsWith('Anatomy'))).toBeTruthy(); | |
| }); | |
| test('concepts_plugins: h2 "Usage"', async ({ page }) => { | |
| await page.goto('/concepts/plugins/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Usage' || t.startsWith('Usage'))).toBeTruthy(); | |
| }); | |
| test('concepts_plugins: h2 "7 Contributors"', async ({ page }) => { | |
| await page.goto('/concepts/plugins/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '7 Contributors' || t.startsWith('7 Contributors'))).toBeTruthy(); | |
| }); | |
| test('concepts_plugins: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/concepts/plugins/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - concepts_targets', () => { | |
| test('concepts_targets: title matches GT', async ({ page }) => { | |
| await page.goto('/concepts/targets/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('targets'); | |
| }); | |
| test('concepts_targets: h2 "Usage"', async ({ page }) => { | |
| await page.goto('/concepts/targets/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Usage' || t.startsWith('Usage'))).toBeTruthy(); | |
| }); | |
| test('concepts_targets: h2 "Multiple Targets"', async ({ page }) => { | |
| await page.goto('/concepts/targets/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Multiple Targets' || t.startsWith('Multiple Targets'))).toBeTruthy(); | |
| }); | |
| test('concepts_targets: h2 "Resources"', async ({ page }) => { | |
| await page.goto('/concepts/targets/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Resources' || t.startsWith('Resources'))).toBeTruthy(); | |
| }); | |
| test('concepts_targets: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/concepts/targets/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - concepts_under_the_hood', () => { | |
| test('concepts_under_the_hood: title matches GT', async ({ page }) => { | |
| await page.goto('/concepts/under-the-hood/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('under the hood'); | |
| }); | |
| test('concepts_under_the_hood: h1 "Under The Hood"', async ({ page }) => { | |
| await page.goto('/concepts/under-the-hood/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Under The Hood' || t.startsWith('Under The Hood'))).toBeTruthy(); | |
| }); | |
| test('concepts_under_the_hood: h2 "The main parts"', async ({ page }) => { | |
| await page.goto('/concepts/under-the-hood/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'The main parts' || t.startsWith('The main parts'))).toBeTruthy(); | |
| }); | |
| test('concepts_under_the_hood: h2 "Chunks"', async ({ page }) => { | |
| await page.goto('/concepts/under-the-hood/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Chunks' || t.startsWith('Chunks'))).toBeTruthy(); | |
| }); | |
| test('concepts_under_the_hood: h2 "Output"', async ({ page }) => { | |
| await page.goto('/concepts/under-the-hood/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Output' || t.startsWith('Output'))).toBeTruthy(); | |
| }); | |
| test('concepts_under_the_hood: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/concepts/under-the-hood/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - concepts_why_webpack', () => { | |
| test('concepts_why_webpack: title matches GT', async ({ page }) => { | |
| await page.goto('/concepts/why-webpack/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('why webpack'); | |
| }); | |
| test('concepts_why_webpack: h1 "Why webpack"', async ({ page }) => { | |
| await page.goto('/concepts/why-webpack/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Why webpack' || t.startsWith('Why webpack'))).toBeTruthy(); | |
| }); | |
| test('concepts_why_webpack: h2 "IIFEs - Immediately invoked fu"', async ({ page }) => { | |
| await page.goto('/concepts/why-webpack/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'IIFEs - Immediately invoked function expressions' || t.startsWith('IIFEs - Immediately invoked function expressions'))).toBeTruthy(); | |
| }); | |
| test('concepts_why_webpack: h2 "Birth of JavaScript Modules ha"', async ({ page }) => { | |
| await page.goto('/concepts/why-webpack/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Birth of JavaScript Modules happened thanks to Node.js' || t.startsWith('Birth of JavaScript Modules happened thanks to Node.js'))).toBeTruthy(); | |
| }); | |
| test('concepts_why_webpack: h2 "npm + Node.js + modules – mass"', async ({ page }) => { | |
| await page.goto('/concepts/why-webpack/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'npm + Node.js + modules – mass distribution' || t.startsWith('npm + Node.js + modules – mass distribution'))).toBeTruthy(); | |
| }); | |
| test('concepts_why_webpack: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/concepts/why-webpack/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - configuration_cache', () => { | |
| test('configuration_cache: title matches GT', async ({ page }) => { | |
| await page.goto('/configuration/cache/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('cache'); | |
| }); | |
| test('configuration_cache: h2 "cache"', async ({ page }) => { | |
| await page.goto('/configuration/cache/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'cache' || t.startsWith('cache'))).toBeTruthy(); | |
| }); | |
| test('configuration_cache: h2 "Setup cache in CI/CD system"', async ({ page }) => { | |
| await page.goto('/configuration/cache/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Setup cache in CI/CD system' || t.startsWith('Setup cache in CI/CD system'))).toBeTruthy(); | |
| }); | |
| test('configuration_cache: h2 "3 Contributors"', async ({ page }) => { | |
| await page.goto('/configuration/cache/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '3 Contributors' || t.startsWith('3 Contributors'))).toBeTruthy(); | |
| }); | |
| test('configuration_cache: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/configuration/cache/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - configuration_configuration_languages', () => { | |
| test('configuration_configuration_languages: title matches GT', async ({ page }) => { | |
| await page.goto('/configuration/configuration-languages/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('configuration languages'); | |
| }); | |
| test('configuration_configuration_languages: h1 "Configuration Languages"', async ({ page }) => { | |
| await page.goto('/configuration/configuration-languages/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Configuration Languages' || t.startsWith('Configuration Languages'))).toBeTruthy(); | |
| }); | |
| test('configuration_configuration_languages: h2 "TypeScript"', async ({ page }) => { | |
| await page.goto('/configuration/configuration-languages/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'TypeScript' || t.startsWith('TypeScript'))).toBeTruthy(); | |
| }); | |
| test('configuration_configuration_languages: h2 "CoffeeScript"', async ({ page }) => { | |
| await page.goto('/configuration/configuration-languages/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'CoffeeScript' || t.startsWith('CoffeeScript'))).toBeTruthy(); | |
| }); | |
| test('configuration_configuration_languages: h2 "Babel and JSX"', async ({ page }) => { | |
| await page.goto('/configuration/configuration-languages/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Babel and JSX' || t.startsWith('Babel and JSX'))).toBeTruthy(); | |
| }); | |
| test('configuration_configuration_languages: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/configuration/configuration-languages/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - configuration_configuration_types', () => { | |
| test('configuration_configuration_types: title matches GT', async ({ page }) => { | |
| await page.goto('/configuration/configuration-types/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('configuration types'); | |
| }); | |
| test('configuration_configuration_types: h1 "Configuration Types"', async ({ page }) => { | |
| await page.goto('/configuration/configuration-types/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Configuration Types' || t.startsWith('Configuration Types'))).toBeTruthy(); | |
| }); | |
| test('configuration_configuration_types: h2 "Exporting a Function"', async ({ page }) => { | |
| await page.goto('/configuration/configuration-types/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Exporting a Function' || t.startsWith('Exporting a Function'))).toBeTruthy(); | |
| }); | |
| test('configuration_configuration_types: h2 "Exporting a Promise"', async ({ page }) => { | |
| await page.goto('/configuration/configuration-types/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Exporting a Promise' || t.startsWith('Exporting a Promise'))).toBeTruthy(); | |
| }); | |
| test('configuration_configuration_types: h2 "Exporting multiple configurati"', async ({ page }) => { | |
| await page.goto('/configuration/configuration-types/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Exporting multiple configurations' || t.startsWith('Exporting multiple configurations'))).toBeTruthy(); | |
| }); | |
| test('configuration_configuration_types: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/configuration/configuration-types/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - configuration_dev_server', () => { | |
| test('configuration_dev_server: title matches GT', async ({ page }) => { | |
| await page.goto('/configuration/dev-server/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('devserver'); | |
| }); | |
| test('configuration_dev_server: h1 "DevServer"', async ({ page }) => { | |
| await page.goto('/configuration/dev-server/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'DevServer' || t.startsWith('DevServer'))).toBeTruthy(); | |
| }); | |
| test('configuration_dev_server: h2 "devServer"', async ({ page }) => { | |
| await page.goto('/configuration/dev-server/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'devServer' || t.startsWith('devServer'))).toBeTruthy(); | |
| }); | |
| test('configuration_dev_server: h2 "devServer.app"', async ({ page }) => { | |
| await page.goto('/configuration/dev-server/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'devServer.app' || t.startsWith('devServer.app'))).toBeTruthy(); | |
| }); | |
| test('configuration_dev_server: h2 "devServer.allowedHosts"', async ({ page }) => { | |
| await page.goto('/configuration/dev-server/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'devServer.allowedHosts' || t.startsWith('devServer.allowedHosts'))).toBeTruthy(); | |
| }); | |
| test('configuration_dev_server: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/configuration/dev-server/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - configuration_devtool', () => { | |
| test('configuration_devtool: title matches GT', async ({ page }) => { | |
| await page.goto('/configuration/devtool/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('devtool'); | |
| }); | |
| test('configuration_devtool: h2 "devtool"', async ({ page }) => { | |
| await page.goto('/configuration/devtool/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'devtool' || t.startsWith('devtool'))).toBeTruthy(); | |
| }); | |
| test('configuration_devtool: h2 "Further Reading"', async ({ page }) => { | |
| await page.goto('/configuration/devtool/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Further Reading' || t.startsWith('Further Reading'))).toBeTruthy(); | |
| }); | |
| test('configuration_devtool: h2 "8 Contributors"', async ({ page }) => { | |
| await page.goto('/configuration/devtool/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '8 Contributors' || t.startsWith('8 Contributors'))).toBeTruthy(); | |
| }); | |
| test('configuration_devtool: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/configuration/devtool/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - configuration_dotenv', () => { | |
| test('configuration_dotenv: title matches GT', async ({ page }) => { | |
| await page.goto('/configuration/dotenv/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('dotenv'); | |
| }); | |
| test('configuration_dotenv: h2 "Options"', async ({ page }) => { | |
| await page.goto('/configuration/dotenv/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Options' || t.startsWith('Options'))).toBeTruthy(); | |
| }); | |
| test('configuration_dotenv: h2 "File Priority"', async ({ page }) => { | |
| await page.goto('/configuration/dotenv/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'File Priority' || t.startsWith('File Priority'))).toBeTruthy(); | |
| }); | |
| test('configuration_dotenv: h2 "Variable Expansion"', async ({ page }) => { | |
| await page.goto('/configuration/dotenv/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Variable Expansion' || t.startsWith('Variable Expansion'))).toBeTruthy(); | |
| }); | |
| test('configuration_dotenv: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/configuration/dotenv/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - configuration_entry_context', () => { | |
| test('configuration_entry_context: title matches GT', async ({ page }) => { | |
| await page.goto('/configuration/entry-context/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('entry and context'); | |
| }); | |
| test('configuration_entry_context: h1 "Entry and Context"', async ({ page }) => { | |
| await page.goto('/configuration/entry-context/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Entry and Context' || t.startsWith('Entry and Context'))).toBeTruthy(); | |
| }); | |
| test('configuration_entry_context: h2 "context"', async ({ page }) => { | |
| await page.goto('/configuration/entry-context/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'context' || t.startsWith('context'))).toBeTruthy(); | |
| }); | |
| test('configuration_entry_context: h2 "entry"', async ({ page }) => { | |
| await page.goto('/configuration/entry-context/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'entry' || t.startsWith('entry'))).toBeTruthy(); | |
| }); | |
| test('configuration_entry_context: h2 "11 Contributors"', async ({ page }) => { | |
| await page.goto('/configuration/entry-context/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '11 Contributors' || t.startsWith('11 Contributors'))).toBeTruthy(); | |
| }); | |
| test('configuration_entry_context: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/configuration/entry-context/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - configuration_experiments', () => { | |
| test('configuration_experiments: title matches GT', async ({ page }) => { | |
| await page.goto('/configuration/experiments/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('experiments'); | |
| }); | |
| test('configuration_experiments: h2 "experiments"', async ({ page }) => { | |
| await page.goto('/configuration/experiments/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'experiments' || t.startsWith('experiments'))).toBeTruthy(); | |
| }); | |
| test('configuration_experiments: h2 "6 Contributors"', async ({ page }) => { | |
| await page.goto('/configuration/experiments/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '6 Contributors' || t.startsWith('6 Contributors'))).toBeTruthy(); | |
| }); | |
| test('configuration_experiments: h3 "webpack"', async ({ page }) => { | |
| await page.goto('/configuration/experiments/'); | |
| const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'webpack' || t.startsWith('webpack'))).toBeTruthy(); | |
| }); | |
| test('configuration_experiments: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/configuration/experiments/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - configuration_extending_configurations', () => { | |
| test('configuration_extending_configurations: title matches GT', async ({ page }) => { | |
| await page.goto('/configuration/extending-configurations/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('extends'); | |
| }); | |
| test('configuration_extending_configurations: h1 "Extends"', async ({ page }) => { | |
| await page.goto('/configuration/extending-configurations/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Extends' || t.startsWith('Extends'))).toBeTruthy(); | |
| }); | |
| test('configuration_extending_configurations: h2 "extends"', async ({ page }) => { | |
| await page.goto('/configuration/extending-configurations/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'extends' || t.startsWith('extends'))).toBeTruthy(); | |
| }); | |
| test('configuration_extending_configurations: h2 "Extending multiple configurati"', async ({ page }) => { | |
| await page.goto('/configuration/extending-configurations/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Extending multiple configurations' || t.startsWith('Extending multiple configurations'))).toBeTruthy(); | |
| }); | |
| test('configuration_extending_configurations: h2 "Overriding Configurations"', async ({ page }) => { | |
| await page.goto('/configuration/extending-configurations/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Overriding Configurations' || t.startsWith('Overriding Configurations'))).toBeTruthy(); | |
| }); | |
| test('configuration_extending_configurations: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/configuration/extending-configurations/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - configuration_externals', () => { | |
| test('configuration_externals: title matches GT', async ({ page }) => { | |
| await page.goto('/configuration/externals/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('externals'); | |
| }); | |
| test('configuration_externals: h2 "externals"', async ({ page }) => { | |
| await page.goto('/configuration/externals/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'externals' || t.startsWith('externals'))).toBeTruthy(); | |
| }); | |
| test('configuration_externals: h2 "externalsType"', async ({ page }) => { | |
| await page.goto('/configuration/externals/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'externalsType' || t.startsWith('externalsType'))).toBeTruthy(); | |
| }); | |
| test('configuration_externals: h2 "externalsPresets"', async ({ page }) => { | |
| await page.goto('/configuration/externals/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'externalsPresets' || t.startsWith('externalsPresets'))).toBeTruthy(); | |
| }); | |
| test('configuration_externals: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/configuration/externals/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - configuration_infrastructureLogging', () => { | |
| test('configuration_infrastructureLogging: title matches GT', async ({ page }) => { | |
| await page.goto('/configuration/infrastructureLogging/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('infrastructurelogging'); | |
| }); | |
| test('configuration_infrastructureLogging: h2 "infrastructureLogging.appendOn"', async ({ page }) => { | |
| await page.goto('/configuration/infrastructureLogging/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'infrastructureLogging.appendOnly' || t.startsWith('infrastructureLogging.appendOnly'))).toBeTruthy(); | |
| }); | |
| test('configuration_infrastructureLogging: h2 "infrastructureLogging.colors"', async ({ page }) => { | |
| await page.goto('/configuration/infrastructureLogging/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'infrastructureLogging.colors' || t.startsWith('infrastructureLogging.colors'))).toBeTruthy(); | |
| }); | |
| test('configuration_infrastructureLogging: h2 "infrastructureLogging.console"', async ({ page }) => { | |
| await page.goto('/configuration/infrastructureLogging/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'infrastructureLogging.console' || t.startsWith('infrastructureLogging.console'))).toBeTruthy(); | |
| }); | |
| test('configuration_infrastructureLogging: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/configuration/infrastructureLogging/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - configuration_mode', () => { | |
| test('configuration_mode: title matches GT', async ({ page }) => { | |
| await page.goto('/configuration/mode/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('mode'); | |
| }); | |
| test('configuration_mode: h2 "Usage"', async ({ page }) => { | |
| await page.goto('/configuration/mode/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Usage' || t.startsWith('Usage'))).toBeTruthy(); | |
| }); | |
| test('configuration_mode: h2 "Further Reading"', async ({ page }) => { | |
| await page.goto('/configuration/mode/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Further Reading' || t.startsWith('Further Reading'))).toBeTruthy(); | |
| }); | |
| test('configuration_mode: h2 "6 Contributors"', async ({ page }) => { | |
| await page.goto('/configuration/mode/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '6 Contributors' || t.startsWith('6 Contributors'))).toBeTruthy(); | |
| }); | |
| test('configuration_mode: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/configuration/mode/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - configuration_module', () => { | |
| test('configuration_module: title matches GT', async ({ page }) => { | |
| await page.goto('/configuration/module/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('module'); | |
| }); | |
| test('configuration_module: h2 "module.defaultRules"', async ({ page }) => { | |
| await page.goto('/configuration/module/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'module.defaultRules' || t.startsWith('module.defaultRules'))).toBeTruthy(); | |
| }); | |
| test('configuration_module: h2 "module.generator"', async ({ page }) => { | |
| await page.goto('/configuration/module/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'module.generator' || t.startsWith('module.generator'))).toBeTruthy(); | |
| }); | |
| test('configuration_module: h2 "module.parser"', async ({ page }) => { | |
| await page.goto('/configuration/module/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'module.parser' || t.startsWith('module.parser'))).toBeTruthy(); | |
| }); | |
| test('configuration_module: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/configuration/module/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - configuration_node', () => { | |
| test('configuration_node: title matches GT', async ({ page }) => { | |
| await page.goto('/configuration/node/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('node'); | |
| }); | |
| test('configuration_node: h2 "node"', async ({ page }) => { | |
| await page.goto('/configuration/node/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'node' || t.startsWith('node'))).toBeTruthy(); | |
| }); | |
| test('configuration_node: h2 "node.global"', async ({ page }) => { | |
| await page.goto('/configuration/node/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'node.global' || t.startsWith('node.global'))).toBeTruthy(); | |
| }); | |
| test('configuration_node: h2 "node.__filename"', async ({ page }) => { | |
| await page.goto('/configuration/node/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'node.__filename' || t.startsWith('node.__filename'))).toBeTruthy(); | |
| }); | |
| test('configuration_node: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/configuration/node/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - configuration_optimization', () => { | |
| test('configuration_optimization: title matches GT', async ({ page }) => { | |
| await page.goto('/configuration/optimization/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('optimization'); | |
| }); | |
| test('configuration_optimization: h2 "optimization.checkWasmTypes"', async ({ page }) => { | |
| await page.goto('/configuration/optimization/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'optimization.checkWasmTypes' || t.startsWith('optimization.checkWasmTypes'))).toBeTruthy(); | |
| }); | |
| test('configuration_optimization: h2 "optimization.chunkIds"', async ({ page }) => { | |
| await page.goto('/configuration/optimization/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'optimization.chunkIds' || t.startsWith('optimization.chunkIds'))).toBeTruthy(); | |
| }); | |
| test('configuration_optimization: h2 "optimization.concatenateModule"', async ({ page }) => { | |
| await page.goto('/configuration/optimization/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'optimization.concatenateModules' || t.startsWith('optimization.concatenateModules'))).toBeTruthy(); | |
| }); | |
| test('configuration_optimization: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/configuration/optimization/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - configuration_other_options', () => { | |
| test('configuration_other_options: title matches GT', async ({ page }) => { | |
| await page.goto('/configuration/other-options/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('other options'); | |
| }); | |
| test('configuration_other_options: h1 "Other Options"', async ({ page }) => { | |
| await page.goto('/configuration/other-options/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Other Options' || t.startsWith('Other Options'))).toBeTruthy(); | |
| }); | |
| test('configuration_other_options: h2 "amd"', async ({ page }) => { | |
| await page.goto('/configuration/other-options/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'amd' || t.startsWith('amd'))).toBeTruthy(); | |
| }); | |
| test('configuration_other_options: h2 "bail"', async ({ page }) => { | |
| await page.goto('/configuration/other-options/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'bail' || t.startsWith('bail'))).toBeTruthy(); | |
| }); | |
| test('configuration_other_options: h2 "dependencies"', async ({ page }) => { | |
| await page.goto('/configuration/other-options/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'dependencies' || t.startsWith('dependencies'))).toBeTruthy(); | |
| }); | |
| test('configuration_other_options: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/configuration/other-options/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - configuration_output', () => { | |
| test('configuration_output: title matches GT', async ({ page }) => { | |
| await page.goto('/configuration/output/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('output'); | |
| }); | |
| test('configuration_output: h2 "output.assetModuleFilename"', async ({ page }) => { | |
| await page.goto('/configuration/output/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'output.assetModuleFilename' || t.startsWith('output.assetModuleFilename'))).toBeTruthy(); | |
| }); | |
| test('configuration_output: h2 "output.asyncChunks"', async ({ page }) => { | |
| await page.goto('/configuration/output/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'output.asyncChunks' || t.startsWith('output.asyncChunks'))).toBeTruthy(); | |
| }); | |
| test('configuration_output: h2 "output.auxiliaryComment"', async ({ page }) => { | |
| await page.goto('/configuration/output/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'output.auxiliaryComment' || t.startsWith('output.auxiliaryComment'))).toBeTruthy(); | |
| }); | |
| test('configuration_output: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/configuration/output/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - configuration_performance', () => { | |
| test('configuration_performance: title matches GT', async ({ page }) => { | |
| await page.goto('/configuration/performance/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('performance'); | |
| }); | |
| test('configuration_performance: h2 "performance"', async ({ page }) => { | |
| await page.goto('/configuration/performance/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'performance' || t.startsWith('performance'))).toBeTruthy(); | |
| }); | |
| test('configuration_performance: h2 "6 Contributors"', async ({ page }) => { | |
| await page.goto('/configuration/performance/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '6 Contributors' || t.startsWith('6 Contributors'))).toBeTruthy(); | |
| }); | |
| test('configuration_performance: h3 "webpack"', async ({ page }) => { | |
| await page.goto('/configuration/performance/'); | |
| const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'webpack' || t.startsWith('webpack'))).toBeTruthy(); | |
| }); | |
| test('configuration_performance: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/configuration/performance/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - configuration_plugins', () => { | |
| test('configuration_plugins: title matches GT', async ({ page }) => { | |
| await page.goto('/configuration/plugins/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('plugins'); | |
| }); | |
| test('configuration_plugins: h2 "plugins"', async ({ page }) => { | |
| await page.goto('/configuration/plugins/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'plugins' || t.startsWith('plugins'))).toBeTruthy(); | |
| }); | |
| test('configuration_plugins: h2 "6 Contributors"', async ({ page }) => { | |
| await page.goto('/configuration/plugins/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '6 Contributors' || t.startsWith('6 Contributors'))).toBeTruthy(); | |
| }); | |
| test('configuration_plugins: h3 "webpack"', async ({ page }) => { | |
| await page.goto('/configuration/plugins/'); | |
| const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'webpack' || t.startsWith('webpack'))).toBeTruthy(); | |
| }); | |
| test('configuration_plugins: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/configuration/plugins/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - configuration_resolve', () => { | |
| test('configuration_resolve: title matches GT', async ({ page }) => { | |
| await page.goto('/configuration/resolve/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('resolve'); | |
| }); | |
| test('configuration_resolve: h2 "resolve"', async ({ page }) => { | |
| await page.goto('/configuration/resolve/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'resolve' || t.startsWith('resolve'))).toBeTruthy(); | |
| }); | |
| test('configuration_resolve: h2 "resolveLoader"', async ({ page }) => { | |
| await page.goto('/configuration/resolve/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'resolveLoader' || t.startsWith('resolveLoader'))).toBeTruthy(); | |
| }); | |
| test('configuration_resolve: h2 "19 Contributors"', async ({ page }) => { | |
| await page.goto('/configuration/resolve/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '19 Contributors' || t.startsWith('19 Contributors'))).toBeTruthy(); | |
| }); | |
| test('configuration_resolve: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/configuration/resolve/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - configuration_stats', () => { | |
| test('configuration_stats: title matches GT', async ({ page }) => { | |
| await page.goto('/configuration/stats/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('stats'); | |
| }); | |
| test('configuration_stats: h2 "Stats Presets"', async ({ page }) => { | |
| await page.goto('/configuration/stats/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Stats Presets' || t.startsWith('Stats Presets'))).toBeTruthy(); | |
| }); | |
| test('configuration_stats: h2 "Stats Options"', async ({ page }) => { | |
| await page.goto('/configuration/stats/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Stats Options' || t.startsWith('Stats Options'))).toBeTruthy(); | |
| }); | |
| test('configuration_stats: h2 "15 Contributors"', async ({ page }) => { | |
| await page.goto('/configuration/stats/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '15 Contributors' || t.startsWith('15 Contributors'))).toBeTruthy(); | |
| }); | |
| test('configuration_stats: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/configuration/stats/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - configuration_target', () => { | |
| test('configuration_target: title matches GT', async ({ page }) => { | |
| await page.goto('/configuration/target/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('target'); | |
| }); | |
| test('configuration_target: h2 "target"', async ({ page }) => { | |
| await page.goto('/configuration/target/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'target' || t.startsWith('target'))).toBeTruthy(); | |
| }); | |
| test('configuration_target: h2 "11 Contributors"', async ({ page }) => { | |
| await page.goto('/configuration/target/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '11 Contributors' || t.startsWith('11 Contributors'))).toBeTruthy(); | |
| }); | |
| test('configuration_target: h3 "webpack"', async ({ page }) => { | |
| await page.goto('/configuration/target/'); | |
| const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'webpack' || t.startsWith('webpack'))).toBeTruthy(); | |
| }); | |
| test('configuration_target: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/configuration/target/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - configuration_watch', () => { | |
| test('configuration_watch: h2 "watch"', async ({ page }) => { | |
| await page.goto('/configuration/watch/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'watch' || t.startsWith('watch'))).toBeTruthy(); | |
| }); | |
| test('configuration_watch: h2 "watchOptions"', async ({ page }) => { | |
| await page.goto('/configuration/watch/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'watchOptions' || t.startsWith('watchOptions'))).toBeTruthy(); | |
| }); | |
| test('configuration_watch: h2 "Troubleshooting"', async ({ page }) => { | |
| await page.goto('/configuration/watch/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Troubleshooting' || t.startsWith('Troubleshooting'))).toBeTruthy(); | |
| }); | |
| test('configuration_watch: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/configuration/watch/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - contribute_Governance_Overview', () => { | |
| test('contribute_Governance_Overview: h2 "Roles and Responsibilities"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-Overview/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Roles and Responsibilities' || t.startsWith('Roles and Responsibilities'))).toBeTruthy(); | |
| }); | |
| test('contribute_Governance_Overview: h2 "Technical Steering Committee"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-Overview/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Technical Steering Committee' || t.startsWith('Technical Steering Committee'))).toBeTruthy(); | |
| }); | |
| test('contribute_Governance_Overview: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-Overview/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - contribute_Governance_ai_policy', () => { | |
| test('contribute_Governance_ai_policy: title matches GT', async ({ page }) => { | |
| await page.goto('/contribute/Governance-ai-policy/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('ai policy'); | |
| }); | |
| test('contribute_Governance_ai_policy: h1 "Ai Policy"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-ai-policy/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Ai Policy' || t.startsWith('Ai Policy'))).toBeTruthy(); | |
| }); | |
| test('contribute_Governance_ai_policy: h1 "AI Usage Policy"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-ai-policy/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'AI Usage Policy' || t.startsWith('AI Usage Policy'))).toBeTruthy(); | |
| }); | |
| test('contribute_Governance_ai_policy: h2 "Extractive Contributions"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-ai-policy/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Extractive Contributions' || t.startsWith('Extractive Contributions'))).toBeTruthy(); | |
| }); | |
| test('contribute_Governance_ai_policy: h2 "Transparency"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-ai-policy/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Transparency' || t.startsWith('Transparency'))).toBeTruthy(); | |
| }); | |
| test('contribute_Governance_ai_policy: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-ai-policy/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - contribute_Governance_charter', () => { | |
| test('contribute_Governance_charter: title matches GT', async ({ page }) => { | |
| await page.goto('/contribute/Governance-charter/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('charter'); | |
| }); | |
| test('contribute_Governance_charter: h1 "Charter"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-charter/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Charter' || t.startsWith('Charter'))).toBeTruthy(); | |
| }); | |
| test('contribute_Governance_charter: h1 "webpack TSC Charter"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-charter/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'webpack TSC Charter' || t.startsWith('webpack TSC Charter'))).toBeTruthy(); | |
| }); | |
| test('contribute_Governance_charter: h2 "Section 0. Guiding Principle"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-charter/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Section 0. Guiding Principle' || t.startsWith('Section 0. Guiding Principle'))).toBeTruthy(); | |
| }); | |
| test('contribute_Governance_charter: h2 "Section 1. Scope"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-charter/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Section 1. Scope' || t.startsWith('Section 1. Scope'))).toBeTruthy(); | |
| }); | |
| test('contribute_Governance_charter: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-charter/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - contribute_Governance_member_expectations', () => { | |
| test('contribute_Governance_member_expectations: title matches GT', async ({ page }) => { | |
| await page.goto('/contribute/Governance-member-expectations/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('member expectations'); | |
| }); | |
| test('contribute_Governance_member_expectations: h1 "Member Expectations"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-member-expectations/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Member Expectations' || t.startsWith('Member Expectations'))).toBeTruthy(); | |
| }); | |
| test('contribute_Governance_member_expectations: h3 "webpack"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-member-expectations/'); | |
| const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'webpack' || t.startsWith('webpack'))).toBeTruthy(); | |
| }); | |
| test('contribute_Governance_member_expectations: h3 "Comparison"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-member-expectations/'); | |
| const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Comparison' || t.startsWith('Comparison'))).toBeTruthy(); | |
| }); | |
| test('contribute_Governance_member_expectations: h3 "Awesome webpack"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-member-expectations/'); | |
| const texts = (await page.locator('h3').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Awesome webpack' || t.startsWith('Awesome webpack'))).toBeTruthy(); | |
| }); | |
| test('contribute_Governance_member_expectations: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-member-expectations/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - contribute_Governance_moderation_policy', () => { | |
| test('contribute_Governance_moderation_policy: title matches GT', async ({ page }) => { | |
| await page.goto('/contribute/Governance-moderation-policy/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('moderation policy'); | |
| }); | |
| test('contribute_Governance_moderation_policy: h1 "Moderation Policy"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-moderation-policy/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Moderation Policy' || t.startsWith('Moderation Policy'))).toBeTruthy(); | |
| }); | |
| test('contribute_Governance_moderation_policy: h2 "Applicability"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-moderation-policy/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Applicability' || t.startsWith('Applicability'))).toBeTruthy(); | |
| }); | |
| test('contribute_Governance_moderation_policy: h2 "Terms"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-moderation-policy/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Terms' || t.startsWith('Terms'))).toBeTruthy(); | |
| }); | |
| test('contribute_Governance_moderation_policy: h2 "Grounds for Moderation"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-moderation-policy/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Grounds for Moderation' || t.startsWith('Grounds for Moderation'))).toBeTruthy(); | |
| }); | |
| test('contribute_Governance_moderation_policy: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-moderation-policy/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - contribute_Governance_working_groups', () => { | |
| test('contribute_Governance_working_groups: title matches GT', async ({ page }) => { | |
| await page.goto('/contribute/Governance-working-groups/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('working groups'); | |
| }); | |
| test('contribute_Governance_working_groups: h1 "Working Groups"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-working-groups/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Working Groups' || t.startsWith('Working Groups'))).toBeTruthy(); | |
| }); | |
| test('contribute_Governance_working_groups: h1 "webpack Working Groups"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-working-groups/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'webpack Working Groups' || t.startsWith('webpack Working Groups'))).toBeTruthy(); | |
| }); | |
| test('contribute_Governance_working_groups: h2 "Joining a WG"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-working-groups/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Joining a WG' || t.startsWith('Joining a WG'))).toBeTruthy(); | |
| }); | |
| test('contribute_Governance_working_groups: h2 "Starting a Working Group"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-working-groups/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Starting a Working Group' || t.startsWith('Starting a Working Group'))).toBeTruthy(); | |
| }); | |
| test('contribute_Governance_working_groups: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/contribute/Governance-working-groups/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - contribute_debugging', () => { | |
| test('contribute_debugging: title matches GT', async ({ page }) => { | |
| await page.goto('/contribute/debugging/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('debugging'); | |
| }); | |
| test('contribute_debugging: h2 "Stats"', async ({ page }) => { | |
| await page.goto('/contribute/debugging/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Stats' || t.startsWith('Stats'))).toBeTruthy(); | |
| }); | |
| test('contribute_debugging: h2 "DevTools"', async ({ page }) => { | |
| await page.goto('/contribute/debugging/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'DevTools' || t.startsWith('DevTools'))).toBeTruthy(); | |
| }); | |
| test('contribute_debugging: h2 "Further Reading"', async ({ page }) => { | |
| await page.goto('/contribute/debugging/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Further Reading' || t.startsWith('Further Reading'))).toBeTruthy(); | |
| }); | |
| test('contribute_debugging: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/contribute/debugging/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - contribute_plugin_patterns', () => { | |
| test('contribute_plugin_patterns: title matches GT', async ({ page }) => { | |
| await page.goto('/contribute/plugin-patterns/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('plugin patterns'); | |
| }); | |
| test('contribute_plugin_patterns: h1 "Plugin Patterns"', async ({ page }) => { | |
| await page.goto('/contribute/plugin-patterns/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Plugin Patterns' || t.startsWith('Plugin Patterns'))).toBeTruthy(); | |
| }); | |
| test('contribute_plugin_patterns: h2 "Exploring assets, chunks, modu"', async ({ page }) => { | |
| await page.goto('/contribute/plugin-patterns/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Exploring assets, chunks, modules, and dependencies' || t.startsWith('Exploring assets, chunks, modules, and dependencies'))).toBeTruthy(); | |
| }); | |
| test('contribute_plugin_patterns: h2 "Changed chunks"', async ({ page }) => { | |
| await page.goto('/contribute/plugin-patterns/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Changed chunks' || t.startsWith('Changed chunks'))).toBeTruthy(); | |
| }); | |
| test('contribute_plugin_patterns: h2 "4 Contributors"', async ({ page }) => { | |
| await page.goto('/contribute/plugin-patterns/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '4 Contributors' || t.startsWith('4 Contributors'))).toBeTruthy(); | |
| }); | |
| test('contribute_plugin_patterns: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/contribute/plugin-patterns/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - contribute_release_process', () => { | |
| test('contribute_release_process: title matches GT', async ({ page }) => { | |
| await page.goto('/contribute/release-process/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('release process'); | |
| }); | |
| test('contribute_release_process: h1 "Release Process"', async ({ page }) => { | |
| await page.goto('/contribute/release-process/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Release Process' || t.startsWith('Release Process'))).toBeTruthy(); | |
| }); | |
| test('contribute_release_process: h2 "Pull Requests"', async ({ page }) => { | |
| await page.goto('/contribute/release-process/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Pull Requests' || t.startsWith('Pull Requests'))).toBeTruthy(); | |
| }); | |
| test('contribute_release_process: h2 "Releasing"', async ({ page }) => { | |
| await page.goto('/contribute/release-process/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Releasing' || t.startsWith('Releasing'))).toBeTruthy(); | |
| }); | |
| test('contribute_release_process: h2 "4 Contributors"', async ({ page }) => { | |
| await page.goto('/contribute/release-process/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '4 Contributors' || t.startsWith('4 Contributors'))).toBeTruthy(); | |
| }); | |
| test('contribute_release_process: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/contribute/release-process/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - contribute_writers_guide', () => { | |
| test('contribute_writers_guide: title matches GT', async ({ page }) => { | |
| await page.goto('/contribute/writers-guide/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('writer\'s guide'); | |
| }); | |
| test('contribute_writers_guide: h1 "Writer\'s Guide"', async ({ page }) => { | |
| await page.goto('/contribute/writers-guide/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Writer\'s Guide' || t.startsWith('Writer\'s Guide'))).toBeTruthy(); | |
| }); | |
| test('contribute_writers_guide: h2 "Process"', async ({ page }) => { | |
| await page.goto('/contribute/writers-guide/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Process' || t.startsWith('Process'))).toBeTruthy(); | |
| }); | |
| test('contribute_writers_guide: h2 "YAML Frontmatter"', async ({ page }) => { | |
| await page.goto('/contribute/writers-guide/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'YAML Frontmatter' || t.startsWith('YAML Frontmatter'))).toBeTruthy(); | |
| }); | |
| test('contribute_writers_guide: h2 "Article Structure"', async ({ page }) => { | |
| await page.goto('/contribute/writers-guide/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Article Structure' || t.startsWith('Article Structure'))).toBeTruthy(); | |
| }); | |
| test('contribute_writers_guide: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/contribute/writers-guide/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - contribute_writing_a_loader', () => { | |
| test('contribute_writing_a_loader: title matches GT', async ({ page }) => { | |
| await page.goto('/contribute/writing-a-loader/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('writing a loader'); | |
| }); | |
| test('contribute_writing_a_loader: h1 "Writing a Loader"', async ({ page }) => { | |
| await page.goto('/contribute/writing-a-loader/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Writing a Loader' || t.startsWith('Writing a Loader'))).toBeTruthy(); | |
| }); | |
| test('contribute_writing_a_loader: h2 "Setup"', async ({ page }) => { | |
| await page.goto('/contribute/writing-a-loader/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Setup' || t.startsWith('Setup'))).toBeTruthy(); | |
| }); | |
| test('contribute_writing_a_loader: h2 "Simple Usage"', async ({ page }) => { | |
| await page.goto('/contribute/writing-a-loader/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Simple Usage' || t.startsWith('Simple Usage'))).toBeTruthy(); | |
| }); | |
| test('contribute_writing_a_loader: h2 "Complex Usage"', async ({ page }) => { | |
| await page.goto('/contribute/writing-a-loader/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Complex Usage' || t.startsWith('Complex Usage'))).toBeTruthy(); | |
| }); | |
| test('contribute_writing_a_loader: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/contribute/writing-a-loader/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - contribute_writing_a_plugin', () => { | |
| test('contribute_writing_a_plugin: title matches GT', async ({ page }) => { | |
| await page.goto('/contribute/writing-a-plugin/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('writing a plugin'); | |
| }); | |
| test('contribute_writing_a_plugin: h1 "Writing a Plugin"', async ({ page }) => { | |
| await page.goto('/contribute/writing-a-plugin/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Writing a Plugin' || t.startsWith('Writing a Plugin'))).toBeTruthy(); | |
| }); | |
| test('contribute_writing_a_plugin: h2 "Creating a Plugin"', async ({ page }) => { | |
| await page.goto('/contribute/writing-a-plugin/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Creating a Plugin' || t.startsWith('Creating a Plugin'))).toBeTruthy(); | |
| }); | |
| test('contribute_writing_a_plugin: h2 "Basic plugin architecture"', async ({ page }) => { | |
| await page.goto('/contribute/writing-a-plugin/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Basic plugin architecture' || t.startsWith('Basic plugin architecture'))).toBeTruthy(); | |
| }); | |
| test('contribute_writing_a_plugin: h2 "Compiler and Compilation"', async ({ page }) => { | |
| await page.goto('/contribute/writing-a-plugin/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Compiler and Compilation' || t.startsWith('Compiler and Compilation'))).toBeTruthy(); | |
| }); | |
| test('contribute_writing_a_plugin: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/contribute/writing-a-plugin/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - contribute_writing_a_scaffold', () => { | |
| test('contribute_writing_a_scaffold: title matches GT', async ({ page }) => { | |
| await page.goto('/contribute/writing-a-scaffold/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('command line interface'); | |
| }); | |
| test('contribute_writing_a_scaffold: h1 "Command Line Interface"', async ({ page }) => { | |
| await page.goto('/contribute/writing-a-scaffold/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Command Line Interface' || t.startsWith('Command Line Interface'))).toBeTruthy(); | |
| }); | |
| test('contribute_writing_a_scaffold: h2 "Commands"', async ({ page }) => { | |
| await page.goto('/contribute/writing-a-scaffold/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Commands' || t.startsWith('Commands'))).toBeTruthy(); | |
| }); | |
| test('contribute_writing_a_scaffold: h2 "Flags"', async ({ page }) => { | |
| await page.goto('/contribute/writing-a-scaffold/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Flags' || t.startsWith('Flags'))).toBeTruthy(); | |
| }); | |
| test('contribute_writing_a_scaffold: h2 "Usage"', async ({ page }) => { | |
| await page.goto('/contribute/writing-a-scaffold/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Usage' || t.startsWith('Usage'))).toBeTruthy(); | |
| }); | |
| test('contribute_writing_a_scaffold: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/contribute/writing-a-scaffold/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - get_started_install_webpack', () => { | |
| test('get_started_install_webpack: title matches GT', async ({ page }) => { | |
| await page.goto('/get-started/install-webpack/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('installation'); | |
| }); | |
| test('get_started_install_webpack: h1 "Installation"', async ({ page }) => { | |
| await page.goto('/get-started/install-webpack/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Installation' || t.startsWith('Installation'))).toBeTruthy(); | |
| }); | |
| test('get_started_install_webpack: h2 "Prerequisites"', async ({ page }) => { | |
| await page.goto('/get-started/install-webpack/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Prerequisites' || t.startsWith('Prerequisites'))).toBeTruthy(); | |
| }); | |
| test('get_started_install_webpack: h2 "Local Installation"', async ({ page }) => { | |
| await page.goto('/get-started/install-webpack/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Local Installation' || t.startsWith('Local Installation'))).toBeTruthy(); | |
| }); | |
| test('get_started_install_webpack: h2 "Global Installation"', async ({ page }) => { | |
| await page.goto('/get-started/install-webpack/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Global Installation' || t.startsWith('Global Installation'))).toBeTruthy(); | |
| }); | |
| test('get_started_install_webpack: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/get-started/install-webpack/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - get_started_why_webpack', () => { | |
| test('get_started_why_webpack: title matches GT', async ({ page }) => { | |
| await page.goto('/get-started/why-webpack/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('comparison'); | |
| }); | |
| test('get_started_why_webpack: h1 "Comparison"', async ({ page }) => { | |
| await page.goto('/get-started/why-webpack/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Comparison' || t.startsWith('Comparison'))).toBeTruthy(); | |
| }); | |
| test('get_started_why_webpack: h2 "Bundling vs. Loading"', async ({ page }) => { | |
| await page.goto('/get-started/why-webpack/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Bundling vs. Loading' || t.startsWith('Bundling vs. Loading'))).toBeTruthy(); | |
| }); | |
| test('get_started_why_webpack: h2 "Further Reading"', async ({ page }) => { | |
| await page.goto('/get-started/why-webpack/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Further Reading' || t.startsWith('Further Reading'))).toBeTruthy(); | |
| }); | |
| test('get_started_why_webpack: h2 "6 Contributors"', async ({ page }) => { | |
| await page.goto('/get-started/why-webpack/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '6 Contributors' || t.startsWith('6 Contributors'))).toBeTruthy(); | |
| }); | |
| test('get_started_why_webpack: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/get-started/why-webpack/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - guides_asset_management', () => { | |
| test('guides_asset_management: title matches GT', async ({ page }) => { | |
| await page.goto('/guides/asset-management/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('asset management'); | |
| }); | |
| test('guides_asset_management: h1 "Asset Management"', async ({ page }) => { | |
| await page.goto('/guides/asset-management/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Asset Management' || t.startsWith('Asset Management'))).toBeTruthy(); | |
| }); | |
| test('guides_asset_management: h2 "Setup"', async ({ page }) => { | |
| await page.goto('/guides/asset-management/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Setup' || t.startsWith('Setup'))).toBeTruthy(); | |
| }); | |
| test('guides_asset_management: h2 "Loading CSS"', async ({ page }) => { | |
| await page.goto('/guides/asset-management/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Loading CSS' || t.startsWith('Loading CSS'))).toBeTruthy(); | |
| }); | |
| test('guides_asset_management: h2 "Loading Images"', async ({ page }) => { | |
| await page.goto('/guides/asset-management/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Loading Images' || t.startsWith('Loading Images'))).toBeTruthy(); | |
| }); | |
| test('guides_asset_management: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/guides/asset-management/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - guides_asset_modules', () => { | |
| test('guides_asset_modules: title matches GT', async ({ page }) => { | |
| await page.goto('/guides/asset-modules/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('asset modules'); | |
| }); | |
| test('guides_asset_modules: h1 "Asset Modules"', async ({ page }) => { | |
| await page.goto('/guides/asset-modules/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Asset Modules' || t.startsWith('Asset Modules'))).toBeTruthy(); | |
| }); | |
| test('guides_asset_modules: h2 "Public Path"', async ({ page }) => { | |
| await page.goto('/guides/asset-modules/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Public Path' || t.startsWith('Public Path'))).toBeTruthy(); | |
| }); | |
| test('guides_asset_modules: h2 "Resource type"', async ({ page }) => { | |
| await page.goto('/guides/asset-modules/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Resource type' || t.startsWith('Resource type'))).toBeTruthy(); | |
| }); | |
| test('guides_asset_modules: h2 "Inlining assets"', async ({ page }) => { | |
| await page.goto('/guides/asset-modules/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Inlining assets' || t.startsWith('Inlining assets'))).toBeTruthy(); | |
| }); | |
| test('guides_asset_modules: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/guides/asset-modules/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - guides_author_libraries', () => { | |
| test('guides_author_libraries: title matches GT', async ({ page }) => { | |
| await page.goto('/guides/author-libraries/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('authoring libraries'); | |
| }); | |
| test('guides_author_libraries: h1 "Authoring Libraries"', async ({ page }) => { | |
| await page.goto('/guides/author-libraries/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Authoring Libraries' || t.startsWith('Authoring Libraries'))).toBeTruthy(); | |
| }); | |
| test('guides_author_libraries: h2 "Authoring a Library"', async ({ page }) => { | |
| await page.goto('/guides/author-libraries/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Authoring a Library' || t.startsWith('Authoring a Library'))).toBeTruthy(); | |
| }); | |
| test('guides_author_libraries: h2 "Webpack Configuration"', async ({ page }) => { | |
| await page.goto('/guides/author-libraries/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Webpack Configuration' || t.startsWith('Webpack Configuration'))).toBeTruthy(); | |
| }); | |
| test('guides_author_libraries: h2 "Expose the Library"', async ({ page }) => { | |
| await page.goto('/guides/author-libraries/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Expose the Library' || t.startsWith('Expose the Library'))).toBeTruthy(); | |
| }); | |
| test('guides_author_libraries: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/guides/author-libraries/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - guides_build_performance', () => { | |
| test('guides_build_performance: title matches GT', async ({ page }) => { | |
| await page.goto('/guides/build-performance/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('build performance'); | |
| }); | |
| test('guides_build_performance: h1 "Build Performance"', async ({ page }) => { | |
| await page.goto('/guides/build-performance/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Build Performance' || t.startsWith('Build Performance'))).toBeTruthy(); | |
| }); | |
| test('guides_build_performance: h2 "General"', async ({ page }) => { | |
| await page.goto('/guides/build-performance/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'General' || t.startsWith('General'))).toBeTruthy(); | |
| }); | |
| test('guides_build_performance: h2 "Development"', async ({ page }) => { | |
| await page.goto('/guides/build-performance/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Development' || t.startsWith('Development'))).toBeTruthy(); | |
| }); | |
| test('guides_build_performance: h2 "Production"', async ({ page }) => { | |
| await page.goto('/guides/build-performance/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Production' || t.startsWith('Production'))).toBeTruthy(); | |
| }); | |
| test('guides_build_performance: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/guides/build-performance/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - guides_caching', () => { | |
| test('guides_caching: title matches GT', async ({ page }) => { | |
| await page.goto('/guides/caching/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('caching'); | |
| }); | |
| test('guides_caching: h2 "Output Filenames"', async ({ page }) => { | |
| await page.goto('/guides/caching/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Output Filenames' || t.startsWith('Output Filenames'))).toBeTruthy(); | |
| }); | |
| test('guides_caching: h2 "Extracting Boilerplate"', async ({ page }) => { | |
| await page.goto('/guides/caching/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Extracting Boilerplate' || t.startsWith('Extracting Boilerplate'))).toBeTruthy(); | |
| }); | |
| test('guides_caching: h2 "Module Identifiers"', async ({ page }) => { | |
| await page.goto('/guides/caching/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Module Identifiers' || t.startsWith('Module Identifiers'))).toBeTruthy(); | |
| }); | |
| test('guides_caching: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/guides/caching/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - guides_code_splitting', () => { | |
| test('guides_code_splitting: title matches GT', async ({ page }) => { | |
| await page.goto('/guides/code-splitting/'); | |
| const t = (await page.title()).toLowerCase(); | |
| expect(t).toContain('code splitting'); | |
| }); | |
| test('guides_code_splitting: h1 "Code Splitting"', async ({ page }) => { | |
| await page.goto('/guides/code-splitting/'); | |
| const texts = (await page.locator('h1').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Code Splitting' || t.startsWith('Code Splitting'))).toBeTruthy(); | |
| }); | |
| test('guides_code_splitting: h2 "Entry Points"', async ({ page }) => { | |
| await page.goto('/guides/code-splitting/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Entry Points' || t.startsWith('Entry Points'))).toBeTruthy(); | |
| }); | |
| test('guides_code_splitting: h2 "Prevent Duplication"', async ({ page }) => { | |
| await page.goto('/guides/code-splitting/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Prevent Duplication' || t.startsWith('Prevent Duplication'))).toBeTruthy(); | |
| }); | |
| test('guides_code_splitting: h2 "Dynamic Imports"', async ({ page }) => { | |
| await page.goto('/guides/code-splitting/'); | |
| const texts = (await page.locator('h2').allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === 'Dynamic Imports' || t.startsWith('Dynamic Imports'))).toBeTruthy(); | |
| }); | |
| test('guides_code_splitting: nav link "(opens in a new tab)"', async ({ page }) => { | |
| await page.goto('/guides/code-splitting/'); | |
| const links = page.locator('nav a'); | |
| const texts = (await links.allTextContents()).map(s => s.replace(/\s+/g, ' ').trim()); | |
| expect(texts.some(t => t === '(opens in a new tab)' || t.startsWith('(opens in a new tab)')), 'link text in nav').toBeTruthy(); | |
| const hrefs = await links.evaluateAll(els => els.map(e => (e.getAttribute('href') || '').toLowerCase())); | |
| expect(hrefs.some(h => h.includes('webpack')), 'href fragment present').toBeTruthy(); | |
| }); | |
| }); | |
| test.describe('Functional - Routing', () => { | |
| test('navigate to contribute via "Contribute"', async ({ page }) => { | |
| await page.goto('/'); | |
| const link = page.locator('a[href*="contribute"]').first(); | |
| expect(await link.count(), 'nav link to contribute exists').toBeGreaterThan(0); | |
| await link.click(); | |
| await page.waitForTimeout(1200); | |
| expect(page.url().toLowerCase(), 'URL changed to destination').toContain('contribute'); | |
| const bodyText = (await page.evaluate(() => document.body.innerText)).replace(/\s+/g, ' '); | |
| expect(bodyText, 'destination distinctive content shown').toContain('Contribute'); | |
| }); | |
| test('navigate to blog via "Blog"', async ({ page }) => { | |
| await page.goto('/'); | |
| const link = page.locator('a[href*="blog"]').first(); | |
| expect(await link.count(), 'nav link to blog exists').toBeGreaterThan(0); | |
| await link.click(); | |
| await page.waitForTimeout(1200); | |
| expect(page.url().toLowerCase(), 'URL changed to destination').toContain('blog'); | |
| const bodyText = (await page.evaluate(() => document.body.innerText)).replace(/\s+/g, ' '); | |
| expect(bodyText, 'destination distinctive content shown').toContain('Blog'); | |
| }); | |
| }); | |