This project is a test automation suite built using Cypress. It includes a login test for the tutorial ninja web application. The following are the tested scenerios:
- Valid login
- Invalid login
- Login without filling textboxes.
- Installation
- Setup
- Running Tests
- Folder Structure
- Writing Tests
- Custom Commands
- Configuration
- Contributing
- License
To get started with this project, you'll need to have Node.js installed. Then follow these steps:
-
Clone the repository:
git clone https://github.com/audukehinde/saucedemo.git cd saucedemo -
Install the dependencies:
npm install
Cypress is configured via the cypress.config.js file. You can modify the base URL and other settings there to match your application's configuration.
Fixtures are stored in the cypress/fixtures directory. These files contain data that you can use in your tests. For this project, there two(2) json files in the fixtures folder and they are the following:
- Credentials(Json) file - This is used to store the login credentials for the test.
- Selector(Json) file - This is used to store the UI elemenmt to code maintainability and reusability.
Custom Cypress commands are located in cypress/support/commands.js. You can add your own custom commands here. Custom commands are added here to help maintain and reuse our codes efficiently and to enforce best practices. The below are the custom commands written for this project:
- userValidLogin
- userInvalidLogin
- userEmptyLogin
- logout
- ClickElement
- Inputelement
- verifyUrl
To open the Cypress Test Runner, run:
npm cypress open