@
Add star-map Angular app, ETL pipeline, and caveman plugin Angular 3D star map (galaxy/system/body views, Three.js rendering, navigation store) plus the NASA ETL tooling that builds the star, exoplanet and solar-system datasets, Playwright e2e suite, and the cs:caveman Claude Code plugin (command, agent, skill). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> @
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { expect, Locator, Page } from '@playwright/test';
|
||||
|
||||
/**
|
||||
* The "Galaxy" back button is only rendered while `NavigationStore.viewLevel() === 'system'`,
|
||||
* which becomes true only once a full galaxy-to-system camera-flight transition has settled.
|
||||
* Bootstrap (data fetch + raycaster wiring) finishes asynchronously after `page.goto()`, so
|
||||
* this repeatedly clicks the canvas (re-checking first, so it never clicks a system-view body
|
||||
* marker by accident once the transition has already completed) until the button appears.
|
||||
*/
|
||||
export function backButtonLocator(page: Page): Locator {
|
||||
return page.getByRole('button', { name: 'Galaxy' });
|
||||
}
|
||||
|
||||
export async function clickCanvasUntilSystemEntered(page: Page, canvas: Locator, backButton: Locator): Promise<void> {
|
||||
await expect
|
||||
.poll(
|
||||
async () => {
|
||||
if (await backButton.isVisible()) {
|
||||
return true;
|
||||
}
|
||||
await canvas.click();
|
||||
return false;
|
||||
},
|
||||
{ timeout: 15_000, intervals: [300] }
|
||||
)
|
||||
.toBe(true);
|
||||
}
|
||||
Reference in New Issue
Block a user