codeceptjs 2.4.3 → 2.6.2

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 (76) hide show
  1. package/CHANGELOG.md +117 -0
  2. package/README.md +32 -7
  3. package/bin/codecept.js +3 -0
  4. package/docs/basics.md +11 -5
  5. package/docs/bdd.md +4 -4
  6. package/docs/build/MockRequest.js +3 -0
  7. package/docs/build/Nightmare.js +10 -2
  8. package/docs/build/Playwright.js +3187 -0
  9. package/docs/build/Protractor.js +16 -2
  10. package/docs/build/Puppeteer.js +126 -19
  11. package/docs/build/REST.js +3 -1
  12. package/docs/build/TestCafe.js +11 -3
  13. package/docs/build/WebDriver.js +361 -28
  14. package/docs/changelog.md +116 -0
  15. package/docs/configuration.md +2 -2
  16. package/docs/custom-helpers.md +55 -10
  17. package/docs/helpers/Appium.md +81 -1
  18. package/docs/helpers/MockRequest.md +281 -38
  19. package/docs/helpers/Nightmare.md +10 -2
  20. package/docs/helpers/Playwright.md +1770 -0
  21. package/docs/helpers/Protractor.md +15 -3
  22. package/docs/helpers/Puppeteer-firefox.md +32 -1
  23. package/docs/helpers/Puppeteer.md +126 -76
  24. package/docs/helpers/TestCafe.md +10 -2
  25. package/docs/helpers/WebDriver.md +208 -118
  26. package/docs/locators.md +2 -0
  27. package/docs/playwright.md +306 -0
  28. package/docs/plugins.md +103 -0
  29. package/docs/reports.md +12 -0
  30. package/docs/shadow.md +68 -0
  31. package/docs/visual.md +0 -73
  32. package/docs/webapi/forceClick.mustache +27 -0
  33. package/docs/webapi/seeInPopup.mustache +7 -0
  34. package/docs/webapi/setCookie.mustache +10 -2
  35. package/docs/webapi/type.mustache +12 -0
  36. package/docs/webdriver.md +7 -3
  37. package/lib/codecept.js +1 -1
  38. package/lib/command/definitions.js +2 -2
  39. package/lib/command/generate.js +4 -4
  40. package/lib/command/gherkin/snippets.js +4 -4
  41. package/lib/command/init.js +1 -1
  42. package/lib/command/interactive.js +3 -0
  43. package/lib/command/run-multiple.js +2 -2
  44. package/lib/command/run-rerun.js +2 -0
  45. package/lib/command/run-workers.js +22 -8
  46. package/lib/command/run.js +2 -0
  47. package/lib/command/workers/runTests.js +1 -0
  48. package/lib/container.js +1 -1
  49. package/lib/event.js +2 -0
  50. package/lib/helper/MockRequest.js +3 -0
  51. package/lib/helper/Playwright.js +2422 -0
  52. package/lib/helper/Protractor.js +1 -2
  53. package/lib/helper/Puppeteer.js +84 -19
  54. package/lib/helper/REST.js +3 -1
  55. package/lib/helper/TestCafe.js +1 -1
  56. package/lib/helper/WebDriver.js +313 -26
  57. package/lib/helper/extras/PlaywrightPropEngine.js +53 -0
  58. package/lib/helper/scripts/isElementClickable.js +54 -14
  59. package/lib/interfaces/gherkin.js +1 -1
  60. package/lib/listener/helpers.js +3 -0
  61. package/lib/locator.js +5 -0
  62. package/lib/mochaFactory.js +12 -10
  63. package/lib/plugin/allure.js +8 -1
  64. package/lib/plugin/autoDelay.js +1 -8
  65. package/lib/plugin/commentStep.js +133 -0
  66. package/lib/plugin/screenshotOnFail.js +3 -10
  67. package/lib/plugin/selenoid.js +2 -2
  68. package/lib/plugin/standardActingHelpers.js +13 -0
  69. package/lib/plugin/stepByStepReport.js +1 -8
  70. package/lib/plugin/wdio.js +10 -1
  71. package/lib/reporter/cli.js +30 -1
  72. package/lib/session.js +7 -4
  73. package/package.json +13 -10
  74. package/typings/Mocha.d.ts +567 -16
  75. package/typings/index.d.ts +9 -5
  76. package/typings/types.d.ts +1634 -74
