mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-06 09:47:44 +02:00
[eric] e2e: create a dashboard before the toolbar/canvas specs so a clean CI profile does not fail - combinatorial Add-note and deep-coverage Dashboard-canvas both clicked surfaces that only mount once a dashboard is active, which a freshly-wiped CI profile lacks
This commit is contained in:
@@ -55,6 +55,19 @@ test.describe('combinatorial user flows', () => {
|
||||
await el.click({ timeout: 8_000 });
|
||||
return el;
|
||||
};
|
||||
// The bottom dashboard toolbar (New Agent / Add note / Add App / Browser) only
|
||||
// mounts when a dashboard is active; a clean CI profile has none, so create one
|
||||
// via the sidebar "+". Idempotent: returns early if the toolbar is already up.
|
||||
const ensureDashboardActive = async () => {
|
||||
const toggle = page.locator('[data-onboarding="sidebar-toggle"]');
|
||||
if ((await toggle.getAttribute('aria-expanded')) === 'false') await toggle.click({ timeout: 5_000 }).catch(() => {});
|
||||
await clickMust(page.locator('[data-onboarding="sidebar-dashboards"]'), 'sidebar dashboards');
|
||||
if (await page.getByRole('button', { name: 'Add note' }).isVisible().catch(() => false)) return;
|
||||
const createBtn = page.locator('[data-onboarding="sidebar-dashboards"] button').first();
|
||||
if (await createBtn.count()) await createBtn.click({ timeout: 5_000 }).catch(() => {});
|
||||
await expect.poll(() => page.url(), { timeout: 8_000 }).toMatch(/\/dashboard\//);
|
||||
await expect(page.getByRole('button', { name: 'Add note' }), 'dashboard toolbar never mounted').toBeVisible({ timeout: 10_000 });
|
||||
};
|
||||
const errorsSince = (mark: number) => errors.slice(mark).filter((e) => !CONSOLE_WHITELIST.some((rx) => rx.test(e.text)));
|
||||
const assertNoNew = (mark: number, label: string) => {
|
||||
const now = rendererCrashes();
|
||||
@@ -290,6 +303,7 @@ test.describe('combinatorial user flows', () => {
|
||||
|
||||
test('dashboard toolbar: Add note + Add App + History each mount their surfaces', async () => {
|
||||
const mark = errors.length;
|
||||
await ensureDashboardActive();
|
||||
await clickMust(page.getByRole('button', { name: 'Add note' }), 'toolbar Add note');
|
||||
assertNoNew(mark, 'Add note mount');
|
||||
|
||||
|
||||
@@ -139,7 +139,20 @@ test.describe('deep interactive coverage', () => {
|
||||
});
|
||||
|
||||
test('Dashboard canvas opens', async ({}, info) => {
|
||||
await safeClick(page.getByText('Getting Started', { exact: true }), 'Getting Started dashboard');
|
||||
// A clean CI profile has no "Getting Started" (or any) dashboard, so open an
|
||||
// existing one if present, else create one via the sidebar "+" so the canvas
|
||||
// actually mounts instead of failing on a missing seed dashboard.
|
||||
const seed = page.getByText('Getting Started', { exact: true });
|
||||
if (await seed.count()) {
|
||||
await seed.first().click({ timeout: 5000 });
|
||||
} else {
|
||||
const toggle = page.locator('[data-onboarding="sidebar-toggle"]');
|
||||
if ((await toggle.getAttribute('aria-expanded')) === 'false') await toggle.click({ timeout: 5000 }).catch(() => {});
|
||||
await page.locator('[data-onboarding="sidebar-dashboards"]').click({ timeout: 5000 }).catch(() => {});
|
||||
const createBtn = page.locator('[data-onboarding="sidebar-dashboards"] button').first();
|
||||
if (await createBtn.count()) await createBtn.click({ timeout: 5000 }).catch(() => {});
|
||||
await expect.poll(() => page.url(), { timeout: 8000 }).toMatch(/\/dashboard\//);
|
||||
}
|
||||
await page.waitForTimeout(2000);
|
||||
await page.screenshot({ path: info.outputPath('dashboard-canvas.png') });
|
||||
noNewCrashes('dashboard canvas open');
|
||||
|
||||
Reference in New Issue
Block a user