Skip to content

About

Cypress (JavaScript) E2E test automation for OWASP Juice Shop: retry-ability instead of fixed waits, failure screenshots and videos in headless runs, environment-driven baseUrl, and a cypress/included Docker runner integrated in a Jenkins CI/CD pipeline.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

⚡ Cypress E2E Test Automation Framework: JavaScript, Node.js & Docker

Cypress JavaScript Node.js Docker Jenkins License: MIT

End-to-End Web Testing with Cypress and JavaScript

This repository is an automated end-to-end (E2E) testing suite built with Cypress (JavaScript). It runs user journeys against the OWASP Juice Shop application, relying on Cypress's built-in retry-ability instead of fixed waits to reduce flakiness, and produces screenshots and videos for debugging.

It is the Cypress layer of a larger CI/CD ecosystem: docker-test-env runs it with Juice Shop inside a Jenkins pipeline, alongside the Playwright, Selenium and API suites.


🗺️ Quick Navigation


💡 Engineering Highlights

  • Retry-ability over Fixed Waits: Avoids fragile fixed waits (cy.wait) by relying on Cypress's native retrying assertions, which keeps runs stable under fluctuating network conditions.
  • Failure Artifacts: Headless runs capture screenshots on failure and can record videos, so each build leaves evidence for debugging and audit.
  • Environment-Driven Configuration: The base URL is a parameter (CYPRESS_baseUrl), so the same suite runs locally or inside containers.

🧭 Architecture

flowchart LR
    S["Spec Files<br/>cypress/e2e"] --> R["Cypress Test Runner<br/>cypress.config.js"]
    SUP["Support File<br/>cypress/support/e2e.js"] --> R
    R -->|"Headless browser"| JS["OWASP Juice Shop"]
    R -->|"Automatic retries"| A["Retrying Assertions"]
    R -.->|"on failure"| ART["Screenshots and Videos"]
Loading

🧭 Where It Fits: CI/CD Pipeline

flowchart LR
    JK["Jenkins Pipeline"] --> D["Docker Compose<br/>docker-test-env"]
    D --> JS["OWASP Juice Shop"]
    D --> CY["cypress/included Container<br/>this repository"]
    CY -->|"Headless browser"| JS
    CY --> R["Test Results<br/>Screenshots and Videos"]
    R --> JK
Loading

🛠️ Tech Stack and Dependencies

  • Core Framework: Cypress 13.15+
  • Language: JavaScript / Node.js
  • Infrastructure: Docker, ready for headless runs in Jenkins CI/CD (via docker-test-env)

📁 Project Structure

e2e-cypress-js/
├── cypress.config.js
├── package.json
└── cypress/
    ├── e2e/
    │   └── juice-shop-login.cy.js
    └── support/
        └── e2e.js

🔍 Covered Scenarios

Products

  • Home page: loads successfully and lists the product components.

Login & Authentication

  • Navigation: the login page renders when opened from the account menu.
  • Invalid login: an error message is displayed when invalid credentials are submitted.

🚀 Running Locally

Prerequisites: Node.js and a running instance of Juice Shop reachable at the URL set in CYPRESS_baseUrl.

Windows (PowerShell):

npm install
$env:CYPRESS_baseUrl = "http://localhost:3001"
npx cypress run

Linux / macOS:

npm install
CYPRESS_baseUrl=http://localhost:3001 npx cypress run

🐳 Running via Docker (CI/CD Orchestration)

This repository is consumed by the docker-test-env orchestration project. The pipeline starts Juice Shop and runs this suite inside the official cypress/included container image, triggered and tracked by a unified Jenkins pipeline. See that project's docker-compose.yml for the full setup.


🔗 Related Projects


📈 Roadmap & Next Steps

  • Expand E2E coverage to multi-step cart, basket and checkout flows
  • Combine UI tests with API-level setup and checks (see api-testing)
  • Integrate with AI-generated test scenarios (LangGraph agentic workflows)

⚖️ License

This repository is licensed under the MIT License. Feel free to clone, study, modify, and distribute the code for educational or portfolio purposes.


👤 Author

Alexsander Corvello da Silveira, Senior QA Engineer focused on AI-driven testing and applied machine learning. GitHub: @acorvello

About

Cypress (JavaScript) E2E test automation for OWASP Juice Shop: retry-ability instead of fixed waits, failure screenshots and videos in headless runs, environment-driven baseUrl, and a cypress/included Docker runner integrated in a Jenkins CI/CD pipeline.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages