# HybridTestFramework | End To End Testing Of Web, API And Security

**URL:** <https://onehack.st/t/hybridtestframework-end-to-end-testing-of-web-api-and-security/214940>\
**Category:** Tools & Scripts\
**Tags:** tools, programming, hacking\
**Created:** [February 20, 2022, 11:27am UTC](https://onehack.st/t/hybridtestframework-end-to-end-testing-of-web-api-and-security/214940 "2022-02-20T11:27:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheStrength](https://onehack.st/user_avatar/onehack.st/thestrength/32/46753_2.png) [@TheStrength](https://onehack.st/u/TheStrength)\
**Post date:** [February 20, 2022, 11:27am UTC](https://onehack.st/t/hybridtestframework-end-to-end-testing-of-web-api-and-security/214940/1 "2022-02-20T11:27:57Z")

</div>

![image](https://onehack.st/uploads/default/original/3X/d/6/d60265e3367ee17062fa194bdb7fadcd2da9dc14.png)

[![Codacy Badge](https://camo.githubusercontent.com/bb06c17b3fbcb7e6794c6966e3436fa9a04608233536ed0ed4f003265f527a68/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3266666439633937373235363435633262636461383630393838646330626166)](https://www.codacy.com/gh/dipjyotimetia/HybridTestFramework/dashboard?utm_source=github.com&utm_medium=referral&utm_content=dipjyotimetia/HybridTestFramework&utm_campaign=Badge_Grade) [![This project is using Percy.io for visual regression testing.](https://camo.githubusercontent.com/b5059bda3f1e150a4efde71c4764a36049ea24135156d700e3d1587e6cd8f03b/68747470733a2f2f70657263792e696f2f7374617469632f696d616765732f70657263792d62616467652e737667)](https://percy.io/CypressTest/Selenium) [![CI](https://github.com/dipjyotimetia/HybridTestFramework/workflows/CI/badge.svg)](https://github.com/dipjyotimetia/HybridTestFramework/workflows/CI/badge.svg) [![CodeQLAnalysis](https://github.com/dipjyotimetia/HybridTestFramework/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/dipjyotimetia/HybridTestFramework/actions/workflows/codeql-analysis.yml)  
[![SupportedBy JetBrains](https://github.com/TestautoDev/Tricks-And-Tips/raw/master/jetbrains.svg)](https://www.jetbrains.com/?from=HybridTestFramework)

### Full-fledged WEB, API and Security testing framework using selenium,ZAP OWASP proxy and rest-assured

[![](https://github.com/dipjyotimetia/HybridTestFramework/raw/master/docs/img/selenium.png)](https://github.com/dipjyotimetia/HybridTestFramework/blob/master/docs/img/selenium.png)

### Supported Platforms

This framework supports WebUi automation across a variety of browsers like Chrome, Firefox, IE, no only limited to this but extended to test rest api, security and visual testing.

### Capabilities

- Cross browser testing support
- Added browserstack support for CrossBrowser testing
- Running tests in docker containers selenium grid
- Running tests in AWS DeviceFarm selenium grid
- Running tests in selenium server in docker containers
- Security testing using OWASP, running in docker container
- Api testing support using RestAssured
- Visual regression testing using [percy.io](http://percy.io)
- Accessibility testing using axe-selenium
- Stubbed api testing using WireMock
- Can send logs to ElasticSearch for kibana dashboard visualization
- Database testing support
- Kafka testing support
- Kubernetes support

### Setup & Tools

- Install intellij [https://www.jetbrains.com/idea/download/](https://www.jetbrains.com/idea/download/)
- Install docker desktop [https://www.docker.com/products/docker-desktop](https://www.docker.com/products/docker-desktop)
- Java JDK\_11  
[https://adoptopenjdk.net/](https://adoptopenjdk.net/)
- Gradle [https://gradle.org/next-steps/?version=6.8.3&format=bin](https://gradle.org/next-steps/?version=6.8.3&format=bin)
- Allure [https://github.com/allure-framework/allure2/archive/2.17.2.zip](https://github.com/allure-framework/allure2/archive/2.17.2.zip)
- Set Environment variables
  - JAVA\_HOME: Pointing to the Java SDK folder\bin
  - GRADLE\_HOME: Pointing to Gradle directory\bin.
  - ALLURE\_HOME: Pointing to allure directory\bin.

### Getting Started

$ git clone $ cd $ import project from intellij as a gradle project $ gradle clean $ gradle build $ gradle task E2E $ gradle allureReport $ gradle allureServe

### Write your first user journey

Create new class and name as the TC00\*\_E2E\_TEST-\*\*\*

- Provide jira link in @Link
- Provide all the api components as @Feature
- Provide test severity and description
- Write test
- Use CatchBlock in try/catch section

### Spin-up chrome, firefox, selenium hub and OWASP proxy server

$ docker-compose up -d

### Complete infrastructure creation for local run

$ $ docker-compose -f docker-compose-infra up -d

### Spin-up four additional node-chrome/firefox instances linked to the hub

$ docker-compose scale chrome=5 $ docker-compose scale firefox=5

### Spin-up kafka instances

$ docker-compose -f docker-compose-kafka.yml up $ docker-compose -f docker-compose-kafka.yml down --rmi all

### Spin-up selenium hub in kubernetes instance

$ kubectl apply -f selenium-k8s-deploy-svc.yaml $ kubectl apply -f [https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml](https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml) $ kubectl proxy $ kubectl describe secret -n kube-system | grep deployment -A 12 ## To delete deployments $ kubectl delete deployment selenium-node-firefox $ kubectl delete deployment selenium-node-chrome $ kubectl delete deployment selenium-hub

navigate to `http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/`  
[![](https://github.com/dipjyotimetia/HybridTestFramework/raw/master/docs/img/kubernetes.png)](https://github.com/dipjyotimetia/HybridTestFramework/blob/master/docs/img/kubernetes.png)

### Execution Gif

[![browserstack](https://github.com/dipjyotimetia/HybridTestFramework/raw/master/docs/gif/videogif.gif)](https://github.com/dipjyotimetia/HybridTestFramework/blob/master/docs/gif/videogif.gif)

## GitHub:

> **[GitHub - dipjyotimetia/HybridTestFramework: End to End testing of Web, API, Cloud, Events and...](https://github.com/dipjyotimetia/HybridTestFramework)**
>
> End to End testing of Web, API, Cloud, Events and Security
