Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

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

Jingyib59ecea34601
diff --git a/e2e/features/apps/create-app.feature b/e2e/features/apps/create-app.feature
index c0ca8ea4e00..d980bb9eb91 100644
--- a/e2e/features/apps/create-app.feature
+++ b/e2e/features/apps/create-app.feature
@@ -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
diff --git a/e2e/features/apps/create-chatbot-app.feature b/e2e/features/apps/create-chatbot-app.feature
index 4f506e4f409..45f66aaa529 100644
--- a/e2e/features/apps/create-chatbot-app.feature
+++ b/e2e/features/apps/create-chatbot-app.feature
@@ -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
diff --git a/e2e/features/apps/create-workflow-app.feature b/e2e/features/apps/create-workflow-app.feature
index b88d94d899c..2c11cf7a7aa 100644
--- a/e2e/features/apps/create-workflow-app.feature
+++ b/e2e/features/apps/create-workflow-app.feature
@@ -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
diff --git a/e2e/features/auth/sign-in.feature b/e2e/features/auth/sign-in.feature
new file mode 100644
index 00000000000..a9a1e13626d
--- /dev/null
+++ b/e2e/features/auth/sign-in.feature
@@ -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
diff --git a/e2e/features/auth/sign-out.feature b/e2e/features/auth/sign-out.feature
index 9112f1220a4..4446beaf766 100644
--- a/e2e/features/auth/sign-out.feature
+++ b/e2e/features/auth/sign-out.feature
@@ -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
diff --git a/e2e/features/step-definitions/auth/sign-in.steps.ts b/e2e/features/step-definitions/auth/sign-in.steps.ts
new file mode 100644
index 00000000000..8f9e8e765cc
--- /dev/null
+++ b/e2e/features/step-definitions/auth/sign-in.steps.ts
@@ -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 })
+})