Welcome to the Cypress Testing Playground! This project is designed to help students learn and practice automated testing using Cypress, a modern testing framework for web applications. The goal is to ensure that all parts of the website work as expected by writing and running automated tests.
This project includes:
- A frontend website built with HTML, CSS, and JavaScript.
- A backend server built with Node.js.
- Simulated real-world interactions such as login forms, dropdown selections, checkboxes, and more.
- Automated testing using Cypress to validate the behavior of each feature.
The following features are tested in this project:
- Users cannot log in with only a username or only a password.
- Usernames must start and end with
#to be valid.
- Users can select options from a dropdown menu.
- A message is displayed based on the selected option.
- Users can check and uncheck a checkbox.
- A message is displayed based on the checkbox state.
- Users can double-click an area to trigger an action.
- Users can right-click an area to trigger a context menu.
- Users can drag an item and drop it into a designated area.
- Users can scroll through a scrollable container.
Make sure you have Node.js installed. Then, install the required dependencies by running:
npm installRun the backend server to serve the frontend:
node server.jsTo open Cypress in interactive mode and run the tests:
npx cypress openproject-root/
├── frontend/ # Frontend code (HTML, CSS, JS)
│ ├── index.html # Main HTML file
│ ├── styles.css # CSS styles
│ └── scripts.js # JavaScript logic
├── backend/ # Backend code (Node.js)
│ ├── server.js # Backend server
│ └── package.json # Backend dependencies
└── cypress/ # Cypress test files
├── e2e/
│ └── tests.cy.js # Cypress test suite
└── fixtures/ # Test data (e.g., example.txt)