Giter Site home page Giter Site logo

test-reporting-sandbox's Introduction

Test Reporting Sandbox

Code illustrating testng, screenshots and REST comparisons see also https://github.com/donhenton/selenium-sandbox

Running the Tests

To run the service and screenshot test:

mvn clean test -Pdev -DtestNgFile=sample

OR

mvn clean test -Pdev -DtestNgFile=sample -Dremote.server=docker

if the local docker instance is configured, its url will be in the env.properties file of the environment (dev,prod)

Demonstration

Once the tests are run, the report will be in target/surefire-reports/html/index.html The reporting code responsible is at https://github.com/donhenton/reportng, and is a forked modification. The mod points to two pages that have been added to the output.

  • target/classes/public_html/index.html (screenshot comparisons)
  • target/classes/service_public_html/index.html (json comparisons)
  • testng reporting suite -- target/surefire-reports/html/index.html

Screenshot Comparisons

This webpage presents a stored gold file image, compares its to the image freshly visited, and highlights the differences. Specialized code is used to generate the image, see MainAppScreenShot.java and ScreenshotComparisonTest.java

JSON comparisons

This webpage illustrates comparing the output of a REST service to a gold file of the same service. Comparisons use Levenshtein algorithm for the comparison. See RestaurantTests.java

Update (6/28/2019)

The current code base needs requires firefox. So docker image that works is

https://github.com/SeleniumHQ/docker-selenium

docker run -d -p 4470:4444 --shm-size 2g selenium/standalone-firefox:3.141.59-radium

The display page will be at http://localhost:4470/wd/hub where dockerlocal refers to the ip of your docker-toolbox vm (docker-machine ip to find it) if you use the dstart.sh script to launch the docker container

At this moment this code uses Selenium < 3, and would need an update if the selenium driver were changed.

Dependencies

This project depends on two other projects in my repository, which you will have to install locally:

An XML Utils library is also required:

https://github.com/donhenton/code-attic/tree/master/utils/XmlUtils

test-reporting-sandbox's People

Contributors

donhenton avatar dependabot[bot] avatar

Watchers

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