Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
10 changes: 10 additions & 0 deletions e2e/features/apps/publish-app.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@apps @authenticated @core
Feature: Publish app

Scenario: Publish a chatbot app for the first time
Given I am signed in as the default E2E admin
And a "chat" app has been created via API
When I open the app from the app list
And I open the publish panel
And I publish the app
Then the app should be marked as published
15 changes: 15 additions & 0 deletions e2e/features/step-definitions/apps/publish-app.steps.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { DifyWorld } from '../../support/world'
import { Then, When } from '@cucumber/cucumber'
import { expect } from '@playwright/test'

When('I open the publish panel', async function (this: DifyWorld) {
await this.getPage().getByRole('button', { name: 'Publish' }).first().click()
})

When('I publish the app', async function (this: DifyWorld) {
await this.getPage().getByRole('button', { name: /Publish Update/ }).click()
})

Then('the app should be marked as published', async function (this: DifyWorld) {
await expect(this.getPage().getByRole('button', { name: 'Published' })).toBeVisible({ timeout: 30_000 })
})
17 changes: 17 additions & 0 deletions e2e/features/step-definitions/common/app.steps.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { DifyWorld } from '../../support/world'
import { Given, When } from '@cucumber/cucumber'
import { expect } from '@playwright/test'
import { createTestApp } from '../../../support/api'

Given('a {string} app has been created via API', async function (this: DifyWorld, mode: string) {
const app = await createTestApp(`E2E ${Date.now()}`, mode)
this.createdAppIds.push(app.id)
this.lastCreatedAppName = app.name
})

When('I open the app from the app list', async function (this: DifyWorld) {
const page = this.getPage()
await page.goto('/apps')
await expect(page.getByRole('button', { name: 'Create from Blank' })).toBeVisible()
await page.getByText(this.lastCreatedAppName!).click()
})
Loading