codeceptjs 3.5.11 → 3.5.12-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 (221) hide show
  1. package/README.md +3 -3
  2. package/lib/command/run-multiple.js +3 -1
  3. package/lib/command/run-workers.js +32 -1
  4. package/lib/command/workers/runTests.js +2 -2
  5. package/lib/helper/Playwright.js +21 -2
  6. package/lib/helper/Puppeteer.js +18 -0
  7. package/lib/helper/WebDriver.js +140 -31
  8. package/lib/locator.js +17 -4
  9. package/lib/plugin/retryFailedStep.js +5 -1
  10. package/lib/plugin/retryTo.js +2 -2
  11. package/package.json +14 -11
  12. package/typings/index.d.ts +9 -6
  13. package/typings/promiseBasedTypes.d.ts +84 -1
  14. package/typings/types.d.ts +102 -2
  15. package/docs/advanced.md +0 -351
  16. package/docs/ai.md +0 -248
  17. package/docs/api.md +0 -323
  18. package/docs/basics.md +0 -979
  19. package/docs/bdd.md +0 -539
  20. package/docs/best.md +0 -237
  21. package/docs/books.md +0 -37
  22. package/docs/bootstrap.md +0 -135
  23. package/docs/build/ApiDataFactory.js +0 -410
  24. package/docs/build/Appium.js +0 -2027
  25. package/docs/build/Expect.js +0 -422
  26. package/docs/build/FileSystem.js +0 -228
  27. package/docs/build/GraphQL.js +0 -229
  28. package/docs/build/GraphQLDataFactory.js +0 -309
  29. package/docs/build/JSONResponse.js +0 -338
  30. package/docs/build/Mochawesome.js +0 -71
  31. package/docs/build/Nightmare.js +0 -2152
  32. package/docs/build/OpenAI.js +0 -126
  33. package/docs/build/Playwright.js +0 -5082
  34. package/docs/build/Protractor.js +0 -2706
  35. package/docs/build/Puppeteer.js +0 -3878
  36. package/docs/build/REST.js +0 -344
  37. package/docs/build/TestCafe.js +0 -2125
  38. package/docs/build/WebDriver.js +0 -4122
  39. package/docs/changelog.md +0 -2572
  40. package/docs/commands.md +0 -266
  41. package/docs/community-helpers.md +0 -58
  42. package/docs/configuration.md +0 -157
  43. package/docs/continuous-integration.md +0 -22
  44. package/docs/custom-helpers.md +0 -306
  45. package/docs/data.md +0 -379
  46. package/docs/detox.md +0 -235
  47. package/docs/docker.md +0 -136
  48. package/docs/email.md +0 -183
  49. package/docs/examples.md +0 -149
  50. package/docs/helpers/ApiDataFactory.md +0 -266
  51. package/docs/helpers/Appium.md +0 -1374
  52. package/docs/helpers/Detox.md +0 -586
  53. package/docs/helpers/Expect.md +0 -275
  54. package/docs/helpers/FileSystem.md +0 -152
  55. package/docs/helpers/GraphQL.md +0 -151
  56. package/docs/helpers/GraphQLDataFactory.md +0 -226
  57. package/docs/helpers/JSONResponse.md +0 -254
  58. package/docs/helpers/Mochawesome.md +0 -8
  59. package/docs/helpers/MockRequest.md +0 -377
  60. package/docs/helpers/Nightmare.md +0 -1305
  61. package/docs/helpers/OpenAI.md +0 -70
  62. package/docs/helpers/Playwright.md +0 -2744
  63. package/docs/helpers/Polly.md +0 -44
  64. package/docs/helpers/Protractor.md +0 -1769
  65. package/docs/helpers/Puppeteer-firefox.md +0 -86
  66. package/docs/helpers/Puppeteer.md +0 -2302
  67. package/docs/helpers/REST.md +0 -218
  68. package/docs/helpers/TestCafe.md +0 -1321
  69. package/docs/helpers/WebDriver.md +0 -2473
  70. package/docs/hooks.md +0 -340
  71. package/docs/index.md +0 -111
  72. package/docs/installation.md +0 -75
  73. package/docs/internal-api.md +0 -266
  74. package/docs/locators.md +0 -331
  75. package/docs/mobile-react-native-locators.md +0 -67
  76. package/docs/mobile.md +0 -338
  77. package/docs/pageobjects.md +0 -291
  78. package/docs/parallel.md +0 -400
  79. package/docs/playwright.md +0 -632
  80. package/docs/plugins.md +0 -1259
  81. package/docs/puppeteer.md +0 -316
  82. package/docs/quickstart.md +0 -162
  83. package/docs/react.md +0 -70
  84. package/docs/reports.md +0 -392
  85. package/docs/secrets.md +0 -36
  86. package/docs/shadow.md +0 -68
  87. package/docs/shared/keys.mustache +0 -31
  88. package/docs/shared/react.mustache +0 -1
  89. package/docs/testcafe.md +0 -174
  90. package/docs/translation.md +0 -247
  91. package/docs/tutorial.md +0 -271
  92. package/docs/typescript.md +0 -180
  93. package/docs/ui.md +0 -59
  94. package/docs/videos.md +0 -28
  95. package/docs/visual.md +0 -202
  96. package/docs/vue.md +0 -143
  97. package/docs/webapi/amOnPage.mustache +0 -11
  98. package/docs/webapi/appendField.mustache +0 -11
  99. package/docs/webapi/attachFile.mustache +0 -12
  100. package/docs/webapi/blur.mustache +0 -18
  101. package/docs/webapi/checkOption.mustache +0 -13
  102. package/docs/webapi/clearCookie.mustache +0 -9
  103. package/docs/webapi/clearField.mustache +0 -9
  104. package/docs/webapi/click.mustache +0 -25
  105. package/docs/webapi/clickLink.mustache +0 -8
  106. package/docs/webapi/closeCurrentTab.mustache +0 -7
  107. package/docs/webapi/closeOtherTabs.mustache +0 -8
  108. package/docs/webapi/dontSee.mustache +0 -11
  109. package/docs/webapi/dontSeeCheckboxIsChecked.mustache +0 -10
  110. package/docs/webapi/dontSeeCookie.mustache +0 -8
  111. package/docs/webapi/dontSeeCurrentUrlEquals.mustache +0 -10
  112. package/docs/webapi/dontSeeElement.mustache +0 -8
  113. package/docs/webapi/dontSeeElementInDOM.mustache +0 -8
  114. package/docs/webapi/dontSeeInCurrentUrl.mustache +0 -4
  115. package/docs/webapi/dontSeeInField.mustache +0 -11
  116. package/docs/webapi/dontSeeInSource.mustache +0 -8
  117. package/docs/webapi/dontSeeInTitle.mustache +0 -8
  118. package/docs/webapi/doubleClick.mustache +0 -13
  119. package/docs/webapi/downloadFile.mustache +0 -12
  120. package/docs/webapi/dragAndDrop.mustache +0 -9
  121. package/docs/webapi/dragSlider.mustache +0 -11
  122. package/docs/webapi/executeAsyncScript.mustache +0 -24
  123. package/docs/webapi/executeScript.mustache +0 -26
  124. package/docs/webapi/fillField.mustache +0 -16
  125. package/docs/webapi/focus.mustache +0 -13
  126. package/docs/webapi/forceClick.mustache +0 -28
  127. package/docs/webapi/forceRightClick.mustache +0 -18
  128. package/docs/webapi/grabAllWindowHandles.mustache +0 -7
  129. package/docs/webapi/grabAttributeFrom.mustache +0 -10
  130. package/docs/webapi/grabAttributeFromAll.mustache +0 -9
  131. package/docs/webapi/grabBrowserLogs.mustache +0 -9
  132. package/docs/webapi/grabCookie.mustache +0 -11
  133. package/docs/webapi/grabCssPropertyFrom.mustache +0 -11
  134. package/docs/webapi/grabCssPropertyFromAll.mustache +0 -10
  135. package/docs/webapi/grabCurrentUrl.mustache +0 -9
  136. package/docs/webapi/grabCurrentWindowHandle.mustache +0 -6
  137. package/docs/webapi/grabDataFromPerformanceTiming.mustache +0 -20
  138. package/docs/webapi/grabElementBoundingRect.mustache +0 -20
  139. package/docs/webapi/grabGeoLocation.mustache +0 -8
  140. package/docs/webapi/grabHTMLFrom.mustache +0 -10
  141. package/docs/webapi/grabHTMLFromAll.mustache +0 -9
  142. package/docs/webapi/grabNumberOfOpenTabs.mustache +0 -8
  143. package/docs/webapi/grabNumberOfVisibleElements.mustache +0 -9
  144. package/docs/webapi/grabPageScrollPosition.mustache +0 -8
  145. package/docs/webapi/grabPopupText.mustache +0 -5
  146. package/docs/webapi/grabSource.mustache +0 -8
  147. package/docs/webapi/grabTextFrom.mustache +0 -10
  148. package/docs/webapi/grabTextFromAll.mustache +0 -9
  149. package/docs/webapi/grabTitle.mustache +0 -8
  150. package/docs/webapi/grabValueFrom.mustache +0 -9
  151. package/docs/webapi/grabValueFromAll.mustache +0 -8
  152. package/docs/webapi/grabWebElement.mustache +0 -9
  153. package/docs/webapi/grabWebElements.mustache +0 -9
  154. package/docs/webapi/moveCursorTo.mustache +0 -12
  155. package/docs/webapi/openNewTab.mustache +0 -7
  156. package/docs/webapi/pressKey.mustache +0 -12
  157. package/docs/webapi/pressKeyDown.mustache +0 -12
  158. package/docs/webapi/pressKeyUp.mustache +0 -12
  159. package/docs/webapi/pressKeyWithKeyNormalization.mustache +0 -60
  160. package/docs/webapi/refreshPage.mustache +0 -6
  161. package/docs/webapi/resizeWindow.mustache +0 -6
  162. package/docs/webapi/rightClick.mustache +0 -14
  163. package/docs/webapi/saveElementScreenshot.mustache +0 -10
  164. package/docs/webapi/saveScreenshot.mustache +0 -12
  165. package/docs/webapi/say.mustache +0 -10
  166. package/docs/webapi/scrollIntoView.mustache +0 -11
  167. package/docs/webapi/scrollPageToBottom.mustache +0 -6
  168. package/docs/webapi/scrollPageToTop.mustache +0 -6
  169. package/docs/webapi/scrollTo.mustache +0 -12
  170. package/docs/webapi/see.mustache +0 -11
  171. package/docs/webapi/seeAttributesOnElements.mustache +0 -9
  172. package/docs/webapi/seeCheckboxIsChecked.mustache +0 -10
  173. package/docs/webapi/seeCookie.mustache +0 -8
  174. package/docs/webapi/seeCssPropertiesOnElements.mustache +0 -9
  175. package/docs/webapi/seeCurrentUrlEquals.mustache +0 -11
  176. package/docs/webapi/seeElement.mustache +0 -8
  177. package/docs/webapi/seeElementInDOM.mustache +0 -8
  178. package/docs/webapi/seeInCurrentUrl.mustache +0 -8
  179. package/docs/webapi/seeInField.mustache +0 -12
  180. package/docs/webapi/seeInPopup.mustache +0 -8
  181. package/docs/webapi/seeInSource.mustache +0 -7
  182. package/docs/webapi/seeInTitle.mustache +0 -8
  183. package/docs/webapi/seeNumberOfElements.mustache +0 -11
  184. package/docs/webapi/seeNumberOfVisibleElements.mustache +0 -10
  185. package/docs/webapi/seeTextEquals.mustache +0 -9
  186. package/docs/webapi/seeTitleEquals.mustache +0 -8
  187. package/docs/webapi/selectOption.mustache +0 -21
  188. package/docs/webapi/setCookie.mustache +0 -16
  189. package/docs/webapi/setGeoLocation.mustache +0 -12
  190. package/docs/webapi/switchTo.mustache +0 -9
  191. package/docs/webapi/switchToNextTab.mustache +0 -10
  192. package/docs/webapi/switchToPreviousTab.mustache +0 -10
  193. package/docs/webapi/type.mustache +0 -21
  194. package/docs/webapi/uncheckOption.mustache +0 -13
  195. package/docs/webapi/wait.mustache +0 -8
  196. package/docs/webapi/waitForClickable.mustache +0 -11
  197. package/docs/webapi/waitForDetached.mustache +0 -10
  198. package/docs/webapi/waitForElement.mustache +0 -11
  199. package/docs/webapi/waitForEnabled.mustache +0 -6
  200. package/docs/webapi/waitForFunction.mustache +0 -17
  201. package/docs/webapi/waitForInvisible.mustache +0 -10
  202. package/docs/webapi/waitForText.mustache +0 -13
  203. package/docs/webapi/waitForValue.mustache +0 -10
  204. package/docs/webapi/waitForVisible.mustache +0 -10
  205. package/docs/webapi/waitInUrl.mustache +0 -9
  206. package/docs/webapi/waitNumberOfVisibleElements.mustache +0 -10
  207. package/docs/webapi/waitToHide.mustache +0 -10
  208. package/docs/webapi/waitUrlEquals.mustache +0 -10
  209. package/docs/webdriver.md +0 -655
  210. package/docs/wiki/Books-&-Posts.md +0 -27
  211. package/docs/wiki/Community-Helpers-&-Plugins.md +0 -53
  212. package/docs/wiki/Converting-Playwright-to-Istanbul-Coverage.md +0 -61
  213. package/docs/wiki/Examples.md +0 -145
  214. package/docs/wiki/Google-Summer-of-Code-(GSoC)-2020.md +0 -68
  215. package/docs/wiki/Home.md +0 -16
  216. package/docs/wiki/Migration-to-Appium-v2---CodeceptJS.md +0 -83
  217. package/docs/wiki/Release-Process.md +0 -24
  218. package/docs/wiki/Roadmap.md +0 -23
  219. package/docs/wiki/Tests.md +0 -1393
  220. package/docs/wiki/Upgrading-to-CodeceptJS-3.md +0 -153
  221. package/docs/wiki/Videos.md +0 -19
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeceptjs",
3
- "version": "3.5.11",
3
+ "version": "3.5.12-beta.1",
4
4
  "description": "Supercharged End 2 End Testing Framework for NodeJS",
