Code Monkey home page Code Monkey logo

sadabnepal / web-mobile-api-test-framework Goto Github PK

View Code? Open in Web Editor NEW
30.0 4.0 15.0 6.38 MB

Boilerplate project for Web, Mobile and API using WebdriverIO, Appium, SuperTest and TypeScript

License: MIT License

Gherkin 1.70% TypeScript 91.89% JavaScript 6.40%
webdriverio webdriverio-boilerplate-framework webdriverio-typescript webdriverio-framework wdio-cucumber-steps mochawesome wdio-async supertest-mocha-chai cucumber-html-report docker

web-mobile-api-test-framework's Introduction

Web, API and Mobile Test Automation Framework

WebdriverIO

Web CI API CI

Pre-requisite

NodeJs Docker VSCode Appium-Inspector AndroidStudio JDK

Clone Repository

git clone https://github.com/sadabnepal/web-mobile-api-test-framework.git
cd web-mobile-api-test-framework

Interactive CLI to run test:

Make sure mobile setup has been completed if selecting mobile as CLI option. See Mobile Test for setup instructions. Before running actual test, presence of node_modules folder will be validated and if not not found installation will take place before proceeding any further.

npm start

It start wizard with test module options, based on user selection either of the below module will start locally or inside docker container. Code to control wizard and user selection is available in 'start.js' which is built using enquirer node package.
Test Module Options : | UI | API | Mobile |
cli_demo


Web Test

Install dependencies:

Navigate to "web" folder and then run below command

npm install

Setup .env file:
create .env file inside web folder and update content with reference to .env.example

Run test in local:

By default test will run in HEADLESS mode. Update MODE=LOCAL in .env file to see test running in browser.

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

Run test in Docker:

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

Pre and Post script will handle start and stop of docker containers automatically. If containers does not stop automatically run "docker-compose down" command.

Generate Report:

npm run report:mocha
npm run report:cucumber

Report Paths:

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

Send Report:

Update .env file details with reference of .env.example file

npm run mailCucumberReport
npm run mailMochaResult

API Test

Install dependencies:

Navigate to "api" folder and then run below command

npm install

Run test:

npm test

Report Paths:

api/reports/mochawesome.html

Mobile Test

Appium setup: Click here to open Appium SetUp README

Install dependencies:

Navigate to "mobile" folder and then run below command

npm install

Run in local:

Make sure android virtual device is up and running before starting mobile test.

npm run test  [ Mobile tests ]

Generate Report:

npm run report

Report Paths:

mobile: mobile/reports/mobile.html

Features:

- Web, Mobile and API Testing
- Mocha and Cucumber BDD framework
- Page Object Design pattern
- Docker with VNC integration
- Parallel execution
- Cross browser testing
- Retry failed test
- Screenshot in report for failed tests
- Github actions
- Send test report to list of Gmail
- Use of types for method params optimization
- Improved import statement using tsconfig path

Tech stacks:

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

Folder Structure:

e2e_framework_folders

Sample Email Report:

email_report

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.