This project contains a comprehensive suite of automated tests for the website https://automationexercise.com. These tests are developed using Cypress, a next-generation front-end testing tool built for the modern web. The aim is to ensure the quality and functionality of the automationexercise website through robust and reliable automated testing.
- Robust End-to-End Testing: Ensure application stability with comprehensive automated test scenarios covering all critical user flows.
- Extensive Test Coverage: Validate diverse application aspects, including UI interactions, form submissions, API integrations, and data integrity.
- Quick Start & Easy Configuration: Effortlessly set up the testing environment with straightforward instructions and a clear project structure.
- Highly Customizable Tests: Adapt and extend test scripts to meet specific application needs using Cypress's powerful and flexible API.
- Seamless CI/CD Integration: Automate your testing pipeline by integrating with popular Continuous Integration and Continuous Delivery platforms.
To run this project, you will need the following installed on your system:
- Node.js: A recent LTS version is recommended (e.g., 18.x or 20.x). You can download it from https://nodejs.org/.
- npm: Node Package Manager, which typically comes bundled with Node.js.
clone the repository and run the following command to install the dependencies
npm install
To run the tests headlessly in your local environment:
npm run cy:run
To open the Cypress Test Runner UI and run tests interactively:
npm run cy:open
To run tests and record the results on Cypress Cloud using the pre-configured script (if available and correctly set up with a record key):
npm run cy:cloud
Alternatively, to run tests on Cypress Cloud with a specific record key, use the following command. Replace YOUR_RECORD_KEY
with your actual Cypress Cloud record key:
npx cypress run --record --key YOUR_RECORD_KEY
Note: The cy:cloud
script in package.json
may contain a hardcoded record key. It's recommended to use the command above with your own key for security and clarity.
This project includes the following automated test cases:
- Register user.
- Login user with correct email and password.
- Login user with incorrect email and password.
- Logout user.
- Register user with existing email.
- Contact us form.
- Verify test cases page.
- Verify all products and product detail page.
- Search product.
- Verify subscription in home page.
- Verify subscription in cart page.
- Add products in cart.
- Verify product quantity in cart.
- Place order: Register while checkout.
- Place order: Register before checkout.
- Place order: Login before checkout.
- Remove products from cart.
- View category products.
- View & cart brand products.
- Search products and verify cart after login.
- Add review on product.
- Add to cart from recommended items.
- Verify address details in checkout page.
- Download invoice after purchase order.
- Verify scroll up using 'Arrow' button and scroll down functionality.
- Verify scroll up without 'Arrow' button and scroll down functionality.
This project follows a standard Cypress project structure. Key directories include:
cypress/
: The main directory for all test-related files.cypress/e2e/
: Contains all end-to-end test script files (e.g.,.cy.js
).cypress/fixtures/
: Stores static test data, like JSON files, that can be used by your tests.cypress/support/
: Holds reusable custom commands (commands.js
) and global configurations (e2e.js
).cypress/screenshots/
: Automatically stores screenshots taken during test execution, typically on failure or when manually triggered.cypress/downloads/
: Stores files downloaded as part of test scenarios.
mochawesome-report/
: Contains the detailed HTML test execution reports generated by the Mochawesome reporter.reports/
: Contains project-related images and documents (e.g., demo images, PDFs)..nyc_output/
: Stores code coverage reports generated when tests are run with coverage tracking..github/
: Contains GitHub Actions workflow configurations (e.g., for CI/CD) and issue templates.
The test cases are also available in the cypress dashboard. The link is here
We welcome contributions to the cypress-fully-automation-site
project! Whether you're fixing a bug, adding a new test case, or improving documentation, your help is appreciated.
Before contributing, please take a moment to review our Code of Conduct.
If you encounter a bug or have an idea for a new feature or enhancement, please check the GitHub Issues page to see if it has already been reported. If not, please open a new issue. We have templates to help you:
- Use the Bug report template for reporting issues.
- Use the Feature request template (or
custom.md
) for suggesting new features or enhancements.
- Fork the repository to your own GitHub account.
- Create a new branch from
main
for your changes (e.g.,git checkout -b feature/your-feature-name
orbugfix/issue-description
). - Make your changes and commit them with clear and descriptive messages.
- Ensure your changes do not break existing functionality. If you're adding new features, please include or update tests as appropriate.
- Push your changes to your forked repository.
- Open a Pull Request (PR) against the
main
branch of this repository. - Clearly describe the purpose and changes of your PR. Link to any relevant issues.
We'll review your PR as soon as possible. Thank you for your contribution!
This project is licensed under the Apache License 2.0.
- Cypress Documentation: Explore Cypress's official documentation for in-depth guides and examples.
- Cypress Best Practices: Learn best practices for writing efficient and maintainable Cypress tests.
- GitHub Repository: Fork and star the repository to stay updated with the latest developments.