HTTP-based DSL for for validating RESTful APIs
Rigor
is a Domain Specific Language (DSL) and Command Line Interface (CLI)
for making HTTP requests, extracting data, and validating responses. The main
intent of Rigor is to be an HTTP-based API (e.g. REST) Testing Framework for
automated functional or integration testing.
Install using pip3
...
pip3 install rigor
$ rigor --help
Usage: rigor [OPTIONS] [PATHS]...
Options:
--profile TEXT Profile name (e.g. test)
--host TEXT Host name (e.g. http://localhost:8000)
-i, --includes TEXT Include tag of cases. (e.g. smoke)
-e, --excludes TEXT Exclude tag of cases to run. (e.g. broken)
-p, --prefixes TEXT Filter cases by file prefix. (e.g. smoke_)
-e, --extensions TEXT Filter cases by file extension. (e.g. rigor)
-c, --concurrency INTEGER # of concurrent HTTP requests. (default: 5)
-o, --output TEXT Report output folder.
-q, --quiet Run in quiet mode. (warning/critical level only)
-v, --verbose Run in verbose mode. (debug level logging)
-j, --json JSON-style logging.
-h, --html Generate HTML report.
-g, --coverage Generate Coverage report.
-r, --retries INTEGER # of retries for GET calls only. (default: 0)
-s, --sleep INTEGER Retry sleep (seconds multiplied by retry).
(default: 60)
-f, --retry_failed Retries all failed scenarios at the end.
--version Logs current version and exits.
--help Show this message and exit.
(rigor) /p/tmp> cat test.rigor
name: Simple case.
steps:
- description: Simple step.
request:
host: https://httpbin.org
path: get
(rigor) /p/tmp> rigor test.rigor --html
2018-02-08 13:18.06 [info ] no config file not found [rigor] paths=('test.rigor',)
2018-02-08 13:18.06 [info ] collecting tests [rigor] cwd=/private/tmp paths=['test.rigor']
2018-02-08 13:18.06 [info ] tests collected [rigor] queued=1 skipped=0
2018-02-08 13:18.06 [info ] execute suite complete [rigor] failed=0 passed=1 timer=0.119s
2018-02-08 13:18.07 [info ] launching browser [rigor] report_path=/var/folders/b_/2hlrn_7930x81r009mfzl50m0000gn/T/tmps_8d7nn_/html-2018-02-08-08-18-06/cucumber-html-reports/cucumber-html-reports/overview-features.html
Comparators are used by the validation phase of each step to check whether an actual value is returning as expected. See the comparisons.rigor example for more details.
More examples can be found by reviewing the tests/httpbin/ folder of this project.
The MIT License (MIT) Copyright (c) 2017 Ian Maurer, Genomoncology LLC