5
5
  "keywords": [
6
6
  "acceptance",
@@ -23,7 +23,6 @@
23
23
  },
24
24
  "files": [
25
25
  "bin",
26
- "docs",
27
26
  "lib",
28
27
  "translations",
29
28
  "typings/**/*.d.ts"
@@ -52,8 +51,11 @@
52
51
  "test:unit:webbapi:playwright": "mocha test/helper/Playwright_test.js",
53
52
  "test:unit:webbapi:puppeteer": "mocha test/helper/Puppeteer_test.js",
54
53
  "test:unit:webbapi:webDriver": "mocha test/helper/WebDriver_test.js",
54
+ "test:unit:webbapi:webDriver:noSeleniumServer": "mocha test/helper/WebDriver.noSeleniumServer_test.js",
55
+ "test:unit:webbapi:webDriver:devtools": "mocha test/helper/WebDriver_devtools_test.js --exit",
55
56
  "test:unit:webbapi:testCafe": "mocha test/helper/TestCafe_test.js",
56
57
  "test:unit:expect": "mocha test/helper/Expect_test.js",
58
+ "test:plugin": "mocha test/plugin/plugin_test.js",
57
59
  "def": "./runok.js def",
58
60
  "dev:graphql": "node test/data/graphql/index.js",
59
61
  "publish:site": "./runok.js publish:site",
@@ -67,7 +69,7 @@
67
69
  "@codeceptjs/helper": "2.0.1",
68
70
  "@cucumber/cucumber-expressions": "17",
69
71
  "@cucumber/gherkin": "26",
70
- "@cucumber/messages": "22.0.0",
72
+ "@cucumber/messages": "24.0.1",
71
73
  "@xmldom/xmldom": "0.8.10",
72
74
  "acorn": "8.11.2",
73
75
  "arrify": "2.0.1",
@@ -81,8 +83,9 @@
81
83
  "chai-string": "^1.5.0",
82
84
  "chalk": "4.1.2",
83
85
  "commander": "11.1.0",
84
- "convert-cssxpath": "1.0.2",
85
86
  "cross-spawn": "7.0.3",
87
+ "csstoxpath": "1.6.0",
88
+ "devtools": "8.27.2",
86
89
  "envinfo": "7.11.0",
87
90
  "escape-string-regexp": "4.0.0",
88
91
  "figures": "3.2.0",
@@ -117,10 +120,11 @@
117
120
  "@pollyjs/core": "5.1.0",
118
121
  "@types/chai": "^4.3.7",
119
122
  "@types/inquirer": "9.0.3",
120
- "@types/node": "20.4.4",
123
+ "@types/node": "20.10.7",
121
124
  "@wdio/sauce-service": "8.27.0",
122
125
  "@wdio/selenium-standalone-service": "8.3.2",
123
- "@wdio/utils": "8.27.0",
126
+ "@wdio/utils": "8.27.2",
127
+ "@xmldom/xmldom": "0.8.10",
124
128
  "apollo-server-express": "2.25.3",
125
129
  "chai-as-promised": "7.1.1",
126
130
  "chai-subset": "1.6.0",
@@ -130,7 +134,7 @@
130
134
  "electron": "28.0.0",
131
135
  "eslint": "8.56.0",
132
136
  "eslint-config-airbnb-base": "15.0.0",
133
- "eslint-plugin-import": "2.29.0",
137
+ "eslint-plugin-import": "2.29.1",
134
138
  "eslint-plugin-mocha": "6.3.0",
135
139
  "expect": "29.7.0",
136
140
  "express": "4.18.2",
@@ -143,7 +147,7 @@
143
147
  "playwright": "1.40.1",
144
148
  "puppeteer": "21.1.1",
145
149
  "qrcode-terminal": "0.12.0",
146
- "rosie": "2.1.0",
150
+ "rosie": "2.1.1",
147
151
  "runok": "0.9.3",
148
152
  "sinon": "17.0.1",
149
153
  "sinon-chai": "3.7.0",
@@ -151,13 +155,12 @@
151
155
  "ts-morph": "21.0.1",
152
156
  "ts-node": "10.9.2",
153
157
  "tsd-jsdoc": "2.5.0",
154
- "typedoc": "0.25.4",
158
+ "typedoc": "0.25.7",
155
159
  "typedoc-plugin-markdown": "3.17.1",
156
160
  "typescript": "5.3.3",
157
161
  "wdio-docker-service": "1.5.0",
158
- "webdriverio": "8.3.8",
162
+ "webdriverio": "8.27.2",
159
163
  "xml2js": "0.6.2",
160
- "@xmldom/xmldom": "0.8.10",
161
164
  "xpath": "0.0.34"
162
165
  },
