From e2becd6746e19d8ed2f14de7c0b1c5ed330256a2 Mon Sep 17 00:00:00 2001 From: yyh <92089059+lyzno1@users.noreply.github.com> Date: Tue, 28 Apr 2026 14:29:48 +0800 Subject: [PATCH] test: cover shared workflow app run (#35634) --- .github/workflows/web-e2e.yml | 2 +- e2e/features/apps/share-app.feature | 7 +++++++ .../step-definitions/apps/share-app.steps.ts | 12 ++++++++++++ .../step-definitions/apps/workflow-run.steps.ts | 6 ++++-- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/web-e2e.yml b/.github/workflows/web-e2e.yml index a634830fef..bdc24887db 100644 --- a/.github/workflows/web-e2e.yml +++ b/.github/workflows/web-e2e.yml @@ -13,7 +13,7 @@ concurrency: jobs: test: name: Web Full-Stack E2E - runs-on: depot-ubuntu-24.04 + runs-on: depot-ubuntu-24.04-4 defaults: run: shell: bash diff --git a/e2e/features/apps/share-app.feature b/e2e/features/apps/share-app.feature index 22f89f7ebb..1c707306ef 100644 --- a/e2e/features/apps/share-app.feature +++ b/e2e/features/apps/share-app.feature @@ -17,3 +17,10 @@ Feature: Share app publicly Given a workflow app has been published and shared via API When I open the shared app URL Then the shared app page should be accessible + + @unauthenticated + Scenario: Run a shared workflow app without authentication + Given a workflow app has been published and shared via API + When I open the shared app URL + And I run the shared workflow app + Then the shared workflow run should succeed diff --git a/e2e/features/step-definitions/apps/share-app.steps.ts b/e2e/features/step-definitions/apps/share-app.steps.ts index 24da05baab..d5742bdaa8 100644 --- a/e2e/features/step-definitions/apps/share-app.steps.ts +++ b/e2e/features/step-definitions/apps/share-app.steps.ts @@ -37,3 +37,15 @@ Then('the shared app page should be accessible', async function (this: DifyWorld await expect(this.getPage()).toHaveURL(/\/(workflow|chat)\/[a-zA-Z0-9]+/, { timeout: 15_000 }) await expect(this.getPage().locator('body')).toBeVisible({ timeout: 10_000 }) }) + +When('I run the shared workflow app', async function (this: DifyWorld) { + const page = this.getPage() + const runButton = page.getByTestId('run-button') + + await expect(runButton).toBeEnabled({ timeout: 15_000 }) + await runButton.click() +}) + +Then('the shared workflow run should succeed', async function (this: DifyWorld) { + await expect(this.getPage().getByTestId('status-icon-success')).toBeVisible({ timeout: 55_000 }) +}) diff --git a/e2e/features/step-definitions/apps/workflow-run.steps.ts b/e2e/features/step-definitions/apps/workflow-run.steps.ts index 584a33e774..84c03bfa8f 100644 --- a/e2e/features/step-definitions/apps/workflow-run.steps.ts +++ b/e2e/features/step-definitions/apps/workflow-run.steps.ts @@ -12,8 +12,10 @@ Given('a minimal runnable workflow draft has been synced', async function (this: When('I run the workflow', async function (this: DifyWorld) { const page = this.getPage() - await page.getByText('Test Run').click() - await expect(page.getByText('Running').first()).toBeVisible({ timeout: 15_000 }) + const testRunButton = page.getByText('Test Run') + + await expect(testRunButton).toBeVisible({ timeout: 15_000 }) + await testRunButton.click() }) Then('the workflow run should succeed', async function (this: DifyWorld) {