codeceptjs 3.5.7 → 3.5.9-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 (108) hide show
  1. package/README.md +1 -1
  2. package/docs/build/Appium.js +27 -22
  3. package/docs/build/Nightmare.js +51 -52
  4. package/docs/build/Playwright.js +75 -75
  5. package/docs/build/Protractor.js +64 -65
  6. package/docs/build/Puppeteer.js +74 -75
  7. package/docs/build/TestCafe.js +54 -55
  8. package/docs/build/WebDriver.js +79 -80
  9. package/docs/changelog.md +1 -562
  10. package/docs/community-helpers.md +4 -8
  11. package/docs/examples.md +2 -8
  12. package/docs/helpers/Appium.md +85 -83
  13. package/docs/helpers/Nightmare.md +75 -77
  14. package/docs/helpers/Playwright.md +175 -177
  15. package/docs/helpers/Protractor.md +153 -155
  16. package/docs/helpers/Puppeteer.md +146 -148
  17. package/docs/helpers/TestCafe.md +124 -126
  18. package/docs/helpers/WebDriver.md +155 -157
  19. package/docs/webapi/amOnPage.mustache +1 -1
  20. package/docs/webapi/appendField.mustache +1 -1
  21. package/docs/webapi/attachFile.mustache +1 -1
  22. package/docs/webapi/blur.mustache +1 -1
  23. package/docs/webapi/checkOption.mustache +1 -1
  24. package/docs/webapi/clearCookie.mustache +1 -2
  25. package/docs/webapi/clearField.mustache +1 -1
  26. package/docs/webapi/click.mustache +1 -1
  27. package/docs/webapi/clickLink.mustache +1 -1
  28. package/docs/webapi/closeCurrentTab.mustache +1 -1
  29. package/docs/webapi/closeOtherTabs.mustache +1 -1
  30. package/docs/webapi/dontSee.mustache +1 -1
  31. package/docs/webapi/dontSeeCheckboxIsChecked.mustache +1 -1
  32. package/docs/webapi/dontSeeCookie.mustache +1 -1
  33. package/docs/webapi/dontSeeCurrentUrlEquals.mustache +1 -1
  34. package/docs/webapi/dontSeeElement.mustache +1 -1
  35. package/docs/webapi/dontSeeElementInDOM.mustache +1 -1
  36. package/docs/webapi/dontSeeInCurrentUrl.mustache +1 -1
  37. package/docs/webapi/dontSeeInField.mustache +1 -1
  38. package/docs/webapi/dontSeeInSource.mustache +1 -1
  39. package/docs/webapi/dontSeeInTitle.mustache +1 -1
  40. package/docs/webapi/doubleClick.mustache +1 -1
  41. package/docs/webapi/downloadFile.mustache +1 -1
  42. package/docs/webapi/dragAndDrop.mustache +1 -1
  43. package/docs/webapi/dragSlider.mustache +1 -1
  44. package/docs/webapi/fillField.mustache +1 -1
  45. package/docs/webapi/focus.mustache +1 -1
  46. package/docs/webapi/forceClick.mustache +1 -1
  47. package/docs/webapi/forceRightClick.mustache +1 -1
  48. package/docs/webapi/grabDataFromPerformanceTiming.mustache +1 -1
  49. package/docs/webapi/moveCursorTo.mustache +1 -1
  50. package/docs/webapi/openNewTab.mustache +1 -1
  51. package/docs/webapi/pressKey.mustache +1 -1
  52. package/docs/webapi/pressKeyDown.mustache +1 -1
  53. package/docs/webapi/pressKeyUp.mustache +1 -1
  54. package/docs/webapi/pressKeyWithKeyNormalization.mustache +1 -1
  55. package/docs/webapi/refreshPage.mustache +1 -1
  56. package/docs/webapi/resizeWindow.mustache +1 -1
  57. package/docs/webapi/rightClick.mustache +1 -1
  58. package/docs/webapi/saveElementScreenshot.mustache +1 -1
  59. package/docs/webapi/saveScreenshot.mustache +1 -1
  60. package/docs/webapi/say.mustache +1 -1
  61. package/docs/webapi/scrollIntoView.mustache +1 -1
  62. package/docs/webapi/scrollPageToBottom.mustache +1 -1
  63. package/docs/webapi/scrollPageToTop.mustache +1 -1
  64. package/docs/webapi/scrollTo.mustache +1 -1
  65. package/docs/webapi/see.mustache +1 -1
  66. package/docs/webapi/seeAttributesOnElements.mustache +1 -1
  67. package/docs/webapi/seeCheckboxIsChecked.mustache +1 -1
  68. package/docs/webapi/seeCookie.mustache +1 -1
  69. package/docs/webapi/seeCssPropertiesOnElements.mustache +1 -1
  70. package/docs/webapi/seeCurrentUrlEquals.mustache +1 -1
  71. package/docs/webapi/seeElement.mustache +1 -1
  72. package/docs/webapi/seeElementInDOM.mustache +1 -1
  73. package/docs/webapi/seeInCurrentUrl.mustache +1 -1
  74. package/docs/webapi/seeInField.mustache +1 -1
  75. package/docs/webapi/seeInPopup.mustache +1 -1
  76. package/docs/webapi/seeInSource.mustache +1 -1
  77. package/docs/webapi/seeInTitle.mustache +1 -1
  78. package/docs/webapi/seeNumberOfElements.mustache +1 -1
  79. package/docs/webapi/seeNumberOfVisibleElements.mustache +1 -1
  80. package/docs/webapi/seeTextEquals.mustache +1 -1
  81. package/docs/webapi/seeTitleEquals.mustache +1 -1
  82. package/docs/webapi/selectOption.mustache +1 -1
  83. package/docs/webapi/setCookie.mustache +1 -1
  84. package/docs/webapi/setGeoLocation.mustache +1 -1
  85. package/docs/webapi/switchTo.mustache +1 -1
  86. package/docs/webapi/switchToNextTab.mustache +1 -1
  87. package/docs/webapi/switchToPreviousTab.mustache +1 -1
  88. package/docs/webapi/type.mustache +1 -1
  89. package/docs/webapi/uncheckOption.mustache +1 -1
  90. package/docs/webapi/wait.mustache +1 -1
  91. package/docs/webapi/waitForClickable.mustache +1 -1
  92. package/docs/webapi/waitForDetached.mustache +1 -1
  93. package/docs/webapi/waitForElement.mustache +1 -1
  94. package/docs/webapi/waitForEnabled.mustache +1 -1
  95. package/docs/webapi/waitForFunction.mustache +1 -1
  96. package/docs/webapi/waitForInvisible.mustache +1 -1
  97. package/docs/webapi/waitForText.mustache +1 -1
  98. package/docs/webapi/waitForValue.mustache +1 -1
  99. package/docs/webapi/waitForVisible.mustache +1 -1
  100. package/docs/webapi/waitInUrl.mustache +1 -1
  101. package/docs/webapi/waitNumberOfVisibleElements.mustache +1 -1
  102. package/docs/webapi/waitToHide.mustache +1 -1
  103. package/docs/webapi/waitUrlEquals.mustache +1 -1
  104. package/lib/helper/Appium.js +9 -4
  105. package/lib/helper/Playwright.js +3 -2
  106. package/package.json +5 -5
  107. package/typings/promiseBasedTypes.d.ts +423 -1010
  108. package/typings/types.d.ts +423 -427
