Skip to content

SoftwareAutomation/automation_framework_ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ServiceAutomation.IO

Mobile, Web, API, Backend, Test Automation Framework, Written in TypeScript

TODO: add passing test results

Requirements

NodeJs Java Docker VSCode Appium-Inspector AndroidStudio

Clone Repository

1. https://github.com/SoftwareAutomation/automation_framework_ts
2. Navigate to `automation_framework_ts`

Interactive CLI to run test:

Before proceeding with the actual test, ensure that the mobile setup has been completed if the mobile option has been selected as the CLI option. For the setup instructions, refer to the Mobile Test section. Additionally, the presence of the "node_modules" folder will be validated, and if it is not found, the installation process will be initiated before any further steps are taken.

Starting the Application:

npm start

The wizard begins with options for testing modules, and depending on the user's selection, the chosen module will either start locally or inside a Docker container. The 'start.js' file, which is developed using the enquirer node package, contains the code to manage the wizard and the user's selection. The available test module options are UI, API, and Mobile.


Web Test

Install dependencies:

Prior to running this command, navigate to the "web" directory.

npm install

Create the .env file:
To set up the .env file, create a file named .env within the web folder, and update its contents by referring to the .env.example file.

To execute the test locally:

The test will run in HEADLESS mode by default. To see the test running in a browser, update the MODE=LOCAL value in the .env file.

npm test             [ Mocha tests ]
npm run test:e2e     [ Cucumber BDD tests ]

To execute the test in Docker:

npm run test:docker       [ Mocha tests]
npm run test:e2e:docker   [ Cucumber BDD tests ]

The Pre and Post script will automatically handle the start and stop of Docker containers. If containers does not stop automatically run "docker-compose down" command. In case the containers fail to stop automatically, execute the "docker-compose down" command.

To generate a report:

npm run report:mocha
npm run report:cucumber

Paths to the report:

mocha: web/mochawesome-report/mochawesome-report.html
cucumber: web/reports/cucumber/cucumber-report.html

The send a report:

Refer to the .env.example file and update the details in the .env file accordingly.

npm run mailCucumberReport
npm run mailMochaResult

API Test

Installing dependencies:

To execute the following command, go to the "api" directory first.

npm install

The run the test:

npm test

The paths to the reports:

api/reports/mochawesome.html

Mobile Test

To set up Appium, please refer to the Appium SetUp README by clicking on this link:

To install dependencies:

To execute the following command, go to the "mobile" directory first.

npm install

To execute in a local environment:

Before initiating the mobile test, ensure that the Android Virtual Device is up and running.

npm run test  [ Mobile tests ]

To generate a report:

npm run report

The report paths:

mobile: mobile/reports/mobile.html

Features:

- Mobile, Web, API, Backend, Test Automation Framework, Written in TypeScript 
- Uses Mocha and Cucumber frameworks for a [Business-Driven Development] (https://softwareautomation.io/business-driven-develop) approach.
- Integration of VNC with Docker, allowing for graphical user interface (GUI) access to Docker containers.
- Concurrent execution of multiple tasks or processes at the same time.
- Testing for compatibility across multiple web browsers.
- [Page Object Design pattern](https://softwareautomation.io/page-object-model)
- Automatic retrying a failed test to ensure that it passes on subsequent attempts.
- Including screenshots of failed tests in reports to provide visual context and facilitate debugging.
- Github actions & CICD Integration (Work in Progress)
- Automatically distributing test reports to a designated list of email recipients.
- Utilizing specific data types for method parameters to optimize performance and efficiency.
- Enhanced import statement functionality through the utilization of tsconfig paths.

Tech stacks:

WebdriverIO Mocha TypeScript CucumberIO SuperTest ChaiJS Enquirer Appium Docker Node-Mailer

About

TypeScript automation_framework_js for ServiceAutomation.IO

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published