Giter VIP home page Giter VIP logo

testpyramidexample's Introduction

RxDemo: Java Application Demonstrating Test Pyramid Concept

Introduction

This project illustrates the Test Pyramid testing strategy published by Mike Cohn in Software Development Using Scrum, Addison-Wesley, 2009. Tests at different layers of the application are complimentary, with unit tests, acceptance tests for logical services, and end to end tests focused on the UI behavior. The sample application is a prescribing application, and there are four primary parts to the application each in a sub-folder of the project:

  • RxDemo Server: This is a java / maven3 sub-application that provides the REST services for the application, along with unit tests.
  • RxDemo UI: This is a javascript / html sub-application that provides the web client for the application, along with unit tests.
  • RxDemo Fitnesse: This is a fitnesse instance with acceptance tests for sample features of the application.
  • RxDemo Selenium: This is a java / maven3 sub-application containing only selenium tests to verify the UI of the example features via a browser.

A powerpoint presentation is at the root directory.

Running RxDemo Server

You will need Java 1.8.x or higher and Maven 3 or higher installed. You should be able to do a "java -version" and "mvn -version" from command line.

  • cd to the rxdemo-server subdirectory and perform a "mvn clean install" operation.
  • cd to the rxdemo-server/rest subdirectory and perform a "mvn exec:java".

At this point the server should be running and listening on port 4567. You can confirm this by hitting the httpget call for drugs to prescribe: localhost:4567/drugs.

You may alternatively run the application from within your IDE if it has processed maven 3 dependencies. The main class to run is in the rest sub-module, AppMainRunner.java.

Unit tests for server-side logic are in rxdemo-server/core/src/test/java. They may be executed by a "mvn test" operation from rxdemo-server directory, or from within IDE.

Running RxDemo UI

You will need node installed. The application was build on node 6.10.0 but a later version should work (node --version to check your version).

  • perform "npm install" from rxdemo-ui directory.
  • perform "npm run run" from rxdemo-ui directory.

Application should launch on port 9000, UI should appear in browser at localhost:9000, and if RxDemo Server is running the list of drugs should be available in droplist.

Unit tests are in rxdemo-ui/test/unit, and may be executed via "npm test".

Running RxDemo Fitnesse

Business logic / acceptance tests for RxDemo along with fitnesse instance to view and run them are in the rxdemo-fitnesse subdirectory.

  • cd to rxdemo-fitnesse
  • perform "java -jar fitnesse-standalone.jar -p 8080"

Fitnesse should be accessible via browser at localhost:8080. You can navigate down the RxDemoTestPyramidTest links and run all of the tests from subsequent suite page by hitting the "Suite" button in the header, or drill down to individual tests to view or run them by hitting the "Test" button in header.

Running Selenium Tests in rxdemo-selenium

  • Download Selenium Standalone Server jar from Selenium HQ Downloads
  • Download driver for browser of choice (links maintained at Selenium HQ)
  • Run Selenium Server with driver, i.e. java -Dwebdriver.chrome.driver=chromedriver -jar selenium-server-standalon3.4.0.jar
  • Run unit test in rxdemo-selenium test/java/rxdemo
  • expected port for UI to be running on is localhost 9000, but this can be modifed via RxConstants in rxdemo-selenium.

testpyramidexample's People

Contributors

cindyleffler avatar surya553 avatar weaverj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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