mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-07-18 01:31:47 +00:00
refactor: consolidate prober logic into shared helper and add test-testid attributes to core UI elements
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import {expect, test} from '@playwright/test';
|
||||
import {test} from '@playwright/test';
|
||||
|
||||
import {runProber} from './helpers';
|
||||
|
||||
/**
|
||||
* Prober: WikiTree GEDCOM + CORS proxy
|
||||
@@ -9,26 +11,8 @@ import {expect, test} from '@playwright/test';
|
||||
* 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();
|
||||
await runProber(page, {
|
||||
url: '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',
|
||||
expectedName: 'Bonifacy',
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user