Git Product home page Git Product logo

test-automation-quickstart's Introduction

test-automation-quickstart

Java quickstart project for test automation, covering performance, UI acceptance, API acceptance testing and security testing. Created with lessons learned from a large number of development projects to provide all commonly required components and concepts. The framework was first introduced on the OpenCredo.com Blog.

Concepts Included

  • Parallel test runs
  • Shared state across cucumber step definitions
  • Dependency injection
  • Page Object pattern
  • Common web page interaction methods
  • Common api interaction methods
  • Mavenised performance tests
  • Externalised test configuration
  • Commonly used test utility classes
  • Simple security tests

Tools

  • Maven
  • Cucumber-JVM
  • JUnit
  • Spring
  • Selenium Webdriver
  • Jackson
  • JMeter
  • OWASP Zed Attack Proxy

Requirements

In order to utilise this project you need to have the following installed locally:

  • Maven 3
  • Firefox 42.0 or higher (used by default for UI tests, this can be changed in the code)
  • Java 1.8
  • ZAP 2.5.0 (Run it in deamon mode using the following command: ./zap.sh -daemon -port 8888 -config api.disablekey=true)

Usage

The project is broken into separate modules for API, UI, Performance and Security testing. Each of these modules can be utilised independently of the others using maven profiles.

To run all modules, navigate to test-automation-quickstart directory and run:

mvn clean install

To run UI acceptance tests only, navigate to test-automation-quickstart directory and run:

mvn clean install -Pui-acceptance-tests

To run API acceptance tests only, navigate to test-automation-quickstart directory and run:

mvn clean install -Papi-acceptance-tests

To run performance tests only, navigate to test-automation-quickstart directory and run:

mvn clean install -Pperformance-tests

To run security tests only, navigate to test-automation-quickstart directory and run:

mvn clean install -Psecurity-acceptance-tests

Reporting

Reports for each module are written into their respective /target directories after a successful run.

UI acceptance tests result in a HTML report for each feature in test-automation-quickstart/ui-acceptance-tests/target/cucumber-parallel/. In the case of test failures, a screen-shot of the UI at the point of failure is embedded into the report.

API acceptance tests result in a HTML report for each feature in test-automation-quickstart/api-acceptance-tests/target/cucumber-parallel/.

Performance tests result in a .jtl results file and .png graphs showing response times and transactions per second, generated in test-automation-quickstart/performance-tests/target/jmeter/results.

Security acceptance tests result in a HTML report for each feature in test-automation-quickstart/security-acceptance-tests/target/cucumber-parallel/. They will also generate a security risks HTML report in test-automation-quickstart/security-acceptance-tests/security-reports/security-report.html.

NOTE: As mentioned, cucumber reports are written to a separate file for each feature. This occurs as a result of running tests in parallel, meaning that you do not get a single unified test report. If using CI, these individual reports can be joined using plugins such as the Jenkins Cucumber-JVM-Reports plugin.

For an alternative approach to combining the cucumber reports, see the parallel testing blog post on OpenCredo.com.

test-automation-quickstart's People

Contributors

tristanmccarthy avatar burythehammer avatar mcalthrop avatar carloslindo avatar

Watchers

James Cloos avatar Dao Minh Dam 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.