This repository contains an automated end-to-end (e2e) testing project using Cypress for the test automation practice website: https://testautomationpractice.blogspot.com/.
This project demonstrates various automated e2e testing scenarios for the specified web application, including form filling, search functionality, dynamic button interactions, alerts and popups handling, drag and drop operations, and more. All tests are designed to run against the live website, simulating real user interactions in a browser environment.
- Cypress: Main testing framework (v13.15.0)
- Node.js: JavaScript runtime
- ESLint: Linting tool for identifying and reporting on patterns in JavaScript
- Prettier: Code formatter
- Husky: Git hooks to improve the commit process
- lint-staged: Run linters on git staged files
- Mochawesome: Test reporter for generating HTML/JSON test reports
- @4tw/cypress-drag-drop: For drag and drop operations
- cypress-real-events: For real mouse events simulation
cypress/e2e
: Contains test filescypress/support/pages
: Page Object Modelscypress/support/commands.js
: Custom Cypress commandscypress.config.js
: Cypress configuration filecypress/results
: Contains generated test reports
- Form filling and submission
- Search functionality testing
- Dynamic button state changes
- Alerts and popups handling
- Drag and drop operations
- Slider manipulation
npm test
: Run Cypress tests in headed modenpm run cypress
: Open Cypress Test Runnernpm run test:headless
: Run Cypress tests in headless modenpm run test:chrome
: Run tests in Chrome browsernpm run test:edge
: Run tests in Edge browsernpm run test:electron
: Run tests in Electron browsernpm run lint
: Run ESLintnpm run format
: Run Prettier to format code
- Clone this repository
- Install dependencies:
npm install
- Run tests using one of the scripts mentioned above
This project uses Mochawesome for generating test reports. After running the tests, you can find the HTML report in the cypress/results
directory. To view the report:
- Navigate to the
cypress/results
directory - Open the
report.html
file in a web browser
The report provides a detailed overview of test results, including passed and failed tests, test duration, and any error messages.
This project uses ESLint for linting and Prettier for code formatting. The configuration can be found in eslint.config.mjs
.
This project uses Husky for Git hooks:
- Pre-commit hook runs linting and formatting on staged files
- ESLint configuration:
eslint.config.mjs
- Cypress configuration:
cypress.config.js
Please ensure that all tests pass and the code adheres to the existing style before submitting a pull request.