Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/respect/guides/run-generated-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Make sure you have the following before you begin:
To get a sense of the API, preview it by running the following command, and then clicking on the link generated to your localhost.

```shell
npx @redocly/cli preview demo.yaml
npx @redocly/cli preview
```
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ npx @redocly/cli preview demo.yaml
redocly preview

Preview Redocly project using one of the product NPM packages.

Options:
      --version                    Show version number.                [boolean]
      --help                       Show help.                          [boolean]
      --product                    Product used to launch preview. Default is in
                                   ferred from project's package.json or 'realm'
                                    is used.
  [string] [choices: "redoc", "revel", "reef", "realm", "redoc-revel", "redoc-re
                                                              ef", "revel-reef"]
      --plan     [string] [choices: "pro", "enterprise"] [default: "enterprise"]
  -p, --port                       Preview port.        [number] [default: 4000]
  -d, --project-dir, --source-dir  Specifies the project content directory. The
                                   default value is the directory where the comm
                                   and is executed.      [string] [default: "."]
      --lint-config                Severity level for config file linting.
                             [choices: "warn", "error", "off"] [default: "warn"]

Unknown argument: demo.yaml


After you review the docs, you can use control-c in your terminal to stop the preview.
Expand All @@ -36,7 +36,7 @@ The following command generates a test description to use with the example API t
npx @redocly/cli generate-arazzo demo.yaml
```

You'll find the output in a file named `auto-generated.yaml`. Take a moment to examine the test description and you will notice that each operation from the OpenAPI file now has a workflow entry like the following example:
You'll find the output in a file named `auto-generated.arazzo.yaml`. Take a moment to examine the test description and you will notice that each operation from the OpenAPI file now has a workflow entry like the following example:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ npx @redocly/cli generate-arazzo demo.yaml

  Generating Arazzo description...

Arazzo description auto-generated.arazzo.yaml successfully generated.
$ npx @redocly/cli respect auto-generated.yaml --verbose
ENOENT: no such file or directory '/Users/xxx/xxx/auto-generated.yaml'


```yaml
- workflowId: get-workflow
Expand All @@ -52,7 +52,7 @@ You can use these starter tests as a basic validation step for an API to check t
Using the generated test file, the following command checks the live API against the behavior described by OpenAPI:

```sh
npx @redocly/cli respect auto-generated.yaml --verbose
npx @redocly/cli respect auto-generated.arazzo.yaml --verbose
```

The tests complete successfully but if you look closely you may notice that all the requests we sent were unauthenticated.
Expand All @@ -71,7 +71,7 @@ The next step is to add authentication information and run the tests again with
To test the behavior of the API when authentication is supplied, it must be added to the workflow file.
Since it's not good practice to add secrets directly to a file that is stored in source control, this example uses an environment variable.

Open the `auto-generated.yaml` file in your IDE or text editor.
Open the `auto-generated.arazzo.yaml` file in your IDE or text editor.
Add the following lines to the file to each workflow (at the same level as `workflowId` and `steps`) to set the authentication header to use, and to describe that the value comes from the `IMFKEY` environment variable:

```yaml
Expand All @@ -93,7 +93,7 @@ inputs:
Run the tests again and supply the input value to the CLI, as shown in the following example:

```sh
npx @redocly/cli respect auto-generated.yaml --input IMFKEY=abc
npx @redocly/cli respect auto-generated.arazzo.yaml --input IMFKEY=abc
```

You can use this exact command, including the value of the environment variable, because the demo API accepts these credentials.
Expand All @@ -112,7 +112,7 @@ This ability to focus is very useful when you need more context to understand a
The following command runs the tests in `--verbose` mode for only that specific failed flow using the `--workflow` parameter:

```sh
npx @redocly/cli respect auto-generated.yaml --verbose \
npx @redocly/cli respect auto-generated.arazzo.yaml --verbose \
--workflow get-users-{id}-workflow
```

Expand Down
2 changes: 1 addition & 1 deletion docs/respect/guides/test-api-sequences.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Make sure you have the following before you begin:
To get a sense of the API, preview it by running the following command, and then clicking on the link generated to your localhost.

```shell
npx @redocly/cli preview demo.yaml
npx @redocly/cli preview
```

After you review the docs, press <kbd>`Control`</kbd> + <kbd>`C`</kbd>` in your terminal to stop the preview.
Expand Down
Loading