Skip to content

Commit 49a06b0

Browse files
committed
test(ui): add centralized playwright suite for github pages
1 parent 89172f4 commit 49a06b0

3 files changed

Lines changed: 79 additions & 0 deletions

File tree

tests/ui/github-pages.spec.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
});

tests/ui/package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "cas-ui-evals",
3+
"version": "1.0.0",
4+
"description": "Centralized Playwright suite for CAS Ecosystem",
5+
"scripts": {
6+
"test": "playwright test",
7+
"test:ui": "playwright test --ui"
8+
},
9+
"devDependencies": {
10+
"@playwright/test": "^1.42.0",
11+
"@types/node": "^20.0.0"
12+
}
13+
}

tests/ui/playwright.config.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { defineConfig, devices } from '@playwright/test';
2+
3+
export default defineConfig({
4+
testDir: './',
5+
fullyParallel: true,
6+
forbidOnly: !!process.env.CI,
7+
retries: process.env.CI ? 2 : 0,
8+
workers: process.env.CI ? 1 : undefined,
9+
reporter: 'html',
10+
use: {
11+
trace: 'on-first-retry',
12+
screenshot: 'only-on-failure',
13+
},
14+
projects: [
15+
{
16+
name: 'chromium',
17+
use: { ...devices['Desktop Chrome'] },
18+
}
19+
],
20+
});

0 commit comments

Comments
 (0)