dify/e2e/features/step-definitions/auth/sign-out.steps.ts
Stephen Zhou 40e040ca1a
chore: workspace lint (#35331)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-04-16 16:47:53 +00:00

26 lines
805 B
TypeScript

import type { DifyWorld } from '../../support/world'
import { Then, When } from '@cucumber/cucumber'
import { expect } from '@playwright/test'
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,
})
})