mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-07-17 17:21:48 +00:00
Add GitHub Pages prober
This commit is contained in:
30
tests/probers/README.md
Normal file
30
tests/probers/README.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# Prober Tests
|
||||
|
||||
These are **live smoke tests** that run against deployed URLs and external
|
||||
services. They are NOT hermetic — they make real network requests to the
|
||||
WikiTree API, CORS proxy, and GitHub raw URLs.
|
||||
|
||||
## Running
|
||||
|
||||
```bash
|
||||
npm run test:probers
|
||||
```
|
||||
|
||||
This uses the separate `playwright.prober.config.ts` configuration, which
|
||||
does not start a local dev server. Each spec navigates to a full absolute
|
||||
URL (or `localhost:8080` for the Docker prober).
|
||||
|
||||
## What They Test
|
||||
|
||||
| Spec | Target | Exercises |
|
||||
| --- | --- | --- |
|
||||
| `gh-pages-gedcom.spec.ts` | `pewu.github.io` | GitHub Pages deployment, CORS proxy, GEDCOM-from-URL |
|
||||
| `wikitree.spec.ts` | `apps.wikitree.com` | WikiTree direct API, WikiTree deployment |
|
||||
| `wikitree-cors-gedcom.spec.ts` | `apps.wikitree.com` | WikiTree deployment, CORS proxy via GEDCOM-from-URL |
|
||||
| `docker.spec.ts` | `localhost:8080` | Published Docker image from GHCR |
|
||||
|
||||
## Notes
|
||||
|
||||
- Probers run sequentially (`fullyParallel: false`) to avoid rate-limiting.
|
||||
- Each prober has its own GitHub Actions workflow for independent triggering.
|
||||
- Probers do not block Google Analytics, so live runs generate real analytics events.
|
||||
35
tests/probers/gh-pages-gedcom.spec.ts
Normal file
35
tests/probers/gh-pages-gedcom.spec.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import {expect, test} from '@playwright/test';
|
||||
|
||||
/**
|
||||
* Prober: GitHub Pages GEDCOM via CORS proxy
|
||||
*
|
||||
* Loads a GEDCOM file from a raw GitHub URL through the app deployed on
|
||||
* pewu.github.io. Because the app is not on the apps.wikitree.com domain,
|
||||
* GEDCOM URL requests are routed through the CORS proxy
|
||||
* (topolaproxy.bieda.it) by default. This exercises the GitHub Pages
|
||||
* deployment, the CORS proxy, and GEDCOM-from-URL loading.
|
||||
*/
|
||||
test('GitHub Pages GEDCOM prober', async ({page}) => {
|
||||
await page.goto(
|
||||
'https://pewu.github.io/topola-viewer/#/view?url=https://raw.githubusercontent.com/PeWu/topola-viewer/master/src/datasource/testdata/test.ged&indi=I1',
|
||||
);
|
||||
|
||||
// Wait for the app to reach SHOWING_CHART state.
|
||||
await expect(page.locator('#content')).toBeVisible();
|
||||
|
||||
// Assert the expected person's name appears in the chart SVG.
|
||||
await expect(page.locator('#chart')).toContainText('Bonifacy');
|
||||
|
||||
// Assert the expected person's name appears in the side panel.
|
||||
// Scoped to div.details to avoid matching <text class="details sex"> SVG
|
||||
// elements in the chart that also carry the "details" class.
|
||||
await expect(page.locator('div.details')).toContainText('Bonifacy');
|
||||
|
||||
// Assert no fatal error is displayed (replaces chart when state is ERROR).
|
||||
await expect(page.locator('.ui.error.message')).not.toBeVisible();
|
||||
|
||||
// Assert no popup error is displayed.
|
||||
// ErrorPopup uses Semantic UI React's <Portal>, which renders at
|
||||
// document.body level, not inside #content.
|
||||
await expect(page.locator('.ui.errorPopup.message')).not.toBeVisible();
|
||||
});
|
||||
Reference in New Issue
Block a user