-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor tweak Read frorm file Promisify CLI output Rename variable File loading by extension Refactor loader loading Get output working CLI hook. Documentation Normalize URLs Clean up
- Loading branch information
Showing
12 changed files
with
770 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Zerxes | ||
|
||
Zerxes is a CLI tool that helps with automation testing of HTTP redirects. | ||
|
||
## Usage | ||
|
||
From any directory, you can run: | ||
|
||
```sh | ||
$ npx @zerxes [args] | ||
``` | ||
|
||
## Options | ||
|
||
You can specify options through the command line (CLI). | ||
|
||
| CLI | Description | Default Value | Example | | ||
| --------- | --------------------------------- | ------------- |--------------------------- | | ||
| `in` | Input file with valid test cases | | `--in=./test-cases.xlsx` | | ||
| `out` | Output file with test results | | `--out=./output.xlsx` | | ||
| `maxHops` | Maximum HTTP hops before failure | 10 | `--maxHops=10` | | ||
|
||
## Input Formats | ||
|
||
Zerxes currently currently only supports CSV and XLSX files for input. | ||
|
||
### XLSX | ||
|
||
When receiving an XLSX file as input, the input file should be structured as follows (without headers): | ||
|
||
- Column 1: The URL to start from (ex: `http://google.com`) | ||
- Column 2: The expected URL to be redirected to (ex: `http://www.google.com`) | ||
- Column 3: The maximum hop count for the redirect (ex: `2`). Optional, leave blank to use default value. | ||
|
||
#### Example: | ||
|
||
| | | | | ||
| -------------------- | ----------------------- | ------- | | ||
| `http://google.com` | `http://www.google.com` | | | ||
| `http://yahoo.com` | `https://www.yahoo.com` | `5` | | ||
|
||
### CSV | ||
|
||
When receiving an CSV file as input, the input file should be structured as follows (without headers): | ||
|
||
- Column 1: The URL to start from (ex: `http://google.com`) | ||
- Column 2: The expected URL to be redirected to (ex: `http://www.google.com`) | ||
- Column 3: The maximum hop count for the redirect (ex: `2`). Optional, leave blank to use default value. | ||
|
||
#### Example: | ||
|
||
```csv | ||
http://www.google.com,http://www.google.com | ||
http://www.yahoo.com,https://www.yahoo.com,5 | ||
``` | ||
|
||
## Output Formats | ||
|
||
Zerxes currently currently only supports CSV and XLSX files for output. Both formats will display the following table: | ||
|
||
| maxHops | url | expectedRedirect | success | hops | | ||
| -------- | ------------------- | ----------------------- | ------- | ---- | | ||
| `10` | `http://google.com` | `http://www.google.com` | TRUE | `1` | | ||
| `5` | `http://yahoo.com` | `https://www.yahoo.com` | TRUE | `1` | | ||
|
||
## Examples | ||
|
||
Call from CLI: | ||
```cli | ||
node src/cli.js --in=./test/data/test.csv --out=./output.csv --maxHops=5 | ||
``` |
Oops, something went wrong.