Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zahid-automate/orangecrmlive

Cypress Automation Using Java Script
https://github.com/zahid-automate/orangecrmlive

Last synced: 11 days ago
JSON representation

Cypress Automation Using Java Script

Awesome Lists containing this project

README

        

Automate and verify the below basic functionalities of the OrangeHRM app using Cypress.
1. Login
2. User/Candidate Creation
3. Created User/Candidate details verification
4. View and Verify the project time report

Framework structure:

| **Folder/FileName** | **Purpose** |
|----------------------|----------------------------------------------------------------------------------|
| e2e\test | Includes all the test cases |
| fixtures\env\demo | Includes json files to parameterize the tests (addUser.json and users.json) |
| support | Contains re-usable Cypress.commands in command.js |
| screenshots | Contains screenshots when test case fails |
| mocha-awesome | Contains HTML reports generated |
| cypress.config.js | Configuration file used by Cypress to customize its behavior and settings |
| package.json | Contains scripts to run the test cases and github details |
| .gitignore | Contains files/folders that have to be ignored for every git commit |

Instructions on how to run the tests are below\
**Pre-requisite**:
Install the latest version of node.js from the link https://nodejs.org/en

 **Step 1**: Clone the repository using VS Code editor as shown in screen shots below\
git clone https://github.com/Zahid-Automate/OrangeCRMLive.git
image
image

 **Step 2:** Install the required dependencies from terminal using below command\
npm ci\
image

 **Step 3:** Use the below command from terminal to run login scenario\
npx cypress run --headed --reporter mochawesome --spec ./cypress/e2e/test/loginTest.cy.js

 **Step 4:** Use the below command from terminal to run User/Candidate Creation scenario\
npx cypress run --headed --reporter mochawesome --spec cypress/e2e/test/addAndVerifyUser.cy.js",

 **Step 5:** Use the below command from terminal to run User/Candidate details verification scenario\
npx cypress run --headed --reporter mochawesome --spec ./cypress/e2e/test/loginTest.cy.js

 **Step 6:** Use the below command from terminal to run View and Verify the project time report scenario\
npx cypress run --headed --reporter mochawesome --spec ./cypress/e2e/test/loginTest.cy.js

**To run all the scenarios use the below command in terminal**\
npx cypress run --headed --reporter mochawesome
image

Reports will be visible in mocha-awesome folder present at the root of the project

In case of failure : Screen shots will be visible in cypress/screenshots folder

**Test Data Management :** Test data is managed using json present in cypress/fixtures folder based on the environment demo/dev\
addUser.json - This is used to add a user of admin or ess type with status enabled or disabled\
user.json - This is used to get the credentials for various users based on the environment (demo/dev) for login and logout with the application

**Custom commands** (Present in cypress/support/command.js)

cy.loginAs: This command is used to login with the application\
cy.openMenuItem: This command is used to open any menu item present on the left-hand side after login with the application\
cy.AddUser: This command is used to add a new users \
cy.verifyUserAndDelete: This command is used to verify that the user was added successfully and then delete the added user

================================\
How to run Cypress in open mode\
================================\
Use the below command from terminal to run Cypress in open mode and follow the below steps
1. npx cypress open\
=> Wait for Cypress window to get opened
image

2. Click on ***E22 Testing***
3. Select the browser of your choice and click on ***Start E2E Testing in Chrome***
image

4. From the Specs menu , click on any of the test cases present to be run
image
+++
Test case results
**login test**
image
**Add and verify user**
image
**Add and verify candidate**
image
**View and verify report**
image

**Run all the scripts together**
image