Skip to content

Samuel1810/orangehrm-automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OrangeHRM Cypress Automation Tests

This repository showcases End-to-End automated tests built with Cypress to validate critical business flows of the OrangeHRM Demo application.


Why this project exists

This project exists to demonstrate my approach as a QA Engineer when validating a real-world HR management system. Instead of focusing on quantity, the goal is to showcase test design, documentation, and conscious automation decisions using Cypress and JavaScript.

What this project proves

  • Risk-based test design: scenarios focus on core business flows (authentication and employee management via PIM).

  • Documentation-first QA mindset: every automated test is backed by written test cases (traditional and Gherkin), available under /docs/test-cases/.

  • Automation as a tool, not a goal: only high-value, stable scenarios were automated to maximize ROI.

  • Maintainable E2E structure: clear test naming, reusable patterns, and fast local execution.

    Evidence: Automated specs, Gherkin scenarios, and traditional test cases are all linked and maintained together.

    πŸ“Œ Coverage Map: see docs/coverage/coverage-map.md

Out of scope (intentional)

To keep the project focused and realistic, the following were intentionally left out:

  • Full regression coverage of all OrangeHRM modules.
  • Cross-browser and mobile testing.
  • Performance, security, and accessibility testing.
  • Complex edge cases unrelated to the main business flows.
  • Exploratory testing sessions and usability assessments (typically executed manually).

These areas could be explored in a different type of test initiative, depending on project needs.


Implemented Scenarios

βœ… Positive

  • TC001 β€” Successful Login
    • Valid credentials (Admin / admin123) β†’ dashboard visible; PIM menu present.
  • TC003 β€” Successfully Add Employee
    • PIM β†’ Add Employee β†’ fill data β†’ Save β†’ appears in list.
  • TC004 β€” Search Employee
    • PIM β†’ Employee List β†’ search by name β†’ result listed.
  • TC005 β€” Edit Employee
    • Employee List β†’ edit β†’ update field(s) β†’ save β†’ change persists.
  • TC006 β€” Delete Employee
    • Employee List β†’ select employee β†’ delete β†’ confirm β†’ not listed.

❌ Negative

  • TC002 β€” Invalid Login
    • Wrong credentials β†’ error β€œInvalid credentials” β†’ stays on /auth/login.

Test Case Documentation

Besides automated specs in cypress/e2e/, we keep written test cases under docs/test-cases/:

  • docs/test-cases/gherkin/ β†’ BDD (Given/When/Then)
  • docs/test-cases/traditional/ β†’ step-by-step

Tip: link each doc to its spec, e.g.
πŸ”— Automated: [tc001_successful_login.cy.js](cypress/e2e/tc001_successful_login.cy.js)


Requirements

  • Node.js (LTS version recommended)
  • Cypress installed locally or globally

Project Structure

cypress/
e2e/
tc001_successful_login.cy.js
tc002_invalid_login.cy.js
tc003_add_employee.cy.js
tc004_search_employee.cy.js
tc005_edit_employee.cy.js
tc006_delete_employee.cy.js
fixtures/
pages/ # 
support/
docs/
test-cases/
gherkin/
traditional/
cypress.config.js
cypress.env.json
package.json

Test Data

  • Valid Username: Admin
  • Valid Password: admin123
  • Sample Employee:
    • First Name: Samuel
    • Last Name: Costa
    • Employee ID: auto-generated

How to Run

1. Clone the repository

git clone https://github.com/Samuel1810/orangehrm-automation.git
cd orangehrm-cypress-tests

2. Install dependencies

npm ci

npm ci is recommended to ensure a clean and reproducible install.

3. Create cypress.env.json for local creds

{ "username": "Admin", "password": "admin123" }

4. Open Cypress Test Runner (interactive)

npx cypress open

5. Run tests in headless mode

npx cypress run

6. Run a single spec in headless mode

npx cypress run --spec "cypress/e2e/tc001_successful_login.cy.js"

NPM Scripts

{
    "scripts": {
        "cy:open": "cypress open",
        "cy:run": "cypress run"
    }
}

Releases

No releases published

Packages

No packages published