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
Copy file name to clipboardExpand all lines: docs/testing.md
+37-11Lines changed: 37 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,23 +108,30 @@ The test can use environmental variables:
108
108
Examples:
109
109
- [Sample api test](../applications/samples/test/api/test_st.py)
110
110
111
-
### Common smoke tests
112
-
113
-
Once a test is created for your application, generic smoke tests are also
114
-
executed, checking for:
115
111
116
-
- Main page is reachable
117
-
- No errors in the console
118
-
- No error responses from network resources and fetch requests (code < 400)
119
-
120
-
The smoke tests is defined [in this file](../test/test-e2e/__tests__/common.spec.ts).
121
112
122
113
123
114
124
115
## End to end (E2E) tests
125
116
126
117
End to end tests run in a headless browser ([Puppeteer](https://github.com/puppeteer/puppeteer)) against the full deployment on Kubernetes.
127
118
119
+
Custom configuration:
120
+
121
+
```yaml
122
+
harness:
123
+
...
124
+
test:
125
+
e2e:
126
+
# -- enable/disable e2e tests
127
+
enabled: true
128
+
# -- ignore errors on console by default
129
+
ignoreConsoleErrors: false
130
+
# -- ignore fetched resources errors by default
131
+
ignoreRequestErrors: false
132
+
# -- enable common smoke tests
133
+
smoketest: true
134
+
```
128
135
129
136
### Write tests with Jest and Puppeteer
130
137
@@ -159,7 +166,7 @@ executed, checking for:
159
166
- No errors in the console
160
167
- No error responses from network resources and fetch requests (code < 400)
161
168
162
-
The smoke tests is defined [in this file](../test/jest-puppeteer/__tests__/common.spec.ts).
169
+
The smoke tests are defined [in this file](../test/jest-puppeteer/__tests__/common.spec.ts).
163
170
164
171
165
172
## Run API and E2E tests in the CI/CD pipeline
@@ -182,7 +189,7 @@ deployment.
182
189
In order to use `harness-test` install the library with
183
190
184
191
```
185
-
pip install -r requirements-test.txt
192
+
pip install -e tools/cloudharness-test
186
193
```
187
194
188
195
In order to run tests against an existing deployment based on a domain (say, my.domain), run:
@@ -198,6 +205,25 @@ If you want to run the deployment locally and then run the tests, can use skaffo
198
205
1. Wait the deployment to settle
199
206
1. Run `harness-test PATHS`
200
207
208
+
### Tests development
209
+
The `harness-test` client is useful while developing and tweaking the tests.
210
+
In that case it's better to target the application under development and
211
+
the kind of tests we are working on.
212
+
213
+
214
+
To target a specific application for end-to-end tests, use:
215
+
```
216
+
harness-test . -i [APPNAME] -e
217
+
```
218
+
219
+
To target a specific application for api tests, use:
220
+
```
221
+
harness-test . -i [APPNAME] -a
222
+
```
223
+
224
+
Note that the local version of the openapi.yaml file located at applications/[APPNAME]/api/openapi.yaml is used if available. That's useful to tweak examples and responses
225
+
used by schemathesis to generate the test hypotheses.
0 commit comments