codeceptjs 3.3.0 → 3.3.3
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.
- package/CHANGELOG.md +50 -1
- package/README.md +6 -1
- package/docs/api.md +1 -1
- package/docs/bdd.md +1 -0
- package/docs/best.md +1 -1
- package/docs/build/ApiDataFactory.js +4 -3
- package/docs/build/Appium.js +21 -16
- package/docs/build/GraphQL.js +4 -2
- package/docs/build/GraphQLDataFactory.js +3 -3
- package/docs/build/JSONResponse.js +1 -1
- package/docs/build/Nightmare.js +54 -25
- package/docs/build/Playwright.js +105 -52
- package/docs/build/Protractor.js +72 -34
- package/docs/build/Puppeteer.js +80 -37
- package/docs/build/REST.js +5 -2
- package/docs/build/TestCafe.js +54 -23
- package/docs/build/WebDriver.js +115 -67
- package/docs/changelog.md +50 -1
- package/docs/custom-helpers.md +1 -1
- package/docs/data.md +2 -2
- package/docs/helpers/ApiDataFactory.md +7 -3
- package/docs/helpers/Appium.md +217 -175
- package/docs/helpers/GraphQL.md +6 -0
- package/docs/helpers/GraphQLDataFactory.md +3 -3
- package/docs/helpers/JSONResponse.md +1 -1
- package/docs/helpers/Nightmare.md +98 -45
- package/docs/helpers/Playwright.md +151 -59
- package/docs/helpers/Puppeteer.md +103 -26
- package/docs/helpers/REST.md +1 -1
- package/docs/helpers/TestCafe.md +77 -22
- package/docs/helpers/WebDriver.md +150 -62
- package/docs/index.md +1 -1
- package/docs/locators.md +1 -1
- package/docs/webapi/amOnPage.mustache +2 -1
- package/docs/webapi/appendField.mustache +2 -1
- package/docs/webapi/attachFile.mustache +2 -1
- package/docs/webapi/checkOption.mustache +2 -1
- package/docs/webapi/clearCookie.mustache +2 -1
- package/docs/webapi/clearField.mustache +1 -0
- package/docs/webapi/click.mustache +2 -1
- package/docs/webapi/clickLink.mustache +2 -1
- package/docs/webapi/closeCurrentTab.mustache +6 -4
- package/docs/webapi/closeOtherTabs.mustache +6 -4
- package/docs/webapi/dontSee.mustache +1 -0
- package/docs/webapi/dontSeeCheckboxIsChecked.mustache +1 -0
- package/docs/webapi/dontSeeCookie.mustache +2 -1
- package/docs/webapi/dontSeeCurrentUrlEquals.mustache +2 -1
- package/docs/webapi/dontSeeElement.mustache +2 -1
- package/docs/webapi/dontSeeElementInDOM.mustache +2 -1
- package/docs/webapi/dontSeeInCurrentUrl.mustache +2 -1
- package/docs/webapi/dontSeeInField.mustache +2 -1
- package/docs/webapi/dontSeeInSource.mustache +1 -0
- package/docs/webapi/dontSeeInTitle.mustache +2 -1
- package/docs/webapi/doubleClick.mustache +1 -0
- package/docs/webapi/downloadFile.mustache +2 -1
- package/docs/webapi/dragAndDrop.mustache +1 -0
- package/docs/webapi/dragSlider.mustache +2 -1
- package/docs/webapi/executeAsyncScript.mustache +1 -1
- package/docs/webapi/executeScript.mustache +1 -1
- package/docs/webapi/fillField.mustache +1 -0
- package/docs/webapi/forceClick.mustache +1 -0
- package/docs/webapi/forceRightClick.mustache +1 -0
- package/docs/webapi/grabDataFromPerformanceTiming.mustache +2 -1
- package/docs/webapi/moveCursorTo.mustache +1 -0
- package/docs/webapi/openNewTab.mustache +6 -4
- package/docs/webapi/pressKey.mustache +2 -1
- package/docs/webapi/pressKeyDown.mustache +1 -0
- package/docs/webapi/pressKeyUp.mustache +1 -0
- package/docs/webapi/pressKeyWithKeyNormalization.mustache +1 -0
- package/docs/webapi/refreshPage.mustache +1 -0
- package/docs/webapi/resizeWindow.mustache +2 -1
- package/docs/webapi/rightClick.mustache +1 -0
- package/docs/webapi/saveElementScreenshot.mustache +1 -0
- package/docs/webapi/saveScreenshot.mustache +2 -1
- package/docs/webapi/say.mustache +2 -1
- package/docs/webapi/scrollIntoView.mustache +1 -0
- package/docs/webapi/scrollPageToBottom.mustache +1 -0
- package/docs/webapi/scrollPageToTop.mustache +1 -0
- package/docs/webapi/scrollTo.mustache +2 -1
- package/docs/webapi/see.mustache +2 -1
- package/docs/webapi/seeAttributesOnElements.mustache +2 -1
- package/docs/webapi/seeCheckboxIsChecked.mustache +1 -0
- package/docs/webapi/seeCookie.mustache +1 -0
- package/docs/webapi/seeCssPropertiesOnElements.mustache +2 -1
- package/docs/webapi/seeCurrentUrlEquals.mustache +2 -1
- package/docs/webapi/seeElement.mustache +2 -1
- package/docs/webapi/seeElementInDOM.mustache +1 -0
- package/docs/webapi/seeInCurrentUrl.mustache +2 -1
- package/docs/webapi/seeInField.mustache +1 -0
- package/docs/webapi/seeInPopup.mustache +1 -0
- package/docs/webapi/seeInSource.mustache +2 -1
- package/docs/webapi/seeInTitle.mustache +2 -1
- package/docs/webapi/seeNumberOfElements.mustache +1 -0
- package/docs/webapi/seeNumberOfVisibleElements.mustache +1 -0
- package/docs/webapi/seeTextEquals.mustache +2 -1
- package/docs/webapi/seeTitleEquals.mustache +6 -5
- package/docs/webapi/selectOption.mustache +1 -0
- package/docs/webapi/setCookie.mustache +1 -0
- package/docs/webapi/setGeoLocation.mustache +1 -0
- package/docs/webapi/switchTo.mustache +2 -1
- package/docs/webapi/switchToNextTab.mustache +8 -7
- package/docs/webapi/switchToPreviousTab.mustache +8 -7
- package/docs/webapi/type.mustache +1 -0
- package/docs/webapi/uncheckOption.mustache +2 -1
- package/docs/webapi/wait.mustache +2 -1
- package/docs/webapi/waitForClickable.mustache +2 -1
- package/docs/webapi/waitForDetached.mustache +2 -1
- package/docs/webapi/waitForElement.mustache +2 -1
- package/docs/webapi/waitForEnabled.mustache +2 -1
- package/docs/webapi/waitForFunction.mustache +1 -0
- package/docs/webapi/waitForInvisible.mustache +2 -1
- package/docs/webapi/waitForText.mustache +2 -1
- package/docs/webapi/waitForValue.mustache +1 -0
- package/docs/webapi/waitForVisible.mustache +1 -0
- package/docs/webapi/waitInUrl.mustache +2 -1
- package/docs/webapi/waitNumberOfVisibleElements.mustache +2 -1
- package/docs/webapi/waitToHide.mustache +2 -1
- package/docs/webapi/waitUrlEquals.mustache +2 -1
- package/lib/cli.js +1 -1
- package/lib/command/definitions.js +9 -0
- package/lib/command/run-workers.js +1 -1
- package/lib/command/run.js +2 -2
- package/lib/command/workers/runTests.js +55 -0
- package/lib/helper/ApiDataFactory.js +4 -3
- package/lib/helper/Appium.js +2 -7
- package/lib/helper/GraphQL.js +4 -2
- package/lib/helper/GraphQLDataFactory.js +3 -3
- package/lib/helper/JSONResponse.js +1 -1
- package/lib/helper/Playwright.js +28 -17
- package/lib/helper/REST.js +5 -2
- package/lib/helper/WebDriver.js +4 -0
- package/lib/interfaces/bdd.js +5 -0
- package/lib/listener/steps.js +1 -0
- package/lib/output.js +4 -0
- package/lib/plugin/fakerTransform.js +1 -1
- package/lib/plugin/stepByStepReport.js +8 -6
- package/lib/workers.js +12 -0
- package/package.json +3 -3
- package/typings/types.d.ts +534 -112
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,52 @@
|
|
|
1
|
+
## 3.3.3
|
|
2
|
+
|
|
3
|
+
* Fixed `DataCloneError: () => could not be cloned` when running data tests in run-workers
|
|
4
|
+
* 🇺🇦 Added #StandWithUkraine notice to CLI
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
## 3.3.2
|
|
8
|
+
|
|
9
|
+
* [REST] Fixed override of headers/token in `haveRequestHeaders()` and `amBearerAuthenticated()`. See #3304 by @mirao
|
|
10
|
+
* Reverted typings change introduced in #3245. [More details on this](https://twitter.com/CodeceptJS/status/1519725963856207873)
|
|
11
|
+
|
|
12
|
+
## 3.3.1
|
|
13
|
+
|
|
14
|
+
🛩️ Features:
|
|
15
|
+
|
|
16
|
+
* Add option to avoid duplicate gherkin step definitions (#3257) - @raywiis
|
|
17
|
+
* Added `step.*` for run-workers #3272. Thanks to @abhimanyupandian
|
|
18
|
+
* Fixed loading tests for `codecept run` using glob patterns. By @jayudey-wf
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
npx codeceptjs run test-dir/*"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
* [Playwright] **Possible breaking change.** By default `timeout` is changed to 5000ms. The value set in 3.3.0 was too low. Please set `timeout` explicitly to not depend on release values.
|
|
25
|
+
* [Playwright] Added for color scheme option by @PeterNgTr
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
helpers: {
|
|
29
|
+
Playwright : {
|
|
30
|
+
url: "http://localhost",
|
|
31
|
+
colorScheme: "dark",
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
🐛 Bugfixes:
|
|
38
|
+
|
|
39
|
+
* [Playwright] Fixed `Cannot read property 'video' of undefined`
|
|
40
|
+
* Fixed haveRequestHeaders() and amBearerAuthenticated() of REST helper (#3260) - @mirao
|
|
41
|
+
* Fixed: allure attachment fails if screenshot failed #3298 by @ruudvanderweijde
|
|
42
|
+
* Fixed #3105 using autoLogin() plugin with TypeScript. Fix #3290 by @PeterNgTr
|
|
43
|
+
* [Playwright] Added extra params for click and dragAndDrop to type definitions by @mirao
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
📖 Documentation
|
|
47
|
+
* Improving the typings in many places
|
|
48
|
+
* Improving the return type of helpers for TS users (#3245) - @nlespiaucq
|
|
49
|
+
|
|
1
50
|
## 3.3.0
|
|
2
51
|
|
|
3
52
|
🛩️ Features:
|
|
@@ -46,7 +95,7 @@ await eachElement('click all links in .list', '.list a', (el) => {
|
|
|
46
95
|
|
|
47
96
|
📖 Documentation
|
|
48
97
|
|
|
49
|
-
* Added [Testomat.io reporter](/
|
|
98
|
+
* Added [Testomat.io reporter](/reports#testomatio)
|
|
50
99
|
* Added [api testing](/api) guides
|
|
51
100
|
* Added [internal api](/internal-api) guides
|
|
52
101
|
* [Appium] Fixed documentation for `performSwipe`
|
package/README.md
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
[](https://stand-with-ukraine.pp.ua)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
1
5
|
[<img src="https://img.shields.io/badge/slack-@codeceptjs-purple.svg?logo=slack">](https://join.slack.com/t/codeceptjs/shared_invite/enQtMzA5OTM4NDM2MzA4LWE4MThhN2NmYTgxNTU5MTc4YzAyYWMwY2JkMmZlYWI5MWQ2MDM5MmRmYzZmYmNiNmY5NTAzM2EwMGIwOTNhOGQ) [<img src="https://img.shields.io/badge/discourse-codeceptjs-purple">](https://codecept.discourse.group) [![NPM version][npm-image]][npm-url]
|
|
6
|
+
[](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)
|
|
2
7
|
|
|
3
8
|
Build Status:
|
|
4
9
|
|
|
@@ -8,7 +13,7 @@ Build Status:
|
|
|
8
13
|
[](https://github.com/codeceptjs/CodeceptJS/actions/workflows/appium.yml)
|
|
9
14
|
[](https://github.com/codeceptjs/CodeceptJS/actions/workflows/testcafe.yml)
|
|
10
15
|
|
|
11
|
-
# CodeceptJS
|
|
16
|
+
# CodeceptJS [](https://stand-with-ukraine.pp.ua)
|
|
12
17
|
|
|
13
18
|
Reference: [Helpers API](https://github.com/codeceptjs/CodeceptJS/tree/master/docs/helpers)
|
|
14
19
|
|
package/docs/api.md
CHANGED
|
@@ -300,7 +300,7 @@ To perform arbitrary assertions on a response object use `seeResponseValidByCall
|
|
|
300
300
|
It allows you to do any kind of assertions by using `expect` from [`chai`](https://www.chaijs.com) library.
|
|
301
301
|
|
|
302
302
|
```js
|
|
303
|
-
I.seeResponseValidByCallback({ data, status, expect } => {
|
|
303
|
+
I.seeResponseValidByCallback(({ data, status, expect }) => {
|
|
304
304
|
// we receive data and expect to combine them for good assertion
|
|
305
305
|
expect(data.users.length).to.be.gte(10);
|
|
306
306
|
})
|
package/docs/bdd.md
CHANGED
|
@@ -399,6 +399,7 @@ Tag should be placed before *Scenario:* or before *Feature:* keyword. In the las
|
|
|
399
399
|
* `gherkin`
|
|
400
400
|
* `features` - path to feature files, or an array of feature file paths
|
|
401
401
|
* `steps` - array of files with step definitions
|
|
402
|
+
* `avoidDuplicateSteps` - attempts to avoid duplicate step definitions by shallow compare
|
|
402
403
|
|
|
403
404
|
```js
|
|
404
405
|
"gherkin": {
|
package/docs/best.md
CHANGED
|
@@ -215,7 +215,7 @@ include: {
|
|
|
215
215
|
* When you need to customize access to API and go beyond what ApiDataFactory provides, implement DAO:
|
|
216
216
|
|
|
217
217
|
```js
|
|
218
|
-
const faker = require('faker');
|
|
218
|
+
const faker = require('@faker-js/faker');
|
|
219
219
|
const { I } = inject();
|
|
220
220
|
const { output } = require('codeceptjs');
|
|
221
221
|
|
|
@@ -36,7 +36,7 @@ const REST = require('./REST');
|
|
|
36
36
|
* Install [Rosie](https://github.com/rosiejs/rosie) and [Faker](https://www.npmjs.com/package/faker) libraries.
|
|
37
37
|
*
|
|
38
38
|
* ```sh
|
|
39
|
-
* npm i rosie faker --save-dev
|
|
39
|
+
* npm i rosie @faker-js/faker --save-dev
|
|
40
40
|
* ```
|
|
41
41
|
*
|
|
42
42
|
* Create a factory file for a resource.
|
|
@@ -46,8 +46,8 @@ const REST = require('./REST');
|
|
|
46
46
|
* ```js
|
|
47
47
|
* // tests/factories/posts.js
|
|
48
48
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
49
|
+
* const Factory = require('rosie').Factory;
|
|
50
|
+
* const faker = require('@faker-js/faker');
|
|
51
51
|
*
|
|
52
52
|
* module.exports = new Factory()
|
|
53
53
|
* // no need to set id, it will be set by REST API
|
|
@@ -264,6 +264,7 @@ class ApiDataFactory extends Helper {
|
|
|
264
264
|
* @param {*} factory factory to use
|
|
265
265
|
* @param {*} params predefined parameters
|
|
266
266
|
* @param {*} options options for programmatically generate the attributes
|
|
267
|
+
* @returns {Promise<*>}
|
|
267
268
|
*/
|
|
268
269
|
have(factory, params, options) {
|
|
269
270
|
const item = this._createItem(factory, params, options);
|
package/docs/build/Appium.js
CHANGED
|
@@ -124,6 +124,7 @@ const webRoot = 'body';
|
|
|
124
124
|
class Appium extends Webdriver {
|
|
125
125
|
/**
|
|
126
126
|
* Appium Special Methods for Mobile only
|
|
127
|
+
* @augments WebDriver
|
|
127
128
|
*/
|
|
128
129
|
|
|
129
130
|
constructor(config) {
|
|
@@ -331,7 +332,6 @@ class Appium extends Webdriver {
|
|
|
331
332
|
*
|
|
332
333
|
* @param {*} caps
|
|
333
334
|
* @param {*} fn
|
|
334
|
-
* @return {Promise<any>}
|
|
335
335
|
*/
|
|
336
336
|
async runOnIOS(caps, fn) {
|
|
337
337
|
if (this.platform !== 'ios') return;
|
|
@@ -374,7 +374,6 @@ class Appium extends Webdriver {
|
|
|
374
374
|
*
|
|
375
375
|
* @param {*} caps
|
|
376
376
|
* @param {*} fn
|
|
377
|
-
* @return {Promise<any>}
|
|
378
377
|
*/
|
|
379
378
|
async runOnAndroid(caps, fn) {
|
|
380
379
|
if (this.platform !== 'android') return;
|
|
@@ -395,7 +394,6 @@ class Appium extends Webdriver {
|
|
|
395
394
|
* ```
|
|
396
395
|
*
|
|
397
396
|
* @param {*} fn
|
|
398
|
-
* @return {Promise<any>}
|
|
399
397
|
*/
|
|
400
398
|
/* eslint-disable */
|
|
401
399
|
async runInWeb(fn) {
|
|
@@ -599,7 +597,6 @@ class Appium extends Webdriver {
|
|
|
599
597
|
* ```
|
|
600
598
|
*
|
|
601
599
|
* @param {'LANDSCAPE'|'PORTRAIT'} orientation LANDSCAPE or PORTRAIT
|
|
602
|
-
* @return {Promise<any>}
|
|
603
600
|
*
|
|
604
601
|
* Appium: support Android and iOS
|
|
605
602
|
*/
|
|
@@ -728,7 +725,6 @@ class Appium extends Webdriver {
|
|
|
728
725
|
* Switch to the specified context.
|
|
729
726
|
*
|
|
730
727
|
* @param {*} context the context to switch to
|
|
731
|
-
|
|
732
728
|
*/
|
|
733
729
|
async _switchToContext(context) {
|
|
734
730
|
return this.browser.switchContext(context);
|
|
@@ -774,7 +770,7 @@ class Appium extends Webdriver {
|
|
|
774
770
|
* // or set context explicitly
|
|
775
771
|
* I.switchToNative('SOME_OTHER_CONTEXT');
|
|
776
772
|
* ```
|
|
777
|
-
* @param {*} context
|
|
773
|
+
* @param {*} [context]
|
|
778
774
|
* @return {Promise<void>}
|
|
779
775
|
*/
|
|
780
776
|
async switchToNative(context = null) {
|
|
@@ -834,7 +830,6 @@ class Appium extends Webdriver {
|
|
|
834
830
|
* ```
|
|
835
831
|
*
|
|
836
832
|
* @param {object} settings object
|
|
837
|
-
* @return {Promise<any>}
|
|
838
833
|
*
|
|
839
834
|
* Appium: support Android and iOS
|
|
840
835
|
*/
|
|
@@ -1337,6 +1332,7 @@ class Appium extends Webdriver {
|
|
|
1337
1332
|
* ```
|
|
1338
1333
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator
|
|
1339
1334
|
* @param {string} value text value to append.
|
|
1335
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1340
1336
|
*
|
|
1341
1337
|
*/
|
|
1342
1338
|
async appendField(field, value) {
|
|
@@ -1357,6 +1353,7 @@ class Appium extends Webdriver {
|
|
|
1357
1353
|
* ```
|
|
1358
1354
|
* @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
|
|
1359
1355
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1356
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1360
1357
|
*
|
|
1361
1358
|
*/
|
|
1362
1359
|
async checkOption(field) {
|
|
@@ -1388,7 +1385,8 @@ class Appium extends Webdriver {
|
|
|
1388
1385
|
* ```
|
|
1389
1386
|
*
|
|
1390
1387
|
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1391
|
-
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1388
|
+
* @param {?CodeceptJS.LocatorOrString | null} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1389
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1392
1390
|
*
|
|
1393
1391
|
*
|
|
1394
1392
|
*/
|
|
@@ -1407,7 +1405,7 @@ class Appium extends Webdriver {
|
|
|
1407
1405
|
* ```
|
|
1408
1406
|
*
|
|
1409
1407
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1410
|
-
*
|
|
1408
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1411
1409
|
*
|
|
1412
1410
|
*/
|
|
1413
1411
|
async dontSeeCheckboxIsChecked(field) {
|
|
@@ -1423,6 +1421,7 @@ class Appium extends Webdriver {
|
|
|
1423
1421
|
* ```
|
|
1424
1422
|
*
|
|
1425
1423
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
|
|
1424
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1426
1425
|
*/
|
|
1427
1426
|
async dontSeeElement(locator) {
|
|
1428
1427
|
if (this.isWeb) return super.dontSeeElement(locator);
|
|
@@ -1440,6 +1439,7 @@ class Appium extends Webdriver {
|
|
|
1440
1439
|
*
|
|
1441
1440
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1442
1441
|
* @param {string} value value to check.
|
|
1442
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1443
1443
|
*
|
|
1444
1444
|
*/
|
|
1445
1445
|
async dontSeeInField(field, value) {
|
|
@@ -1458,7 +1458,7 @@ class Appium extends Webdriver {
|
|
|
1458
1458
|
*
|
|
1459
1459
|
* @param {string} text which is not present.
|
|
1460
1460
|
* @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
1461
|
-
*
|
|
1461
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1462
1462
|
*/
|
|
1463
1463
|
async dontSee(text, context = null) {
|
|
1464
1464
|
if (this.isWeb) return super.dontSee(text, context);
|
|
@@ -1481,7 +1481,7 @@ class Appium extends Webdriver {
|
|
|
1481
1481
|
* ```
|
|
1482
1482
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1483
1483
|
* @param {CodeceptJS.StringOrSecret} value text value to fill.
|
|
1484
|
-
*
|
|
1484
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1485
1485
|
*
|
|
1486
1486
|
*/
|
|
1487
1487
|
async fillField(field, value) {
|
|
@@ -1642,7 +1642,7 @@ class Appium extends Webdriver {
|
|
|
1642
1642
|
*
|
|
1643
1643
|
* @param {LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1644
1644
|
* @param {ScrollIntoViewOptions} scrollIntoViewOptions see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
|
|
1645
|
-
*
|
|
1645
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1646
1646
|
*
|
|
1647
1647
|
* Supported only for web testing
|
|
1648
1648
|
*/
|
|
@@ -1660,7 +1660,7 @@ class Appium extends Webdriver {
|
|
|
1660
1660
|
* ```
|
|
1661
1661
|
*
|
|
1662
1662
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1663
|
-
*
|
|
1663
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1664
1664
|
*
|
|
1665
1665
|
*/
|
|
1666
1666
|
async seeCheckboxIsChecked(field) {
|
|
@@ -1676,6 +1676,7 @@ class Appium extends Webdriver {
|
|
|
1676
1676
|
* I.seeElement('#modal');
|
|
1677
1677
|
* ```
|
|
1678
1678
|
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1679
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1679
1680
|
*
|
|
1680
1681
|
*/
|
|
1681
1682
|
async seeElement(locator) {
|
|
@@ -1695,7 +1696,7 @@ class Appium extends Webdriver {
|
|
|
1695
1696
|
* ```
|
|
1696
1697
|
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1697
1698
|
* @param {string} value value to check.
|
|
1698
|
-
*
|
|
1699
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1699
1700
|
*
|
|
1700
1701
|
*/
|
|
1701
1702
|
async seeInField(field, value) {
|
|
@@ -1714,6 +1715,7 @@ class Appium extends Webdriver {
|
|
|
1714
1715
|
* ```
|
|
1715
1716
|
* @param {string} text expected on page.
|
|
1716
1717
|
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1718
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1717
1719
|
*
|
|
1718
1720
|
*/
|
|
1719
1721
|
async see(text, context) {
|
|
@@ -1742,7 +1744,7 @@ class Appium extends Webdriver {
|
|
|
1742
1744
|
* ```
|
|
1743
1745
|
* @param {LocatorOrString} select field located by label|name|CSS|XPath|strict locator.
|
|
1744
1746
|
* @param {string|Array<*>} option visible text or value of option.
|
|
1745
|
-
*
|
|
1747
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1746
1748
|
*
|
|
1747
1749
|
* Supported only for web testing
|
|
1748
1750
|
*/
|
|
@@ -1762,6 +1764,7 @@ class Appium extends Webdriver {
|
|
|
1762
1764
|
*
|
|
1763
1765
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1764
1766
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
1767
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1765
1768
|
*
|
|
1766
1769
|
*/
|
|
1767
1770
|
async waitForElement(locator, sec = null) {
|
|
@@ -1779,7 +1782,7 @@ class Appium extends Webdriver {
|
|
|
1779
1782
|
*
|
|
1780
1783
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1781
1784
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
1782
|
-
*
|
|
1785
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1783
1786
|
*
|
|
1784
1787
|
*/
|
|
1785
1788
|
async waitForVisible(locator, sec = null) {
|
|
@@ -1797,6 +1800,7 @@ class Appium extends Webdriver {
|
|
|
1797
1800
|
*
|
|
1798
1801
|
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1799
1802
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
1803
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1800
1804
|
*
|
|
1801
1805
|
*/
|
|
1802
1806
|
async waitForInvisible(locator, sec = null) {
|
|
@@ -1817,6 +1821,7 @@ class Appium extends Webdriver {
|
|
|
1817
1821
|
* @param {string }text to wait for.
|
|
1818
1822
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
1819
1823
|
* @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator.
|
|
1824
|
+
* [!] returns a _promise_ which is synchronized internally by recorder
|
|
1820
1825
|
*
|
|
1821
1826
|
*/
|
|
1822
1827
|
async waitForText(text, sec = null, context = null) {
|
package/docs/build/GraphQL.js
CHANGED
|
@@ -112,15 +112,15 @@ class GraphQL extends Helper {
|
|
|
112
112
|
*
|
|
113
113
|
* @param {object} operation
|
|
114
114
|
* @param {object} headers
|
|
115
|
+
* @return {object} graphQLRequest
|
|
115
116
|
*/
|
|
116
117
|
_prepareGraphQLRequest(operation, headers) {
|
|
117
|
-
|
|
118
|
+
return {
|
|
118
119
|
baseURL: this.options.endpoint,
|
|
119
120
|
method: 'POST',
|
|
120
121
|
data: operation,
|
|
121
122
|
headers,
|
|
122
123
|
};
|
|
123
|
-
return request;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
/**
|
|
@@ -142,6 +142,7 @@ class GraphQL extends Helper {
|
|
|
142
142
|
* @param {object} variables that may go along with the query
|
|
143
143
|
* @param {object} options are additional query options
|
|
144
144
|
* @param {object} headers
|
|
145
|
+
* @return Promise<any>
|
|
145
146
|
*/
|
|
146
147
|
async sendQuery(query, variables, options = {}, headers = {}) {
|
|
147
148
|
if (typeof query !== 'string') {
|
|
@@ -181,6 +182,7 @@ class GraphQL extends Helper {
|
|
|
181
182
|
* @param {object} variables that may go along with the mutation
|
|
182
183
|
* @param {object} options are additional query options
|
|
183
184
|
* @param {object} headers
|
|
185
|
+
* @return Promise<any>
|
|
184
186
|
*/
|
|
185
187
|
async sendMutation(mutation, variables, options = {}, headers = {}) {
|
|
186
188
|
if (typeof mutation !== 'string') {
|
|
@@ -36,7 +36,7 @@ const GraphQL = require('./GraphQL');
|
|
|
36
36
|
* Install [Rosie](https://github.com/rosiejs/rosie) and [Faker](https://www.npmjs.com/package/faker) libraries.
|
|
37
37
|
*
|
|
38
38
|
* ```sh
|
|
39
|
-
* npm i rosie faker --save-dev
|
|
39
|
+
* npm i rosie @faker-js/faker --save-dev
|
|
40
40
|
* ```
|
|
41
41
|
*
|
|
42
42
|
* Create a factory file for a resource.
|
|
@@ -46,8 +46,8 @@ const GraphQL = require('./GraphQL');
|
|
|
46
46
|
* ```js
|
|
47
47
|
* // tests/factories/users.js
|
|
48
48
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
49
|
+
* const Factory = require('rosie').Factory;
|
|
50
|
+
* const faker = require('@faker-js/faker');
|
|
51
51
|
*
|
|
52
52
|
* // Used with a constructor function passed to Factory, so that the final build
|
|
53
53
|
* // object matches the necessary pattern to be sent as the variables object.
|
|
@@ -218,7 +218,7 @@ class JSONResponse extends Helper {
|
|
|
218
218
|
* Use it to perform custom checks of response data
|
|
219
219
|
*
|
|
220
220
|
* ```js
|
|
221
|
-
* I.seeResponseValidByCallback({ data, status, expect } => {
|
|
221
|
+
* I.seeResponseValidByCallback(({ data, status, expect }) => {
|
|
222
222
|
* expect(status).to.eql(200);
|
|
223
223
|
* expect(data).keys.to.include(['user', 'company']);
|
|
224
224
|
* });
|