163
166
  "engines": {
@@ -97,7 +97,7 @@ declare namespace CodeceptJS {
97
97
  * }
98
98
  * }
99
99
  * ```
100
- */
100
+ */
101
101
  helpers?: {
102
102
  /**
103
103
  * Run web tests controlling browsers via Playwright engine.
@@ -289,7 +289,7 @@ declare namespace CodeceptJS {
289
289
  * ```js
290
290
  * bootstrap: 'bootstrap.js',
291
291
  * ```
292
- */
292
+ */
293
293
  bootstrap?: (() => Promise<void>) | boolean | string;
294
294
  /**
295
295
  * [Execute code after tests](https://codecept.io/bootstrap/) finished.
@@ -303,7 +303,7 @@ declare namespace CodeceptJS {
303
303
  * ```js
304
304
  * teardown: 'teardown.js',
305
305
  * ```
306
- */
306
+ */
307
307
  teardown?: (() => Promise<void>) | boolean | string;
308
308
  /**
309
309
  * [Execute code before launching tests in parallel mode](https://codecept.io/bootstrap/#bootstrapall-teardownall)
@@ -312,7 +312,7 @@ declare namespace CodeceptJS {
312
312
  bootstrapAll?: (() => Promise<void>) | boolean | string;
313
313
  /**
314
314
  * [Execute JS code after finishing tests in parallel mode](https://codecept.io/bootstrap/#bootstrapall-teardownall)
315
- */
315
+ */
316
316
  teardownAll?: (() => Promise<void>) | boolean | string;
317
317
 
318
318
  /** Enable [localized test commands](https://codecept.io/translation/) */
@@ -328,7 +328,7 @@ declare namespace CodeceptJS {
328
328
  * ```
