This repository contains a test automation project developed with Cypress, TypeScript and Page Objects Model (POM). The goal of this project is to validate the functionalities of an e-commerce, ensuring that the main user journeys work as expected.
This project was created to perform automated tests on an e-commerce, including:
- Authentication (Login and Registration)
- Product Search
- Shopping Cart
- Cypress - Framework for end-to-end testing.
- TypeScript - JavaScript superset for static typing.
Follow the steps below to install and configure the project:
- Installation of
devDependencies
:
Make sure Node.js is installed.
To install the devDependencies
, run:
npm install
- Running the Tests:
- To open the Cypress App, run:
npm run cy:open
- To run the tests in headless model run:
npm test
├── cypress
│ ├── e2e # Test files
│ └── support # Cypress support files
│ └── page_objects # Page Objects Models
├── cypress.config.ts # Cypress configuration
├── package.json # Project dependencies, npm scripts, etc.
├── tsconfig.json # TypeScript configuration
└── README.md # Project documentation
The below test cases are currently implemented.
cypress/e2e/auth.cy.ts (3 tests)
└─ Authentication
├─ successfully logs in
├─ shows an error message when trying to login with invalid credentials
└─ successfully registers a new user
cypress/e2e/search.cy.ts (2 tests)
└─ Search
├─ searches for an existing product
└─ searches for an non-existing product
cypress/e2e/shoppingCart.cy.ts (1 test)
└─ Shopping Cart
└─ successfully adds a product to the cart
- Create a new file in the
cypress/e2e
folder with the name of the functionality that will be tested (e.g.,productDetails.cy.ts
). - Use the best practices of Cypress and TypeScript to implement the test.
- Run the tests to validate that they're working as expected.
Feel free to contribute to this project! To do so:
- Fork the repository
- Create a new branch:
git checkout -b branch-name-here
-
Commit your changes and push them to your fork
-
Open a Pull Request explaining your changes
If you have any questions or suggestions, feel free to contact me.