Files
dify/e2e/features/step-definitions/common/app.steps.ts
yyh 1ae2f95f7c test(e2e): add agent v2 core coverage (#38209)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-02 06:18:38 +00:00

27 lines
1.1 KiB
TypeScript

import type { DifyWorld } from '../../support/world'
import { Given, When } from '@cucumber/cucumber'
import { expect } from '@playwright/test'
import { createTestApp, syncMinimalWorkflowDraft } from '../../../support/api'
import { waitForAppsConsole } from '../../../support/apps'
import { createE2EResourceName } from '../../../support/naming'
Given('a {string} app has been created via API', async function (this: DifyWorld, mode: string) {
const app = await createTestApp(createE2EResourceName('App', mode), mode)
this.createdAppIds.push(app.id)
this.lastCreatedAppName = app.name
})
Given('a minimal workflow draft has been synced', async function (this: DifyWorld) {
const appId = this.createdAppIds.at(-1)!
await syncMinimalWorkflowDraft(appId)
})
When('I open the app from the app list', async function (this: DifyWorld) {
const page = this.getPage()
await page.goto('/apps')
await waitForAppsConsole(page)
const appLink = page.getByRole('link', { name: this.lastCreatedAppName!, exact: true })
await expect(appLink).toBeVisible()
await appLink.click()
})