329
329
  * require: ["should"]
330
330
  * ```
331
- */
331
+ */
332
332
  require?: Array<string>;
333
333
 
334
334
  /**
@@ -423,15 +423,18 @@ declare namespace CodeceptJS {
423
423
  | { ios: string }
424
424
  | { android: string; ios: string }
425
425
  | { react: string }
426
+ | { vue: string }
426
427
  | { shadow: string[] }
427
428
  | { custom: string };
428
429
 
429
430
  interface CustomLocators {}
431
+ interface OtherLocators { props?: object }
430
432
  type LocatorOrString =
431
433
  | string
432
434
  | ILocator
433
435
  | Locator
434
- | CustomLocators;
436
+ | OtherLocators
437
+ | CustomLocators[keyof CustomLocators];
435
438
 
436
439
  type StringOrSecret = string | CodeceptJS.Secret;
437
440
 
@@ -4347,6 +4347,16 @@ declare namespace CodeceptJS {
4347
4347
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
4348
4348
  */
4349
4349
  waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
4350
+ /**
4351
+ * Waits for number of tabs.
4352
+ *
4353
+ * ```js
4354
+ * I.waitForNumberOfTabs(2);
4355
+ * ```
4356
+ * @param expectedTabs - expecting the number of tabs.
4357
+ * @param sec - number of secs to wait.
4358
+ */
4359
+ waitForNumberOfTabs(expectedTabs: number, sec: number): Promise<any>;
4350
4360
  /**
4351
4361
  * Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
4352
4362
  *
@@ -7454,6 +7464,16 @@ declare namespace CodeceptJS {
7454
7464
  * @param [sec = 1] - (optional, `1` by default) time in seconds to wait
7455
7465
  */
7456
7466
  waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): Promise<any>;
7467
+ /**
7468
+ * Waits for number of tabs.
7469
+ *
7470
+ * ```js
7471
+ * I.waitForNumberOfTabs(2);
7472
+ * ```
7473
+ * @param expectedTabs - expecting the number of tabs.
7474
+ * @param sec - number of secs to wait.
7475
+ */
7476
+ waitForNumberOfTabs(expectedTabs: number, sec: number): Promise<any>;
7457
7477
  /**
7458
7478
  * Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
7459
7479
  *
@@ -8667,6 +8687,13 @@ declare namespace CodeceptJS {
8667
8687
  *
8668
8688
  * WebDriver requires Selenium Server and ChromeDriver/GeckoDriver to be installed. Those tools can be easily installed via NPM. Please check [Testing with WebDriver](https://codecept.io/webdriver/#testing-with-webdriver) for more details.
8669
8689
  *
8690
+ * With the release of WebdriverIO version v8.14.0, and onwards, all driver management hassles are now a thing of the past 🙌. Read more [here](https://webdriver.io/blog/2023/07/31/driver-management/).
8691
+ * One of the significant advantages of this update is that you can now get rid of any driver services you previously had to manage, such as
8692
+ * `wdio-chromedriver-service`, `wdio-geckodriver-service`, `wdio-edgedriver-service`, `wdio-safaridriver-service`, and even `@wdio/selenium-standalone-service`.
8693
+ *
8694
+ * For those who require custom driver options, fear not; WebDriver Helper allows you to pass in driver options through custom WebDriver configuration.
8695
+ * If you have a custom grid, use a cloud service, or prefer to run your own driver, there's no need to worry since WebDriver Helper will only start a driver when there are no other connection information settings like hostname or port specified.
8696
+ *
8670
8697
  * <!-- configuration -->
8671
8698
  *
8672
8699
  * Example:
@@ -8688,6 +8715,28 @@ declare namespace CodeceptJS {
8688
8715
  * }
8689
8716
  * ```
