|
| 1 | +import { test, expect } from '@playwright/test'; |
| 2 | + |
| 3 | +const repositories = [ |
| 4 | + 'Promptimprover', |
| 5 | + 'autogen', |
| 6 | + 'gsd-orchestrator', |
| 7 | + 'cas-contracts', |
| 8 | + 'cas-evals', |
| 9 | + 'cas-platform', |
| 10 | + 'cas-reference-product', |
| 11 | + 'cas-workstation', |
| 12 | + 'autopilot-core', |
| 13 | + 'autopilot-demo', |
| 14 | + 'ci-autopilot', |
| 15 | + 'cloud-security-service-model', |
| 16 | + 'org-dotgithub' |
| 17 | +]; |
| 18 | + |
| 19 | +test.describe('GitHub Pages Omni-Audit', () => { |
| 20 | + for (const repo of repositories) { |
| 21 | + // Note: the org-dotgithub repo resolves to the root domain in gh pages |
| 22 | + const path = repo === 'org-dotgithub' ? '' : repo; |
| 23 | + const url = `https://Coding-Autopilot-System.github.io/${path}`; |
| 24 | + |
| 25 | + test(`Visual & Functional audit for ${repo} MkDocs Page`, async ({ page }) => { |
| 26 | + // 1. Navigate to the deployed site |
| 27 | + const response = await page.goto(url); |
| 28 | + |
| 29 | + // 2. Assert no 404 |
| 30 | + expect(response?.status()).toBeLessThan(400); |
| 31 | + |
| 32 | + // 3. Assert MkDocs Material Theme loaded correctly |
| 33 | + const header = page.locator('.md-header'); |
| 34 | + await expect(header).toBeVisible(); |
| 35 | + |
| 36 | + // 4. Assert health badges exist on the landing page |
| 37 | + const badges = page.locator('img[src*="badge.svg"]'); |
| 38 | + // Some repos might not have the badge rendered yet, but we check if the element exists in DOM |
| 39 | + // We wrap in a soft assertion so the test doesn't immediately fail if CI is slow to generate badges |
| 40 | + await expect.soft(badges.first()).toBeVisible(); |
| 41 | + |
| 42 | + // 5. Take visual snapshot (commented out until baselines are generated) |
| 43 | + // await expect(page).toHaveScreenshot(`${repo}-landing.png`); |
| 44 | + }); |
| 45 | + } |
| 46 | +}); |
0 commit comments