Giter VIP home page Giter VIP logo

qa-automation-accelerator's Introduction

Build Status

Index

  1. Introduction
  2. Features
  3. Pre-requisites
  4. Dependencies
  5. Quick start
  6. IDE setup
  7. Where do I see reports?
  8. Report Samples
  9. How to utilize Jenkins pipeline feature?
  10. How to utilize Selenium grid feature?
  11. How to utilize Redis and Jedis feature?
  12. How to utilize Elasticsearch, Logstash and Kibana feature?
  13. Developer guide
  14. Feedback
  15. License

qa-automation-accelerator

A cloud-scale, opinionated, test automation framework for Web, APIs, and Micro Services. Strongly aligned with the DevOps-way of doing things

Aim is to provide out-of-box patterns and reference implementation to accelerate test automation and to drive best practices

Disclaimer: This is work in progress at this stage.

Features

  1. Selenium + Cucumber based automation test examples for automationpractice.com
  2. Demonstrates use of BDD style tests using cucumber
  3. Demonstrates use of Selenium Grid via docker-compose (almost zero configuration)
  4. Supports various modes - headless, grid, incognito, normal (default)
  5. Support feature level parallelization. (Recommended not to use scenario level parallelization)
  6. Utilities to deal with test data in properties, yaml format
  7. Utilities to deal with driver, finders
  8. Externalized selector configuration
  9. Almost zero setup overhead - driver setup is automated via webdrivermanager
  10. Support for BrowserStack, SauceLabs
  11. TODO support to trigger emails from the tests
  12. Fully functional Jenkinsfile that can be used to setup a Jenkins pipeline
  13. Sample API tests using RestAssured
  14. Support for Redis for coordination of user data across tests
  15. Support for ELK (Elasticsearch, Logback and Kibana)

Pre-requisites

JDK 8

docker, docker-compose - Optional for local development. Recommended for CI setup.

Jenkins - 2.88+

Dependencies

  1. Cucumber - 1.2.5
  2. Selenium - 3.8.1
  3. Courgette - 1.5.1
  4. WebDriverManager - 2.0.1
  5. RestAssured - 3.0.6
  6. SnakeYaml - 1.8
  7. docker - 17
  8. docker-compose - 1.17
  9. Jedis - 2.4.2
  10. Logback-Logstash-Encoder = 4.9
  11. Logback-Classic-Version = 1.2.3

Quick start

$ git clone https://github.com/mindstix-labs/qa-automation-accelerator.git
$ cd qa-automation-accelerator
$ ./gradlew clean build

Above steps will execute the tests in Chrome hitting www.automationpractice.com portal. It would take approximately 1 or 2 minutes to complete. At the end of this, you will see build failed. Do not panic! We have intentionally added one failing test as a sample.

IDE setup

$ ./gradlew idea (for IDEA)
$ ./gradlew eclipse (for Eclipse)

Import the project in IDE after above steps generate required project setup files.

Where do I see reports?

Open: build/reports/cucumberreport/index/index.html

Alternatively, open courgette reports: target/courgette-report/index.html

The best reports are generated once you setup Jenkins with cucumber-reports plugin. We are working on getting these reports generated even for local builds. See Issue 19

Report Samples

Courtesy: https://github.com/damianszczepanik/cucumber-reporting

There is a feature overview page:

feature overview page|50x50

And there are also feature specific results pages:

feature specific page passing|50%

And useful information for failures:

feature specific page passing|50%

If you have tags in your cucumber features you can see a tag overview:

Tag overview

And you can drill down into tag specific reports:

Tag report

Trends report

How to utilize Jenkins pipeline feature?

  1. Setup Jenkins 2.88+. Refer https://jenkins.io/doc/pipeline/tour/getting-started/
  2. Install cucumber-reporting plugin by going to Manage Jenkins -> Manage Plugins -> Available -> Search for cucumber-reporting. Select the cucumber-reporting plugin. Click on Install (without restart works just fine)
  3. Install Blue Ocean plugin in similar way as above. Things will be much more beautiful this way!
  4. Create a new pipeline job. Name it properly. Go to Pipeline section. Select pipeline script from SCM. Give the github URL. Add credentials using Add new or select existing.
  5. Branches to build: keep default - master.
  6. Script path: Jenkinsfile-minimal (good to start with, later you could try Jenkinsfile that is fully featured with docker-compose based selenium grid)
  7. Save.
  8. Go to Job page. Build the job. Keep default parameters if asked.
  9. Once the job is complete, go to the specific build page. You would see Cucumber reports menu. Click to see report.
  10. For email triggers to work from Jenkins, you will need to change the target email address in Script (Jenkinsfile-minimal or whichever you pick in Script path above).

Too much just to get build run on Jenkins? We are working on simplifying it for you! See Issue 30

How to utilize Selenium grid feature?

  1. Install docker using: https://docs.docker.com/engine/installation/#server
  2. Install docker-compose using: https://docs.docker.com/compose/install/
  3. Once you have above installed, you can go ahead and setup Jenkins pipeline with grid capabilities (Jenkinsfile).
  4. For reference on commands fired from Jenkins pipeline, refer to docker-compose commands in Jenkinsfile.

How to utilize Redis and Jedis feature?

  1. Test scenarios do not share the data while executing in parallel.
  2. We are using Redis for synchronizing the user data across tests.
  3. Redis is used with the grid. When you hit command $ docker-compose up -d it will start the Redis container. You may not require Redis while executing tests locally or when you do not want to share data across the tests.
  4. In this project we are using Redis to distribute users across each test. Please refer scenario @signingusingredis in signin.feature.
  5. While executing @usercheck setup, after creating a user it adds that user in redis set after that while running the test it pops one user from the set.
  6. For information about Redis please refer selenium-accelerator/src/main/java/com/mindstix/cb/utils/RedisUtility.java

How to utilize Elasticsearch, Logstash and Kibana feature?

  1. Please refer elk\README.md for more information.

Developer Guide

Refer Wiki here

For more topics related to development and design aspects, please refer Home page of wiki Home

Suggest a feature or report a bug

Click to report

License

Licensed under MIT license

MIT License

Copyright (c) 2018 Mindstix Software Labs, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

qa-automation-accelerator's People

Contributors

amitmindstix avatar kalpeshchaudhari 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.