feat: added support for passing env.json file to test cmd (#2373)
This commit is contained in:
@@ -24,13 +24,26 @@ hopp [options or commands] arguments
|
||||
|
||||
- Displays the help text
|
||||
|
||||
3. #### **`hopp test <file_path>`**
|
||||
3. #### **`hopp test [options] <file_path>`**
|
||||
- Interactive CLI to accept Hoppscotch collection JSON path
|
||||
- Parses the collection JSON and executes each requests
|
||||
- Executes pre-request script.
|
||||
- Outputs the response of each request.
|
||||
- Executes and outputs test-script response.
|
||||
|
||||
#### Options:
|
||||
##### `-e <file_path>` / `--env <file_path>`
|
||||
- Accepts path to env.json with contents in below format:
|
||||
```json
|
||||
{
|
||||
"ENV1":"value1",
|
||||
"ENV2":"value2"
|
||||
}
|
||||
```
|
||||
- You can now access those variables using `pw.env.get('<var_name>')`
|
||||
|
||||
Taking the above example, `pw.env.get("ENV1")` will return `"value1"`
|
||||
|
||||
## Install
|
||||
|
||||
Install [@hoppscotch/cli](https://www.npmjs.com/package/@hoppscotch/cli) from npm by running:
|
||||
|
||||
Reference in New Issue
Block a user