codeceptjs 3.0.3 → 3.0.7

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.
Files changed (64) hide show
  1. package/CHANGELOG.md +114 -18
  2. package/bin/codecept.js +1 -0
  3. package/docs/basics.md +2 -2
  4. package/docs/bdd.md +12 -1
  5. package/docs/build/Appium.js +2 -1
  6. package/docs/build/GraphQL.js +9 -10
  7. package/docs/build/Nightmare.js +4 -5
  8. package/docs/build/Playwright.js +164 -37
  9. package/docs/build/Protractor.js +1 -1
  10. package/docs/build/Puppeteer.js +1 -1
  11. package/docs/build/REST.js +24 -4
  12. package/docs/build/TestCafe.js +1 -1
  13. package/docs/build/WebDriver.js +85 -17
  14. package/docs/changelog.md +114 -18
  15. package/docs/data.md +5 -5
  16. package/docs/detox.md +2 -2
  17. package/docs/docker.md +11 -11
  18. package/docs/email.md +8 -8
  19. package/docs/helpers/Appium.md +1 -1
  20. package/docs/helpers/Nightmare.md +4 -5
  21. package/docs/helpers/Playwright.md +94 -64
  22. package/docs/helpers/Protractor.md +1 -1
  23. package/docs/helpers/Puppeteer.md +1 -1
  24. package/docs/helpers/REST.md +9 -0
  25. package/docs/helpers/TestCafe.md +1 -1
  26. package/docs/helpers/WebDriver.md +2 -1
  27. package/docs/locators.md +29 -2
  28. package/docs/mobile-react-native-locators.md +2 -2
  29. package/docs/mobile.md +3 -3
  30. package/docs/nightmare.md +0 -5
  31. package/docs/pageobjects.md +3 -1
  32. package/docs/parallel.md +35 -10
  33. package/docs/playwright.md +55 -8
  34. package/docs/plugins.md +73 -29
  35. package/docs/reports.md +8 -7
  36. package/docs/typescript.md +47 -5
  37. package/docs/webapi/fillField.mustache +1 -1
  38. package/lib/cli.js +25 -10
  39. package/lib/codecept.js +9 -1
  40. package/lib/command/interactive.js +10 -9
  41. package/lib/command/run.js +1 -1
  42. package/lib/command/workers/runTests.js +11 -6
  43. package/lib/config.js +8 -3
  44. package/lib/event.js +2 -0
  45. package/lib/helper/Appium.js +1 -0
  46. package/lib/helper/GraphQL.js +9 -10
  47. package/lib/helper/Nightmare.js +1 -1
  48. package/lib/helper/Playwright.js +131 -38
  49. package/lib/helper/REST.js +24 -4
  50. package/lib/helper/WebDriver.js +84 -16
  51. package/lib/interfaces/gherkin.js +11 -4
  52. package/lib/output.js +7 -4
  53. package/lib/plugin/allure.js +3 -7
  54. package/lib/plugin/fakerTransform.js +51 -0
  55. package/lib/plugin/screenshotOnFail.js +6 -2
  56. package/lib/recorder.js +9 -0
  57. package/lib/step.js +2 -1
  58. package/lib/transform.js +26 -0
  59. package/lib/ui.js +6 -2
  60. package/lib/within.js +1 -1
  61. package/lib/workers.js +39 -25
  62. package/package.json +14 -9
  63. package/typings/index.d.ts +49 -21
  64. package/typings/types.d.ts +72 -26
@@ -396,6 +396,7 @@ class WebDriver extends Helper {
396
396
  this.isRunning = false;
397
397
  this.sessionWindows = {};
398
398
  this.activeSessionName = '';
399
+ this.customLocatorStrategies = config.customLocatorStrategies;
399
400
 
400
401
  this._setConfig(config);
401
402
 
@@ -503,6 +504,33 @@ class WebDriver extends Helper {
503
504
  }
504
505
  }
505
506
 
