From 14c24c82456cd8792cfb5d9f45d6c27b35dac32e Mon Sep 17 00:00:00 2001 From: SaelixCode Date: Sun, 22 Mar 2026 01:20:54 -0400 Subject: [PATCH] fix(e2e): fix stacks timeout and nodes skip in CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit stacks.spec.ts: - waitForStacksLoaded: wait for 'Create Stack' button instead of [cmdk-item] > 0 CI starts with empty COMPOSE_DIR so there are no stacks; the button is always rendered in the sidebar regardless of whether any stacks exist nodes.spec.ts: - beforeEach: click Settings then 'Nodes' nav item to reach NodeManager The Add Node button lives inside Settings → Nodes; the previous beforeEach only clicked Settings but never navigated to the Nodes section, so the add-node button was never found and tests silently skipped --- e2e/nodes.spec.ts | 7 ++++--- e2e/stacks.spec.ts | 10 +++------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/e2e/nodes.spec.ts b/e2e/nodes.spec.ts index 39104e38..d2ae2411 100644 --- a/e2e/nodes.spec.ts +++ b/e2e/nodes.spec.ts @@ -8,9 +8,10 @@ import { loginAs } from './helpers'; test.describe('Node management', () => { test.beforeEach(async ({ page }) => { await loginAs(page); - // Navigate to the nodes section (Settings / Node Manager) - const nodesBtn = page.getByRole('button', { name: /nodes|manage nodes|settings/i }).first(); - if (await nodesBtn.isVisible()) await nodesBtn.click(); + // Open Settings modal + await page.getByRole('button', { name: /settings/i }).click(); + // Navigate to the Nodes section inside the modal + await page.getByRole('button', { name: /^nodes$/i }).click(); }); test('adding a node with localhost api_url shows a validation error', async ({ page }) => { diff --git a/e2e/stacks.spec.ts b/e2e/stacks.spec.ts index b93a17d5..c9a55fc6 100644 --- a/e2e/stacks.spec.ts +++ b/e2e/stacks.spec.ts @@ -2,17 +2,13 @@ * Stack management E2E tests — happy path CRUD. */ import { test, expect } from '@playwright/test'; -import { loginAs, TEST_USERNAME, TEST_PASSWORD } from './helpers'; +import { loginAs } from './helpers'; const TEST_STACK = 'e2e-test-stack'; -/** Wait for stacks to load in the sidebar (uses /api/stacks via the browser context). */ +/** Wait for the stacks sidebar to be ready (Create Stack button is always rendered). */ async function waitForStacksLoaded(page: import('@playwright/test').Page) { - // Poll until the stacks API returns data AND the sidebar has at least one item - await page.waitForFunction(() => { - const items = document.querySelectorAll('[cmdk-item]'); - return items.length > 0; - }, { timeout: 15_000 }); + await expect(page.getByRole('button', { name: 'Create Stack' })).toBeVisible({ timeout: 15_000 }); } /** Delete the test stack via the browser's authenticated fetch (so cookies are included). */