Files
gsfdc/demo-dify/dify/e2e/features/step-definitions/apps/workflow-run.steps.ts
T
wuzilongandCursor 6519682885 chore: 纳入本地 Dify 1.19.0 源码及品牌与免登改动
演示目录只保留可重建的源码。运行密钥、数据卷、依赖和带口令的本地配置不进入仓库。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-18 13:59:25 +08:00

28 lines
1.1 KiB
TypeScript

import type { DifyWorld } from '../../support/world.ts'
import { Given, Then, When } from '@cucumber/cucumber'
import { expect } from '@playwright/test'
import { syncRunnableWorkflowDraft } from '../../../support/api/workflows.ts'
Given('a minimal runnable workflow draft has been synced', async function (this: DifyWorld) {
const appId = this.createdAppIds.at(-1)
if (!appId)
throw new Error('No app ID found. Run "a \\"workflow\\" app has been created via API" first.')
await syncRunnableWorkflowDraft(this.getConsoleClient(), appId)
})
When('I run the workflow', async function (this: DifyWorld) {
const page = this.getPage()
const testRunButton = page.getByRole('button', { name: /Test Run/ })
await expect(testRunButton).toBeVisible({ timeout: 15_000 })
await testRunButton.click()
})
Then('the workflow run should succeed', async function (this: DifyWorld) {
const page = this.getPage()
await page.getByText('DETAIL', { exact: true }).click()
await expect(page.getByRole('status').getByText('Success', { exact: true })).toBeVisible({
timeout: 55_000,
})
})