1 parent
43347c1172
commit
6e15063502
122 files changed
+7848
-9828
No files matched your search
@@ -0,0 +1,69 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto('/');
|
||||
await expect(page.getByText('ALPHA-17', { exact: true })).toBeVisible();
|
||||
await expect(page.getByTestId('operational-map')).toBeVisible();
|
||||
});
|
||||
|
||||
test('former workspaces preserve the same map, camera, selection, and live telemetry', async ({ page }) => {
|
||||
await page.evaluate(() => { (document.querySelector('[data-testid="operational-map"]') as HTMLElement & { __persistent?: symbol }).__persistent = Symbol.for('persistent-map'); });
|
||||
const originalCamera = await page.getByTestId('operational-map').getAttribute('data-camera');
|
||||
await expect(page.getByRole('complementary', { name: 'Fleet roster and control groups' })).toBeVisible();
|
||||
for (const tool of ['Queue', 'Events', 'Configuration', 'Recovery', 'Settings']) {
|
||||
await page.getByRole('button', { name: tool, exact: true }).first().click();
|
||||
await expect(page.getByTestId('operational-map')).toBeAttached();
|
||||
expect(await page.evaluate(() => (document.querySelector('[data-testid="operational-map"]') as HTMLElement & { __persistent?: symbol }).__persistent === Symbol.for('persistent-map'))).toBe(true);
|
||||
expect(await page.getByTestId('operational-map').getAttribute('data-camera')).toBe(originalCamera);
|
||||
}
|
||||
await expect(page.getByText(/12 VEHICLES/).first()).toBeVisible();
|
||||
await expect(page.getByText('LIVE TELEMETRY CONTINUES')).toBeVisible();
|
||||
});
|
||||
|
||||
test('control groups remain local and double recall frames selected units', async ({ page }) => {
|
||||
await page.keyboard.press('Control+2');
|
||||
await expect(page.getByRole('status')).toContainText('Control group 2 assigned');
|
||||
await page.keyboard.press('2'); await page.keyboard.press('2');
|
||||
await expect(page.getByTestId('operational-map')).toHaveAttribute('data-camera', /1\.50|2\.10/);
|
||||
});
|
||||
|
||||
test('route geometry completes into review and can be cancelled without issuing', async ({ page }) => {
|
||||
await page.getByRole('button', { name: 'Route', exact: true }).first().click();
|
||||
const map = page.getByTestId('operational-map'); const box = await map.boundingBox(); if (!box) throw new Error('map has no bounds');
|
||||
await page.mouse.click(box.x + box.width * .15, box.y + box.height * .68);
|
||||
await page.mouse.click(box.x + box.width * .43, box.y + box.height * .74);
|
||||
await page.mouse.click(box.x + box.width * .72, box.y + box.height * .69);
|
||||
await page.keyboard.press('Enter');
|
||||
await expect(page.getByLabel('Command draft review')).toContainText('3 WAYPOINTS');
|
||||
await expect(page.getByLabel('Command draft review')).toContainText('LOCAL ROUTE DRAFT · NOT SENT');
|
||||
await page.getByLabel('Command draft review').getByRole('button', { name: 'CANCEL' }).click();
|
||||
await expect(page.getByLabel('Command draft review')).not.toBeAttached();
|
||||
});
|
||||
|
||||
test('map annotations use draft history undo and redo', async ({ page }) => {
|
||||
await page.getByRole('button', { name: 'Map creation tools' }).click();
|
||||
await page.getByRole('button', { name: 'Marker' }).click();
|
||||
const map = page.getByTestId('operational-map'); const box = await map.boundingBox(); if (!box) throw new Error('map has no bounds');
|
||||
await page.mouse.click(box.x + box.width * .55, box.y + box.height * .42);
|
||||
await page.keyboard.press('Control+z'); await page.keyboard.press('Control+y');
|
||||
await expect(map.locator('.draft-shape.complete')).toHaveCount(1);
|
||||
});
|
||||
|
||||
test('deploys fifty provisional simulated vehicles in one cohort', async ({ page }) => {
|
||||
await page.keyboard.press('v'); await expect(page.getByText('VEHICLE DEPLOYMENT · PROVISIONAL')).toBeVisible();
|
||||
await page.getByRole('button', { name: 'STAGE 50 GHOSTS' }).click();
|
||||
await expect(page.getByRole('status')).toContainText('50 provisional'); await expect(page.getByText('50 STAGED')).toBeVisible();
|
||||
});
|
||||
|
||||
test('commissioning remains docked over visible map and exposes calibration and diffs', async ({ page }) => {
|
||||
await page.getByRole('button', { name: 'Configuration' }).click();
|
||||
await expect(page.getByText('DOCKED COMMISSIONING')).toBeVisible(); await expect(page.getByTestId('operational-map')).toBeVisible();
|
||||
await page.getByRole('button', { name: 'SENSORS', exact: true }).click(); await expect(page.getByText('GYRO RESIDUAL')).toBeVisible();
|
||||
await page.getByRole('button', { name: 'PARAMETERS', exact: true }).click(); await expect(page.getByText('BASELINE → CURRENT → DESIRED')).toBeVisible();
|
||||
});
|
||||
|
||||
for (const viewport of [{ width: 1366, height: 768 }, { width: 1920, height: 1080 }, { width: 3440, height: 1440 }]) test(`scene fits ${viewport.width}x${viewport.height}`, async ({ page }) => {
|
||||
await page.setViewportSize(viewport); const map = page.getByTestId('operational-map'); await expect(map).toBeVisible();
|
||||
const box = await map.boundingBox(); expect(box).not.toBeNull(); expect(box!.width).toBeGreaterThan(viewport.width * .3); expect(box!.height).toBeGreaterThan(viewport.height * .45);
|
||||
const overflow = await page.evaluate(() => ({ x: document.documentElement.scrollWidth - innerWidth, y: document.documentElement.scrollHeight - innerHeight })); expect(overflow.x).toBeLessThanOrEqual(0); expect(overflow.y).toBeLessThanOrEqual(0);
|
||||
});
|
||||
@@ -0,0 +1,29 @@
|
||||
import { expect, test, type Page, type TestInfo } from '@playwright/test';
|
||||
|
||||
const viewports = [{ width: 1366, height: 768 }, { width: 1920, height: 1080 }, { width: 3440, height: 1440 }];
|
||||
const ready = async (page: Page) => { await page.goto('/'); await expect(page.getByTestId('operational-map')).toBeVisible(); };
|
||||
|
||||
for (const viewport of viewports) test(`renders the eight spatial compositions at ${viewport.width}x${viewport.height}`, async ({ page }, testInfo: TestInfo) => {
|
||||
await page.setViewportSize(viewport);
|
||||
const shot = (name: string) => page.screenshot({ path: testInfo.outputPath(`${name}-${viewport.width}x${viewport.height}.png`), animations: 'disabled' });
|
||||
|
||||
await ready(page); await shot('01-live-tactical');
|
||||
|
||||
await page.getByText('Low reserve', { exact: true }).click(); await expect(page.getByText(/VEHICLES/).first()).toBeVisible(); await shot('02-large-multiselection');
|
||||
|
||||
await ready(page); await page.getByRole('button', { name: 'Route', exact: true }).first().click();
|
||||
{ const box = await page.getByTestId('operational-map').boundingBox(); if (!box) throw new Error('map has no bounds'); for (const [x, y] of [[.15,.68],[.43,.74],[.72,.69]]) await page.mouse.click(box.x + box.width * x, box.y + box.height * y); }
|
||||
await page.keyboard.press('Enter'); await expect(page.getByLabel('Command draft review')).toBeVisible(); await shot('03-route-formation-draft');
|
||||
|
||||
await ready(page); await page.getByRole('button', { name: 'Map creation tools' }).click(); await page.getByRole('button', { name: 'Polygon', exact: true }).click();
|
||||
{ const box = await page.getByTestId('operational-map').boundingBox(); if (!box) throw new Error('map has no bounds'); for (const [x, y] of [[.18,.62],[.38,.70],[.44,.48],[.24,.42]]) await page.mouse.click(box.x + box.width * x, box.y + box.height * y); }
|
||||
await page.keyboard.press('Enter'); await shot('04-task-area-drawing');
|
||||
|
||||
await ready(page); await page.getByRole('button', { name: 'Deploy', exact: true }).click(); await page.getByRole('button', { name: 'DISCOVER', exact: true }).click(); await expect(page.getByText('KPT-F722-9A31')).toBeVisible(); await shot('05-deployment-discovery');
|
||||
|
||||
await ready(page); await page.getByRole('button', { name: 'Configuration' }).click(); await page.getByRole('button', { name: 'SENSORS', exact: true }).click(); await expect(page.getByText('GYRO RESIDUAL')).toBeVisible(); await shot('06-sensor-radio-calibration');
|
||||
|
||||
await page.getByRole('button', { name: 'PARAMETERS', exact: true }).click(); await expect(page.getByText('BASELINE → CURRENT → DESIRED')).toBeVisible(); await shot('07-parameter-configuration-diff');
|
||||
|
||||
await ready(page); await page.getByRole('button', { name: 'Recovery' }).click(); await expect(page.getByText('DEGRADED OPERATIONS')).toBeVisible(); await shot('08-degraded-recovery');
|
||||
});
|
||||
Reference in new issue
Block a user