From 3658246177c5f026779da849c3e7207b22d29587 Mon Sep 17 00:00:00 2001 From: "MSI\\niranjankagri" Date: Fri, 30 Oct 2026 11:14:02 +0530 Subject: [PATCH] Add manual test cases and put case IDs in scenario names and tags docs/manual-test-cases.md: every scenario written out for a manual run (setup, steps, expected results; Scenario Outlines as one case with data sets). Scenarios carry their ID in the name ([TC-101] ...) and as a tag (@TC-101). README links the document. Co-Authored-By: Claude Opus 5.5 --- README.md | 4 ++ docs/manual-test-cases.md | 86 +++++++++++++++++++++++ src/test/resources/features/admin.feature | 10 +-- src/test/resources/features/login.feature | 14 ++-- 4 files changed, 104 insertions(+), 10 deletions(-) create mode 100644 docs/manual-test-cases.md diff --git a/README.md b/README.md index 0ae36ff..cc11421 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,10 @@ cucumber-java-framework └── admin.feature ``` +## Test cases + +Every scenario carries its test case ID in its name and as a tag (`[TC-101] Successful login with valid credentials`, `@TC-101`). The seven cases (login TC-101 to TC-104, admin TC-105 to TC-107) are written out for a manual run in [docs/manual-test-cases.md](docs/manual-test-cases.md); run one with `mvn test -Dcucumber.filter.tags="@TC-106"`. + ## How it works The framework has three layers: diff --git a/docs/manual-test-cases.md b/docs/manual-test-cases.md new file mode 100644 index 0000000..af8d7a1 --- /dev/null +++ b/docs/manual-test-cases.md @@ -0,0 +1,86 @@ +# Manual test cases + +The scenarios this framework automates, written as a tester would run them by hand. Every case has an +ID; the Cucumber scenario that covers it carries the same ID in its name (`[TC-101] Successful login +with valid credentials`) and as a tag (`@TC-101`), so a failure in the report leads straight to the +case below, and one case can be run on its own: + +``` +mvn test -Dcucumber.filter.tags="@TC-106" +``` + +## Setup + +- Application: OrangeHRM demo (public, shared with other + testers). +- Admin login: `Admin` / `admin123` (`src/test/resources/config.properties`). + +## Summary + +| ID | Title | Type | Priority | Feature file | +|---|---|---|---|---| +| TC-101 | Successful login with valid credentials | Smoke | High | `login.feature` | +| TC-102 | Login is rejected (wrong password, unknown user) | Negative | High | `login.feature` (Scenario Outline) | +| TC-103 | Login is not submitted without a password | Negative | Medium | `login.feature` | +| TC-104 | Successful logout | Smoke | High | `login.feature` | +| TC-105 | Open the System Users page from the menu | Smoke | High | `admin.feature` | +| TC-106 | Search users by username and status | Regression | High | `admin.feature` | +| TC-107 | Reset clears the search filters | Regression | Medium | `admin.feature` | + +--- + +## Login (`features/login.feature`) + +Precondition for all: the login page is open. + +### TC-101 Successful login with valid credentials + +| # | Step | Expected result | +|---|---|---| +| 1 | Enter `Admin` / `admin123`, click **Login** | The Dashboard is displayed | + +### TC-102 Login is rejected + +For every data set: enter the username and password, click **Login**. Expected: the message +"Invalid credentials"; still on the login page. + +| Data set | Username | Password | +|---|---|---| +| the password is wrong | `Admin` | `wrong123` | +| the user is unknown | `nobody42` | `admin123` | + +### TC-103 Login is not submitted without a password + +| # | Step | Expected result | +|---|---|---| +| 1 | Enter username `Admin`, leave the password empty, click **Login** | The **Password** field shows "Required"; no login request | + +### TC-104 Successful logout + +| # | Step | Expected result | +|---|---|---| +| 1 | Log in as in TC-101 | Dashboard | +| 2 | Open the user menu (top right), click **Logout** | The login page is displayed | + +## Admin user management (`features/admin.feature`) + +Precondition for all: logged in as `Admin`. + +### TC-105 Open the System Users page from the menu + +| # | Step | Expected result | +|---|---|---| +| 1 | Click **Admin** in the side menu | System Users page: page title "Admin", the user search form and the user list | + +### TC-106 Search users by username and status + +| # | Step | Expected result | +|---|---|---| +| 1 | On System Users enter username `Admin`, choose status **Enabled**, click **Search** | Only users named "Admin" with status "Enabled" are listed | + +### TC-107 Reset clears the search filters + +| # | Step | Expected result | +|---|---|---| +| 1 | Enter username `Admin`, choose status **Enabled** | Filters filled | +| 2 | Click **Reset** | The username field is empty and status shows "-- Select --" | diff --git a/src/test/resources/features/admin.feature b/src/test/resources/features/admin.feature index 0c1f736..3e67c7a 100644 --- a/src/test/resources/features/admin.feature +++ b/src/test/resources/features/admin.feature @@ -10,19 +10,21 @@ Feature: Admin user management Background: Given the admin is logged in - @smoke - Scenario: Open the System Users page from the menu + @smoke @TC-105 + Scenario: [TC-105] Open the System Users page from the menu When the admin opens the "Admin" menu Then the System Users page is displayed - Scenario: Search users by username and status + @TC-106 + Scenario: [TC-106] Search users by username and status Given the admin is on the System Users page When the admin filters by username "Admin" And the admin filters by status "Enabled" And the admin runs the search Then only users named "Admin" with status "Enabled" are listed - Scenario: Reset clears the search filters + @TC-107 + Scenario: [TC-107] Reset clears the search filters Given the admin is on the System Users page When the admin filters by username "Admin" And the admin filters by status "Enabled" diff --git a/src/test/resources/features/login.feature b/src/test/resources/features/login.feature index 9e9f019..0f69921 100644 --- a/src/test/resources/features/login.feature +++ b/src/test/resources/features/login.feature @@ -11,13 +11,14 @@ Feature: Login Background: Given the user is on the login page - @smoke - Scenario: Successful login with valid credentials + @smoke @TC-101 + Scenario: [TC-101] Successful login with valid credentials When the user logs in with valid credentials Then the dashboard is displayed # One scenario per Examples row; is replaced in the scenario name - Scenario Outline: Login is rejected when + @TC-102 + Scenario Outline: [TC-102] Login is rejected when When the user logs in with username "" and password "" Then the error message "Invalid credentials" is shown @@ -26,12 +27,13 @@ Feature: Login | the password is wrong | Admin | wrong123 | | the user is unknown | nobody42 | admin123 | - Scenario: Login is not submitted without a password + @TC-103 + Scenario: [TC-103] Login is not submitted without a password When the user logs in with username "Admin" and no password Then the "Password" field shows "Required" - @smoke - Scenario: Successful logout + @smoke @TC-104 + Scenario: [TC-104] Successful logout Given the user has logged in with valid credentials When the user logs out Then the login page is displayed