8690
8717
  *
8718
+ * Testing Chrome locally is now more convenient than ever. You can define a browser channel, and WebDriver Helper will take care of downloading the specified browser version for you.
8719
+ * For example:
8720
+ *
8721
+ * ```js
8722
+ * {
8723
+ * helpers: {
8724
+ * WebDriver : {
8725
+ * smartWait: 5000,
8726
+ * browser: "chrome",
8727
+ * browserVersion: '116.0.5793.0', // or 'stable', 'beta', 'dev' or 'canary'
8728
+ * restart: false,
8729
+ * windowSize: "maximize",
8730
+ * timeouts: {
8731
+ * "script": 60000,
8732
+ * "page load": 10000
8733
+ * }
8734
+ * }
8735
+ * }
8736
+ * }
8737
+ * ```
8738
+ *
8739
+ *
8691
8740
  * Example with basic authentication
8692
8741
  * ```js
8693
8742
  * {
@@ -8728,6 +8777,25 @@ declare namespace CodeceptJS {
8728
8777
  * }
8729
8778
  * ```
8730
8779
  *
8780
+ * ### Running with devtools protocol
8781
+ *
8782
+ * ```js
8783
+ * {
8784
+ * helpers: {
8785
+ * WebDriver : {
8786
+ * url: "http://localhost",
8787
+ * browser: "chrome",
8788
+ * devtoolsProtocol: true,
8789
+ * desiredCapabilities: {
8790
+ * chromeOptions: {
8791
+ * args: [ "--headless", "--disable-gpu", "--no-sandbox" ]
8792
+ * }
8793
+ * }
8794
+ * }
8795
+ * }
8796
+ * }
8797
+ * ```
8798
+ *
8731
8799
  * ### Internet Explorer
