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: API.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@
16
16
|`launch`|`Object`[puppeteer.launch options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions)|launches new browser and returns browser object|
17
17
|`connect`|`Object`[puppeteer.connect options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerconnectoptions)|Attaches to an existing browser instance and returns browser object|
18
18
|`freezeImage`|`string`|Selector name of a `<img>` tag containing animated image to be freezed before taking screenshot|
19
+
|`mockRequests`|`Object`|Runs chrome headless browser in isolation using [Mockeer](https://github.com/NimaSoroush/Mockeer)|
@@ -158,6 +160,44 @@ To Create/Update reference screenshots, simply set environment variable `update=
158
160
> update=true node test.js
159
161
```
160
162
163
+
## Mocking browser requests
164
+
Differencify uses [Mockeer](https://github.com/NimaSoroush/Mockeer) to run chrome headless browser in isolation. This will help with more consistent and stable results when it comes dealing with a website that has inconsistent downstream dependencies. (e.g. unique API call returns different results based on request time). More details [here](https://github.com/NimaSoroush/Mockeer)
165
+
166
+
To use this feature call `mockRequests` during your tests.
More examples [here](src/integration.tests/integration.test.js)
200
+
161
201
## Debugging
162
202
It is possible to debug your tests execution by passing `debug:true` as global config in Differencify class. See full list of configs [below](https://github.com/NimaSoroush/differencify#globaloptions)
0 commit comments