@@ -805,6 +805,8 @@ I.dontSeeTraffic({ name: 'Unexpected API Call of "user" endpoint', url: /api.exa
805
805
- ` opts.name ` ** [ string] [ 9 ] ** A name of that request. Can be any value. Only relevant to have a more meaningful error message in case of fail.
806
806
- ` opts.url ` ** ([ string] [ 9 ] | [ RegExp] [ 11 ] )** Expected URL of request in network traffic. Can be a string or a regular expression.
807
807
808
+ Returns ** void** automatically synchronized promise through #recorder
809
+
808
810
### doubleClick
809
811
810
812
Performs a double-click on an element matched by link|button|label|CSS or XPath.
@@ -921,6 +923,10 @@ Returns **void** automatically synchronized promise through #recorder
921
923
922
924
Resets all recorded network requests.
923
925
926
+ ``` js
927
+ I .flushNetworkTraffics ();
928
+ ```
929
+
924
930
### flushWebSocketMessages
925
931
926
932
Resets all recorded WS messages.
@@ -1309,7 +1315,7 @@ expect(traffics[0].response.status).to.equal(200);
1309
1315
expect (traffics[0 ].response .body ).to .contain ({ name: ' this was mocked' });
1310
1316
```
1311
1317
1312
- Returns ** [ Promise ] [ 22 ] & lt ; [ Array] [ 10 ] & lt ; any>> **
1318
+ Returns ** [ Array] [ 10 ] ** recorded network traffics
1313
1319
1314
1320
### grabSource
1315
1321
@@ -2096,26 +2102,26 @@ Verifies that a certain request is part of network traffic.
2096
2102
I .amOnPage (' https://openai.com/blog/chatgpt' );
2097
2103
I .startRecordingTraffic ();
2098
2104
await I .seeTraffic ({
2099
- name: ' sentry event' ,
2100
- url: ' https://images.openai.com/blob/cf717bdb-0c8c-428a-b82b-3c3add87a600' ,
2101
- parameters: {
2102
- width: ' 1919' ,
2103
- height: ' 1138' ,
2105
+ name: ' sentry event' ,
2106
+ url: ' https://images.openai.com/blob/cf717bdb-0c8c-428a-b82b-3c3add87a600' ,
2107
+ parameters: {
2108
+ width: ' 1919' ,
2109
+ height: ' 1138' ,
2104
2110
},
2105
- });
2111
+ });
2106
2112
```
2107
2113
2108
2114
``` js
2109
2115
// checking the request url contains certain post data
2110
2116
I .amOnPage (' https://openai.com/blog/chatgpt' );
2111
2117
I .startRecordingTraffic ();
2112
2118
await I .seeTraffic ({
2113
- name: ' event' ,
2114
- url: ' https://cloudflareinsights.com/cdn-cgi/rum' ,
2115
- requestPostData: {
2116
- st: 2 ,
2119
+ name: ' event' ,
2120
+ url: ' https://cloudflareinsights.com/cdn-cgi/rum' ,
2121
+ requestPostData: {
2122
+ st: 2 ,
2117
2123
},
2118
- });
2124
+ });
2119
2125
```
2120
2126
2121
2127
#### Parameters
@@ -2127,7 +2133,7 @@ await I.seeTraffic({
2127
2133
- ` opts.requestPostData ` ** [ Object] [ 6 ] ?** Expected that request contains post data in network traffic
2128
2134
- ` opts.timeout ` ** [ number] [ 20 ] ?** Timeout to wait for request in seconds. Default is 10 seconds.
2129
2135
2130
- Returns ** [ Promise ] [ 22 ] & lt ; any> **
2136
+ Returns ** void ** automatically synchronized promise through #recorder
2131
2137
2132
2138
### selectOption
2133
2139
@@ -2195,15 +2201,12 @@ I.setPlaywrightRequestHeaders({
2195
2201
2196
2202
### startRecordingTraffic
2197
2203
2198
- Starts recording the network traffics.
2199
- This also resets recorded network requests.
2204
+ Resets all recorded network requests.
2200
2205
2201
2206
``` js
2202
- I .startRecordingTraffic ();
2207
+ I .flushNetworkTraffics ();
2203
2208
```
2204
2209
2205
- Returns ** void**
2206
-
2207
2210
### startRecordingWebSocketMessages
2208
2211
2209
2212
Starts recording of websocket messages.
0 commit comments