Skip to content

Commit 71de81b

Browse files
author
DavertMik
committed
Merge branch '3.x' into refactor/mocha-hooks
2 parents 7a513dc + eeb5a02 commit 71de81b

File tree

139 files changed

+6862
-7515
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+6862
-7515
lines changed

bin/codecept.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const commandFlags = {
3232
}
3333

3434
const errorHandler =
35-
(fn) =>
35+
fn =>
3636
async (...args) => {
3737
try {
3838
await fn(...args)
@@ -286,7 +286,7 @@ program
286286

287287
.action(require('../lib/command/run-rerun'))
288288

289-
program.on('command:*', (cmd) => {
289+
program.on('command:*', cmd => {
290290
console.log(`\nUnknown command ${cmd}\n`)
291291
program.outputHelp()
292292
})

docs/helpers/ApiDataFactory.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ delete: (id) => ({ method: 'delete', url: '/posts', data: { id } })
146146
Requests can be updated on the fly by using `onRequest` function. For instance, you can pass in current session from a cookie.
147147

148148
```js
149-
onRequest: async (request) => {
149+
onRequest: async request => {
150150
// using global codeceptjs instance
151151
let cookie = await codeceptjs.container.helpers('WebDriver').grabCookie('session')
152152
request.headers = { Cookie: `session=${cookie.value}` }

docs/helpers/Appium.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ Also capabilities can be checked by a function.
183183

184184
```js
185185
I.runOnAndroid(
186-
(caps) => {
186+
caps => {
187187
// caps is current config of desiredCapabiliites
188188
return caps.platformVersion >= 6
189189
},
@@ -222,7 +222,7 @@ In this case, code will be executed only on Android >= 6.
222222

223223
```js
224224
I.runOnAndroid(
225-
(caps) => {
225+
caps => {
226226
// caps is current config of desiredCapabiliites
227227
return caps.platformVersion >= 6
228228
},

docs/helpers/GraphQLDataFactory.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const { faker } = require('@faker-js/faker')
5858

5959
// Used with a constructor function passed to Factory, so that the final build
6060
// object matches the necessary pattern to be sent as the variables object.
61-
module.exports = new Factory((buildObj) => ({
61+
module.exports = new Factory(buildObj => ({
6262
input: { ...buildObj },
6363
}))
6464
// 'attr'-id can be left out depending on the GraphQl resolvers
@@ -137,7 +137,7 @@ Each operation must have the following:
137137
Requests can be updated on the fly by using `onRequest` function. For instance, you can pass in current session from a cookie.
138138

139139
```js
140-
onRequest: async (request) => {
140+
onRequest: async request => {
141141
// using global codeceptjs instance
142142
let cookie = await codeceptjs.container.helpers('WebDriver').grabCookie('session')
143143
request.headers = { Cookie: `session=${cookie.value}` }

docs/helpers/JSONResponse.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,14 @@ I.seeResponseMatchesJsonSchema(joi.object({
227227
228228
### seeResponseValidByCallback
229229
230-
Executes a callback function passing in `response` object and chai assertions with `expect`
230+
Executes a callback function passing in `response` object and assert
231231
Use it to perform custom checks of response data
232232
233233
```js
234-
I.seeResponseValidByCallback(({ data, status, expect }) => {
235-
expect(status).to.eql(200)
236-
expect(data).keys.to.include(['user', 'company'])
234+
I.seeResponseValidByCallback(({ data, status }) => {
235+
assert.strictEqual(status, 200)
236+
assert('user' in data)
237+
assert('company' in data)
237238
})
238239
```
239240

docs/helpers/MockRequest.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ Use `I.mockServer()` to customize which requests should be recorded and under wh
184184
185185
```js
186186
I.startMocking()
187-
I.mockServer((server) => {
187+
I.mockServer(server => {
188188
// mock request only from ap1.com and api2.com and
189189
// store recording into two different files
190190
server.any('https://api1.com/*').passthrough(false).recordingName('api1')
@@ -243,7 +243,7 @@ I.mockRequest('GET', ['/secrets', '/v2/secrets'], 403)
243243
Use PollyJS [Server Routes API][12] to declare mocks via callback function:
244244

245245
```js
246-
I.mockServer((server) => {
246+
I.mockServer(server => {
247247
// basic usage
248248
server.get('/api/v2/users').intercept((req, res) => {
249249
res.sendStatus(200).json({ users })
@@ -258,7 +258,7 @@ In record replay mode you can define which routes should be recorded and where t
258258

259259
```js
260260
I.startMocking('mock')
261-
I.mockServer((server) => {
261+
I.mockServer(server => {
262262
// record requests from cdn1.com and save them to data/recording/xml
263263
server.any('https://cdn1.com/*').passthrough(false).recordingName('xml')
264264

docs/helpers/Nightmare.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ if none provided clears all cookies.
148148

149149
```js
150150
I.clearCookie()
151-
I.clearCookie('test') // Playwright currently doesn't support clear a particular cookie name
151+
I.clearCookie('test')
152152
```
153153

154154
#### Parameters
@@ -1197,7 +1197,7 @@ I.waitForFunction(fn[, [args[, timeout]])
11971197
```js
11981198
I.waitForFunction(() => window.requests == 0)
11991199
I.waitForFunction(() => window.requests == 0, 5) // waits for 5 sec
1200-
I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and wait for 5 sec
1200+
I.waitForFunction(count => window.requests == count, [3], 5) // pass args and wait for 5 sec
12011201
```
12021202
12031203
#### Parameters

docs/helpers/Playwright.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -542,11 +542,12 @@ if none provided clears all cookies.
542542

543543
```js
544544
I.clearCookie()
545-
I.clearCookie('test') // Playwright currently doesn't support clear a particular cookie name
545+
I.clearCookie('test')
546546
```
547547

548548
#### Parameters
549549

550+
- `cookieName`  
550551
- `cookie` **[string][9]?** (optional, `null` by default) cookie name
551552

552553
### clearField
@@ -1021,7 +1022,7 @@ Get JS log from browser.
10211022

10221023
```js
10231024
const logs = await I.grabBrowserLogs()
1024-
const errors = logs.map((l) => ({ type: l.type(), text: l.text() })).filter((l) => l.type === 'error')
1025+
const errors = logs.map(l => ({ type: l.type(), text: l.text() })).filter(l => l.type === 'error')
10251026
console.log(JSON.stringify(errors))
10261027
```
10271028

@@ -1499,7 +1500,7 @@ Returns **[Promise][22]<[object][6]>** response
14991500
Mocks network request using [`browserContext.route`][30] of Playwright
15001501

15011502
```js
1502-
I.mockRoute(/(.png$)|(.jpg$)/, (route) => route.abort())
1503+
I.mockRoute(/(.png$)|(.jpg$)/, route => route.abort())
15031504
```
15041505

15051506
This method allows intercepting and mocking requests & responses. [Learn more about it][31]
@@ -2495,7 +2496,7 @@ I.waitForFunction(fn[, [args[, timeout]])
24952496
```js
24962497
I.waitForFunction(() => window.requests == 0)
24972498
I.waitForFunction(() => window.requests == 0, 5) // waits for 5 sec
2498-
I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and wait for 5 sec
2499+
I.waitForFunction(count => window.requests == count, [3], 5) // pass args and wait for 5 sec
24992500
```
25002501

25012502
#### Parameters
@@ -2553,7 +2554,7 @@ Waits for a network request.
25532554

25542555
```js
25552556
I.waitForRequest('http://example.com/resource')
2556-
I.waitForRequest((request) => request.url() === 'http://example.com' && request.method() === 'GET')
2557+
I.waitForRequest(request => request.url() === 'http://example.com' && request.method() === 'GET')
25572558
```
25582559

25592560
#### Parameters
@@ -2567,7 +2568,7 @@ Waits for a network response.
25672568

25682569
```js
25692570
I.waitForResponse('http://example.com/resource')
2570-
I.waitForResponse((response) => response.url() === 'https://example.com' && response.status() === 200)
2571+
I.waitForResponse(response => response.url() === 'https://example.com' && response.status() === 200)
25712572
```
25722573

25732574
#### Parameters

docs/helpers/Protractor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ if none provided clears all cookies.
267267

268268
```js
269269
I.clearCookie()
270-
I.clearCookie('test') // Playwright currently doesn't support clear a particular cookie name
270+
I.clearCookie('test')
271271
```
272272

273273
#### Parameters
@@ -1582,7 +1582,7 @@ I.waitForFunction(fn[, [args[, timeout]])
15821582
```js
15831583
I.waitForFunction(() => window.requests == 0)
15841584
I.waitForFunction(() => window.requests == 0, 5) // waits for 5 sec
1585-
I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and wait for 5 sec
1585+
I.waitForFunction(count => window.requests == count, [3], 5) // pass args and wait for 5 sec
15861586
```
15871587
15881588
#### Parameters

docs/helpers/Puppeteer.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ if none provided clears all cookies.
388388

389389
```js
390390
I.clearCookie()
391-
I.clearCookie('test') // Playwright currently doesn't support clear a particular cookie name
391+
I.clearCookie('test')
392392
```
393393

394394
#### Parameters
@@ -1270,7 +1270,7 @@ I.seeFile('avatar.jpg')
12701270
Mocks network request using [`Request Interception`][19]
12711271
12721272
```js
1273-
I.mockRoute(/(.png$)|(.jpg$)/, (route) => route.abort())
1273+
I.mockRoute(/(.png$)|(.jpg$)/, route => route.abort())
12741274
```
12751275
12761276
This method allows intercepting and mocking requests & responses. [Learn more about it][19]
@@ -2181,7 +2181,7 @@ I.waitForFunction(fn[, [args[, timeout]])
21812181
```js
21822182
I.waitForFunction(() => window.requests == 0)
21832183
I.waitForFunction(() => window.requests == 0, 5) // waits for 5 sec
2184-
I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and wait for 5 sec
2184+
I.waitForFunction(count => window.requests == count, [3], 5) // pass args and wait for 5 sec
21852185
```
21862186
21872187
#### Parameters
@@ -2239,7 +2239,7 @@ Waits for a network request.
22392239
22402240
```js
22412241
I.waitForRequest('http://example.com/resource')
2242-
I.waitForRequest((request) => request.url() === 'http://example.com' && request.method() === 'GET')
2242+
I.waitForRequest(request => request.url() === 'http://example.com' && request.method() === 'GET')
22432243
```
22442244
22452245
#### Parameters
@@ -2253,7 +2253,7 @@ Waits for a network response.
22532253
22542254
```js
22552255
I.waitForResponse('http://example.com/resource')
2256-
I.waitForResponse((response) => response.url() === 'http://example.com' && response.request().method() === 'GET')
2256+
I.waitForResponse(response => response.url() === 'http://example.com' && response.request().method() === 'GET')
22572257
```
22582258
22592259
#### Parameters

0 commit comments

Comments
 (0)