8732
8800
  *
8733
8801
  * Additional configuration params can be used from [IE options](https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/IE/Options.html)
@@ -10295,6 +10363,16 @@ declare namespace CodeceptJS {
10295
10363
  * @param [sec = null] - (optional, `1` by default) time in seconds to wait
10296
10364
  */
10297
10365
  waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): Promise<any>;
10366
+ /**
10367
+ * Waits for number of tabs.
10368
+ *
10369
+ * ```js
10370
+ * I.waitForNumberOfTabs(2);
10371
+ * ```
10372
+ * @param expectedTabs - expecting the number of tabs.
10373
+ * @param sec - number of secs to wait.
10374
+ */
10375
+ waitForNumberOfTabs(expectedTabs: number, sec: number): Promise<any>;
10298
10376
  /**
10299
10377
  * Switches frame or in case of null locator reverts to parent.
10300
10378
  *
@@ -10388,6 +10466,9 @@ declare namespace CodeceptJS {
10388
10466
  */
10389
10467
  grabPageScrollPosition(): Promise<PageScrollPosition>;
10390
10468
  /**
10469
+ * This method is **deprecated**.
10470
+ *
10471
+ *
10391
10472
  * Set the current geo location
10392
10473
  *
10393
10474
  *
@@ -10397,10 +10478,12 @@ declare namespace CodeceptJS {
10397
10478
  * ```
10398
10479
  * @param latitude - to set.
10399
10480
  * @param longitude - to set
10400
- * @param [altitude = null] - (optional, null by default) to set
10481
+ * @param [altitude] - (optional, null by default) to set
10401
10482
  */
10402
10483
  setGeoLocation(latitude: number, longitude: number, altitude?: number): Promise<any>;
10403
10484
  /**
10485
+ * This method is **deprecated**.
10486
+ *
10404
10487
  * Return the current geo location
10405
10488
  * Resumes test execution, so **should be used inside async function with `await`** operator.
10406
10489
  *
@@ -4583,6 +4583,17 @@ declare namespace CodeceptJS {
4583
4583
  * @returns automatically synchronized promise through #recorder
4584
4584
  */
