Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/zahid-automate/orangecrmlive
- Owner: Zahid-Automate
- Created: 2024-01-27T04:06:47.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-04-05T16:34:00.000Z (9 months ago)
- Last Synced: 2024-11-07T19:31:44.064Z (2 months ago)
- Language: JavaScript
- Homepage: https://opensource-demo.orangehrmlive.com
- Size: 124 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 reportFramework 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
**Step 2:** Install the required dependencies from terminal using below command\
npm ci\
**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
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
2. Click on ***E22 Testing***
3. Select the browser of your choice and click on ***Start E2E Testing in Chrome***
4. From the Specs menu , click on any of the test cases present to be run
+++
Test case results
**login test**
**Add and verify user**
**Add and verify candidate**
**View and verify report****Run all the scripts together**