Skip to content

Commit ef451d6

Browse files
committed
docs: Add missing arguments in documentation + correct typos
1 parent 8d38c75 commit ef451d6

File tree

4 files changed

+32
-6
lines changed

4 files changed

+32
-6
lines changed

docs/commands-and-arguments/arguments.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ You can get the full list of arguments by running `cats -h`. Below is a short de
1010
- `--server=URL` supplies the URL of the service implementing the contract.
1111
- `--basicauth=USR:PWD` supplies a `username:password` pair, in case the service uses basic auth.
1212
- `--authRefreshInterval=value_in_seconds` Amount of time in seconds after which to get new auth credentials
13-
- `--authRefreshScript=script` Script to get executed after `--authRefreshInterval` in order to get new auth credentials. The script will replace any headers that have aut_script as value. If you don't supply a --authRefreshInterval, but you supply a script, the script will be used to get the initial auth credentials.
13+
- `--authRefreshScript=script` Script to get executed after `--authRefreshInterval` in order to get new auth credentials. The script will replace any headers that have `auth_script` as value. If you don't supply a `--authRefreshInterval`, but you supply a script, the script will be used to get the initial auth credentials.
1414
- `--fuzzers=LIST_OF_FUZZERS` supplies a comma separated list of fuzzers. The supplied list of Fuzzers can be partial names, not full Fuzzer names. CATS which check for all Fuzzers containing the supplied strings. If the argument is not supplied, all fuzzers will be run.
1515
- `--log=PACKAGE:LEVEL` can configure custom log level for a given package. You can provide a comma separated list of packages and levels or a level to apply to everything. This is helpful when you want to see full HTTP traffic: `--log=org.apache.http.wire:debug` or suppress CATS logging: `--log=com.endava.cats:warn`
1616
- `--skipLog=LEVELS` A list of log levels to skip. For example, you can skip only note and info levels, but leave the rest
@@ -76,7 +76,7 @@ You can get the full list of arguments by running `cats -h`. Below is a short de
7676
- `--[no-]-color` If true enables ANSI codes and coloured console output. Default: true
7777
- `--onlyLog=star,note` A list of log levels to include; allows more granular control of the log levels
7878
- `--userAgent=USER_AGENT` The user agent to be set in the User-Agent HTTP header. Default: cats/version
79-
- `--verbosity=DEETAILED|SUMMARY` Sets the verbosity of the console logging. If set to summary CATS will only output a simple progress screen per path. Default: `SUMMARY`
79+
- `--verbosity=DETAILED|SUMMARY` Sets the verbosity of the console logging. If set to summary CATS will only output a simple progress screen per path. Default: `SUMMARY`
8080
- `--oneOfSelection "field1=value1"`, `--anyOfSelection` A `name=value` list of discriminator names and values that can be use to filter request payloads when objects use oneOf or anyOf definitions which result in multiple payloads for a single endpoint and http method
8181
- `--randomHeadersNumber=NUMBER` The number of random headers that will be sent by the `LargeNumberOfRandomAlphanumericHeadersFuzzer` and `LargeNumberOfRandomHeadersFuzzer`. Default: `10000`
8282
- `--skipFieldTypes=string,integer,etc.` A comma separated list of OpenAPI data types to skip. It only supports standard types: https://swagger.io/docs/specification/data-models/data-types
@@ -96,7 +96,10 @@ You can get the full list of arguments by running `cats -h`. Below is a short de
9696
- `--selfReferenceDepth=<selfReferenceDepth>` Max depth for objects having cyclic dependencies
9797
- `--limitXxxOfCombinations=<limitXxxOfCombinations>` Max number of anyOf/oneOf combinations
9898
- `--[no-]useDefaults` If set to true, it will use the default values when generating examples
99-
- `--simpleReplace` If set to true, it will simply do a replacement between the targetFields names provided and the fuzz values
99+
- `--nameReplace` If set to true, it will simply do a replacement between the targetFields names provided and the fuzz values
100+
- `--stopAfterErrors=<stopAfterErrors>` Number of errors after which the continuous fuzzing will stop running. Errors are defined as conditions matching the given match arguments. Only available in `cats random` sub-command.
101+
- `--stopAfterMutations=<stopAfterMutations>` Number of mutations (test cases) after which the continuous fuzzing will stop running. Only available in `cats random` sub-command.
102+
- `--stopAfterTimeInSec=<stopAfterTimeInSec>` Amount of time in seconds for how long the continuous fuzzing will run before stopping. Only available in `cats random` sub-command.
100103

101104
:::tip
102105
When you want to skip fuzzing entirely for a specific JSON object or specific fields you must prefix the field name from the `--skipFields` argument with `!`.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
sidebar_position: 5
3+
description: Continuous fuzzing
4+
---
5+
6+
# RandomFuzzer
7+
8+
This is the fuzzer behind the [Continuous Fuzzing Mode](/docs/getting-started/running-cats#continuous-fuzzing-mode). It will run based on the
9+
registered mutators.

docs/fuzzers/special-fuzzers/template-fuzzer.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ If the target API does not have an OpenAPI spec available, you can use a request
99
The syntax for running the `TemplateFuzzer` is very similar to `curl`:
1010

1111
```shell
12-
cats fuzz -H header=value -X POST -d '{"field1":"value1","field2":"value2","field3":"value3"}' -t "field1,field2,header" -i "2XX,4XX" http://service-url
12+
cats template -H header=value -X POST -d '{"field1":"value1","field2":"value2","field3":"value3"}' -t "field1,field2,header" -i "2XX,4XX" http://service-url
1313
```
1414

1515
:::tip
@@ -53,5 +53,14 @@ HTTP methods without bodies will be fuzzed at path and query parameters and head
5353
This is an example for a `GET` request:
5454

5555
```shell
56-
cats fuzz -X GET -t "path1,query1" -i "2XX,4XX" http://service-url/paths1?query1=test&query2
57-
```
56+
cats template -X GET -t "path1,query1" -i "2XX,4XX" http://service-url/paths1?query1=test&query2
57+
```
58+
59+
# TemplateFuzzer with continuous fuzzing
60+
You can also run the `TemplateFuzzer` in continuous mode using the `--random` argument.
61+
It will run similarly to the [Continuous Fuzzing Mode](/docs/getting-started/running-cats#continuous-fuzzing-mode) based on the registered mutators.
62+
You must either provide a match condition using the `--matchXXX` arguments, a ignore condition using the `--ignoreXXX` arguments or a filtering condition using the `--filterXXX` arguments.
63+
64+
```shell
65+
cats template -X GET -t "path1,query1" -i "2XX,4XX" http://service-url/paths1?query1=test&query2 --random
66+
```

docs/getting-started/running-cats.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ This will run continuous fuzzing for method `POST` on path `/users/auth`, flag a
5454
As continuous fuzzing do not rely on pre-defined fuzzers, the `matchXXX` condition offers control on how each test case is flagged as error or not.
5555
Continuous fuzzing is also more targeted, this is why supplying the `--path` and http method `-X` is required.
5656

57+
:::caution
58+
It's recommended to supply a `--stopXXX` argument in order for CATS to stop the execution when the supplied condition is met.
59+
Otherwise, it will run indefinitely and won't produce a summary report. It will still produce individual .json and .html test reports.
60+
:::
61+
5762
Continuous fuzzing is based on [mutators](./mutators.md).
5863

5964
## Notes on Skipped Tests

0 commit comments

Comments
 (0)