Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions frontend/tests/e2e/add-node-button-alignment.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,25 @@ test('the "+" add-next button aligns consistently across node types', async ({ p
await page.getByRole('button', { name: 'Add trigger' }).click()
await page.getByRole('button', { name: 'Manual Trigger', exact: true }).click()
await expect(page.locator('.workflows-node-trigger')).toBeVisible()
// Adding the node opens its Node Details panel automatically; close it before
// continuing, otherwise its overlay covers the canvas and intercepts clicks below.
await page.getByRole('button', { name: 'Close' }).click()

await page.locator('.workflows-node-trigger .workflows-node-add-button').click()
await page.getByRole('button', { name: 'LLM Prompt', exact: true }).click()
await expect(page.locator('.workflows-node-llm')).toBeVisible()
await page.getByRole('button', { name: 'Close' }).click()

await page.locator('.workflows-node-llm .workflows-node-add-button').click()
await page.getByRole('button', { name: 'Add Tag', exact: true }).click()
await expect(page.locator('.workflows-node-action')).toBeVisible()
await page.getByRole('button', { name: 'Close' }).click()

// Adding a node schedules a re-fitted viewport via a 50ms-delayed `fitView` call (see
// `fitViewSoon` in WorkflowBuilder.vue — it needs Vue Flow to measure the new node's DOM
// first). Wait it out before measuring, otherwise these bounding-box reads can race that
// delayed pan/zoom and pick up transient coordinates.
await page.waitForTimeout(150)

const centerOffsets: number[] = []

Expand Down
7 changes: 7 additions & 0 deletions frontend/tests/e2e/automation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ test('background execution connects automatically and can be disconnected', asyn
await page.getByRole('button', { name: 'Add trigger' }).click()
await page.getByRole('button', { name: 'Manual Trigger', exact: true }).click()
await expect(page.locator('.workflows-node-trigger')).toBeVisible()
// Adding the node opens its Node Details panel automatically; close it before
// continuing, otherwise its overlay covers the canvas and intercepts clicks below.
await page.getByRole('button', { name: 'Close' }).click()

const workflowName = `e2e automation workflow ${Date.now()}`
await page.getByRole('button', { name: 'Untitled workflow' }).click()
Expand All @@ -64,6 +67,10 @@ test('background execution connects automatically and can be disconnected', asyn
await page.goto('/workflows/workflows')
await expect(page.getByText('Background execution active')).toBeVisible()
await expect(page.getByRole('button', { name: 'Connect automation' })).toHaveCount(0)
// The workflow list loads asynchronously after mount — wait for it to settle before
// opening the automation panel below, otherwise its automatedWorkflowCount prop (derived
// from that list) can still read 0 and silently skip the confirm-warning step.
await expect(page.getByText('Loading workflows...')).toBeHidden()

// Disconnecting while the workflow is still active shows the warning.
await page.getByRole('button', { name: 'manage' }).click()
Expand Down
3 changes: 2 additions & 1 deletion frontend/tests/unit/WorkflowBuilder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { createGettext } from 'vue3-gettext'
// auth store (no token needed since we never hit the network in this test).
vi.mock('@ownclouders/web-pkg', () => ({
useRoute: () => ref({ params: { id: 'new' } }),
useAuthStore: () => ({ accessToken: 'test-token' })
useAuthStore: () => ({ accessToken: 'test-token' }),
useMessages: () => ({ showMessage: vi.fn() })
}))

// The canvas itself (pan/zoom/measuring DOM nodes) is irrelevant to this behavior and
Expand Down
Loading