package/CHANGELOG.md CHANGED
@@ -1,3 +1,120 @@
1
+ ## 2.6.2
2
+
3
+ * [WebDriver][Puppeteer] Added `forceClick` method to emulate click event instead of using native events.
4
+ * [Playwright] Updated to 0.14
5
+ * [Puppeteer] Updated to Puppeteer v3.0
6
+ * [wdio] Fixed undefined output directory for wdio plugns. Fix By @PeterNgTr
7
+ * [Playwright] Introduced `handleDownloads` method to download file. Please note, this method has slightly different API than the same one in Puppeteer.
8
+ * [allure] Fixed undefined output directory for allure plugin on using custom runner. Fix by @charliepradeep
9
+ * [WebDriver] Fixed `waitForEnabled` fix for webdriver 6. Fix by @dsharapkou
10
+ * Workers: Fixed negative failure result if use scenario with the same names. Fix by @Vorobeyko
11
+ * [MockRequest] Updated documentation to match new helper version
12
+ * Fixed: skipped tests are not reported if a suite failed in `before`. Refer #2349 & #2354. Fix by @koushikmohan1996
13
+
14
+ ## 2.6.1
15
+
16
+ * [screenshotOnFail plugin] Fixed saving screenshot of active session.
17
+ * [screenshotOnFail plugin] Fix issue #2301 when having the flag `uniqueScreenshotNames`=true results in `undefined` in screenshot file name by @PeterNgTr
18
+ * [WebDriver] Fixed `waitForElement` not applying the optional second argument to override the default timeout in webdriverio 6. Fix by @Mooksc
19
+ * [WebDriver] Updated `waitUntil` method which is used by all of the wait* functions. This updates the `waitForElement` by the same convention used to update `waitForVisible` and `waitInUrl` to be compatible with both WebDriverIO v5 & v6. See #2313 by @Mooksc
20
+
21
+ ## 2.6.0
22
+
23
+ * **[Playwright] Updated to Playwright 0.12** by @Georgegriff.
24
+
25
+ Upgrade playwright to ^0.12:
26
+
27
+ ```
28
+ npm i playwright@^0.12 --save
29
+ ```
30
+
31
+ [Notable changes](https://github.com/microsoft/playwright/releases/tag/v0.12.0):
32
+ * Fixed opening two browsers on start
33
+ * `executeScript` - passed function now accepts only one argument. Pass in objects or arrays if you need multtple arguments:
34
+ ```js
35
+ // Old style, does not work anymore:
36
+ I.executeScript((x, y) => x + y, x, y);
37
+ // New style, passing an object:
38
+ I.executeScript(({x, y}) => x + y, {x, y});
39
+ ```
40
+ * `click` - automatically waits for element to become clickable (visible, not animated) and waits for navigation.
41
+ * `clickLink` - deprecated
42
+ * `waitForClickable` - deprecated
43
+ * `forceClick` - added
44
+ * Added support for custom locators. See #2277
45
+ * Introduced [device emulation](/playwright/#device-emulation):
46
+ * globally via `emulate` config option
47
+ * per session
48
+
49
+ **[WebDriver] Updated to webdriverio v6** by @PeterNgTr.
50
+
51
+ Read [release notes](https://webdriver.io/blog/2020/03/26/webdriverio-v6-released.html), then
52
+ upgrade webdriverio to ^6.0:
53
+
54
+ ```
55
+ npm i webdriverio@^6.0 --save
56
+ ```
57
+ *(webdriverio v5 support is deprecated and will be removed in CodeceptJS 3.0)*
58
+
59
+ [WebDriver] Introduced [Shadow DOM support](/shadow) by @gkushang
60
+
61
+ ```js
62
+ I.click({ shadow: ['my-app', 'recipe-hello', 'button'] });
63
+ ```
64
+
65
+ * **Fixed parallel execution of `run-workers` for Gherkin** scenarios by @koushikmohan1996
66
+ * [MockRequest] Updated and **moved to [standalone package](https://github.com/codecept-js/mock-request)**:
67
+ * full support for record/replay mode for Puppeteer
68
+ * added `mockServer` method to use flexible PollyJS API to define mocks
69
+ * fixed stale browser screen in record mode.
70
+ * [Playwright] Added support on for `screenshotOnFail` plugin by @amonkc
71
+ * Gherkin improvement: setting different tags per examples. See #2208 by @acuper
72
+ * [TestCafe] Updated `click` to take first visible element. Fixes #2226 by @theTainted
73
+ * [Puppeteer][WebDriver] Updated `waitForClickable` method to check for element overlapping. See #2261 by @PiQx
74
+ * [Puppeteer] Dropped `puppeteer-firefox` support, as Puppeteer supports Firefox natively.
75
+ * [REST] Rrespect Content-Type header. See #2262 by @pmarshall-legacy
76
+ * [allure plugin] Fixes BeforeSuite failures in allure reports. See #2248 by @Georgegriff
77
+ * [WebDriver][Puppeteer][Playwright] A screenshot of for an active session is saved in multi-session mode. See #2253 by @ChexWarrior
78
+ * Fixed `--profile` option by @pablopaul. Profile value to be passed into `run-multiple` and `run-workers`:
79
+
80
+ ```
81
+ npx codecept run-workers 2 --profile firefox
82
+ ```
83
+
84
+ Value is available at `process.env.profile` (previously `process.profile`). See #2302. Fixes #1968 #1315
85
+
86
+ * [commentStep Plugin introduced](/plugins#commentstep). Allows to annotate logical parts of a test:
87
+
88
+ ```js
89
+ __`Given`;
90
+ I.amOnPage('/profile')
91
+
92
+ __`When`;
93
+ I.click('Logout');
94
+
95
+ __`Then`;
96
+ I.see('You are logged out');
97
+ ```
98
+
99
+ ## 2.5.0
100
+
101
+ * **Experimental: [Playwright](/playwright) helper introduced**.
102
+
103
+ > [Playwright](https://github.com/microsoft/playwright/) is an alternative to Puppeteer which works very similarly to it but adds cross-browser support with Firefox and Webkit. Until v1.0 Playwright API is not stable but we introduce it to CodeceptJS so you could try it.
104
+
105
+ * [Puppeteer] Fixed basic auth support when running in multiple sessions. See #2178 by @ian-bartholomew
106
+ * [Puppeteer] Fixed `waitForText` when there is no `body` element on page (redirect). See #2181 by @Vorobeyko
107
+ * [Selenoid plugin] Fixed overriding current capabilities by adding deepMerge. Fixes #2183 by @koushikmohan1996
108
+ * Added types for `Scenario.todo` by @Vorobeyko
109
+ * Added types for Mocha by @Vorobeyko. Fixed typing conflicts with Jest
110
+ * [FileSystem] Added methods by @nitschSB
111
+ * `waitForFile`
112
+ * `seeFileContentsEqualReferenceFile`
113
+ * Added `--colors` option to `run` and `run-multiple` so you force colored output in dockerized environment. See #2189 by @mirao
114
+ * [WebDriver] Added `type` command to enter value without focusing on a field. See #2198 by @xMutaGenx
115
+ * Fixed `codeceptjs gt` command to respect config pattern for tests. See #2200 and #2204 by @matheo
116
+
117
+
1
118
  ## 2.4.3
2
119
 
3
120
  * Hotfix for interactive pause
package/README.md CHANGED
@@ -182,13 +182,13 @@ In case you need to return a value from a webpage and use it directly in test, y
182
182
  They are expected to be used inside async/await functions, and their results will be available in test:
183
183
 
184
184
  ```js
185
- let assert = require('assert');
185
+ const assert = require('assert');
186
186
 
187
187
  Feature('CodeceptJS Demonstration');
188
188
 
189
189
  Scenario('test page title', async (I) => {
190
190
  I.amOnPage('http://simple-form-bootstrap.plataformatec.com.br/documentation');
191
- let title = await I.grabTitle();
191
+ const title = await I.grabTitle();
192
192
  assert.equal(title, 'Example application with SimpleForm and Twitter Bootstrap');
193
193
  });
194
194
  ```
@@ -277,11 +277,36 @@ When using typescript, replace `module.exports` with `export` for autocompletion
277
277
  Thanks all to those who are and will have contributing to this awesome project!
278
278
 
279
279
  [//]: contributor-faces
280
- <a href="https://github.com/DavertMik"><img src="https://avatars0.githubusercontent.com/u/220264?v=4" title="DavertMik" width="80" height="80"></a><a href="https://github.com/PeterNgTr"><img src="https://avatars0.githubusercontent.com/u/7845001?v=4" title="PeterNgTr" width="80" height="80"></a><a href="https://github.com/APshenkin"><img src="https://avatars1.githubusercontent.com/u/14344430?v=4" title="APshenkin" width="80" height="80"></a><a href="https://github.com/reubenmiller"><img src="https://avatars0.githubusercontent.com/u/3029781?v=4" title="reubenmiller" width="80" height="80"></a><a href="https://github.com/fabioel"><img src="https://avatars1.githubusercontent.com/u/9824235?v=4" title="fabioel" width="80" height="80"></a><a href="https://github.com/Vorobeyko"><img src="https://avatars3.githubusercontent.com/u/11293201?v=4" title="Vorobeyko" width="80" height="80"></a><a href="https://github.com/pablopaul"><img src="https://avatars1.githubusercontent.com/u/635526?v=4" title="pablopaul" width="80" height="80"></a><a href="https://github.com/tsuemura"><img src="https://avatars1.githubusercontent.com/u/17092259?v=4" title="tsuemura" width="80" height="80"></a>
281
- <a href="https://github.com/VikalpP"><img src="https://avatars2.githubusercontent.com/u/11846339?v=4" title="VikalpP" width="80" height="80"></a><a href="https://github.com/MercifulCode"><img src="https://avatars2.githubusercontent.com/u/1740822?v=4" title="MercifulCode" width="80" height="80"></a><a href="https://github.com/elukoyanov"><img src="https://avatars3.githubusercontent.com/u/11647141?v=4" title="elukoyanov" width="80" height="80"></a><a href="https://github.com/hubidu"><img src="https://avatars2.githubusercontent.com/u/13134082?v=4" title="hubidu" width="80" height="80"></a><a href="https://github.com/BorisOsipov"><img src="https://avatars0.githubusercontent.com/u/6514276?v=4" title="BorisOsipov" width="80" height="80"></a><a href="https://github.com/jploskonka"><img src="https://avatars3.githubusercontent.com/u/669483?v=4" title="jploskonka" width="80" height="80"></a><a href="https://github.com/martomo"><img src="https://avatars2.githubusercontent.com/u/1850135?v=4" title="martomo" width="80" height="80"></a><a href="https://github.com/denis-sokolov"><img src="https://avatars0.githubusercontent.com/u/113721?v=4" title="denis-sokolov" width="80" height="80"></a>
282
- <a href="https://github.com/lennym"><img src="https://avatars3.githubusercontent.com/u/117398?v=4" title="lennym" width="80" height="80"></a><a href="https://github.com/petehouston"><img src="https://avatars0.githubusercontent.com/u/9006720?v=4" title="petehouston" width="80" height="80"></a><a href="https://github.com/Holorium"><img src="https://avatars1.githubusercontent.com/u/10815542?v=4" title="Holorium" width="80" height="80"></a><a href="https://github.com/johnyb"><img src="https://avatars2.githubusercontent.com/u/86358?v=4" title="johnyb" width="80" height="80"></a><a href="https://github.com/jamesgeorge007"><img src="https://avatars2.githubusercontent.com/u/25279263?v=4" title="jamesgeorge007" width="80" height="80"></a><a href="https://github.com/jinjorge"><img src="https://avatars3.githubusercontent.com/u/2208083?v=4" title="jinjorge" width="80" height="80"></a>
283
- <a href="https://github.com/galkin"><img src="https://avatars3.githubusercontent.com/u/5930544?v=4" title="galkin" width="80" height="80"></a><a href="https://github.com/radhey1851"><img src="https://avatars2.githubusercontent.com/u/22446528?v=4" title="radhey1851" width="80" height="80"></a>
284
- <a href="https://github.com/nitschSB"><img src="https://avatars0.githubusercontent.com/u/39341455?v=4" title="nitschSB" width="80" height="80"></a><a href="https://github.com/abner"><img src="https://avatars1.githubusercontent.com/u/42773?v=4" title="abner" width="80" height="80"></a><a href="https://github.com/Akxe"><img src="https://avatars3.githubusercontent.com/u/2001798?v=4" title="Akxe" width="80" height="80"></a><a href="https://github.com/Kalostrinho"><img src="https://avatars0.githubusercontent.com/u/19229249?v=4" title="Kalostrinho" width="80" height="80"></a><a href="https://github.com/asselin"><img src="https://avatars2.githubusercontent.com/u/911250?v=4" title="asselin" width="80" height="80"></a><a href="https://github.com/xt1"><img src="https://avatars2.githubusercontent.com/u/3820037?v=4" title="xt1" width="80" height="80"></a>
280
+ <a href="https://github.com/DavertMik"><img src="https://avatars0.githubusercontent.com/u/220264?v=4" title="DavertMik" width="80" height="80"></a>
281
+ <a href="https://github.com/PeterNgTr"><img src="https://avatars0.githubusercontent.com/u/7845001?v=4" title="PeterNgTr" width="80" height="80"></a>
282
+ <a href="https://github.com/APshenkin"><img src="https://avatars1.githubusercontent.com/u/14344430?v=4" title="APshenkin" width="80" height="80"></a>
283
+ <a href="https://github.com/reubenmiller"><img src="https://avatars0.githubusercontent.com/u/3029781?v=4" title="reubenmiller" width="80" height="80"></a>
284
+ <a href="https://github.com/Vorobeyko"><img src="https://avatars3.githubusercontent.com/u/11293201?v=4" title="Vorobeyko" width="80" height="80"></a>
285
+ <a href="https://github.com/fabioel"><img src="https://avatars1.githubusercontent.com/u/9824235?v=4" title="fabioel" width="80" height="80"></a>
286
+ <a href="https://github.com/pablopaul"><img src="https://avatars1.githubusercontent.com/u/635526?v=4" title="pablopaul" width="80" height="80"></a>
287
+ <a href="https://github.com/tsuemura"><img src="https://avatars1.githubusercontent.com/u/17092259?v=4" title="tsuemura" width="80" height="80"></a>
288
+ <a href="https://github.com/VikalpP"><img src="https://avatars2.githubusercontent.com/u/11846339?v=4" title="VikalpP" width="80" height="80"></a>
289
+ <a href="https://github.com/elukoyanov"><img src="https://avatars3.githubusercontent.com/u/11647141?v=4" title="elukoyanov" width="80" height="80"></a>
290
+ <a href="https://github.com/MercifulCode"><img src="https://avatars2.githubusercontent.com/u/1740822?v=4" title="MercifulCode" width="80" height="80"></a>
291
+ <a href="https://github.com/koushikmohan1996"><img src="https://avatars3.githubusercontent.com/u/24666922?v=4" title="koushikmohan1996" width="80" height="80"></a>
292
+ <a href="https://github.com/hubidu"><img src="https://avatars2.githubusercontent.com/u/13134082?v=4" title="hubidu" width="80" height="80"></a>
293
+ <a href="https://github.com/BorisOsipov"><img src="https://avatars0.githubusercontent.com/u/6514276?v=4" title="BorisOsipov" width="80" height="80"></a>
294
+ <a href="https://github.com/jploskonka"><img src="https://avatars3.githubusercontent.com/u/669483?v=4" title="jploskonka" width="80" height="80"></a>
295
+ <a href="https://github.com/martomo"><img src="https://avatars2.githubusercontent.com/u/1850135?v=4" title="martomo" width="80" height="80"></a>
296
+ <a href="https://github.com/denis-sokolov"><img src="https://avatars0.githubusercontent.com/u/113721?v=4" title="denis-sokolov" width="80" height="80"></a>
297
+ <a href="https://github.com/lennym"><img src="https://avatars3.githubusercontent.com/u/117398?v=4" title="lennym" width="80" height="80"></a>
298
+ <a href="https://github.com/petehouston"><img src="https://avatars0.githubusercontent.com/u/9006720?v=4" title="petehouston" width="80" height="80"></a>
299
+ <a href="https://github.com/Holorium"><img src="https://avatars1.githubusercontent.com/u/10815542?v=4" title="Holorium" width="80" height="80"></a>
300
+ <a href="https://github.com/nitschSB"><img src="https://avatars0.githubusercontent.com/u/39341455?v=4" title="nitschSB" width="80" height="80"></a>
301
+ <a href="https://github.com/johnyb"><img src="https://avatars2.githubusercontent.com/u/86358?v=4" title="johnyb" width="80" height="80"></a>
302
+ <a href="https://github.com/jamesgeorge007"><img src="https://avatars2.githubusercontent.com/u/25279263?v=4" title="jamesgeorge007" width="80" height="80"></a>
303
+ <a href="https://github.com/jinjorge"><img src="https://avatars3.githubusercontent.com/u/2208083?v=4" title="jinjorge" width="80" height="80"></a>
304
+ <a href="https://github.com/galkin"><img src="https://avatars3.githubusercontent.com/u/5930544?v=4" title="galkin" width="80" height="80"></a>
305
+ <a href="https://github.com/orihomie"><img src="https://avatars2.githubusercontent.com/u/29889683?v=4" title="orihomie" width="80" height="80"></a>
306
+ <a href="https://github.com/radhey1851"><img src="https://avatars2.githubusercontent.com/u/22446528?v=4" title="radhey1851" width="80" height="80"></a>
307
+ <a href="https://github.com/abner"><img src="https://avatars1.githubusercontent.com/u/42773?v=4" title="abner" width="80" height="80"></a>
308
+ <a href="https://github.com/Akxe"><img src="https://avatars3.githubusercontent.com/u/2001798?v=4" title="Akxe" width="80" height="80"></a>
309
+ <a href="https://github.com/Kalostrinho"><img src="https://avatars0.githubusercontent.com/u/19229249?v=4" title="Kalostrinho" width="80" height="80"></a>
285
310
 
286
311
  [//]: contributor-faces
287
312
 
package/bin/codecept.js CHANGED
@@ -190,6 +190,9 @@ program.command('run-multiple [suites...]')
190
190
  .option('-R, --reporter <name>', 'specify the reporter to use')
191
191
  .option('--recursive', 'include sub directories')
192
192
 
193
+ // mocha options
194
+ .option('--colors', 'force enabling of colors')
195
+
193
196
  .action(require('../lib/command/run-multiple'));
194
197
 
195
198
  program.command('info [path]')
package/docs/basics.md CHANGED
@@ -41,6 +41,7 @@ Refer to following guides to more information on:
41
41
  * [▶ WebDriver](/webdriver)
42
42
  * [▶ Protractor](/angular)
43
43
  * [▶ Puppeteer](/puppeteer)
44
+ * [▶ Playwright](/playwright)
44
45
  * [▶ Nightmare](/nightmare)
45
46
  * [▶ TestCafe](/testcafe)
46
47
 
@@ -146,6 +147,8 @@ I.click('#signup');
146
147
  I.click('//dev[@test-id="myid"]');
147
148
  ```
148
149
 
150
+ > ℹ If click doesn't work in a test but works for user, it is possible that frontend application is not designed for automated testing. To overcome limitation of standard click in this edgecase use `forceClick` method. It will emulate click instead of sending native event. This command will click an element no matter if this element is visible or animating. It will send JavaScript "click" event to it.
151
+
149
152
  ### Filling Fields
150
153
 
151
154
  Clicking the links is not what takes the most time during testing a web site. If your site consists only of links you can skip test automation. The most waste of time goes into the testing of forms. CodeceptJS provides several ways of doing that.
@@ -233,6 +236,8 @@ I.seeInTitle('My Website');
233
236
 
234
237
  To see all possible assertions, check the helper's reference.
235
238
 
239
+ > ℹ If you need custom assertions, you can install an assertion libarary like `chai`, use grabbers to obtain information from a browser and perform assertions. However, it is recommended to put custom assertions into a helper for further reuse.
240
+
236
241
  ### Grabbing
237
242
 
238
243
  Sometimes you need to retrieve data from a page to use it in the following steps of a scenario.
@@ -422,7 +427,7 @@ Try to perform your scenario step by step. Then copy succesful commands and inse
422
427
 
423
428
  ### Pause
424
429
 
425
- Test execution can be paused in any place of a test with `pause()` call.
430
+ Test execution can be paused in any place of a test with `pause()` call.
426
431
  Variables can also be passed to `pause({data: 'hi', func: () => console.log('hello')})` which can be accessed in Interactive shell.
427
432
 
428
433
  This launches the interactive console where you can call any action from the `I` object.
@@ -430,10 +435,11 @@ This launches the interactive console where you can call any action from the `I`
430
435
  ```
431
436
  Interactive shell started
432
437
  Press ENTER to resume test
433
- - Use JavaScript syntax to try steps in action
438
+ Use JavaScript syntax to try steps in action
439
+ - Press ENTER to run the next step
434
440
  - Press TAB twice to see all available commands
435
- - Enter next to run the next step
436
-
441
+ - Type exit + Enter to exit the interactive shell
442
+ - Prefix => to run js commands
437
443
  I.
438
444
  ```
439
445
 
@@ -620,7 +626,7 @@ within('.js-signup-form', () => {
620
626
  I.see('There were problems creating your account.');
621
627
  ```
622
628
 
623
- > ⚠ `within` can cause problems when used incorrectly. If you see a weired behavior of a test try to refactor it to not use `within`. It is recommended to keep within for simplest cases when possible.
629
+ > ⚠ `within` can cause problems when used incorrectly. If you see a weird behavior of a test try to refactor it to not use `within`. It is recommended to keep within for simplest cases when possible.
624
630
 
625
631
  `within` can also work with IFrames. A special `frame` locator is required to locate the iframe and get into its context.
626
632
 
package/docs/bdd.md CHANGED
@@ -140,7 +140,7 @@ This scenarios are nice as live documentation but they do not test anything yet.
140
140
  Steps can be defined by executing `gherkin:snippets` command:
141
141
 
142
142
  ```bash
143
- codeceptjs gherkin:snippets [--path=PATH] [--feature=PATH]
143
+ npx codeceptjs gherkin:snippets [--path=PATH] [--feature=PATH]
144
144
  ```
145
145
 
146
146
  This will produce code templates for all undefined steps in the .feature files.
@@ -329,7 +329,7 @@ Then('Then i see in file {string}', (file, text) => {
329
329
  Gherkin scenarios and features can contain tags marked with `@`. Tags are appended to feature titles so you can easily filter by them when running tests:
330
330
 
331
331
  ```bash
332
- codeceptjs run --grep "@important"
332
+ npx codeceptjs run --grep "@important"
333
333
  ```
334
334
 
335
335
  Tag should be placed before *Scenario:* or before *Feature:* keyword. In the last case all scenarios of that feature will be added to corresponding group.
@@ -406,7 +406,7 @@ In CodeceptJS you can combine tests written in Gherkin format with classical acc
406
406
  To run only features use `--features` option:
407
407
 
408
408
  ```
409
- codeceptjs run --features
409
+ npx codeceptjs run --features
410
410
  ```
411
411
 
412
412
  You can run a specific feature file by its filename or by grepping by name or tag.
@@ -414,6 +414,6 @@ You can run a specific feature file by its filename or by grepping by name or ta
414
414
  To run only tests without features use `--tests` option:
415
415
 
416
416
  ```
417
- codeceptjs run --tests
417
+ npx codeceptjs run --tests
418
418
  ```
419
419
 
@@ -57,6 +57,9 @@ let PollyJS;
57
57
  */
58
58
  class MockRequest extends Helper {
59
59
  constructor(config) {
60
+ console.log('DEPRECATION NOTICE:');
61
+ console.log('MockRequest helper was moved to a standalone package: https://github.com/codecept-js/mock-request');
62
+ console.log('Disable MockRequest in config & install @codeceptjs/mock-request package\n');
60
63
  super(config);
61
64
  this._setConfig(config);
62
65
  PollyJS = requireg('@pollyjs/core').Polly;
@@ -1294,13 +1294,21 @@ class Nightmare extends Helper {
1294
1294
  }
1295
1295
 
1296
1296
  /**
1297
- * Sets a cookie.
1297
+ * Sets cookie(s).
1298
+ *
1299
+ * Can be a single cookie object or an array of cookies:
1298
1300
  *
1299
1301
  * ```js
1300
1302
  * I.setCookie({name: 'auth', value: true});
1303
+ *
1304
+ * // as array
1305
+ * I.setCookie([
1306
+ * {name: 'auth', value: true},
1307
+ * {name: 'agree', value: true}
1308
+ * ]);
1301
1309
  * ```
1302
1310
  *
1303
- * @param {object} cookie a cookie object.
1311
+ * @param {object|array} cookie a cookie object or array of cookie objects.
1304
1312
  *
1305
1313
  * Wrapper for `.cookies.set(cookie)`.
1306
1314
  * [See more](https://github.com/segmentio/nightmare/blob/master/Readme.md#cookiessetcookie)