Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 79 lines (55 sloc) 3.14 kB
324d746 @urigolani included package json information and file reorg
authored
1
2 # rinuts
3
18e44e7 @urigolani seperated rinuts web service from the nodeunit driver. Now this pacak…
authored
4 A service which exposes tests through a RESTful api. Allows for remote querying and running tests on the service, by using http requests", as well as retrieving a detailed run information
324d746 @urigolani included package json information and file reorg
authored
5
18e44e7 @urigolani seperated rinuts web service from the nodeunit driver. Now this pacak…
authored
6 built on [node](http://nodejs.org) and [express](http://github.com/visionmedia/express)
324d746 @urigolani included package json information and file reorg
authored
7
8 ## Installation
9
10 Install with [npm](http://github.com/isaacs/npm):
11
12 $ npm install rinuts
13
14 ## Usage
15
16 ### Starting the service:
3fce7d1 @urigolani Modified rinuts to a 'plugin-like' model. Now supports loading of dir…
authored
17
18 var path = require('path'),
18e44e7 @urigolani seperated rinuts web service from the nodeunit driver. Now this pacak…
authored
19 rinuts = require('rinuts'),
20 someDriver = require('rinuts-someDriver'),
21 service;
22
23 // what ever api the driver has to load tests
24 someDriver.addTests(*TESTS*);
25
26 service = new rinuts(someDriver);
27 service.listen(3333);
324d746 @urigolani included package json information and file reorg
authored
28
29 ### Service API:
3fce7d1 @urigolani Modified rinuts to a 'plugin-like' model. Now supports loading of dir…
authored
30
4205b0f @urigolani modified Readme file to include context
authored
31 * *ctor* (driver, context)
18e44e7 @urigolani seperated rinuts web service from the nodeunit driver. Now this pacak…
authored
32 Constructor. Loads a driver which implementes 'enumTests' and 'runTest'.
33 [Argument] driver - The driver
4205b0f @urigolani modified Readme file to include context
authored
34 [Argument] context - (optional) An object being the context of each test run.
324d746 @urigolani included package json information and file reorg
authored
35
36 ### HTTP exposed API:
37
38 * GET /tests : JSON response with a list of the tests exposed. Each test includes it's unique name and a POST URL which can be used to execute it. The list structure is as follows:
39 {
18e44e7 @urigolani seperated rinuts web service from the nodeunit driver. Now this pacak…
authored
40 "*testName*": {
3fce7d1 @urigolani Modified rinuts to a 'plugin-like' model. Now supports loading of dir…
authored
41 "name": "*testName*",
18e44e7 @urigolani seperated rinuts web service from the nodeunit driver. Now this pacak…
authored
42 "url":"/tests/*testName*"
324d746 @urigolani included package json information and file reorg
authored
43 }
44 ...
45 }
46
f900da7 @urigolani small fixes to the previous load. changed dep order
authored
47 * GET /tests/:testName : Returns an individual entry from the list above. has the form of:
48 {
3fce7d1 @urigolani Modified rinuts to a 'plugin-like' model. Now supports loading of dir…
authored
49 "name": "*testName*",
18e44e7 @urigolani seperated rinuts web service from the nodeunit driver. Now this pacak…
authored
50 "url": "/tests/*testName*"}
324d746 @urigolani included package json information and file reorg
authored
51
18e44e7 @urigolani seperated rinuts web service from the nodeunit driver. Now this pacak…
authored
52 * POST /tests/:testName : Executes the individual test and returns the test run summary, in the following structure (can be expanded by the driver):
324d746 @urigolani included package json information and file reorg
authored
53 {
18e44e7 @urigolani seperated rinuts web service from the nodeunit driver. Now this pacak…
authored
54 "name": *testName*,
55 "state": *true|false*
324d746 @urigolani included package json information and file reorg
authored
56 }
4205b0f @urigolani modified Readme file to include context
authored
57
58 Adding context to the request(Optional):
59 HTTP-Headers: "Content-Type: application/json"
986568a @urigolani another minor fix in context readme
authored
60 HTTP-Body: {"context": *whatEver*}" - a JSON notated object
4205b0f @urigolani modified Readme file to include context
authored
61
62 note - added context will override context supplied to the *ctor* of rinuts.
5ba6336 @urigolani updated enumTest interface so that each test includes a name and an i…
authored
63
64
65 ### Driver interface:
66
67 Drivers for rinuts should export the following methods inorder to enable 'rinuts' to
68 enumarate the driver's tests as a reponse for 'GET' request and to run a speicific test per 'POST' request:
69
70 * 'enumTests' (callback): applies *callback* on an array containing the tests to be exposed. each array element has the form:
71 {
72 name: *the name of the test*,
94936df @urigolani update
authored
73 identifier: *the unique identifier of the test. Will be appended to the test url in the get response, e.g, \tests\testoddnumbers*
5ba6336 @urigolani updated enumTest interface so that each test includes a name and an i…
authored
74 }
75 * 'runTest' (identifier, callback, context) : runs the test matching 'identifier', with 'context' if supplied in the in the POST request,
94936df @urigolani update
authored
76 and applies callback on the testresult(type Object).
77 ### important - testresult must supply a **success** property set to true upon test run success or false upon test run failure.
5ba6336 @urigolani updated enumTest interface so that each test includes a name and an i…
authored
78
79
Something went wrong with that request. Please try again.