mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-07-17 17:21:48 +00:00
Add cors proxy prober on apps.wikitree.com
This commit is contained in:
77
.github/workflows/prober-wikitree-cors.yml
vendored
Normal file
77
.github/workflows/prober-wikitree-cors.yml
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
name: Prober - WikiTree CORS
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
wait_for_propagation:
|
||||
type: boolean
|
||||
default: false
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
wait_for_propagation:
|
||||
type: boolean
|
||||
default: false
|
||||
schedule:
|
||||
- cron: '0 5 * * *'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: write
|
||||
|
||||
concurrency:
|
||||
group: prober-${{ github.workflow }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
prober:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
env:
|
||||
SPEC: wikitree-cors-gedcom.spec.ts
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 24.x
|
||||
cache: 'npm'
|
||||
|
||||
- run: npm ci
|
||||
|
||||
- name: Wait for deployment propagation
|
||||
if: inputs.wait_for_propagation
|
||||
run: sleep 180
|
||||
|
||||
- name: Get Playwright version
|
||||
id: playwright-version
|
||||
run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache Playwright Browsers
|
||||
id: cache-playwright
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}
|
||||
|
||||
- name: Install Playwright System Dependencies
|
||||
run: npx playwright install-deps chromium
|
||||
|
||||
- name: Install Playwright Browsers (If Not Cached)
|
||||
if: steps.cache-playwright.outputs.cache-hit != 'true'
|
||||
run: npx playwright install chromium
|
||||
|
||||
- name: Run prober
|
||||
env:
|
||||
PLAYWRIGHT_HTML_REPORT: playwright-report/prober
|
||||
run: npx playwright test --config=playwright.prober.config.ts "${SPEC}"
|
||||
|
||||
- name: Upload Playwright report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: prober-report-wikitree-cors
|
||||
path: playwright-report/
|
||||
retention-days: 30
|
||||
34
tests/probers/wikitree-cors-gedcom.spec.ts
Normal file
34
tests/probers/wikitree-cors-gedcom.spec.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import {expect, test} from '@playwright/test';
|
||||
|
||||
/**
|
||||
* Prober: WikiTree GEDCOM + CORS proxy
|
||||
*
|
||||
* Loads a GEDCOM file from a raw GitHub URL through the app deployed on
|
||||
* apps.wikitree.com. Even though the app is on the WikiTree domain,
|
||||
* GEDCOM-from-URL always uses the CORS proxy by default. This confirms
|
||||
* the CORS proxy is reachable from the WikiTree deployment.
|
||||
*/
|
||||
test('WikiTree CORS proxy prober', async ({page}) => {
|
||||
await page.goto(
|
||||
'https://apps.wikitree.com/apps/wiech13/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