Giter Site home page Giter Site logo

fitnesse-slim-rest-json-driver's Introduction

Small driver to test REST-JSON APIs with FitNesse.
==================================================

Allows to REST-JSON api with FitNesse/SLIM without writing extra java code "Fixtures or Drivers".

Driver provides methods for rest calls:

REST calls get, post, put (delete pending)

A Method to extract data from JSON.
retrieve/eval js on json.

The returned json include status, header, and body.

It also includes 
an echo function and 
a concatRandomInt to generate random Strings for testing.

It uses apache httpcomponent 4.1 and org.json library.
apache httpcomponent: have to be added to the path. (!path)
org.json: no need to add it, fitnesse.jar includes org.json. 

Simple example testing twitter:

--------- FitNesse Wiki Page ------------
!define TEST_SYSTEM {slim} 

!path /repos/fitnesse-rest-json/bin
!path /opt/httpcomponents-client-4.1/lib/*.jar
!note org.json not needed because fitNesse uses it.

Example test twitter trends, test we get a OK response and 10 trends.

!|script|net.zesc.fitnesse.driver.RestJsonDriver         |
|$json= |get        |http://api.twitter.com/1/trends.json|
|check  |retrieve js|status.code        |json |$json|=200|
|check  |retrieve js|body.trends.length |json |$json|=10 |
------------------------------------------

fitnesse-slim-rest-json-driver's People

Contributors

fgui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

bneijt

fitnesse-slim-rest-json-driver's Issues

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.