4585
4585
  waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): void;
4586
+ /**
4587
+ * Waits for number of tabs.
4588
+ *
4589
+ * ```js
4590
+ * I.waitForNumberOfTabs(2);
4591
+ * ```
4592
+ * @param expectedTabs - expecting the number of tabs.
4593
+ * @param sec - number of secs to wait.
4594
+ * @returns automatically synchronized promise through #recorder
4595
+ */
4596
+ waitForNumberOfTabs(expectedTabs: number, sec: number): void;
4586
4597
  /**
4587
4598
  * Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
4588
4599
  *
@@ -7938,6 +7949,17 @@ declare namespace CodeceptJS {
7938
7949
  * @returns automatically synchronized promise through #recorder
7939
7950
  */
7940
7951
  waitToHide(locator: CodeceptJS.LocatorOrString, sec?: number): void;
7952
+ /**
7953
+ * Waits for number of tabs.
7954
+ *
7955
+ * ```js
7956
+ * I.waitForNumberOfTabs(2);
7957
+ * ```
7958
+ * @param expectedTabs - expecting the number of tabs.
7959
+ * @param sec - number of secs to wait.
7960
+ * @returns automatically synchronized promise through #recorder
7961
+ */
7962
+ waitForNumberOfTabs(expectedTabs: number, sec: number): void;
7941
7963
  /**
7942
7964
  * Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
7943
7965
  *
@@ -9255,6 +9277,8 @@ declare namespace CodeceptJS {
9255
9277
  * @property [manualStart = false] - do not start browser before a test, start it manually inside a helper with `this.helpers["WebDriver"]._startBrowser()`.
9256
9278
  * @property [timeouts] - [WebDriver timeouts](http://webdriver.io/docs/timeouts.html) defined as hash.
9257
9279
  * @property [highlightElement] - highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
9280
+ * @property [logLevel = silent] - level of logging verbosity. Default: silent. Options: trace | debug | info | warn | error | silent. More info: https://webdriver.io/docs/configuration/#loglevel
9281
+ * @property [devtoolsProtocol = false] - enable devtools protocol. Default: false. More info: https://webdriver.io/docs/automationProtocols/#devtools-protocol.
9258
9282
  */
