You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -54,26 +41,13 @@ The above code is quite simple, but it needs some explanation.
54
41
55
42
## Description
56
43
57
-
#### 1. AddReplacementValues
58
-
This is a method that will add key/value pairs for replacement values you need to replace in the Swagger requests.
59
-
60
-
In the example above we say: "Replace `{version}` placeholder in Path and URL parameters and JSON body models."
61
-
62
-
In other words, if you have a test API endpoint like this: https://api.demo.com/v{version}/categories?parent={parentId} that will be set to https://api.demo.com/v1/categories?parent=4.
63
-
64
-
That, does not stop there, you can also populate JSON request bodies in this way:
65
-
66
-
[TODO sample JSON Body]
67
-
68
-
`ReplcementValue[]` has precedence over data generation (check below chapter 5).
69
-
70
-
#### 2. AddBasicAuthentication
44
+
#### 1. AddBasicAuthentication
71
45
If your Swagger.json files are protected by basic authentication, you can set those with `AddBasicAuthentication`.
72
46
73
-
#### 3, AddRequestFilters
47
+
#### 2. AddRequestFilters
74
48
Filters comprise of different types. Those are `AuthenticationTypes`, `TestTypes` and `EndpointNameWhitelist`.
75
49
76
-
##### 3.1. AuthenticationTypes
50
+
##### 2.1. AuthenticationTypes
77
51
Here we specify a list of Authentication types, that will be filtered out from the whole swagger file. This is where QA Tool Kit presents a convention.
78
52
The built-in types are:
79
53
-`AuthenticationType.Customer` which specifies a string `"@customer"`,
@@ -101,7 +75,7 @@ This is an example from swagger.json excerpt:
101
75
102
76
Parser then finds those string in the description field and populates the `RequestFilter` property.
103
77
104
-
##### 3.2 TestTypes
78
+
##### 2.2 TestTypes
105
79
Similarly as in the `AuthenticationTypes` you can filter out certain endpoints to be used in certain test scenarios. Currently libraray supports:
106
80
107
81
- TestType.LoadTest which specifies a string `"@loadtest"`,
@@ -121,13 +95,13 @@ The same swagger-json excerpt which allows load and integration tests.
121
95
"operationId": "GetCategories",
122
96
```
123
97
124
-
##### 3.3 EndpointNameWhitelist
98
+
##### 2.3 EndpointNameWhitelist
125
99
Final `RequestFilter` option is `EndpointNameWhitelist`. With it you can specify a list of endpoints that will be included in the results.
126
100
127
101
Every other endpoint will be excluded. In the sample above we have set the result to include only `GetCategories` endpoint.
128
102
That corresponds to the `operationId` in the swagger file above.
129
103
130
-
#### 4. AddBaseUrl
104
+
#### 3. AddBaseUrl
131
105
Your swagger file has a `Server section`, where you can specify an server URI and can be absolute or relative. An example of relative server section is:
132
106
```json
133
107
"servers": [
@@ -138,10 +112,11 @@ Your swagger file has a `Server section`, where you can specify an server URI an
138
112
```
139
113
In case of relative paths you need to add an absolute base URL to `Swagger Processor` with `AddBaseUrl`, otherwise the one from the `Servers section` will be used.
140
114
141
-
#### 5. AddDataGeneration
142
-
##### !! EXPERIMENTAL !!
143
-
This is an experimental feature. It will generate the missing data in the `List<HttpTestRequest>` object from the swagger models, uri and query parameters.
144
-
`ReplcementValue[]` has precedence over data generation.
115
+
#### 4. UseSwaggerExampleValues
116
+
You can set `UseSwaggerExampleValues = true` in the SwaggerOptions when creating new Swagger source object. This will
117
+
check Swagger for example files and populate those.
0 commit comments