Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

1.1 KB
Raw Blame
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,
  })
})