Skip to content

Nilsty/elstack-qa-monitoring

Repository files navigation

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 'Content-Type: application/json' \
  -d '{
	"environment" : "Staging",
	"test_title" : "the-test-test",
	"result" : "PASS",
	"report" : "All test steps have passed."

}'
curl -X POST \
  http://localhost:8060/ \
  -H 'Content-Type: application/json' \
  -d '{
	"environment" : "Production",
	"test_title" : "the-test-test",
	"result" : "PASS",
	"report" : "All test steps have passed."

}'
curl -X POST \
  http://localhost:8060/ \
  -H 'Content-Type: application/json' \
  -d '{
	"environment" : "Staging",
	"test_title" : "the-test-test",
	"result" : "FAIL",
	"report" : "Test failed on step 23\nCould not find UI object."

}'
  • or use these robot framework tests to populate some example test results robot robot-tests

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.

About

A demo of the elastic stack used for test monitoring

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published