test(auth): add sign-in smoke test and core validation (#35501)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jingyi
2026-04-22 21:54:45 -07:00
committed by GitHub
parent 61c0948136
commit b59ecea346
6 changed files with 32 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
@apps @authenticated
@apps @authenticated @core
Feature: Create app
Scenario: Create a new blank app and redirect to the editor
Given I am signed in as the default E2E admin

View File

@@ -1,4 +1,4 @@
@apps @authenticated
@apps @authenticated @core @mode-matrix
Feature: Create Chatbot app
Scenario: Create a new Chatbot app and redirect to the configuration page
Given I am signed in as the default E2E admin

View File

@@ -1,4 +1,4 @@
@apps @authenticated
@apps @authenticated @core @mode-matrix
Feature: Create Workflow app
Scenario: Create a new Workflow app and redirect to the workflow editor
Given I am signed in as the default E2E admin

View File

@@ -0,0 +1,8 @@
@auth @smoke @core @unauthenticated
Feature: Sign in
Scenario: Sign in with valid credentials and reach the apps console
Given I am not signed in
When I open the sign-in page
And I sign in as the default E2E admin
Then I should be on the apps console

View File

@@ -1,4 +1,4 @@
@auth @authenticated
@auth @authenticated @core
Feature: Sign out
Scenario: Sign out from the apps console
Given I am signed in as the default E2E admin

View File

@@ -0,0 +1,20 @@
import type { DifyWorld } from '../../support/world'
import { Then, When } from '@cucumber/cucumber'
import { expect } from '@playwright/test'
import { adminCredentials } from '../../../fixtures/auth'
When('I open the sign-in page', async function (this: DifyWorld) {
await this.getPage().goto('/signin')
})
When('I sign in as the default E2E admin', async function (this: DifyWorld) {
const page = this.getPage()
await page.getByLabel('Email address').fill(adminCredentials.email)
await page.getByLabel('Password').fill(adminCredentials.password)
await page.getByRole('button', { name: 'Sign in' }).click()
})
Then('I should be on the apps console', async function (this: DifyWorld) {
await expect(this.getPage()).toHaveURL(/\/apps(?:\?.*)?$/, { timeout: 30_000 })
})