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.
You need to have docker installed.
To later send seed demo data as test results you can either use
- Postman,
- Newman,
- cURL
- or Robotframework with RequestsLibrary
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.
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".
- 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
In your browser go to http://localhost:80 to see the Kibana frontend.
-
Go to discover and select the fields you are interested in to have a less convoluted view.
-
Build some nice visualisations in the Visualize section. I highly recommend using a tutorial to get into this.