diff --git a/e2e/features/apps/create-app.feature b/e2e/features/apps/create-app.feature index c0ca8ea4e0..d980bb9eb9 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 4f506e4f40..45f66aaa52 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 b88d94d899..2c11cf7a7a 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 0000000000..a9a1e13626 --- /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 9112f1220a..4446beaf76 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 0000000000..8f9e8e765c --- /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 }) +})