codeceptjs 3.5.10 → 3.5.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,7 +20,7 @@ chai.use(require('chai-match-pattern'));
20
20
  *{
21
21
  * helpers: {
22
22
  * Playwright: {...},
23
- * ExpectHelper: {},
23
+ * Expect: {},
24
24
  * }
25
25
  *}
26
26
  * ```
@@ -32,7 +32,7 @@ class ExpectHelper {
32
32
  *
33
33
  * @param {*} actualValue
34
34
  * @param {*} expectedValue
35
- * @param {*} customErrorMsg
35
+ * @param {*} [customErrorMsg]
36
36
  */
37
37
  expectEqual(actualValue, expectedValue, customErrorMsg = '') {
38
38
  // @ts-ignore
@@ -44,7 +44,7 @@ class ExpectHelper {
44
44
  *
45
45
  * @param {*} actualValue
46
46
  * @param {*} expectedValue
47
- * @param {*} customErrorMsg
47
+ * @param {*} [customErrorMsg]
48
48
  */
49
49
  expectNotEqual(actualValue, expectedValue, customErrorMsg = '') {
50
50
  // @ts-ignore
@@ -56,7 +56,7 @@ class ExpectHelper {
56
56
  *
57
57
  * @param {*} actualValue
58
58
  * @param {*} expectedValue
59
- * @param {*} customErrorMsg
59
+ * @param {*} [customErrorMsg]
60
60
 
61
61
  */
62
62
  expectDeepEqual(actualValue, expectedValue, customErrorMsg = '') {
@@ -69,7 +69,7 @@ class ExpectHelper {
69
69
  *
70
70
  * @param {*} actualValue
71
71
  * @param {*} expectedValue
72
- * @param {*} customErrorMsg
72
+ * @param {*} [customErrorMsg]
73
73
  */
74
74
  expectNotDeepEqual(actualValue, expectedValue, customErrorMsg = '') {
75
75
  // @ts-ignore
@@ -81,7 +81,7 @@ class ExpectHelper {
81
81
  *
82
82
  * @param {*} actualValue
83
83
  * @param {*} expectedValueToContain
84
- * @param {*} customErrorMsg
84
+ * @param {*} [customErrorMsg]
85
85
  */
86
86
  expectContain(actualValue, expectedValueToContain, customErrorMsg = '') {
87
87
  // @ts-ignore
@@ -95,7 +95,7 @@ class ExpectHelper {
95
95
  *
96
96
  * @param {*} actualValue
97
97
  * @param {*} expectedValueToNotContain
98
- * @param {*} customErrorMsg
98
+ * @param {*} [customErrorMsg]
99
99
  */
100
100
  expectNotContain(
101
101
  actualValue,
@@ -113,7 +113,7 @@ class ExpectHelper {
113
113
  *
114
114
  * @param {*} actualValue
115
115
  * @param {*} expectedValueToStartWith
116
- * @param {*} customErrorMsg
116
+ * @param {*} [customErrorMsg]
117
117
  */
118
118
  expectStartsWith(actualValue, expectedValueToStartWith, customErrorMsg = '') {
119
119
  // @ts-ignore
@@ -127,7 +127,7 @@ class ExpectHelper {
127
127
  *
128
128
  * @param {*} actualValue
129
129
  * @param {*} expectedValueToNotStartWith
130
- * @param {*} customErrorMsg
130
+ * @param {*} [customErrorMsg]
131
131
  */
132
132
  expectNotStartsWith(
133
133
  actualValue,
@@ -144,7 +144,7 @@ class ExpectHelper {
144
144
  /**
145
145
  * @param {*} actualValue
146
146
  * @param {*} expectedValueToEndWith
147
- * @param {*} customErrorMsg
147
+ * @param {*} [customErrorMsg]
148
148
  */
149
149
  expectEndsWith(actualValue, expectedValueToEndWith, customErrorMsg = '') {
150
150
  // @ts-ignore
@@ -157,7 +157,7 @@ class ExpectHelper {
157
157
  /**
158
158
  * @param {*} actualValue
159
159
  * @param {*} expectedValueToNotEndWith
160
- * @param {*} customErrorMsg
160
+ * @param {*} [customErrorMsg]
161
161
  */
162
162
  expectNotEndsWith(
163
163
  actualValue,
@@ -174,7 +174,7 @@ class ExpectHelper {
174
174
  /**
175
175
  * @param {*} targetData
176
176
  * @param {*} jsonSchema
177
- * @param {*} customErrorMsg
177
+ * @param {*} [customErrorMsg]
178
178
  */
179
179
  expectJsonSchema(targetData, jsonSchema, customErrorMsg = '') {
180
180
  // @ts-ignore
@@ -186,7 +186,7 @@ class ExpectHelper {
186
186
  /**
187
187
  * @param {*} targetData
188
188
  * @param {*} jsonSchema
189
- * @param {*} customErrorMsg
189
+ * @param {*} [customErrorMsg]
190
190
  * @param {*} ajvOptions Pass AJV options
191
191
  */
192
192
  expectJsonSchemaUsingAJV(
@@ -204,7 +204,7 @@ class ExpectHelper {
204
204
  /**
205
205
  * @param {*} targetData
206
206
  * @param {*} propertyName
207
- * @param {*} customErrorMsg
207
+ * @param {*} [customErrorMsg]
208
208
  */
209
209
  expectHasProperty(targetData, propertyName, customErrorMsg = '') {
210
210
  // @ts-ignore
@@ -215,7 +215,7 @@ class ExpectHelper {
215
215
  /**
216
216
  * @param {*} targetData
217
217
  * @param {*} propertyName
218
- * @param {*} customErrorMsg
218
+ * @param {*} [customErrorMsg]
219
219
  */
220
220
  expectHasAProperty(targetData, propertyName, customErrorMsg = '') {
221
221
  // @ts-ignore
@@ -226,7 +226,7 @@ class ExpectHelper {
226
226
  /**
227
227
  * @param {*} targetData
228
228
  * @param {*} type
229
- * @param {*} customErrorMsg
229
+ * @param {*} [customErrorMsg]
230
230
  */
231
231
  expectToBeA(targetData, type, customErrorMsg = '') {
232
232
  // @ts-ignore
@@ -237,7 +237,7 @@ class ExpectHelper {
237
237
  /**
238
238
  * @param {*} targetData
239
239
  * @param {*} type
240
- * @param {*} customErrorMsg
240
+ * @param {*} [customErrorMsg]
241
241
  */
242
242
  expectToBeAn(targetData, type, customErrorMsg = '') {
243
243
  // @ts-ignore
@@ -248,7 +248,7 @@ class ExpectHelper {
248
248
  /**
249
249
  * @param {*} targetData
250
250
  * @param {*} regex
251
- * @param {*} customErrorMsg
251
+ * @param {*} [customErrorMsg]
252
252
  */
253
253
  expectMatchRegex(targetData, regex, customErrorMsg = '') {
254
254
  // @ts-ignore
@@ -259,7 +259,7 @@ class ExpectHelper {
259
259
  /**
260
260
  * @param {*} targetData
261
261
  * @param {*} length
262
- * @param {*} customErrorMsg
262
+ * @param {*} [customErrorMsg]
263
263
  */
264
264
  expectLengthOf(targetData, length, customErrorMsg = '') {
265
265
  // @ts-ignore
@@ -269,7 +269,7 @@ class ExpectHelper {
269
269
 
270
270
  /**
271
271
  * @param {*} targetData
272
- * @param {*} customErrorMsg
272
+ * @param {*} [customErrorMsg]
273
273
  */
274
274
  expectEmpty(targetData, customErrorMsg = '') {
275
275
  // @ts-ignore
@@ -279,7 +279,7 @@ class ExpectHelper {
279
279
 
280
280
  /**
281
281
  * @param {*} targetData
282
- * @param {*} customErrorMsg
282
+ * @param {*} [customErrorMsg]
283
283
  */
284
284
  expectTrue(targetData, customErrorMsg = '') {
285
285
  // @ts-ignore
@@ -289,7 +289,7 @@ class ExpectHelper {
289
289
 
290
290
  /**
291
291
  * @param {*} targetData
292
- * @param {*} customErrorMsg
292
+ * @param {*} [customErrorMsg]
293
293
  */
294
294
  expectFalse(targetData, customErrorMsg = '') {
295
295
  // @ts-ignore
@@ -299,8 +299,8 @@ class ExpectHelper {
299
299
 
300
300
  /**
301
301
  * @param {*} targetData
302
- * @param {*} aboveThan number | Date
303
- * @param {*} customErrorMsg
302
+ * @param {*} aboveThan
303
+ * @param {*} [customErrorMsg]
304
304
  */
305
305
  expectAbove(targetData, aboveThan, customErrorMsg = '') {
306
306
  // @ts-ignore
@@ -310,8 +310,8 @@ class ExpectHelper {
310
310
 
311
311
  /**
312
312
  * @param {*} targetData
313
- * @param {*} belowThan number | Date
314
- * @param {*} customErrorMsg
313
+ * @param {*} belowThan
314
+ * @param {*} [customErrorMsg]
315
315
  */
316
316
  expectBelow(targetData, belowThan, customErrorMsg = '') {
317
317
  // @ts-ignore
@@ -322,7 +322,7 @@ class ExpectHelper {
322
322
  /**
323
323
  * @param {*} targetData
324
324
  * @param {*} lengthAboveThan
325
- * @param {*} customErrorMsg
325
+ * @param {*} [customErrorMsg]
326
326
  */
327
327
  expectLengthAboveThan(targetData, lengthAboveThan, customErrorMsg = '') {
328
328
  // @ts-ignore
@@ -335,7 +335,7 @@ class ExpectHelper {
335
335
  /**
336
336
  * @param {*} targetData
337
337
  * @param {*} lengthBelowThan
338
- * @param {*} customErrorMsg
338
+ * @param {*} [customErrorMsg]
339
339
  */
340
340
  expectLengthBelowThan(targetData, lengthBelowThan, customErrorMsg = '') {
341
341
  // @ts-ignore
@@ -348,7 +348,7 @@ class ExpectHelper {
348
348
  /**
349
349
  * @param {*} actualValue
350
350
  * @param {*} expectedValue
351
- * @param {*} customErrorMsg
351
+ * @param {*} [customErrorMsg]
352
352
  */
353
353
  expectEqualIgnoreCase(actualValue, expectedValue, customErrorMsg = '') {
354
354
  // @ts-ignore
@@ -362,7 +362,7 @@ class ExpectHelper {
362
362
  * expects members of two arrays are deeply equal
363
363
  * @param {*} actualValue
364
364
  * @param {*} expectedValue
365
- * @param {*} customErrorMsg
365
+ * @param {*} [customErrorMsg]
366
366
  */
367
367
  expectDeepMembers(actualValue, expectedValue, customErrorMsg = '') {
368
368
  // @ts-ignore
@@ -376,7 +376,7 @@ class ExpectHelper {
376
376
  * expects an array to be a superset of another array
377
377
  * @param {*} superset
378
378
  * @param {*} set
379
- * @param {*} customErrorMsg
379
+ * @param {*} [customErrorMsg]
380
380
  */
381
381
  expectDeepIncludeMembers(superset, set, customErrorMsg = '') {
382
382
  // @ts-ignore
@@ -391,7 +391,7 @@ class ExpectHelper {
391
391
  * @param {*} actualValue
392
392
  * @param {*} expectedValue
393
393
  * @param {*} fieldsToExclude
394
- * @param {*} customErrorMsg
394
+ * @param {*} [customErrorMsg]
395
395
  */
396
396
  expectDeepEqualExcluding(
397
397
  actualValue,
@@ -410,7 +410,7 @@ class ExpectHelper {
410
410
  * expects a JSON object matches a provided pattern
411
411
  * @param {*} actualValue
412
412
  * @param {*} expectedPattern
413
- * @param {*} customErrorMsg
413
+ * @param {*} [customErrorMsg]
414
414
  */
415
415
  expectMatchesPattern(actualValue, expectedPattern, customErrorMsg = '') {
416
416
  // @ts-ignore
@@ -33,7 +33,7 @@ const ElementNotFound = require('./errors/ElementNotFound');
33
33
  const RemoteBrowserConnectionRefused = require('./errors/RemoteBrowserConnectionRefused');
34
34
  const Popup = require('./extras/Popup');
35
35
  const Console = require('./extras/Console');
36
- const findReact = require('./extras/React');
36
+ const { findReact, findVue } = require('./extras/PlaywrightReactVueLocator');
37
37
 
38
38
  let playwright;
39
39
  let perfTiming;
@@ -666,7 +666,7 @@ class Playwright extends Helper {
666
666
  * ```
