Git Product home page Git Product logo

deck_of_cards's Introduction

deckofcards

API validation on Deck Of Cards application http://deckofcardsapi.com/

Prerequisites

  1. java IDE (ex: eclipse)
  2. Maven configured.
  3. Preferably testNG plug-in configured on your IDE for execution.

Installation

  1. Clone this repo on to your local system.
  2. Open your IDE (like eclipse) and import the project as Maven -> Existing Maven Projects -- This is going to take little time to download missing artifacts and configure -- Make sure your IDE is using correct version of JDK (1.8)
  3. Run testng.xml file at root directory.

Structure of tests

All the tests are located under package core.tests
Each REST endpoint has its own class (Tests file) unless if there are similar to each other.
Example: Add and Shuffle card piles are merged to a single Tests file.


core.library package currently has only one class CardsClient. This client is responsible for making the end calls to application. Headers, authentication, baseURLs should be handled here if they are required in future. Also general assertions can be added here to like checking for 5XX response codes and timeouts.
All tests will make use of this class methods instead of directly calling RestAssured methods. (This is to remove direct dependency of REST library in the tests)

Assertions

Individual tests files get their own assert methods implemented from a Interface.
This helps in properly planning and asserting the response of a particular REST call.
We can also add a grouping feature here where a method will provide a set of assertions. This helps in future if we need to add a particular assertion to all tests.

Conclusion

Goal in this sample project is to demostrate that tests should be independent of libraries we use.
Ex: If in future, I want to use a different library to make REST calls, we can update the CardsClient. Similarly, Assert library can be easily modified without any changes to test classes.

deck_of_cards's People

Contributors

mahesh4eva avatar

Stargazers

 avatar

Watchers

 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.