codeceptjs 3.3.5 → 3.3.7-beta.1

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 (129) hide show
  1. package/CHANGELOG.md +37 -7
  2. package/bin/codecept.js +40 -3
  3. package/docs/basics.md +24 -1
  4. package/docs/build/Appium.js +41 -22
  5. package/docs/build/FileSystem.js +1 -1
  6. package/docs/build/Nightmare.js +106 -57
  7. package/docs/build/Playwright.js +187 -111
  8. package/docs/build/Protractor.js +132 -70
  9. package/docs/build/Puppeteer.js +143 -76
  10. package/docs/build/REST.js +2 -2
  11. package/docs/build/TestCafe.js +107 -57
  12. package/docs/build/WebDriver.js +162 -89
  13. package/docs/changelog.md +37 -7
  14. package/docs/commands.md +5 -3
  15. package/docs/configuration.md +5 -5
  16. package/docs/helpers/Appium.md +25 -23
  17. package/docs/helpers/FileSystem.md +1 -1
  18. package/docs/helpers/Nightmare.md +57 -57
  19. package/docs/helpers/Playwright.md +76 -75
  20. package/docs/helpers/Puppeteer.md +76 -85
  21. package/docs/helpers/REST.md +1 -1
  22. package/docs/helpers/TestCafe.md +57 -57
  23. package/docs/helpers/WebDriver.md +84 -97
  24. package/docs/quickstart.md +1 -1
  25. package/docs/reports.md +1 -1
  26. package/docs/secrets.md +1 -1
  27. package/docs/webapi/appendField.mustache +1 -1
  28. package/docs/webapi/attachFile.mustache +3 -3
  29. package/docs/webapi/checkOption.mustache +1 -1
  30. package/docs/webapi/clearCookie.mustache +1 -1
  31. package/docs/webapi/clearField.mustache +1 -1
  32. package/docs/webapi/click.mustache +1 -1
  33. package/docs/webapi/clickLink.mustache +1 -1
  34. package/docs/webapi/closeCurrentTab.mustache +1 -1
  35. package/docs/webapi/closeOtherTabs.mustache +1 -1
  36. package/docs/webapi/dontSee.mustache +1 -1
  37. package/docs/webapi/dontSeeCheckboxIsChecked.mustache +1 -1
  38. package/docs/webapi/dontSeeCookie.mustache +1 -1
  39. package/docs/webapi/dontSeeCurrentUrlEquals.mustache +1 -1
  40. package/docs/webapi/dontSeeElement.mustache +1 -1
  41. package/docs/webapi/dontSeeElementInDOM.mustache +1 -1
  42. package/docs/webapi/dontSeeInCurrentUrl.mustache +1 -1
  43. package/docs/webapi/dontSeeInField.mustache +1 -1
  44. package/docs/webapi/dontSeeInSource.mustache +1 -1
  45. package/docs/webapi/dontSeeInTitle.mustache +1 -1
  46. package/docs/webapi/doubleClick.mustache +1 -1
  47. package/docs/webapi/downloadFile.mustache +1 -1
  48. package/docs/webapi/dragAndDrop.mustache +1 -1
  49. package/docs/webapi/dragSlider.mustache +1 -1
  50. package/docs/webapi/executeAsyncScript.mustache +1 -1
  51. package/docs/webapi/executeScript.mustache +1 -1
  52. package/docs/webapi/fillField.mustache +1 -1
  53. package/docs/webapi/forceClick.mustache +1 -1
  54. package/docs/webapi/forceRightClick.mustache +1 -1
  55. package/docs/webapi/moveCursorTo.mustache +1 -1
  56. package/docs/webapi/openNewTab.mustache +1 -1
  57. package/docs/webapi/pressKey.mustache +1 -1
  58. package/docs/webapi/pressKeyDown.mustache +1 -1
  59. package/docs/webapi/pressKeyUp.mustache +1 -1
  60. package/docs/webapi/pressKeyWithKeyNormalization.mustache +1 -1
  61. package/docs/webapi/refreshPage.mustache +1 -1
  62. package/docs/webapi/resizeWindow.mustache +1 -1
  63. package/docs/webapi/rightClick.mustache +1 -1
  64. package/docs/webapi/saveElementScreenshot.mustache +2 -2
  65. package/docs/webapi/saveScreenshot.mustache +2 -2
  66. package/docs/webapi/say.mustache +1 -1
  67. package/docs/webapi/scrollIntoView.mustache +1 -1
  68. package/docs/webapi/scrollPageToBottom.mustache +1 -1
  69. package/docs/webapi/scrollPageToTop.mustache +1 -1
  70. package/docs/webapi/scrollTo.mustache +1 -1
  71. package/docs/webapi/see.mustache +1 -1
  72. package/docs/webapi/seeAttributesOnElements.mustache +1 -1
  73. package/docs/webapi/seeCheckboxIsChecked.mustache +1 -1
  74. package/docs/webapi/seeCookie.mustache +1 -1
  75. package/docs/webapi/seeCssPropertiesOnElements.mustache +1 -1
  76. package/docs/webapi/seeCurrentUrlEquals.mustache +1 -1
  77. package/docs/webapi/seeElement.mustache +1 -1
  78. package/docs/webapi/seeElementInDOM.mustache +1 -1
  79. package/docs/webapi/seeInCurrentUrl.mustache +1 -1
  80. package/docs/webapi/seeInField.mustache +1 -1
  81. package/docs/webapi/seeInPopup.mustache +1 -1
  82. package/docs/webapi/seeInSource.mustache +1 -1
  83. package/docs/webapi/seeInTitle.mustache +1 -1
  84. package/docs/webapi/seeNumberOfElements.mustache +1 -1
  85. package/docs/webapi/seeNumberOfVisibleElements.mustache +1 -1
  86. package/docs/webapi/seeTextEquals.mustache +1 -1
  87. package/docs/webapi/seeTitleEquals.mustache +1 -1
  88. package/docs/webapi/selectOption.mustache +1 -1
  89. package/docs/webapi/setCookie.mustache +1 -1
  90. package/docs/webapi/setGeoLocation.mustache +1 -1
  91. package/docs/webapi/switchTo.mustache +1 -1
  92. package/docs/webapi/switchToNextTab.mustache +1 -1
  93. package/docs/webapi/switchToPreviousTab.mustache +1 -1
  94. package/docs/webapi/type.mustache +1 -1
  95. package/docs/webapi/uncheckOption.mustache +1 -1
  96. package/docs/webapi/wait.mustache +1 -1
  97. package/docs/webapi/waitForClickable.mustache +1 -1
  98. package/docs/webapi/waitForDetached.mustache +1 -1
  99. package/docs/webapi/waitForElement.mustache +1 -1
  100. package/docs/webapi/waitForEnabled.mustache +1 -1
  101. package/docs/webapi/waitForFunction.mustache +1 -1
  102. package/docs/webapi/waitForInvisible.mustache +1 -1
  103. package/docs/webapi/waitForText.mustache +1 -1
  104. package/docs/webapi/waitForValue.mustache +1 -1
  105. package/docs/webapi/waitForVisible.mustache +1 -1
  106. package/docs/webapi/waitInUrl.mustache +1 -1
  107. package/docs/webapi/waitNumberOfVisibleElements.mustache +1 -1
  108. package/docs/webapi/waitToHide.mustache +1 -1
  109. package/docs/webapi/waitUrlEquals.mustache +1 -1
  110. package/lib/command/configMigrate.js +1 -1
  111. package/lib/command/dryRun.js +2 -1
  112. package/lib/command/generate.js +35 -18
  113. package/lib/command/run-rerun.js +38 -0
  114. package/lib/command/utils.js +13 -3
  115. package/lib/config.js +2 -2
  116. package/lib/data/context.js +7 -0
  117. package/lib/helper/Appium.js +6 -4
  118. package/lib/helper/FileSystem.js +1 -1
  119. package/lib/helper/Nightmare.js +1 -1
  120. package/lib/helper/Playwright.js +50 -38
  121. package/lib/helper/Protractor.js +1 -1
  122. package/lib/helper/REST.js +2 -2
  123. package/lib/helper/TestCafe.js +1 -1
  124. package/lib/helper/WebDriver.js +7 -7
  125. package/lib/plugin/wdio.js +11 -2
  126. package/lib/utils.js +3 -0
  127. package/package.json +2 -2
  128. package/typings/index.d.ts +46 -46
  129. package/typings/types.d.ts +497 -443
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeceptjs",
3
- "version": "3.3.5",
3
+ "version": "3.3.7-beta.1",
4
4
  "description": "Supercharged End 2 End Testing Framework for NodeJS",