667
667
  *
668
668
  * @param {string} description used to show in logs.
669
- * @param {function} fn async function that executed with Playwright helper as argumen
669
+ * @param {function} fn async function that executed with Playwright helper as arguments
670
670
  */
671
671
  usePlaywrightTo(description, fn) {
672
672
  return this._useTo(...arguments);
@@ -946,10 +946,9 @@ class Playwright extends Helper {
946
946
  }
947
947
 
948
948
  /**
949
- * {{> resizeWindow }}
950
949
  *
951
950
  * Unlike other drivers Playwright changes the size of a viewport, not the window!
952
- * Playwright does not control the window of a browser so it can't adjust its real size.
951
+ * Playwright does not control the window of a browser, so it can't adjust its real size.
953
952
  * It also can't maximize a window.
954
953
  *
955
954
  * Update configuration to change real window size on start:
@@ -959,6 +958,8 @@ class Playwright extends Helper {
959
958
  * // @codeceptjs/configure package must be installed
960
959
  * { setWindowSize } = require('@codeceptjs/configure');
961
960
  * ````
961
+ *
962
+ * {{> resizeWindow }}
962
963
  */
963
964
  async resizeWindow(width, height) {
964
965
  if (width === 'maximize') {
@@ -1058,8 +1059,6 @@ class Playwright extends Helper {
1058
1059
  }
1059
1060
 
1060
1061
  /**
1061
- * {{> dragAndDrop }}
1062
- * @param {any} [options] [Additional options](https://playwright.dev/docs/api/class-page#page-drag-and-drop) can be passed as 3rd argument.
1063
1062
  *
1064
1063
  * ```js
1065
1064
  * // specify coordinates for source position
@@ -1067,6 +1066,10 @@ class Playwright extends Helper {
1067
1066
  * ```
1068
1067
  *
1069
1068
  * > When no option is set, custom drag and drop would be used, to use the dragAndDrop API from Playwright, please set options, for example `force: true`
1069
+ *
1070
+ * {{> dragAndDrop }}
1071
+ * @param {any} [options] [Additional options](https://playwright.dev/docs/api/class-page#page-drag-and-drop) can be passed as 3rd argument.
1072
+ *
1070
1073
  */
1071
1074
  async dragAndDrop(srcElement, destElement, options) {
1072
1075
  const src = new Locator(srcElement);
@@ -1514,7 +1517,7 @@ class Playwright extends Helper {
1514
1517
  *
1515
1518
  * @param {any} [options] [Additional options](https://playwright.dev/docs/api/class-page#page-click) for click available as 3rd argument.
1516
1519
  *
1517
- * Examples:
1520
+ * @example
1518
1521
  *
1519
1522
  * ```js
1520
1523
  * // click on element at position
@@ -1547,8 +1550,6 @@ class Playwright extends Helper {
1547
1550
 
1548
1551
  /**
1549
1552
  * {{> doubleClick }}
1550
- *
1551
- *
1552
1553
  */
1553
1554
  async doubleClick(locator, context = null) {
1554
1555
  return proceedClick.call(this, locator, context, { clickCount: 2 });
@@ -1556,15 +1557,12 @@ class Playwright extends Helper {
1556
1557
 
1557
1558
  /**
1558
1559
  * {{> rightClick }}
1559
- *
1560
- *
1561
1560
  */
1562
1561
  async rightClick(locator, context = null) {
1563
1562
  return proceedClick.call(this, locator, context, { button: 'right' });
1564
1563
  }
1565
1564
 
1566
1565
  /**
1567
- * {{> checkOption }}
1568
1566
  *
1569
1567
  * [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-check) for check available as 3rd argument.
1570
1568
  *
@@ -1575,6 +1573,9 @@ class Playwright extends Helper {
1575
1573
  * I.checkOption('Agree', '.signup', { position: { x: 5, y: 5 } })
1576
1574
  * ```
1577
1575
  * > ⚠️ To avoid flakiness, option `force: true` is set by default
1576
+ *
1577
+ * {{> checkOption }}
1578
+ *
1578
1579
  */
1579
1580
  async checkOption(field, context = null, options = { force: true }) {
1580
1581
  const elm = await this._locateCheckable(field, context);
@@ -1583,7 +1584,6 @@ class Playwright extends Helper {
1583
1584
  }
1584
1585
 
1585
1586
  /**
1586
- * {{> uncheckOption }}
1587
1587
  *
1588
1588
  * [Additional options](https://playwright.dev/docs/api/class-elementhandle#element-handle-uncheck) for uncheck available as 3rd argument.
1589
1589
  *
@@ -1594,6 +1594,8 @@ class Playwright extends Helper {
1594
1594
  * I.uncheckOption('Agree', '.signup', { position: { x: 5, y: 5 } })
1595
1595
  * ```
1596
1596
  * > ⚠️ To avoid flakiness, option `force: true` is set by default
1597
+ *
1598
+ * {{> uncheckOption }}
1597
1599
  */
1598
1600
  async uncheckOption(field, context = null, options = { force: true }) {
1599
1601
  const elm = await this._locateCheckable(field, context);
@@ -1634,9 +1636,10 @@ class Playwright extends Helper {
1634
1636
  }
1635
1637
 
1636
1638
  /**
1637
- * {{> pressKeyWithKeyNormalization }}
1638
1639
  *
1639
1640
  * _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/Puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
1641
+ *
1642
+ * {{> pressKeyWithKeyNormalization }}
1640
1643
  */
1641
1644
  async pressKey(key) {
1642
1645
  const modifiers = [];
@@ -1728,8 +1731,6 @@ class Playwright extends Helper {
1728
1731
 
1729
1732
  /**
1730
1733
  * {{> appendField }}
1731
- *
1732
- *
1733
1734
  */
1734
1735
  async appendField(field, value) {
1735
1736
  const els = await findFields.call(this, field);
@@ -1953,9 +1954,9 @@ class Playwright extends Helper {
1953
1954
  }
1954
1955
 
1955
1956
  /**
1956
- * {{> grabCookie }}
1957
- *
1958
1957
  * Returns cookie in JSON format. If name not passed returns all cookies for this domain.
1958
+ *
1959
+ * {{> grabCookie }}
1959
1960
  */
1960
1961
  async grabCookie(name) {
1961
1962
  const cookies = await this.browserContext.cookies();
@@ -1986,8 +1987,8 @@ class Playwright extends Helper {
1986
1987
  * ```js
1987
1988
  * I.executeScript(({x, y}) => x + y, {x, y});
1988
1989
  * ```
1989
- * You can pass only one parameter into a function
1990
- * but you can pass in array or object.
1990
+ * You can pass only one parameter into a function,
1991
+ * or you can pass in array or object.
1991
1992
  *
1992
1993
  * ```js
1993
1994
  * I.executeScript(([x, y]) => x + y, [x, y]);
@@ -2167,7 +2168,8 @@ class Playwright extends Helper {
2167
2168
  let chunked = chunkArray(attrs, values.length);
2168
2169
  chunked = chunked.filter((val) => {
2169
2170
  for (let i = 0; i < val.length; ++i) {
2170
- if (!val[i].includes(values[i])) return false;
2171
+ // if the attribute doesn't exist, returns false as well
2172
+ if (!val[i] || !val[i].includes(values[i])) return false;
2171
2173
  }
2172
2174
  return true;
2173
2175
  });
@@ -2493,9 +2495,9 @@ class Playwright extends Helper {
2493
2495
  }
2494
2496
 
2495
2497
  /**
2496
- * {{> waitForVisible }}
2497
- *
2498
2498
  * This method accepts [React selectors](https://codecept.io/react).
2499
+ *
2500
+ * {{> waitForVisible }}
2499
2501
  */
2500
2502
  async waitForVisible(locator, sec) {
2501
2503
  const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
@@ -3260,7 +3262,7 @@ class Playwright extends Helper {
3260
3262
  /**
3261
3263
  * Returns all URLs of all network requests recorded so far during execution of test scenario.
3262
3264
  *
3263
- * @return {string} List of URLs recorded as a string, seperaeted by new lines after each URL
3265
+ * @return {string} List of URLs recorded as a string, separated by new lines after each URL
3264
3266
  * @private
3265
3267
  */
3266
3268
  _getTrafficDump() {
@@ -3442,6 +3444,7 @@ function buildLocatorString(locator) {
3442
3444
 
3443
3445
  async function findElements(matcher, locator) {
3444
3446
  if (locator.react) return findReact(matcher, locator);
3447
+ if (locator.vue) return findVue(matcher, locator);
3445
3448
  locator = new Locator(locator, 'css');
3446
3449
 
3447
3450
  return matcher.locator(buildLocatorString(locator)).all();
@@ -3503,6 +3506,7 @@ async function proceedClick(locator, context = null, options = {}) {
3503
3506
 
3504
3507
  async function findClickable(matcher, locator) {
3505
3508
  if (locator.react) return findReact(matcher, locator);
3509
+ if (locator.vue) return findVue(matcher, locator);
3506
3510
 
3507
3511
  locator = new Locator(locator);
3508
3512
  if (!locator.isFuzzy()) return findElements.call(this, matcher, locator);
@@ -259,6 +259,7 @@ class Puppeteer extends Helper {
259
259
  headless: !this.options.show,
260
260
  ...this._getOptions(config),
261
261
  };
262
+ if (this.puppeteerOptions.headless) this.puppeteerOptions.headless = 'new';
262
263
  this.isRemoteBrowser = !!this.puppeteerOptions.browserWSEndpoint;
263
264
  popupStore.defaultAction = this.options.defaultPopupAction;
264
265
  }
@@ -684,11 +685,13 @@ class Puppeteer extends Helper {
684
685
  }
685
686
 
686
687
  /**
687
- * {{> resizeWindow }}
688
688
  *
689
689
  * Unlike other drivers Puppeteer changes the size of a viewport, not the window!
690
- * Puppeteer does not control the window of a browser so it can't adjust its real size.
690
+ * Puppeteer does not control the window of a browser, so it can't adjust its real size.
691
691
  * It also can't maximize a window.
692
+ *
693
+ * {{> resizeWindow }}
694
+ *
692
695
  */
693
696
  async resizeWindow(width, height) {
694
697
  if (width === 'maximize') {
@@ -740,7 +743,8 @@ class Puppeteer extends Helper {
740
743
  assertElementExists(els, locator, 'Element to focus');
741
744
  const el = els[0];
742
745
 
743
- await focusElement(el, this.page);
746
+ await el.click();
747
+ await el.focus();
744
748
  return this._waitForAction();
745
749
  }
746
750
 
@@ -880,7 +884,7 @@ class Puppeteer extends Helper {
880
884
  }
881
885
 
882
886
  /**
883
- * Find a checkbox by providing human readable text:
887
+ * Find a checkbox by providing human-readable text:
884
888
  * NOTE: Assumes the checkable element exists
885
889
  *
886
890
  * ```js
@@ -895,7 +899,7 @@ class Puppeteer extends Helper {
895
899
  }
896
900
 
897
901
  /**
898
- * Find a clickable element by providing human readable text:
902
+ * Find a clickable element by providing human-readable text:
899
903
  *
900
904
  * ```js
901
905
  * this.helpers['Puppeteer']._locateClickable('Next page').then // ...
@@ -907,7 +911,7 @@ class Puppeteer extends Helper {
907
911
  }
908
912
 
909
913
  /**
910
- * Find field elements by providing human readable text:
914
+ * Find field elements by providing human-readable text:
911
915
  *
912
916
  * ```js
913
917
  * this.helpers['Puppeteer']._locateFields('Your email').then // ...
@@ -1119,7 +1123,7 @@ class Puppeteer extends Helper {
1119
1123
  * Sets a directory to where save files. Allows to test file downloads.
1120
1124
  * Should be used with [FileSystem helper](https://codecept.io/helpers/FileSystem) to check that file were downloaded correctly.
1121
1125
  *
1122
- * By default files are saved to `output/downloads`.
1126
+ * By default, files are saved to `output/downloads`.
1123
1127
  * This directory is cleaned on every `handleDownloads` call, to ensure no old files are kept.
1124
1128
  *
1125
1129
  * ```js
@@ -1291,9 +1295,9 @@ class Puppeteer extends Helper {
1291
1295
  }
1292
1296
 
1293
1297
  /**
1294
- * {{> pressKeyWithKeyNormalization }}
1295
- *
1296
1298
  * _Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/puppeteer#1313](https://github.com/GoogleChrome/puppeteer/issues/1313)).
1299
+ *
1300
+ * {{> pressKeyWithKeyNormalization }}
1297
1301
  */
1298
1302
  async pressKey(key) {
1299
1303
  const modifiers = [];
@@ -1395,9 +1399,9 @@ class Puppeteer extends Helper {
1395
1399
  }
1396
1400
 
1397
1401
  /**
1398
- * {{> attachFile }}
1399
- *
1400
1402
  * > ⚠ There is an [issue with file upload in Puppeteer 2.1.0 & 2.1.1](https://github.com/puppeteer/puppeteer/issues/5420), downgrade to 2.0.0 if you face it.
1403
+ *
1404
+ * {{> attachFile }}
1401
1405
  */
1402
1406
  async attachFile(locator, pathToFile) {
1403
1407
  const file = path.join(global.codecept_dir, pathToFile);
@@ -1628,9 +1632,9 @@ class Puppeteer extends Helper {
1628
1632
  }
1629
1633
 
1630
1634
  /**
1631
- * {{> executeScript }}
1635
+ * If a function returns a Promise, tt will wait for its resolution.
1632
1636
  *
1633
- * If a function returns a Promise It will wait for it resolution.
1637
+ * {{> executeScript }}
1634
1638
  */
1635
1639
  async executeScript(...args) {
1636
1640
  let context = this.page;
@@ -1641,9 +1645,8 @@ class Puppeteer extends Helper {
1641
1645
  }
1642
1646
 
1643
1647
  /**
1644
- * {{> executeAsyncScript }}
1645
- *
1646
1648
  * Asynchronous scripts can also be executed with `executeScript` if a function returns a Promise.
1649
+ * {{> executeAsyncScript }}
1647
1650
  */
1648
1651
  async executeAsyncScript(...args) {
1649
1652
  const asyncFn = function () {
@@ -1822,7 +1825,8 @@ class Puppeteer extends Helper {
1822
1825
  for (let i = 0; i < val.length; ++i) {
1823
1826
  const _actual = Number.isNaN(val[i]) || (typeof values[i]) === 'string' ? val[i] : Number.parseInt(values[i], 10);
1824
1827
  const _expected = Number.isNaN(values[i]) || (typeof values[i]) === 'string' ? values[i] : Number.parseInt(values[i], 10);
1825
- if (!_actual.includes(_expected)) return false;
1828
+ // if the attribute doesn't exist, returns false as well
1829
+ if (!_actual || !_actual.includes(_expected)) return false;
1826
1830
  }
1827
1831
  return true;
1828
1832
  });
@@ -2092,7 +2096,7 @@ class Puppeteer extends Helper {
2092
2096
  /**
2093
2097
  * {{> waitForVisible }}
2094
2098
  *
2095
- * This method accepts [React selectors](https://codecept.io/react).
2099
+ * {{ react }}
2096
2100
  */
2097
2101
  async waitForVisible(locator, sec) {
2098
2102
  const waitTimeout = sec ? sec * 1000 : this.options.waitForTimeout;
@@ -2321,9 +2325,9 @@ class Puppeteer extends Helper {
2321
2325
  }
2322
2326
 
2323
2327
  /**
2324
- * Waits for navigation to finish. By default takes configured `waitForNavigation` option.
2328
+ * Waits for navigation to finish. By default, takes configured `waitForNavigation` option.
2325
2329
  *
2326
- * See [Pupeteer's reference](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagewaitfornavigationoptions)
2330
+ * See [Puppeteer's reference](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagewaitfornavigationoptions)
2327
2331
  *
2328
2332
  * @param {*} opts
2329
2333
  */