This repository contains the code for an automated testing suite using Cypress for the application hosted in https://www.saucedemo.com/. This README will guide you through the project setup and how to use the provided NPM scripts.
Before you get started, make sure you have the following software installed on your machine:
-
Clone this repository to your local machine:
git clone https://github.com/cezarvaz/swag-labs-ui-tests.git cd swag-labs-ui-tests
-
Install project dependencies:
npm install
In this project, you can use the following NPM scripts to perform various tasks:
You can use ESLint to check and automatically fix coding style issues in your code.
npm run lint
Husky is a tool that enables Git hooks. You need to install it using the following command:
npm run prepare
This will set up Git hooks to run actions like linting and testing before committing or pushing code.
To interactively run your Cypress tests in the Cypress Test Runner, use the following command:
npm run open
This will open the Cypress Test Runner, where you can select and run individual test cases.
To run your Cypress tests headlessly in the Chrome browser, use the following command:
npm test
This script will execute your test suite in Chrome without any graphical interface and report the results in the terminal.