forked from Azure/azure-rest-api-specs
-
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.
update api scenario documentation (Azure#16086)
* add operation step * fix schema * restore OpTest * add cleanUpSteps & remove type * use draft-07 schema * refine propertyNames * add description * remove merge * fix copy/move * use property name * variable type * restore plain style * define Example and file reference in v1.1 * remove raw Example support * fix * rename to API scenario * restore entry * fix ref
- Loading branch information
1 parent
69f8091
commit ff73046
Showing
19 changed files
with
573 additions
and
496 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
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
File renamed without changes
File renamed without changes
File renamed without changes
57 changes: 57 additions & 0 deletions
57
documentation/api-scenario/how-to/generateABasicApiScenario.md
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,57 @@ | ||
# Generate a basic API scenario file | ||
|
||
## Prerequisite | ||
|
||
We use `oav` tools to generate basic API scenario. `oav` analyze swagger file and use swagger example as API scenario steps. So first, you need to install the latest oav. | ||
|
||
## Introduction | ||
|
||
`oav` support rule based API scenario file generation. We use this command to generate API scenario file. | ||
|
||
`oav generate-static-api-scenario --readme <readme> --tag <tag> --rules <generated-rules>` | ||
|
||
- readme: swagger readme file. | ||
- tag: which tag to generate. oav will analyze swagger file under the tag and generate API scenario. | ||
- rules: Currently support two types. `resource-put-delete`, `operations-list`. Default: `resource-put-delete` | ||
- `resource-put-delete`: generate resource put and delete API scenario. | ||
- `operations-list`: generate operations list API scenario. `operations-list` is the simplest API which must be defined in swagger. | ||
|
||
Example: | ||
|
||
![](./genTestScenario.gif) | ||
|
||
This command will load and analyze swagger and generate a basic API scenario file (`resource-put-delete`). | ||
|
||
Result: the output contains two files | ||
|
||
- scenarios/signalR.yaml: The API scenario file. | ||
- readme.test.md: The entry for SDK test generation | ||
|
||
The generated API scenario file: The generated API scenario file contains two steps. Create signalR and delete it. It's a basic API scenario and developer can add more step based on the basic API scenario file. | ||
|
||
``` | ||
scope: ResourceGroup | ||
testScenarios: | ||
- description: Microsoft.SignalRService/signalR SignalR_CreateOrUpdate | ||
steps: | ||
- step: SignalR_CreateOrUpdate | ||
exampleFile: ../examples/SignalR_CreateOrUpdate.json | ||
- step: SignalR_Delete | ||
exampleFile: ../examples/SignalR_Delete.json | ||
``` | ||
|
||
If you pass rule option `operations-list`, you will get such API scenario file. | ||
|
||
``` | ||
scope: ResourceGroup | ||
testScenarios: | ||
- description: operationsList | ||
steps: | ||
- step: operationsList | ||
exampleFile: ../examples/Operations_List.json | ||
``` | ||
|
||
## Reference | ||
|
||
- [oav](https://github.com/Azure/oav/tree/develop) |
File renamed without changes
File renamed without changes
File renamed without changes
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,29 @@ | ||
# API Scenario Documentation | ||
|
||
API Scenario is a YAML file defining RESTful API usage scenarios of your service with a series of API calls. API scenario can be used for service functional test, API quality validation and SDK/CLIs test generation. | ||
|
||
_**Caution**: This project is in early preview phase, hence breaking changes should be expected._ | ||
|
||
## Features | ||
|
||
- Simple to use: Intuitive step definition based on Swagger examples and raw REST call. | ||
- ARM Template integration: Support creating external Azure resources with ARM Template and executing Azure Powershell or Azure CLI scripts with ARM Template deployment script. | ||
- Implementation independent: [oav](https://github.com/Azure/oav) is the default API scenario runner, and more runners will be supported, like SDKs in different languages. | ||
|
||
### Demo gif | ||
|
||
![demo](./how-to/runApiTest.gif) | ||
|
||
## Quick start | ||
|
||
- [Example: Write and run your first API scenario file](./how-to/QuickStart.md) | ||
- [Example: Generate a basic API scenario file](./how-to/generateABasicApiScenario.md) | ||
- [Example: use armTemplate to generate unique resourceName](./how-to/apiScenarioWithARMTemplate.md) | ||
- [API scenario file sample](../samplefiles/Microsoft.YourServiceName/stable/YYYY-MM-DD/scenarios/quickStart.yaml) | ||
|
||
## References | ||
|
||
- [API Scenario Definition Reference](./references/ApiScenarioDefinition.md) | ||
- [API Scenario Variable Definition Reference](./references/Variables.md) | ||
- [API Scenario Runner Reference](./references/Runner.md) | ||
- [API Scenario JSON Schema](./references/v1.1/schema.json) |
Oops, something went wrong.