Skip to content

Commit

Permalink
documentation added...
Browse files Browse the repository at this point in the history
  • Loading branch information
victorjonsson committed Apr 18, 2012
1 parent e706f86 commit d4b7a99
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.md
@@ -1,10 +1,10 @@
# Package Changelog # Package Changelog


## v. 0.0.14 ## v. 0.0.14
First beta release - First beta release


## v. 0.0.15 ## v. 0.0.15
Moved callback into a class function to make it possible for extending class to override the execute() function - Moved callback into a class function to make it possible for extending class to override the execute() function


## v 0.0.16 ## v 0.0.16
- Added comments - Added comments
Expand All @@ -17,4 +17,7 @@ Moved callback into a class function to make it possible for extending class to
- Now following redirects - Now following redirects
- Fixed bug, callback function did not run on request error - Fixed bug, callback function did not run on request error
- Fixed bug, not possible to use the same cookies for several tests - Fixed bug, not possible to use the same cookies for several tests
- Extension of test files changed from .dokimon to .djs
## v 0.0.18
- Extension of test files changed from .dokimon to .djs
- minor bug fixes
25 changes: 13 additions & 12 deletions README.md
@@ -1,13 +1,14 @@
# Dokimon # Dokimon


This project is supposed to end up in a nodejs module used for writing and running automated tests of various kinds. This is a node module used for setting up automated tests of various kinds. It may also
It's fast and easy to write the tests and you run them using a command line interface. be used as an alternative (or complement) to client test tools such as Selenium. You write your
tests in a heartbeat and run them using a command line interface.


<strong>Example usages:</strong> <strong>Example usages:</strong>


- Verify that your online services is up and running - Verify that your online services is up and running
- Verfify that your RESTfull API is responding and behaving as expected - Verfify that your RESTfull API is responding and behaving as expected
- Validate that your website is spitting out expected html code - Validate that your website generates expected html code


## Getting started ## Getting started


Expand All @@ -19,7 +20,7 @@ Create a directory where you find suitable, go to the directory in your shell in
``npm install dokimon`` ``npm install dokimon``


### 4) Create test directory ### 4) Create test directory
You write your tests in files that has the extension .dokimon... You write your tests in files that has the extension .djs (more information about writing the tests below).


### 3) config.json ### 3) config.json
This file should be placed in the root of your project directory and contain a JSON object with This file should be placed in the root of your project directory and contain a JSON object with
Expand Down Expand Up @@ -49,16 +50,16 @@ will search for a file named config.json in current working directory if not spe
``` ```
/Users/john/nodetests/ /Users/john/nodetests/
tests/ tests/
- myscript.dokimon - myscript.djs
- config.json - config.json
``` ```


## Writing tests ## Writing tests


You can have one or several dokimon scripts, each containing one or several tests. All dokimon scripts should have You can have one or several dokimon scripts, each containing one or several tests. All dokimon scripts should have
the extension <em>.dokimon</em> and be located in the test directory defined in config.json. The scripts is written as ordinary node modules (http://howtonode.org/creating-custom-modules). the extension <em>.djs</em> and be located in the test directory defined in config.json. The scripts is written as ordinary node modules (http://howtonode.org/creating-custom-modules).


<strong>Basic example (myscript.dokimon)</strong> <strong>Basic example (myscript.djs)</strong>


```js ```js
var dokimon = require('dokimon'), var dokimon = require('dokimon'),
Expand Down Expand Up @@ -100,7 +101,7 @@ var checkSiteSearch = new dokimon.TestPostForm(
module.exports = [checkHomepage,checkSiteSearch]; module.exports = [checkHomepage,checkSiteSearch];
``` ```


Assuming that I've written this code in a file residing in my test directory (defined in config.json) and that the file has <em>.dokimon</em> as extension I can now run my tests by calling `dokimon -r` in the project directory. I can also choose to only run one the tests like `dokimon -rs myscript HomePageIsRunning` Assuming that I've written this code in a file residing in my test directory (defined in config.json) and that the file has <em>.djs</em> as extension I can now run my tests by calling `dokimon -r` in the project directory. I can also choose to only run one the tests like `dokimon -rs myscript HomePageIsRunning`


[Read more about writing tests here](https://github.com/victorjonsson/nodejs-dokimon/wiki/Writing-tests) [Read more about writing tests here](https://github.com/victorjonsson/nodejs-dokimon/wiki/Writing-tests)


Expand All @@ -113,13 +114,13 @@ Run all dokimon scripts in the test directory defined in config.json
``` ```
dokimon -r api website dokimon -r api website
``` ```
Run the scripts named api.dokimon and website.dokimon residing in the test directory defined in config.json. You can Run the scripts named api.djs and website.djs residing in the test directory defined in config.json. You can
also write the paths to the scripts, -r tests/api.dokimon tests/website.dokimon also write the paths to the scripts, -r tests/api.djs tests/website.djs


``` ```
dokimon -rs website HomePageIsRunning dokimon -rs website HomePageIsRunning
``` ```
Run the test named <em>HomePageIsRunning</em> that's located in the script website.dokimon residing in the test Run the test named <em>HomePageIsRunning</em> that's located in the script website.djs residing in the test
directory defined in config.json directory defined in config.json


``` ```
Expand All @@ -130,7 +131,7 @@ List all scripts (and their tests) that is located in the test directory, define
``` ```
dokimon -s website dokimon -s website
``` ```
List all available tests in the script website.dokimon List all available tests in the script website.djs


### Optional arguments ### Optional arguments


Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{ {
"author": "Victor Jonsson <kontakt@victorjonsson.se> (http://victorjonsson.se)", "author": "Victor Jonsson <kontakt@victorjonsson.se> (http://victorjonsson.se)",
"name": "dokimon", "name": "dokimon",
"description": "A simple framework that is used for test automation. Write tests for a website or web service and manage them with a command line interface", "description": "This is a module used for setting up automated tests of various kinds. It may also be used as an alternative (or complement) to browser test tools such as Selenium. Write tests for a website or web service and manage them with a command line interface. Documentation available on github",
"version": "0.0.17", "version": "0.0.17",
"homepage": "https://github.com/victorjonsson/nodejs-dokimon", "homepage": "https://github.com/victorjonsson/nodejs-dokimon",
"keywords": ["test","tests","scraping","node.js", "automation", "testing"], "keywords": ["test","tests","scraping","node.js", "automation", "testing"],
Expand Down

0 comments on commit d4b7a99

Please sign in to comment.