cjp-automation
v1.0.52
Published
README Documentation: Setting Up and Running Automation Tests This guide provides a detailed process for setting up your project and running automation tests using cjp-automation.
Downloads
108
Keywords
Readme
CJP Automation Framework
README Documentation: Setting Up and Running Automation Tests This guide provides a detailed process for setting up your project and running automation tests using cjp-automation.
Description
This automation framework is built using Behavior-Driven Development (BDD) principles with Node.js, making it intuitive and collaborative for developers and testers. It supports testing across multiple platforms:
REST APIs: Automate API testing efficiently with comprehensive features. Mobile Applications: Conduct mobile app automation with seamless integration. Web Applications: Perform end-to-end testing of web applications.
Prerequisites
Before starting, ensure the following are installed on your computer:
Node.js: Download and install from Node.js official website. Visual Studio Code (VS Code): Download and install from VS Code official website.
Setup Instructions
Project Initialization Create a new folder for your project and give it a suitable name. Open VS Code and load the created project folder. Open the integrated terminal in VS Code (Ctrl + or from the top menu:Terminal > New Terminal`).
Initialize a Node.js Project In the terminal, run the following command:
npm init
Follow the prompts: Package name: Enter the project name (or press Enter to use the default). Version: Press Enter to accept the default (1.0.0). Description: Provide a brief project description (or press Enter to skip). Entry point: Press Enter to accept the default (index.js). Test command: Press Enter to skip. Git repository: Press Enter to skip. Keywords: Press Enter to skip. Author: Enter your name (or press Enter to skip). License: Press Enter to accept the default (ISC). When prompted, confirm by typing yes.
- Install Dependencies Run the following command in the terminal to install the cjp-automation package:
npm i cjp-automation
Project Configuration
Open the package.json file in your project directory. Locate the "scripts" section and replace it with the following:
"scripts": { "Test": "cucumber-js Features/Test.feature -f json:./Report/Report.json", "report": "node Report.js", "report_2": "node Report_Junit.js" }
Running Tests and Generating Reports
- Run the Test Script Execute the following command in the terminal:
npm run Test
- Generate Reports To create a test report, run:
npm run report
Notes
Replace Features/Test.feature with the path to your feature file if it differs. Ensure your test scripts and report generation scripts (Report.js and Report_Junit.js) are correctly implemented.