5
5
  "keywords": [
6
6
  "acceptance",
@@ -87,6 +87,7 @@
87
87
  "requireg": "^0.2.2",
88
88
  "resq": "^1.10.2",
89
89
  "sprintf-js": "^1.1.1",
90
+ "semver": "^6.3.0",
90
91
  "uuid": "^8.3.2"
91
92
  },
92
93
  "devDependencies": {
@@ -127,7 +128,6 @@
127
128
  "qrcode-terminal": "^0.12.0",
128
129
  "rosie": "^1.6.0",
129
130
  "runok": "^0.9.2",
130
- "semver": "^6.3.0",
131
131
  "sinon": "^9.2.4",
132
132
  "sinon-chai": "^3.7.0",
133
133
  "testcafe": "^1.18.3",
@@ -32,20 +32,20 @@ declare namespace CodeceptJS {
32
32
  * ```
33
33
  */
34
34
  tests: string;
35
- /**
36
- * Where to store failure screenshots, artifacts, etc
37
- *
35
+ /**
36
+ * Where to store failure screenshots, artifacts, etc
37
+ *
38
38
  * ```js
39
39
  * output: './output'
40
40
  * ```
41
41
  */
42
42
  output: string;
43
- /**
43
+ /**
44
44
  * Pattern to filter tests by name.
45
45
  * This option is useful if you plan to use multiple configs for different environments.
46
- *
46
+ *
47
47
  * To execute only tests with @firefox tag
48
- *
48
+ *
49
49
  * ```js
50
50
  * grep: '@firefox'
51
51
  * ```
@@ -64,11 +64,11 @@ declare namespace CodeceptJS {
64
64
  * ```
65
65
  */
66
66
  helpers?: {
67
- /**
68
- * Run web tests controlling browsers via Playwright engine.
67
+ /**
68
+ * Run web tests controlling browsers via Playwright engine.
69
+ *
70
+ * https://codecept.io/helpers/playwright
69
71
  *
70
- * https://codecept.io/helpers/playwright
71
- *
72
72
  * Available commands:
73
73
  * ```js
74
74
  * I.amOnPage('/');
@@ -77,11 +77,11 @@ declare namespace CodeceptJS {
77
77
  * ```
78
78
  */
79
79
  Playwright?: PlaywrightConfig;
80
- /**
81
- * Run web tests controlling browsers via Puppeteer engine.
82
- *
83
- * https://codecept.io/helpers/puppeteer
84
- *
80
+ /**
81
+ * Run web tests controlling browsers via Puppeteer engine.
82
+ *
83
+ * https://codecept.io/helpers/puppeteer
84
+ *
85
85
  * Available commands:
86
86
  * ```js
87
87
  * I.amOnPage('/');
@@ -91,24 +91,24 @@ declare namespace CodeceptJS {
91
91
  */
92
92
  Puppeteer?: PuppeteerConfig;
93
93
 
94
- /**
95
- * Run web tests controlling browsers via WebDriver engine.
96
- *
94
+ /**
95
+ * Run web tests controlling browsers via WebDriver engine.
96
+ *
97
97
  * Available commands:
98
98
  * ```js
99
99
  * I.amOnPage('/');
100
100
  * I.click('Open');
101
101
  * I.see('Welcome');
102
102
  * ```
103
- *
104
- * https://codecept.io/helpers/webdriver
103
+ *
104
+ * https://codecept.io/helpers/webdriver
105
105
  */
106
106
  WebDriver?: WebDriverConfig;
107
- /**
108
- * Execute REST API requests for API testing or to assist web testing.
109
- *
110
- * https://codecept.io/helpers/REST
111
- *
107
+ /**
108
+ * Execute REST API requests for API testing or to assist web testing.
109
+ *
110
+ * https://codecept.io/helpers/REST
111
+ *
112
112
  * Available commands:
113
113
  * ```js
114
114
  * I.sendGetRequest('/');
@@ -116,30 +116,30 @@ declare namespace CodeceptJS {
116
116
  */
117
117
  REST?: RESTConfig;
118
118
 
119
- /**
119
+ /**
120
120
  * Use JSON assertions for API testing.
121
121
  * Can be paired with REST or GraphQL helpers.
122
- *
123
- * https://codecept.io/helpers/JSONResponse
124
- *
122
+ *
123
+ * https://codecept.io/helpers/JSONResponse
124
+ *
125
125
  * Available commands:
126
126
  * ```js
127
127
  * I.seeResponseContainsJson({ user: { email: 'jon@doe.com' } });
128
128
  * ```
129
129
  */
130
- JSONResponse?: any;
130
+ JSONResponse?: any;
131
131
 
132
132
  [key: string]: any;
133
133
  },
134
- /**
135
- * Enable CodeceptJS plugins.
136
- *
134
+ /**
135
+ * Enable CodeceptJS plugins.
136
+ *
137
137
  * https://codecept.io/plugins/
138
- *
138
+ *
139
139
  * Plugins listen to test events and extend functionality of CodeceptJS.
140
- *
140
+ *
141
141
  * Example:
142
- *
142
+ *
143
143
  * ```js
144
144
  * plugins: {
145
145
  * autoDelay: {
@@ -195,7 +195,7 @@ declare namespace CodeceptJS {
195
195
  mocha?: any;
196
196
  /**
197
197
  * [Execute code before](https://codecept.io/bootstrap/) tests are run.
198
- *
198
+ *
199
199
  * Can be either JS module file or async function:
200
200
  *
201
201
  * ```js
@@ -206,10 +206,10 @@ declare namespace CodeceptJS {
206
206
  * bootstrap: 'bootstrap.js',
207
207
  * ```
208
208
  */
209
- bootstrap?: () => Promise<void> | boolean | string;
209
+ bootstrap?: (() => Promise<void>) | boolean | string;
210
210
  /**
211
- * [Execute code after tests](https://codecept.io/bootstrap/) finished.
212
- *
211
+ * [Execute code after tests](https://codecept.io/bootstrap/) finished.
212
+ *
213
213
  * Can be either JS module file or async function:
214
214
  *
215
215
  * ```js
@@ -220,16 +220,16 @@ declare namespace CodeceptJS {
220
220
  * teardown: 'teardown.js',
221
221
  * ```
222
222
  */
223
- teardown?: () => Promise<void> | boolean | string;
223
+ teardown?: (() => Promise<void>) | boolean | string;
224
224
  /**
225
225
  * [Execute code before launching tests in parallel mode](https://codecept.io/bootstrap/#bootstrapall-teardownall)
226
- *
226
+ *
227
227
  */
228
- bootstrapAll?: () => Promise<void> | boolean | string;
228
+ bootstrapAll?: (() => Promise<void>) | boolean | string;
229
229
  /**
230
230
  * [Execute JS code after finishing tests in parallel mode](https://codecept.io/bootstrap/#bootstrapall-teardownall)
231
231
  */
232
- teardownAll?: () => Promise<void> | boolean | string;
232
+ teardownAll?: (() => Promise<void>) | boolean | string;
233
233
  /** Enable [localized test commands](https://codecept.io/translation/) */
234
234
  translation?: string;
235
235
  /**
@@ -243,8 +243,8 @@ declare namespace CodeceptJS {
243
243
  require?: Array<string>;
244
244
 
245
245
  /**
246
- * Enable [BDD features](https://codecept.io/bdd/#configuration).
247
- *
246
+ * Enable [BDD features](https://codecept.io/bdd/#configuration).
247
+ *
248
248
  * Sample configuration:
249
249
  * ```js
250
250
  * gherkin: {