Code Monkey home page Code Monkey logo

elstack-qa-monitoring's Introduction

Monitor your automation test results with logstash, elastic search and kibana

Intro

As QA you are always required to provide the best possible transparency for your test automation. To always know what was tested when and with what result will benefit your stakeholders as well as your team members. This demo project should show how the elastic stack can be used as a monitoring tool for automation test results.

Requirements

You need to have docker installed.

To later send seed demo data as test results you can either use

How to run it

git clone this repository

Build and run the docker container

docker build -t el-qa-mon .
docker run -d --name qa-mon-elastic-stack -p 80:80 -p 8060:8060 -p 9200:9200 el-qa-mon

This docker container will bring up Logstash, Elastic Search and Kibana with a default configuration. I used this docker image as a base and only added the Logstash http-input-plugin.

Explore Kibana and Logstash

In your browser go to http://localhost:80 to see the Kibana frontend. (Not much to see yet without data)

In your browser go to http://localhost:8060 to check if the logstash http input plugin is listening (it takes 2 mins to come up after the docker container has been started) Once it's running it'll show "ok".

Send seed data - demo test reports

  • Either open with Postman the collection QA-Monitoring-demo-seed-data.postman_collection.json and execute it.
  • or use Newman
newman run QA-Monitoring-demo-seed-data.postman_collection.json
  • or send the following cURLs
curl -X POST \
  http://localhost:8060/ \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: 1b71cf1e-cb7f-44d2-87cd-0bb9d7754e6a' \
  -d '{
	"environment" : "Staging", 
	"test_title" : "the-test-test", 
	"result" : "PASS", 
	"report" : "All test steps have passed."
	
}'
curl -X POST \
  http://localhost:8060/ \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: 764d202c-5f1f-4068-9f39-2359e024e63d' \
  -d '{
	"environment" : "Production", 
	"test_title" : "the-test-test", 
	"result" : "PASS", 
	"report" : "All test steps have passed."
	
}'
curl -X POST \
  http://localhost:8060/ \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: d4eea417-95d8-49aa-bcd7-e3d75a499573' \
  -d '{
	"environment" : "Staging", 
	"test_title" : "the-test-test", 
	"result" : "FAIL", 
	"report" : "Test failed on step 23\nCould not find UI object."
	
}'

Find data in Kibana

In your browser go to http://localhost:80 to see the Kibana frontend.

  1. Create an index pattern "*" index pattern

  2. Index creation step 2 - Time filter = @timestamp index pattern

  3. Go to discover and select the fields you are interested in to have a less convoluted view. index pattern

  4. Build some nice visualisations in the Visualize section I highly recommend using a tutorial to get into this.

elstack-qa-monitoring's People

Watchers

Marco Bierbach avatar James Cloos avatar

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.