507
+ _lookupCustomLocator(customStrategy) {
508
+ if (typeof (this.customLocatorStrategies) !== 'object') {
509
+ return null;
510
+ }
511
+ const strategy = this.customLocatorStrategies[customStrategy];
512
+ return typeof (strategy) === 'function' ? strategy : null;
513
+ }
514
+
515
+ _isCustomLocator(locator) {
516
+ const locatorObj = new Locator(locator);
517
+ if (locatorObj.isCustom()) {
518
+ const customLocator = this._lookupCustomLocator(locatorObj.type);
519
+ if (customLocator) {
520
+ return true;
521
+ }
522
+ throw new Error('Please define "customLocatorStrategies" as an Object and the Locator Strategy as a "function".');
523
+ }
524
+ return false;
525
+ }
526
+
527
+ async _res(locator) {
528
+ const res = (this._isShadowLocator(locator) || this._isCustomLocator(locator))
529
+ ? await this._locate(locator)
530
+ : await this.$$(withStrictLocator(locator));
531
+ return res;
532
+ }
533
+
506
534
  async _startBrowser() {
507
535
  try {
508
536
  if (this.options.multiremote) {
@@ -530,9 +558,22 @@ class WebDriver extends Helper {
530
558
  await this._resizeWindowIfNeeded(this.browser, this.options.windowSize);
531
559
 
532
560
  this.$$ = this.browser.$$.bind(this.browser);
561
+
562
+ if (this._isCustomLocatorStrategyDefined()) {
563
+ Object.keys(this.customLocatorStrategies).forEach(async (customLocator) => {
564
+ this.debugSection('Weddriver', `adding custom locator strategy: ${customLocator}`);
565
+ const locatorFunction = this._lookupCustomLocator(customLocator);
566
+ this.browser.addLocatorStrategy(customLocator, locatorFunction);
567
+ });
568
+ }
569
+
533
570
  return this.browser;
534
571
  }
535
572
 
573
+ _isCustomLocatorStrategyDefined() {
574
+ return this.customLocatorStrategies && Object.keys(this.customLocatorStrategies).length;
575
+ }
576
+
536
577
  async _stopBrowser() {
537
578
  if (this.browser && this.isRunning) await this.browser.deleteSession();
538
579
  }
@@ -718,7 +759,7 @@ class WebDriver extends Helper {
718
759
  * @param {object} locator
719
760
  */
720
761
  async _smartWait(locator) {
721
- this.debugSection(`SmartWait (${this.options.smartWait}ms)`, `Locating ${locator} in ${this.options.smartWait}`);
762
+ this.debugSection(`SmartWait (${this.options.smartWait}ms)`, `Locating ${JSON.stringify(locator)} in ${this.options.smartWait}`);
722
763
  await this.defineTimeout({ implicit: this.options.smartWait });
723
764
  }
724
765
 
@@ -755,17 +796,34 @@ class WebDriver extends Helper {
755
796
  }
756
797
 
757
798
  if (!this.options.smartWait || !smartWait) {
799
+ if (this._isCustomLocator(locator)) {
800
+ const locatorObj = new Locator(locator);
801
+ return this.browser.custom$$(locatorObj.type, locatorObj.value);
802
+ }
803
+
758
804
  const els = await this.$$(withStrictLocator(locator));
759
805
  return els;
760
806
  }
761
807
 
762
808
  await this._smartWait(locator);
763
809
 
810
+ if (this._isCustomLocator(locator)) {
811
+ const locatorObj = new Locator(locator);
812
+ return this.browser.custom$$(locatorObj.type, locatorObj.value);
813
+ }
814
+
764
815
  const els = await this.$$(withStrictLocator(locator));
765
816
  await this.defineTimeout({ implicit: 0 });
766
817
  return els;
767
818
  }
768
819
 
820
+ _grabCustomLocator(locator) {
821
+ if (typeof locator === 'string') {
822
+ locator = new Locator(locator);
823
+ }
824
+ return locator.value ? locator.value : locator.custom;
825
+ }
826
+
769
827
  /**
770
828
  * Find a checkbox by providing human readable text:
771
829
  *
@@ -1076,9 +1134,10 @@ class WebDriver extends Helper {
1076
1134
  * I.fillField({css: 'form#login input[name=username]'}, 'John');
1077
1135
  * ```
1078
1136
  * @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
1079
- * @param {string} value text value to fill.
1137
+ * @param {CodeceptJS.StringOrSecret} value text value to fill.
1080
1138
  *
1081
1139
  * {{ react }}
1140
+ * {{ custom }}
1082
1141
  *
1083
1142
  */
1084
1143
  async fillField(field, value) {
@@ -1723,7 +1782,7 @@ class WebDriver extends Helper {
1723
1782
  *
1724
1783
  */
1725
1784
  async seeElementInDOM(locator) {
1726
- const res = await this.$$(withStrictLocator(locator));
1785
+ const res = await this._res(locator);
1727
1786
  return empty('elements').negate(res);
1728
1787
  }
1729
1788
 
@@ -1738,7 +1797,7 @@ class WebDriver extends Helper {
1738
1797
  *
1739
1798
  */
1740
1799
  async dontSeeElementInDOM(locator) {
1741
- const res = await this.$$(withStrictLocator(locator));
1800
+ const res = await this._res(locator);
1742
1801
  return empty('elements').assert(res);
1743
1802
  }
1744
1803
 
@@ -1785,7 +1844,7 @@ class WebDriver extends Helper {
1785
1844
  */
1786
1845
  async grabBrowserLogs() {
1787
1846
  if (this.browser.isW3C) {
1788
- this.debug('Logs not awailable in W3C specification');
1847
+ this.debug('Logs not available in W3C specification');
1789
1848
  return;
1790
1849
  }
1791
1850
  return this.browser.getLogs('browser');
@@ -2787,7 +2846,7 @@ class WebDriver extends Helper {
2787
2846
  }, aSec * 1000, `element (${new Locator(locator)}) still not enabled after ${aSec} sec`);
2788
2847
  }
2789
2848
  return this.browser.waitUntil(async () => {
2790
- const res = await this.$$(withStrictLocator(locator));
2849
+ const res = await this._res(locator);
2791
2850
  if (!res || res.length === 0) {
2792
2851
  return false;
2793
2852
  }
@@ -2823,7 +2882,7 @@ class WebDriver extends Helper {
2823
2882
  }, aSec * 1000, `element (${locator}) still not present on page after ${aSec} sec`);
2824
2883
  }
2825
2884
  return this.browser.waitUntil(async () => {
2826
- const res = await this.$$(withStrictLocator(locator));
2885
+ const res = await this._res(locator);
2827
2886
  return res && res.length;
2828
2887
  }, { timeout: aSec * 1000, timeoutMsg: `element (${locator}) still not present on page after ${aSec} sec` });
2829
2888
  }
@@ -3046,9 +3105,7 @@ class WebDriver extends Helper {
3046
3105
  }, aSec * 1000, `element (${new Locator(locator)}) still not visible after ${aSec} sec`);
3047
3106
  }
3048
3107
  return this.browser.waitUntil(async () => {
3049
- const res = (this._isShadowLocator(locator))
3050
- ? await this._locate(withStrictLocator(locator))
3051
- : await this.$$(withStrictLocator(locator));
3108
+ const res = await this._res(locator);
3052
3109
  if (!res || res.length === 0) return false;
3053
3110
  const selected = await forEachAsync(res, async el => el.isDisplayed());
3054
3111
  if (Array.isArray(selected)) {
@@ -3083,7 +3140,7 @@ class WebDriver extends Helper {
3083
3140
  }, aSec * 1000, `The number of elements (${new Locator(locator)}) is not ${num} after ${aSec} sec`);
3084
3141
  }
3085
3142
  return this.browser.waitUntil(async () => {
3086
- const res = await this.$$(withStrictLocator(locator));
3143
+ const res = await this._res(locator);
3087
3144
  if (!res || res.length === 0) return false;
3088
3145
  let selected = await forEachAsync(res, async el => el.isDisplayed());
3089
3146
 
@@ -3115,7 +3172,7 @@ class WebDriver extends Helper {
3115
3172
  }, aSec * 1000, `element (${new Locator(locator)}) still visible after ${aSec} sec`);
3116
3173
  }
3117
3174
  return this.browser.waitUntil(async () => {
3118
- const res = await this.$$(withStrictLocator(locator));
3175
+ const res = await this._res(locator);
3119
3176
  if (!res || res.length === 0) return true;
3120
3177
  const selected = await forEachAsync(res, async el => el.isDisplayed());
3121
3178
  return !selected.length;
@@ -3152,7 +3209,7 @@ class WebDriver extends Helper {
3152
3209
  const aSec = sec || this.options.waitForTimeout;
3153
3210
  if (isWebDriver5()) {
3154
3211
  return this.browser.waitUntil(async () => {
3155
- const res = await this.$$(withStrictLocator(locator));
3212
+ const res = await this._res(locator);
3156
3213
  if (!res || res.length === 0) {
3157
3214
  return true;
3158
3215
  }
@@ -3160,7 +3217,7 @@ class WebDriver extends Helper {
3160
3217
  }, aSec * 1000, `element (${new Locator(locator)}) still on page after ${aSec} sec`);
3161
3218
  }
3162
3219
  return this.browser.waitUntil(async () => {
3163
- const res = await this.$$(withStrictLocator(locator));
3220
+ const res = await this._res(locator);
3164
3221
  if (!res || res.length === 0) {
3165
3222
  return true;
3166
3223
  }
@@ -3563,12 +3620,9 @@ async function proceedSee(assertType, text, context, strict = false) {
3563
3620
  }
3564
3621
 
3565
3622
  const smartWaitEnabled = assertType === 'assert';
3566
-
3567
3623
  const res = await this._locate(withStrictLocator(context), smartWaitEnabled);
3568
3624
  assertElementExists(res, context);
3569
-
3570
3625
  const selected = await forEachAsync(res, async el => this.browser.getElementText(getElementId(el)));
3571
-
3572
3626
  if (strict) {
3573
3627
  if (Array.isArray(selected) && selected.length !== 0) {
3574
3628
  return selected.map(elText => equals(description)[assertType](text, elText));
@@ -3636,6 +3690,11 @@ async function filterAsync(array, callback) {
3636
3690
 
3637
3691
  async function findClickable(locator, locateFn) {
3638
3692
  locator = new Locator(locator);
3693
+
3694
+ if (this._isCustomLocator(locator)) {
3695
+ return locateFn(locator.value);
3696
+ }
3697
+
3639
3698
  if (locator.isAccessibilityId() && !this.isWeb) return locateFn(locator, true);
3640
3699
  if (!locator.isFuzzy()) return locateFn(locator, true);
3641
3700
 
@@ -3657,6 +3716,10 @@ async function findClickable(locator, locateFn) {
3657
3716
  async function findFields(locator) {
3658
3717
  locator = new Locator(locator);
3659
3718
 
3719
+ if (this._isCustomLocator(locator)) {
3720
+ return this._locate(locator);
3721
+ }
3722
+
3660
3723
  if (locator.isAccessibilityId() && !this.isWeb) return this._locate(locator, true);
3661
3724
  if (!locator.isFuzzy()) return this._locate(locator, true);
3662
3725
 
@@ -3762,6 +3825,10 @@ async function findCheckable(locator, locateFn) {
3762
3825
  let els;
3763
3826
  locator = new Locator(locator);
3764
3827
 
3828
+ if (this._isCustomLocator(locator)) {
3829
+ return locateFn(locator.value);
3830
+ }
3831
+
3765
3832
  if (locator.isAccessibilityId() && !this.isWeb) return locateFn(locator, true);
3766
3833
  if (!locator.isFuzzy()) return locateFn(locator, true);
3767
3834
 
@@ -3807,6 +3874,7 @@ function getElementId(el) {
3807
3874
  if (el.ELEMENT) {
3808
3875
  return el.ELEMENT;
3809
3876
  }
3877
+
3810
3878
  return null;
3811
3879
  }
3812
3880
 
package/docs/changelog.md CHANGED
@@ -7,29 +7,125 @@ layout: Section
7
7
 
8
8
  # Releases
9
9
 
10
+ ## 3.0.7
11
+
12
+ Documentation fixes:
13
+ * Remove broken link from `Nightmare helper`. See [#2860](https://github.com/codeceptjs/CodeceptJS/issues/2860) by **[Arhell](https://github.com/Arhell)**
14
+ * Fixed broken links in `playwright.md`. See [#2848](https://github.com/codeceptjs/CodeceptJS/issues/2848) by **[johnhoodjr](https://github.com/johnhoodjr)**
15
+ * Fix mocha-multi config example. See [#2881](https://github.com/codeceptjs/CodeceptJS/issues/2881) by **[rimesc](https://github.com/rimesc)**
16
+ * Fix small errors in email documentation file. See [#2884](https://github.com/codeceptjs/CodeceptJS/issues/2884) by **[mkrtchian](https://github.com/mkrtchian)**
17
+ * Improve documentation for `Sharing Data Between Workers` section. See [#2891](https://github.com/codeceptjs/CodeceptJS/issues/2891) by **[ngraf](https://github.com/ngraf)**
18
+
19
+ Features:
20
+ * **[WebDriver]** Shadow DOM Support for `Webdriver`. See [#2741](https://github.com/codeceptjs/CodeceptJS/issues/2741) by **[gkushang](https://github.com/gkushang)**
21
+ * [Release management] Introduce the versioning automatically, it follows the semantics versioning. See [#2883](https://github.com/codeceptjs/CodeceptJS/issues/2883) by **[PeterNgTr](https://github.com/PeterNgTr)**
22
+ * Adding opts into `Scenario.skip` that it would be useful for building reports. See [#2867](https://github.com/codeceptjs/CodeceptJS/issues/2867) by **[AlexKo4](https://github.com/AlexKo4)**
23
+ * Added support for attaching screenshots to [cucumberJsonReporter](https://github.com/ktryniszewski-mdsol/codeceptjs-cucumber-json-reporter) See [#2888](https://github.com/codeceptjs/CodeceptJS/issues/2888) by **[fijijavis](https://github.com/fijijavis)**
24
+ * Supported config file for `codeceptjs shell` command. See [#2895](https://github.com/codeceptjs/CodeceptJS/issues/2895) by **[PeterNgTr](https://github.com/PeterNgTr)**:
25
+
26
+ ```
27
+ npx codeceptjs shell -c foo.conf.js
28
+ ```
29
+
30
+ Bug fixes:
31
+ * **[GraphQL]** Use a helper-specific instance of Axios to avoid contaminating global defaults. See [#2868](https://github.com/codeceptjs/CodeceptJS/issues/2868) by **[vanvoljg](https://github.com/vanvoljg)**
32
+ * A default system color is used when passing non supported system color when using I.say(). See [#2874](https://github.com/codeceptjs/CodeceptJS/issues/2874) by **[PeterNgTr](https://github.com/PeterNgTr)**
33
+ * **[Playwright]** Avoid the timout due to calling the click on invisible elements. See [#2875](https://github.com/codeceptjs/CodeceptJS/issues/2875) by cbayer97
34
+
35
+
36
+ ## 3.0.6
37
+
38
+ * **[Playwright]** Added `electron` as a browser to config. See [#2834](https://github.com/codeceptjs/CodeceptJS/issues/2834) by **[cbayer97](https://github.com/cbayer97)**
39
+ * **[Playwright]** Implemented `launchPersistentContext` to be able to launch persistent remote browsers. See [#2817](https://github.com/codeceptjs/CodeceptJS/issues/2817) by **[brunoqueiros](https://github.com/brunoqueiros)**. Fixes [#2376](https://github.com/codeceptjs/CodeceptJS/issues/2376).
40
+ * Fixed printing logs and stack traces for `run-workers`. See [#2857](https://github.com/codeceptjs/CodeceptJS/issues/2857) by **[haveac1gar](https://github.com/haveac1gar)**. Fixes [#2621](https://github.com/codeceptjs/CodeceptJS/issues/2621), [#2852](https://github.com/codeceptjs/CodeceptJS/issues/2852)
41
+ * Emit custom messages from worker to the main thread. See [#2824](https://github.com/codeceptjs/CodeceptJS/issues/2824) by **[jccguimaraes](https://github.com/jccguimaraes)**
42
+ * Improved workers processes output. See [#2804](https://github.com/codeceptjs/CodeceptJS/issues/2804) by **[drfiresign](https://github.com/drfiresign)**
43
+ * BDD. Added ability to use an array of feature files inside config in `gherkin.features`. See [#2814](https://github.com/codeceptjs/CodeceptJS/issues/2814) by **[jbergeronjr](https://github.com/jbergeronjr)**
44
+
45
+ ```js
46
+ "features": [
47
+ "./features/*.feature",
48
+ "./features/api_features/*.feature"
49
+ ],
50
+ ```
51
+ * Added `getQueueId` to reporter to rerun a specific promise. See [#2837](https://github.com/codeceptjs/CodeceptJS/issues/2837) by **[jonatask](https://github.com/jonatask)**
52
+ * **Added `fakerTransform` plugin** to use faker data in Gherkin scenarios. See [#2854](https://github.com/codeceptjs/CodeceptJS/issues/2854) by **[adrielcodeco](https://github.com/adrielcodeco)**
53
+
54
+ ```feature
55
+ Scenario Outline: ...
56
+ Given ...
57
+ When ...
58
+ Then ...
59
+
60
+ Examples:
61
+ | productName | customer | email | anythingMore |
62
+ | {{commerce.product}} | Dr. {{name.findName}} | {{internet.email}} | staticData |
63
+ ```
64
+ * **[REST]** Use class instance of axios, not the global instance, to avoid contaminating global configuration. [#2846](https://github.com/codeceptjs/CodeceptJS/issues/2846) by **[vanvoljg](https://github.com/vanvoljg)**
65
+ * **[Appium]** Added `tunnelIdentifier` config option to provide tunnel for SauceLabs. See [#2832](https://github.com/codeceptjs/CodeceptJS/issues/2832) by **[gurjeetbains](https://github.com/gurjeetbains)**
66
+
67
+ ## 3.0.5
68
+
69
+
70
+ Features:
71
+
72
+ * **[Official Docker image for CodeceptJS v3](https://hub.docker.com/r/codeceptjs/codeceptjs)**. New Docker image is based on official Playwright image and supports Playwright, Puppeteer, WebDriver engines. Thanks **[VikentyShevyrin](https://github.com/VikentyShevyrin)**
73
+ * Better support for Typescript `codecept.conf.ts` configuration files. See [#2750](https://github.com/codeceptjs/CodeceptJS/issues/2750) by **[elaichenkov](https://github.com/elaichenkov)**
74
+ * Propagate more events for custom parallel script. See [#2796](https://github.com/codeceptjs/CodeceptJS/issues/2796) by **[jccguimaraes](https://github.com/jccguimaraes)**
75
+ * [mocha-junit-reporter] Now supports attachments, see documentation for details. See [#2675](https://github.com/codeceptjs/CodeceptJS/issues/2675) by **[Shard](https://github.com/Shard)**
76
+ * CustomLocators interface for TypeScript to extend from LocatorOrString. See [#2798](https://github.com/codeceptjs/CodeceptJS/issues/2798) by **[danielrentz](https://github.com/danielrentz)**
77
+ * **[REST]** Mask sensitive data from log messages.
78
+ ```js
79
+ I.sendPatchRequest('/api/users.json', secret({ "email": "user@user.com" }));
80
+ ```
81
+ See [#2786](https://github.com/codeceptjs/CodeceptJS/issues/2786) by **[PeterNgTr](https://github.com/PeterNgTr)**
82
+
83
+ Bug fixes:
84
+ * Fixed reporting of nested steps with PageObjects and BDD scenarios. See [#2800](https://github.com/codeceptjs/CodeceptJS/issues/2800) by **[davertmik](https://github.com/davertmik)**. Fixes [#2720](https://github.com/codeceptjs/CodeceptJS/issues/2720) [#2682](https://github.com/codeceptjs/CodeceptJS/issues/2682)
85
+ * Fixed issue with `codeceptjs shell` which was broken since 3.0.0. See [#2743](https://github.com/codeceptjs/CodeceptJS/issues/2743) by **[stedman](https://github.com/stedman)**
86
+ * **[Gherkin]** Fixed issue suppressed or hidden errors in tests. See [#2745](https://github.com/codeceptjs/CodeceptJS/issues/2745) by **[ktryniszewski-mdsol](https://github.com/ktryniszewski-mdsol)**
87
+ * **[Playwright]** fix grabCssPropertyFromAll serialization by using property names. See [#2757](https://github.com/codeceptjs/CodeceptJS/issues/2757) by **[elaichenkov](https://github.com/elaichenkov)**
88
+ * **[Allure]** fix report for multi sessions. See [#2771](https://github.com/codeceptjs/CodeceptJS/issues/2771) by **[cbayer97](https://github.com/cbayer97)**
89
+ * **[WebDriver]** Fix locator object debug log messages in smart wait. See 2748 by **[elaichenkov](https://github.com/elaichenkov)**
90
+
91
+ Documentation fixes:
92
+ * Fixed some broken examples. See [#2756](https://github.com/codeceptjs/CodeceptJS/issues/2756) by **[danielrentz](https://github.com/danielrentz)**
93
+ * Fixed Typescript typings. See [#2747](https://github.com/codeceptjs/CodeceptJS/issues/2747), [#2758](https://github.com/codeceptjs/CodeceptJS/issues/2758) and [#2769](https://github.com/codeceptjs/CodeceptJS/issues/2769) by **[elaichenkov](https://github.com/elaichenkov)**
94
+ * Added missing type for xFeature. See [#2754](https://github.com/codeceptjs/CodeceptJS/issues/2754) by **[PeterNgTr](https://github.com/PeterNgTr)**
95
+ * Fixed code example in Page Object documentation. See [#2793](https://github.com/codeceptjs/CodeceptJS/issues/2793) by **[mkrtchian](https://github.com/mkrtchian)**
96
+
97
+ Library updates:
98
+ * Updated Axios to 0.21.1. See by **[sseide](https://github.com/sseide)**
99
+ * Updated **[pollyjs](https://github.com/pollyjs)**/core **[pollyjs](https://github.com/pollyjs)**/adapter-puppeteer. See [#2760](https://github.com/codeceptjs/CodeceptJS/issues/2760) by **[Anikethana](https://github.com/Anikethana)**
100
+
101
+ ## 3.0.4
102
+
103
+ * **Hotfix** Fixed `init` script by adding `cross-spawn` package. By **[vipulgupta2048](https://github.com/vipulgupta2048)**
104
+ * Fixed handling error during initialization of `run-multiple`. See [#2730](https://github.com/codeceptjs/CodeceptJS/issues/2730) by **[wagoid](https://github.com/wagoid)**
105
+
10
106
  ## 3.0.3
11
107
 
12
108
  * **Playwright 1.7 support**
13
- * **[Playwright]** Fixed handling null context in click. See [#2667](https://github.com/codeceptjs/CodeceptJS/issues/2667) by **[matthewjf](https://github.com/matthewjf)**
14
- * **[Playwright]** Fixed `Cannot read property '$$' of null` when locating elements. See [#2713](https://github.com/codeceptjs/CodeceptJS/issues/2713) by **[matthewjf](https://github.com/matthewjf)**
109
+ * **[Playwright]** Fixed handling null context in click. See [#2667](https://github.com/codeceptjs/CodeceptJS/issues/2667) by **[matthewjf](https://github.com/matthewjf)**
110
+ * **[Playwright]** Fixed `Cannot read property '$$' of null` when locating elements. See [#2713](https://github.com/codeceptjs/CodeceptJS/issues/2713) by **[matthewjf](https://github.com/matthewjf)**
15
111
  * Command `npx codeceptjs init` improved
16
112
  * auto-installing required packages
17
113
  * better error messages
18
114
  * fixed generating type definitions
19
- * Data Driven Tests improvements: instead of having one skipped test for data driven scenarios when using xData you get a skipped test for each entry in the data table. See [#2698](https://github.com/codeceptjs/CodeceptJS/issues/2698) by **[Georgegriff](https://github.com/Georgegriff)**
20
- * **[Puppeteer]** Fixed that `waitForFunction` was not working with number values. See [#2703](https://github.com/codeceptjs/CodeceptJS/issues/2703) by **[MumblesNZ](https://github.com/MumblesNZ)**
115
+ * Data Driven Tests improvements: instead of having one skipped test for data driven scenarios when using xData you get a skipped test for each entry in the data table. See [#2698](https://github.com/codeceptjs/CodeceptJS/issues/2698) by **[Georgegriff](https://github.com/Georgegriff)**
116
+ * **[Puppeteer]** Fixed that `waitForFunction` was not working with number values. See [#2703](https://github.com/codeceptjs/CodeceptJS/issues/2703) by **[MumblesNZ](https://github.com/MumblesNZ)**
21
117
  * Enabled autocompletion for custom helpers. [#2695](https://github.com/codeceptjs/CodeceptJS/issues/2695) by **[PeterNgTr](https://github.com/PeterNgTr)**
22
118
  * Emit test.after on workers. Fix [#2693](https://github.com/codeceptjs/CodeceptJS/issues/2693) by **[jccguimaraes](https://github.com/jccguimaraes)**
23
- * TypeScript: Allow .ts config files. See [#2708](https://github.com/codeceptjs/CodeceptJS/issues/2708) by **[elukoyanov](https://github.com/elukoyanov)**
119
+ * TypeScript: Allow .ts config files. See [#2708](https://github.com/codeceptjs/CodeceptJS/issues/2708) by **[elukoyanov](https://github.com/elukoyanov)**
24
120
  * Fixed definitions generation errors by **[elukoyanov](https://github.com/elukoyanov)**. See [#2707](https://github.com/codeceptjs/CodeceptJS/issues/2707) and [#2718](https://github.com/codeceptjs/CodeceptJS/issues/2718)
25
121
  * Fixed handing error in _after function; for example, browser is closed during test and tests executions is stopped, but error was not logged. See [#2715](https://github.com/codeceptjs/CodeceptJS/issues/2715) by **[elukoyanov](https://github.com/elukoyanov)**
26
122
  * Emit hook.failed in workers. Fix [#2723](https://github.com/codeceptjs/CodeceptJS/issues/2723) by **[jccguimaraes](https://github.com/jccguimaraes)**
27
- * [wdio plugin] Added `seleniumArgs` and `seleniumInstallArgs` config options for plugin. See [#2687](https://github.com/codeceptjs/CodeceptJS/issues/2687) by **[andrerleao](https://github.com/andrerleao)**
123
+ * [wdio plugin] Added `seleniumArgs` and `seleniumInstallArgs` config options for plugin. See [#2687](https://github.com/codeceptjs/CodeceptJS/issues/2687) by **[andrerleao](https://github.com/andrerleao)**
28
124
  * [allure plugin] Added `addParameter` method in [#2717](https://github.com/codeceptjs/CodeceptJS/issues/2717) by **[jancorvus](https://github.com/jancorvus)**. Fixes [#2716](https://github.com/codeceptjs/CodeceptJS/issues/2716)
29
- * Added mocha-based `--reporter-options` and `--reporter <name>` commands to `run-workers` command by in [#2691](https://github.com/codeceptjs/CodeceptJS/issues/2691) **[Ameterezu](https://github.com/Ameterezu)**
30
- * Fixed infinite loop for junit reports. See [#2691](https://github.com/codeceptjs/CodeceptJS/issues/2691) **[Ameterezu](https://github.com/Ameterezu)**
31
- * Added status, start/end time, and match line for BDD steps. See [#2678](https://github.com/codeceptjs/CodeceptJS/issues/2678) by **[ktryniszewski-mdsol](https://github.com/ktryniszewski-mdsol)**
32
- * [stepByStepReport plugin] Fixed "helper.saveScreenshot is not a function". Fix [#2688](https://github.com/codeceptjs/CodeceptJS/issues/2688) by **[andrerleao](https://github.com/andrerleao)**
125
+ * Added mocha-based `--reporter-options` and `--reporter <name>` commands to `run-workers` command by in [#2691](https://github.com/codeceptjs/CodeceptJS/issues/2691) **[Ameterezu](https://github.com/Ameterezu)**
126
+ * Fixed infinite loop for junit reports. See [#2691](https://github.com/codeceptjs/CodeceptJS/issues/2691) **[Ameterezu](https://github.com/Ameterezu)**
127
+ * Added status, start/end time, and match line for BDD steps. See [#2678](https://github.com/codeceptjs/CodeceptJS/issues/2678) by **[ktryniszewski-mdsol](https://github.com/ktryniszewski-mdsol)**
128
+ * [stepByStepReport plugin] Fixed "helper.saveScreenshot is not a function". Fix [#2688](https://github.com/codeceptjs/CodeceptJS/issues/2688) by **[andrerleao](https://github.com/andrerleao)**
33
129
 
34
130
 
35
131
 
@@ -37,21 +133,21 @@ layout: Section
37
133
 
38
134
  * **[Playwright]** Fix connection close with remote browser. See [#2629](https://github.com/codeceptjs/CodeceptJS/issues/2629) by **[dipiash](https://github.com/dipiash)**
39
135
  * **[REST]** set maxUploadFileSize when performing api calls. See [#2611](https://github.com/codeceptjs/CodeceptJS/issues/2611) by **[PeterNgTr](https://github.com/PeterNgTr)**
40
- * Duplicate Scenario names (combined with Feature name) are now detected via a warning message.
136
+ * Duplicate Scenario names (combined with Feature name) are now detected via a warning message.
41
137
  Duplicate test names can cause `codeceptjs run-workers` to not function. See [#2656](https://github.com/codeceptjs/CodeceptJS/issues/2656) by **[Georgegriff](https://github.com/Georgegriff)**
42
138
  * Documentation fixes
43
139
 
44
140
  Bug Fixes:
45
141
  * --suites flag now should function correctly for `codeceptjs run-workers`. See [#2655](https://github.com/codeceptjs/CodeceptJS/issues/2655) by **[Georgegriff](https://github.com/Georgegriff)**
46
142
  * [autoLogin plugin] Login methods should now function as expected with `codeceptjs run-workers`. See [#2658](https://github.com/codeceptjs/CodeceptJS/issues/2658) by **[Georgegriff](https://github.com/Georgegriff)**, resolves [#2620](https://github.com/codeceptjs/CodeceptJS/issues/2620)
47
-
143
+
48
144
 
49
145
 
50
146
  ## 3.0.1
51
147
 
52
148
  ♨️ Hot fix:
53
149
  * Lock the mocha version to avoid the errors. See [#2624](https://github.com/codeceptjs/CodeceptJS/issues/2624) by PeterNgTr
54
-
150
+
55
151
  🐛 Bug Fix:
56
152
  * Fixed error handling in Scenario.js. See [#2607](https://github.com/codeceptjs/CodeceptJS/issues/2607) by haveac1gar
57
153
  * Changing type definition in order to allow the use of functions with any number of any arguments. See [#2616](https://github.com/codeceptjs/CodeceptJS/issues/2616) by akoltun
@@ -74,9 +170,9 @@ Scenario('title', (I, loginPage) => {});
74
170
  Scenario('title', ({ I, loginPage }) => {});
75
171
  ```
76
172
 
77
- * **BREAKING** Replaced bootstrap/teardown scripts to accept only functions or async functions. Async function with callback (with done parameter) should be replaced with async/await. [See our upgrde guide](https://bit.ly/codecept3Up).
173
+ * **BREAKING** Replaced bootstrap/teardown scripts to accept only functions or async functions. Async function with callback (with done parameter) should be replaced with async/await. [See our upgrade guide](https://bit.ly/codecept3Up).
78
174
  * **[TypeScript guide](/typescript)** and [boilerplate project](https://github.com/codeceptjs/typescript-boilerplate)
79
- * [tryTo](/plugins/#tryTo) and [pauseOnFail](/plugins/#pauseOnFail) plugins installed by default
175
+ * [tryTo](/plugins/#tryto) and [pauseOnFail](/plugins/#pauseOnFail) plugins installed by default
80
176
  * Introduced one-line installer:
81
177
 
82
178
  ```
@@ -202,9 +298,9 @@ tryTo(() => I.click('Accept', '.cookies'));
202
298
  ## 2.6.11
203
299
 
204
300
  * **[Playwright]** Playwright 1.4 compatibility
205
- * **[Playwright]** Added `ignoreHTTPSErrors` config option (default: false). See [#2566](https://github.com/codeceptjs/CodeceptJS/issues/2566) by gurjeetbains
206
- * Added French translation by **[vimar](https://github.com/vimar)**
207
- * **[WebDriver]** Updated `dragSlider` to work in WebDriver W3C protocol. Fixes [#2557](https://github.com/codeceptjs/CodeceptJS/issues/2557) by suniljaiswal01
301
+ * **[Playwright]** Added `ignoreHTTPSErrors` config option (default: false). See [#2566](https://github.com/codeceptjs/CodeceptJS/issues/2566) by gurjeetbains
302
+ * Added French translation by **[vimar](https://github.com/vimar)**
303
+ * **[WebDriver]** Updated `dragSlider` to work in WebDriver W3C protocol. Fixes [#2557](https://github.com/codeceptjs/CodeceptJS/issues/2557) by suniljaiswal01
208
304
 
209
305
  ## 2.6.10
210
306
 
package/docs/data.md CHANGED
@@ -154,8 +154,8 @@ Scenario('check post page', async ({ I }) => {
154
154
  // cleanup created data
155
155
  After(({ I }) => {
156
156
  I.sendMutation(
157
- 'mutation deletePost($permalink: /ID!) { deletePost(permalink: /$id) }',
158
- { permalink: /postData.id},
157
+ 'mutation deletePost($id: ID!) { deletePost(id: $id) }',
158
+ { id: postData.id},
159
159
  );
160
160
  });
161
161
  ```
@@ -196,7 +196,7 @@ The way for setting data for a test is as simple as writing:
196
196
  ```js
197
197
  // inside async function
198
198
  let post = await I.have('post');
199
- I.haveMultiple('comment', 5, { postpermalink: /post.id});
199
+ I.haveMultiple('comment', 5, { postId: post.id});
200
200
  ```
201
201
 
202
202
  After completing the preparations under 'Data Generation with Factories', create a factory module which will export a factory.
@@ -248,7 +248,7 @@ This way for setting data for a test is as simple as writing:
248
248
  ```js
249
249
  // inside async function
250
250
  let post = await I.mutateData('createPost');
251
- I.mutateMultiple('createComment', 5, { postpermalink: /post.id});
251
+ I.mutateMultiple('createComment', 5, { postId: post.id});
252
252
  ```
253
253
 
254
254
 
@@ -288,7 +288,7 @@ GraphQLDataFactory: {
288
288
  query: 'mutation createUser($input: UserInput!) { createUser(input: $input) { id name }}',
289
289
  factory: './factories/users',
290
290
  revert: (data) => ({
291
- query: 'mutation deleteUser($permalink: /ID!) { deleteUser(permalink: /$id) }',
291
+ query: 'mutation deleteUser($id: ID!) { deleteUser(id: $id) }',
292
292
  variables: { id : data.id},
293
293
  }),
294
294
  },
package/docs/detox.md CHANGED
@@ -179,7 +179,7 @@ If element differs on on iOS and Android you can use **cross platform locators**
179
179
  ```js
180
180
  // locate element by text on Android
181
181
  // locate element by accessibility id on iOS
182
- I.click({ android: /'Start', ios: '~start' });
182
+ I.click({ android: 'Start', ios: '~start' });
183
183
  ```
184
184
 
185
185
  When application behavior differs on Android and iOS use platform-specific actions:
@@ -207,7 +207,7 @@ Scenario('save in application', ({ I }) => {
207
207
  I.fillField('#text', 'a new text');
208
208
  I.see('a new text', '#textValue');
209
209
  I.dontSeeElement('#createdAndVisibleText');
210
- I.click({ ios: '#GoButton', android: /'Button' });
210
+ I.click({ ios: '#GoButton', android: 'Button' });
211
211
  I.waitForElement('#createdAndVisibleText', 20);
212
212
  I.seeElement('#createdAndVisibleText');
213
213
  I.runOnAndroid(() => {
package/docs/docker.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Codeceptjs Docker
2
2
 
3
- CodeceptJS packed into container with the Nightmare, Protractor, Puppeteer, and WebDriver drivers.
3
+ CodeceptJS has an [official docker image](https://hub.docker.com/r/codeceptjs/codeceptjs) based on Playwright image. Image supports Playwright, Puppeteer, and WebDriver engines.
4
4
 
5
5
  ## How to Use
6
6
 
@@ -16,17 +16,17 @@ CodeceptJS runner is available inside container as `codeceptjs`.
16
16
  You can execute CodeceptJS with Puppeteer or Nightmare locally with no extra configuration.
17
17
 
18
18
  ```sh
19
- docker run --net=host -v $PWD:/tests codeception/codeceptjs
19
+ docker run --net=host -v $PWD:/tests codeceptjs/codeceptjs
20
20
  ```
21
21
 
22
22
  To customize execution call `codeceptjs` command:
23
23
 
24
24
  ```sh
25
25
  # run tests with steps
26
- docker run --net=host -v $PWD:/tests codeception/codeceptjs codeceptjs run --steps
26
+ docker run --net=host -v $PWD:/tests codeceptjs/codeceptjs codeceptjs run --steps
27
27
 
28
28
  # run tests with @user in a name
29
- docker run --net=host -v $PWD:/tests codeception/codeceptjs codeceptjs run --grep "@user"
29
+ docker run --net=host -v $PWD:/tests codeceptjs/codeceptjs codeceptjs run --grep "@user"
30
30
  ```
31
31
 
32
32
 
@@ -36,7 +36,7 @@ docker run --net=host -v $PWD:/tests codeception/codeceptjs codeceptjs run --gre
36
36
  version: '2'
37
37
  services:
38
38
  codeceptjs:
39
- image: codeception/codeceptjs
39
+ image: codeceptjs/codeceptjs
40
40
  depends_on:
41
41
  - firefox
42
42
  - web
@@ -75,7 +75,7 @@ $ docker run -d -P --name selenium-chrome selenium/standalone-chrome
75
75
 
76
76
  # Alternatively, selenium/standalone-firefox can be used
77
77
 
78
- $ docker run -it --rm -v /<path_to_codeceptjs_test_dir>/:/tests/ --link selenium-chrome:selenium codeception/codeceptjs
78
+ $ docker run -it --rm -v /<path_to_codeceptjs_test_dir>/:/tests/ --link selenium-chrome:selenium codeceptjs/codeceptjs
79
79
  ```
80
80
 
81
81
  You may run use `-v $(pwd)/:tests/` if running this from the root of your CodeceptJS tests directory.
@@ -87,7 +87,7 @@ _Note: If running with the Nightmare driver, it is not necessary to run a seleni
87
87
  To build this image:
88
88
 
89
89
  ```sh
90
- docker build -t codeception/codeceptjs .
90
+ docker build -t codeceptjs/codeceptjs .
91
91
  ```
92
92
 
93
93
  * this directory will be added as `/codecept` insde container
@@ -97,7 +97,7 @@ docker build -t codeception/codeceptjs .
97
97
  To build this image with your desired Node version:
98
98
 
99
99
  ```sh
100
- docker build -t codeception/codeceptjs . --build-arg NODE_VERSION=12.10.0
100
+ docker build -t codeceptjs/codeceptjs . --build-arg NODE_VERSION=12.10.0
101
101
  ```
102
102
 
103
103
  ### Passing Options
@@ -105,7 +105,7 @@ docker build -t codeception/codeceptjs . --build-arg NODE_VERSION=12.10.0
105
105
  Options can be passed by calling `codeceptjs`:
106
106
 
107
107
  ```
108
- docker run -v $PWD:/tests codeception/codeceptjs codeceptjs run --debug
108
+ docker run -v $PWD:/tests codeceptjs/codeceptjs codeceptjs run --debug
109
109
  ```
110
110
 
111
111
  Alternatively arguments to `codecept run` command can be passed via `CODECEPT_ARGS` environment variable. For example to run your tests with debug
@@ -115,7 +115,7 @@ output:
115
115
  version: '2'
116
116
  services:
117
117
  codeceptjs:
118
- image: codeception/codeceptjs
118
+ image: codeceptjs/codeceptjs
119
119
  environment:
120
120
  - CODECEPT_ARGS=--debug
121
121
  volumes:
@@ -128,7 +128,7 @@ You can also use `run-workers`to run tests by passing `NO_OF_WORKERS`, additiona
128
128
  version: '2'
129
129
  services:
130
130
  codeceptjs:
131
- image: codeception/codeceptjs
131
+ image: codeceptjs/codeceptjs
132
132
  environment:
133
133
  - NO_OF_WORKERS=3
134
134
  - CODECEPT_ARGS=--debug