9259
9283
  type WebDriverConfig = {
9260
9284
  url: string;
@@ -9277,6 +9301,8 @@ declare namespace CodeceptJS {
9277
9301
  manualStart?: boolean;
9278
9302
  timeouts?: any;
9279
9303
  highlightElement?: boolean;
9304
+ logLevel?: string;
9305
+ devtoolsProtocol?: boolean;
9280
9306
  };
9281
9307
  /**
9282
9308
  * WebDriver helper which wraps [webdriverio](http://webdriver.io/) library to
@@ -9284,6 +9310,13 @@ declare namespace CodeceptJS {
9284
9310
  *
9285
9311
  * WebDriver requires Selenium Server and ChromeDriver/GeckoDriver to be installed. Those tools can be easily installed via NPM. Please check [Testing with WebDriver](https://codecept.io/webdriver/#testing-with-webdriver) for more details.
9286
9312
  *
9313
+ * With the release of WebdriverIO version v8.14.0, and onwards, all driver management hassles are now a thing of the past 🙌. Read more [here](https://webdriver.io/blog/2023/07/31/driver-management/).
9314
+ * One of the significant advantages of this update is that you can now get rid of any driver services you previously had to manage, such as
9315
+ * `wdio-chromedriver-service`, `wdio-geckodriver-service`, `wdio-edgedriver-service`, `wdio-safaridriver-service`, and even `@wdio/selenium-standalone-service`.
9316
+ *
9317
+ * For those who require custom driver options, fear not; WebDriver Helper allows you to pass in driver options through custom WebDriver configuration.
9318
+ * If you have a custom grid, use a cloud service, or prefer to run your own driver, there's no need to worry since WebDriver Helper will only start a driver when there are no other connection information settings like hostname or port specified.
9319
+ *
9287
9320
  * <!-- configuration -->
9288
9321
  *
9289
9322
  * Example:
@@ -9305,6 +9338,28 @@ declare namespace CodeceptJS {
9305
9338
  * }
9306
9339
  * ```
9307
9340
  *
9341
+ * Testing Chrome locally is now more convenient than ever. You can define a browser channel, and WebDriver Helper will take care of downloading the specified browser version for you.
9342
+ * For example:
9343
+ *
9344
+ * ```js
9345
+ * {
9346
+ * helpers: {
9347
+ * WebDriver : {
9348
+ * smartWait: 5000,
9349
+ * browser: "chrome",
9350
+ * browserVersion: '116.0.5793.0', // or 'stable', 'beta', 'dev' or 'canary'
9351
+ * restart: false,
9352
+ * windowSize: "maximize",
9353
+ * timeouts: {
9354
+ * "script": 60000,
9355
+ * "page load": 10000
9356
+ * }
9357
+ * }
9358
+ * }
9359
+ * }
9360
+ * ```
9361
+ *
9362
+ *
9308
9363
  * Example with basic authentication
9309
9364
  * ```js
9310
9365
  * {
@@ -9345,6 +9400,25 @@ declare namespace CodeceptJS {
9345
9400
  * }
9346
9401
  * ```
9347
9402
  *
9403
+ * ### Running with devtools protocol
9404
+ *
9405
+ * ```js
9406
+ * {
9407
+ * helpers: {
9408
+ * WebDriver : {
9409
+ * url: "http://localhost",
9410
+ * browser: "chrome",
9411
+ * devtoolsProtocol: true,
9412
+ * desiredCapabilities: {
9413
+ * chromeOptions: {
9414
+ * args: [ "--headless", "--disable-gpu", "--no-sandbox" ]
9415
+ * }
9416
+ * }
9417
+ * }
9418
+ * }
9419
+ * }
9420
+ * ```
9421
+ *
9348
9422
  * ### Internet Explorer
9349
9423
  *
9350
9424
  * Additional configuration params can be used from [IE options](https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/IE/Options.html)
@@ -11016,6 +11090,17 @@ declare namespace CodeceptJS {
11016
11090
  * @returns automatically synchronized promise through #recorder
11017
11091
  */
11018
11092
  waitForFunction(fn: string | ((...params: any[]) => any), argsOrSec?: any[] | number, sec?: number): void;
11093
+ /**
11094
+ * Waits for number of tabs.
11095
+ *
11096
+ * ```js
11097
+ * I.waitForNumberOfTabs(2);
11098
+ * ```
11099
+ * @param expectedTabs - expecting the number of tabs.
11100
+ * @param sec - number of secs to wait.
11101
+ * @returns automatically synchronized promise through #recorder
11102
+ */
11103
+ waitForNumberOfTabs(expectedTabs: number, sec: number): void;
11019
11104
  /**
11020
11105
  * Switches frame or in case of null locator reverts to parent.
11021
11106
  *
@@ -11117,6 +11202,9 @@ declare namespace CodeceptJS {
11117
11202
  */
11118
11203
  grabPageScrollPosition(): Promise<PageScrollPosition>;
11119
11204
  /**
11205
+ * This method is **deprecated**.
11206
+ *
11207
+ *
11120
11208
  * Set the current geo location
11121
11209
  *
11122
11210
  *
@@ -11126,11 +11214,13 @@ declare namespace CodeceptJS {
11126
11214
  * ```
11127
11215
  * @param latitude - to set.
11128
11216
  * @param longitude - to set
11129
- * @param [altitude = null] - (optional, null by default) to set
11217
+ * @param [altitude] - (optional, null by default) to set
11130
11218
  * @returns automatically synchronized promise through #recorder
11131
11219
  */
11132
11220
  setGeoLocation(latitude: number, longitude: number, altitude?: number): void;
11133
11221
  /**
11222
+ * This method is **deprecated**.
11223
+ *
11134
11224
  * Return the current geo location
11135
11225
  * Resumes test execution, so **should be used inside async function with `await`** operator.
11136
11226
  *
@@ -11513,7 +11603,10 @@ declare namespace CodeceptJS {
11513
11603
  isStrict(): boolean;
11514
11604
  isAccessibilityId(): boolean;
11515
11605
  isBasic(): boolean;
11516
- toXPath(): string;
11606
+ /**
11607
+ * @param [pseudoSelector] - CSS to XPath extension pseudo: https://www.npmjs.com/package/csstoxpath?activeTab=explore#extension-pseudos
11608
+ */
11609
+ toXPath(pseudoSelector?: string): string;
11517
11610
  or(locator: CodeceptJS.LocatorOrString): Locator;
11518
11611
  find(locator: CodeceptJS.LocatorOrString): Locator;
11519
11612
  withChild(locator: CodeceptJS.LocatorOrString): Locator;
@@ -11521,7 +11614,14 @@ declare namespace CodeceptJS {
11521
11614
  at(position: number): Locator;
11522
11615
  first(): Locator;
11523
11616
  last(): Locator;
11617
+ /**
11618
+ * Find an element containing a text
11619
+ */
11524
11620
  withText(text: string): Locator;
11621
+ /**
11622
+ * Find an element with exact text
11623
+ */
11624
+ withTextEquals(text: string): Locator;
11525
11625
  withAttr(attributes: {
11526
11626
  [key: string]: string;
11527
11627
  }): Locator;