@@ -7,4 +7,4 @@ I.waitForVisible('#popup');
7
7
 
8
8
  @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
9
9
  @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
10
- @returns {Promise<void>} automatically synchronized promise through #recorder
10
+ @returns {void} automatically synchronized promise through #recorder
@@ -6,4 +6,4 @@ I.waitInUrl('/info', 2);
6
6
 
7
7
  @param {string} urlPart value to check.
8
8
  @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
9
- @returns {Promise<void>} automatically synchronized promise through #recorder
9
+ @returns {void} automatically synchronized promise through #recorder
@@ -7,4 +7,4 @@ I.waitNumberOfVisibleElements('a', 3);
7
7
  @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
8
8
  @param {number} num number of elements.
9
9
  @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
10
- @returns {Promise<void>} automatically synchronized promise through #recorder
10
+ @returns {void} automatically synchronized promise through #recorder
@@ -7,4 +7,4 @@ I.waitToHide('#popup');
7
7
 
8
8
  @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
9
9
  @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
10
- @returns {Promise<void>} automatically synchronized promise through #recorder
10
+ @returns {void} automatically synchronized promise through #recorder
@@ -7,4 +7,4 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
7
7
 
8
8
  @param {string} urlPart value to check.
9
9
  @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
10
- @returns {Promise<void>} automatically synchronized promise through #recorder
10
+ @returns {void} automatically synchronized promise through #recorder
@@ -183,7 +183,11 @@ class Appium extends Webdriver {
183
183
  this.axios = axios.create();
184
184
 
185
185
  webdriverio = require('webdriverio');
186
- console.log('The Appium core team does not maintain Appium 1.x anymore since the 1st of January 2022. Please migrating to Appium 2.x by adding appiumV2: true to your config.\nThis Appium 1.x support will be removed in next major release');
186
+ if (!config.appiumV2) {
187
+ console.log('The Appium core team does not maintain Appium 1.x anymore since the 1st of January 2022. Please migrating to Appium 2.x by adding appiumV2: true to your config.');
188
+ console.log('More info: https://bit.ly/appium-v2-migration');
189
+ console.log('This Appium 1.x support will be removed in next major release.');
190
+ }
187
191
  }
