dify/e2e/features/step-definitions/auth/sign-out.steps.ts
lif 4c6b8f9229
test: add e2e scenarios for app creation and sign-out (#34285)
Signed-off-by: majiayu000 <1835304752@qq.com>
2026-04-09 03:31:13 +00:00

26 lines
805 B
TypeScript

import { Then, When } from '@cucumber/cucumber'
import { expect } from '@playwright/test'
import type { DifyWorld } from '../../support/world'
When('I open the account menu', async function (this: DifyWorld) {
const page = this.getPage()
const trigger = page.getByRole('button', { name: 'Account' })
await expect(trigger).toBeVisible()
await trigger.click()
})
When('I sign out', async function (this: DifyWorld) {
const page = this.getPage()
await expect(page.getByText('Log out')).toBeVisible()
await page.getByText('Log out').click()
})
Then('I should be on the sign-in page', async function (this: DifyWorld) {
await expect(this.getPage()).toHaveURL(/\/signin/)
await expect(this.getPage().getByRole('button', { name: /^Sign in$/i })).toBeVisible({
timeout: 30_000,
})
})