Skip to content

Commit

Permalink
chore(userAccounts): scenarios for acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
benjohns1 committed Feb 29, 2024
1 parent 4462534 commit 233d004
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/cypress/.gherkin-lintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"Background": 0,
"Scenario": 0,
"Step": 2,
"Examples": 0,
"example": 2,
"Examples": 2,
"example": 4,
"given": 2,
"when": 2,
"then": 2,
Expand Down
44 changes: 44 additions & 0 deletions test/cypress/features/userAccounts.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Feature: User Accounts
The admin can manually create user accounts

Background:
Given I am logged in as the admin

@implementing
Scenario: Create a new user with a valid username and password
Given I am on the user list page

When I create a new user with the username "testuser" and password "password12345678"

Then I should see a user created success message
And I should see the user in the list

@pending
Scenario: Newly created user can log in
Given I have created a new user "testuser" with the password "password12345678"

When I log out and enter the username "testuser" and password "password123" in the login form

Then I should successfully log in

@pending
Scenario: Admin cannot create a user with a duplicate username
Given I am on the user list page
And a user with the name "testuser" already exists

When I create a new user with the username "testuser" and password "password12345678"

Then I should see a duplicate username failure message

@pending
Scenario Outline: Admin cannot create a user with an invalid password
Given I am on the user list page

When I create a new user with the username "testuser" and password <password>

Then I should see an invalid password failure message

Examples:
| password |
| "" |
| "password1234567" |
6 changes: 6 additions & 0 deletions test/cypress/steps/userAccounts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {Given} from "@badeball/cypress-cucumber-preprocessor";
import {login} from "./shared/login";

Given("I am logged in as the admin", () => {
login("{admin}", "{admin}");
});

0 comments on commit 233d004

Please sign in to comment.