188
192
 
189
193
  _validateConfig(config) {
@@ -917,11 +921,12 @@ class Appium extends Webdriver {
917
921
  * I.setNetworkConnection(4) // airplane mode off, wifi off, data on
918
922
  * I.setNetworkConnection(6) // airplane mode off, wifi on, data on
919
923
  * ```
920
- * See corresponding [webdriverio reference](http://webdriver.io/api/mobile/setNetworkConnection.html).
921
- *
922
- * @return {Promise<{}>}
924
+ * See corresponding [webdriverio reference](https://webdriver.io/docs/api/chromium/#setnetworkconnection).
923
925
  *
924
926
  * Appium: support only Android
927
+ *
928
+ * @param {number} value The network connection mode bitmask
929
+ * @return {Promise<number>}
925
930
  */
926
931
  async setNetworkConnection(value) {
927
932
  onlyForApps.call(this, supportedPlatform.android);
@@ -1892,7 +1892,7 @@ class Playwright extends Helper {
1892
1892
  */
1893
1893
  async clearCookie() {
1894
1894
  // Playwright currently doesn't support to delete a certain cookie
1895
- // https://github.com/microsoft/playwright/blob/main/docs/api.md#class-browsercontext
1895
+ // https://github.com/microsoft/playwright/blob/main/docs/src/api/class-browsercontext.md#async-method-browsercontextclearcookies
1896
1896
  if (!this.browserContext) return;
1897
1897
  return this.browserContext.clearCookies();
1898
1898
  }
@@ -2582,6 +2582,7 @@ class Playwright extends Helper {
2582
2582
  let count = 0;
2583
2583
  do {
2584
2584
  waiter = await _contextObject.locator(`:has-text('${text}')`).first().isVisible();
2585
+ if (waiter) break;
2585
2586
  await this.wait(1);
2586
2587
  count += 1000;
2587
2588
  } while (count <= waitTimeout);
@@ -3448,7 +3449,7 @@ async function proceedSee(assertType, text, context, strict = false) {
3448
3449
  if (!context) {
3449
3450
  const el = await this.context;
3450
3451
 
3451
- allText = el.constructor.name ? [await el.locator('body').innerText()] : [await el.innerText()];
3452
+ allText = el.constructor.name !== 'Locator' ? [await el.locator('body').innerText()] : [await el.innerText()];
3452
3453
 
3453
3454
  description = 'web application';
3454
3455
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeceptjs",
3
- "version": "3.5.7",
3
+ "version": "3.5.9-beta.1",
4
4
  "description": "Supercharged End 2 End Testing Framework for NodeJS",
5
5
  "keywords": [
6
6
  "acceptance",
@@ -123,18 +123,18 @@
123
123
  "chai-subset": "1.6.0",
124
124
  "contributor-faces": "1.1.0",
125
125
  "documentation": "12.3.0",
126
- "dtslint": "4.1.6",
127
- "electron": "27.0.2",
126
+ "dtslint": "4.2.1",
127
+ "electron": "27.0.4",
128
128
  "eslint": "8.53.0",
129
129
  "eslint-config-airbnb-base": "15.0.0",
130
130
  "eslint-plugin-import": "2.29.0",
131
131
  "eslint-plugin-mocha": "6.3.0",
132
132
  "expect": "29.7.0",
133
- "express": "4.17.2",
133
+ "express": "4.18.2",
134
134
  "graphql": "14.6.0",
135
135
  "husky": "8.0.3",
136
136
  "inquirer-test": "2.0.1",
137
- "jsdoc": "3.6.10",
137
+ "jsdoc": "3.6.11",
138
138
  "jsdoc-typeof-plugin": "1.0.0",
139
139
  "json-server": "0.10.1",
140
140
  "playwright": "1.39.0",