codeceptjs 3.3.5 → 3.3.6
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 +37 -7
- package/bin/codecept.js +40 -3
- package/docs/basics.md +24 -1
- package/docs/build/Appium.js +41 -22
- package/docs/build/FileSystem.js +1 -1
- package/docs/build/Nightmare.js +106 -57
- package/docs/build/Playwright.js +187 -111
- package/docs/build/Protractor.js +132 -70
- package/docs/build/Puppeteer.js +143 -76
- package/docs/build/REST.js +2 -2
- package/docs/build/TestCafe.js +107 -57
- package/docs/build/WebDriver.js +162 -89
- package/docs/changelog.md +37 -7
- package/docs/commands.md +5 -3
- package/docs/configuration.md +5 -5
- package/docs/helpers/Appium.md +25 -23
- package/docs/helpers/FileSystem.md +1 -1
- package/docs/helpers/Nightmare.md +57 -57
- package/docs/helpers/Playwright.md +76 -75
- package/docs/helpers/Puppeteer.md +76 -85
- package/docs/helpers/REST.md +1 -1
- package/docs/helpers/TestCafe.md +57 -57
- package/docs/helpers/WebDriver.md +84 -97
- package/docs/quickstart.md +1 -1
- package/docs/reports.md +1 -1
- package/docs/secrets.md +1 -1
- package/docs/webapi/appendField.mustache +1 -1
- package/docs/webapi/attachFile.mustache +3 -3
- package/docs/webapi/checkOption.mustache +1 -1
- package/docs/webapi/clearCookie.mustache +1 -1
- package/docs/webapi/clearField.mustache +1 -1
- package/docs/webapi/click.mustache +1 -1
- package/docs/webapi/clickLink.mustache +1 -1
- package/docs/webapi/closeCurrentTab.mustache +1 -1
- package/docs/webapi/closeOtherTabs.mustache +1 -1
- package/docs/webapi/dontSee.mustache +1 -1
- package/docs/webapi/dontSeeCheckboxIsChecked.mustache +1 -1
- package/docs/webapi/dontSeeCookie.mustache +1 -1
- package/docs/webapi/dontSeeCurrentUrlEquals.mustache +1 -1
- package/docs/webapi/dontSeeElement.mustache +1 -1
- package/docs/webapi/dontSeeElementInDOM.mustache +1 -1
- package/docs/webapi/dontSeeInCurrentUrl.mustache +1 -1
- package/docs/webapi/dontSeeInField.mustache +1 -1
- package/docs/webapi/dontSeeInSource.mustache +1 -1
- package/docs/webapi/dontSeeInTitle.mustache +1 -1
- package/docs/webapi/doubleClick.mustache +1 -1
- package/docs/webapi/downloadFile.mustache +1 -1
- package/docs/webapi/dragAndDrop.mustache +1 -1
- package/docs/webapi/dragSlider.mustache +1 -1
- package/docs/webapi/executeAsyncScript.mustache +1 -1
- package/docs/webapi/executeScript.mustache +1 -1
- package/docs/webapi/fillField.mustache +1 -1
- package/docs/webapi/forceClick.mustache +1 -1
- package/docs/webapi/forceRightClick.mustache +1 -1
- package/docs/webapi/moveCursorTo.mustache +1 -1
- package/docs/webapi/openNewTab.mustache +1 -1
- package/docs/webapi/pressKey.mustache +1 -1
- package/docs/webapi/pressKeyDown.mustache +1 -1
- package/docs/webapi/pressKeyUp.mustache +1 -1
- package/docs/webapi/pressKeyWithKeyNormalization.mustache +1 -1
- package/docs/webapi/refreshPage.mustache +1 -1
- package/docs/webapi/resizeWindow.mustache +1 -1
- package/docs/webapi/rightClick.mustache +1 -1
- package/docs/webapi/saveElementScreenshot.mustache +2 -2
- package/docs/webapi/saveScreenshot.mustache +2 -2
- package/docs/webapi/say.mustache +1 -1
- package/docs/webapi/scrollIntoView.mustache +1 -1
- package/docs/webapi/scrollPageToBottom.mustache +1 -1
- package/docs/webapi/scrollPageToTop.mustache +1 -1
- package/docs/webapi/scrollTo.mustache +1 -1
- package/docs/webapi/see.mustache +1 -1
- package/docs/webapi/seeAttributesOnElements.mustache +1 -1
- package/docs/webapi/seeCheckboxIsChecked.mustache +1 -1
- package/docs/webapi/seeCookie.mustache +1 -1
- package/docs/webapi/seeCssPropertiesOnElements.mustache +1 -1
- package/docs/webapi/seeCurrentUrlEquals.mustache +1 -1
- package/docs/webapi/seeElement.mustache +1 -1
- package/docs/webapi/seeElementInDOM.mustache +1 -1
- package/docs/webapi/seeInCurrentUrl.mustache +1 -1
- package/docs/webapi/seeInField.mustache +1 -1
- package/docs/webapi/seeInPopup.mustache +1 -1
- package/docs/webapi/seeInSource.mustache +1 -1
- package/docs/webapi/seeInTitle.mustache +1 -1
- package/docs/webapi/seeNumberOfElements.mustache +1 -1
- package/docs/webapi/seeNumberOfVisibleElements.mustache +1 -1
- package/docs/webapi/seeTextEquals.mustache +1 -1
- package/docs/webapi/seeTitleEquals.mustache +1 -1
- package/docs/webapi/selectOption.mustache +1 -1
- package/docs/webapi/setCookie.mustache +1 -1
- package/docs/webapi/setGeoLocation.mustache +1 -1
- package/docs/webapi/switchTo.mustache +1 -1
- package/docs/webapi/switchToNextTab.mustache +1 -1
- package/docs/webapi/switchToPreviousTab.mustache +1 -1
- package/docs/webapi/type.mustache +1 -1
- package/docs/webapi/uncheckOption.mustache +1 -1
- package/docs/webapi/wait.mustache +1 -1
- package/docs/webapi/waitForClickable.mustache +1 -1
- package/docs/webapi/waitForDetached.mustache +1 -1
- package/docs/webapi/waitForElement.mustache +1 -1
- package/docs/webapi/waitForEnabled.mustache +1 -1
- package/docs/webapi/waitForFunction.mustache +1 -1
- package/docs/webapi/waitForInvisible.mustache +1 -1
- package/docs/webapi/waitForText.mustache +1 -1
- package/docs/webapi/waitForValue.mustache +1 -1
- package/docs/webapi/waitForVisible.mustache +1 -1
- package/docs/webapi/waitInUrl.mustache +1 -1
- package/docs/webapi/waitNumberOfVisibleElements.mustache +1 -1
- package/docs/webapi/waitToHide.mustache +1 -1
- package/docs/webapi/waitUrlEquals.mustache +1 -1
- package/lib/command/configMigrate.js +1 -1
- package/lib/command/dryRun.js +2 -1
- package/lib/command/generate.js +35 -18
- package/lib/command/run-rerun.js +38 -0
- package/lib/command/utils.js +13 -3
- package/lib/config.js +2 -2
- package/lib/data/context.js +7 -0
- package/lib/helper/Appium.js +6 -4
- package/lib/helper/FileSystem.js +1 -1
- package/lib/helper/Nightmare.js +1 -1
- package/lib/helper/Playwright.js +48 -38
- package/lib/helper/Protractor.js +1 -1
- package/lib/helper/REST.js +2 -2
- package/lib/helper/TestCafe.js +1 -1
- package/lib/helper/WebDriver.js +7 -7
- package/lib/plugin/wdio.js +11 -2
- package/lib/utils.js +3 -0
- package/package.json +2 -2
- package/typings/index.d.ts +46 -46
- package/typings/types.d.ts +497 -443
package/docs/changelog.md
CHANGED
|
@@ -7,17 +7,44 @@ layout: Section
|
|
|
7
7
|
|
|
8
8
|
# Releases
|
|
9
9
|
|
|
10
|
+
## 3.3.6
|
|
11
|
+
|
|
12
|
+
* [`run-rerun`](https://codecept.io/commands/#run-rerun) command was re-introduced by **[dwentland24](https://github.com/dwentland24)** in [#3436](https://github.com/codeceptjs/CodeceptJS/issues/3436). Use it to perform run multiple times and detect flaky tests
|
|
13
|
+
* Enabled `retryFailedStep` by default in `@codeceptjs/configure` v 0.10. See https://github.com/codeceptjs/configure/pull/26
|
|
14
|
+
* **[Playwright]** Fixed properties types "waitForNavigation" and "firefox" by **[mirao](https://github.com/mirao)** in [#3401](https://github.com/codeceptjs/CodeceptJS/issues/3401)
|
|
15
|
+
* **[REST]** Changed "endpoint" to optional by **[mirao](https://github.com/mirao)** in [#3404](https://github.com/codeceptjs/CodeceptJS/issues/3404)
|
|
16
|
+
* **[REST]** Use [`secret`]() for form encoded string by **[PeterNgTr](https://github.com/PeterNgTr)**:
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
const secretData = secret('name=john&password=123456');
|
|
20
|
+
const response = await I.sendPostRequest('/user', secretData);
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
* [Playwright]Fixed docs related to fixed properties types "waitForNavigation" and "firefox" by **[mirao](https://github.com/mirao)** in [#3407](https://github.com/codeceptjs/CodeceptJS/issues/3407)
|
|
24
|
+
* [Playwright]Fixed parameters of startActivity() by **[mirao](https://github.com/mirao)** in [#3408](https://github.com/codeceptjs/CodeceptJS/issues/3408)
|
|
25
|
+
* Move semver to prod dependencies by **[timja](https://github.com/timja)** in [#3413](https://github.com/codeceptjs/CodeceptJS/issues/3413)
|
|
26
|
+
* check if browser is W3C instead of Android by **[mikk150](https://github.com/mikk150)** in [#3414](https://github.com/codeceptjs/CodeceptJS/issues/3414)
|
|
27
|
+
* Pass service configs with options and caps as array for browsers… by **[07souravkunda](https://github.com/07souravkunda)** in [#3418](https://github.com/codeceptjs/CodeceptJS/issues/3418)
|
|
28
|
+
* fix for type of "webdriver.port" by **[ngraf](https://github.com/ngraf)** in [#3421](https://github.com/codeceptjs/CodeceptJS/issues/3421)
|
|
29
|
+
* fix for type of "webdriver.smartWait" by **[pmajewski24](https://github.com/pmajewski24)** in [#3426](https://github.com/codeceptjs/CodeceptJS/issues/3426)
|
|
30
|
+
* fix(datatable): mask secret text by **[PeterNgTr](https://github.com/PeterNgTr)** in [#3432](https://github.com/codeceptjs/CodeceptJS/issues/3432)
|
|
31
|
+
* fix(playwright) - video name and missing type by **[PeterNgTr](https://github.com/PeterNgTr)** in [#3430](https://github.com/codeceptjs/CodeceptJS/issues/3430)
|
|
32
|
+
* fix for expected type of "bootstrap", "teardown", "bootstrapAll" and "teardownAll" by **[ngraf](https://github.com/ngraf)** in [#3424](https://github.com/codeceptjs/CodeceptJS/issues/3424)
|
|
33
|
+
* Improve generate pageobject `gpo` command to work with TypeScript by **[PeterNgTr](https://github.com/PeterNgTr)** in [#3411](https://github.com/codeceptjs/CodeceptJS/issues/3411)
|
|
34
|
+
* Fixed dry-run to always return 0 code and exit
|
|
35
|
+
* Added minimal version notice for NodeJS >= 12
|
|
36
|
+
* fix(utils): remove . of test title to avoid confusion by **[PeterNgTr](https://github.com/PeterNgTr)** in [#3431](https://github.com/codeceptjs/CodeceptJS/issues/3431)
|
|
37
|
+
|
|
10
38
|
## 3.3.5
|
|
11
39
|
|
|
12
40
|
🛩️ Features
|
|
13
41
|
|
|
14
|
-
* Added **
|
|
15
|
-
|
|
16
|
-
|
|
42
|
+
* Added **TypeScript types for CodeceptJS config**.
|
|
43
|
+
|
|
44
|
+
Update `codecept.conf.js` to get intellisense when writing config file:
|
|
17
45
|
|
|
18
46
|
```js
|
|
19
|
-
|
|
20
|
-
/** **[type](https://github.com/type)** {CodeceptJS.MainConfig} */
|
|
47
|
+
/**@type {CodeceptJS.MainConfig}**/
|
|
21
48
|
exports.config = {
|
|
22
49
|
//...
|
|
23
50
|
}
|
|
@@ -27,6 +54,9 @@ exports.config = {
|
|
|
27
54
|
* Puppeteer
|
|
28
55
|
* WebDriver
|
|
29
56
|
* REST
|
|
57
|
+
* Added **[TypeScript option](/typescript)** for installation via `codeceptjs init` to initialize new projects in TS (by **[PeterNgTr](https://github.com/PeterNgTr)** and **[davertmik](https://github.com/davertmik)**)
|
|
58
|
+
* Includes `node-ts` automatically when using TypeScript setup.
|
|
59
|
+
|
|
30
60
|
|
|
31
61
|
🐛 Bugfixes
|
|
32
62
|
|
|
@@ -580,7 +610,7 @@ MyPage.hasFiles('first arg', 'second arg');
|
|
|
580
610
|
|
|
581
611
|
// OUTPUT:
|
|
582
612
|
MyPage: hasFile "First arg", "Second arg"
|
|
583
|
-
I see file "codecept.
|
|
613
|
+
I see file "codecept.js"
|
|
584
614
|
I see file "codecept.po.json"
|
|
585
615
|
```
|
|
586
616
|
* Introduced official [TypeScript boilerplate](https://github.com/codeceptjs/typescript-boilerplate). Started by **[Vorobeyko](https://github.com/Vorobeyko)**.
|
|
@@ -2176,7 +2206,7 @@ module.exports = function(done) {
|
|
|
2176
2206
|
```js
|
|
2177
2207
|
// inside codecept.conf.js
|
|
2178
2208
|
exports.config = {
|
|
2179
|
-
// contents of codecept.
|
|
2209
|
+
// contents of codecept.js
|
|
2180
2210
|
}
|
|
2181
2211
|
```
|
|
2182
2212
|
* Added `--profile` option to pass its value to `codecept.conf.js` as `process.profile` for [dynamic configuration](http://codecept.io/configuration#dynamic-configuration).
|
package/docs/commands.md
CHANGED
|
@@ -57,7 +57,7 @@ Select config file manually (`-c` or `--config` option)
|
|
|
57
57
|
|
|
58
58
|
```sh
|
|
59
59
|
npx codeceptjs run -c my.codecept.conf.js
|
|
60
|
-
npx codeceptjs run --config path/to/codecept.
|
|
60
|
+
npx codeceptjs run --config path/to/codecept.conf.js
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
Override config on the fly. Provide valid JSON which will be merged into current config:
|
|
@@ -102,7 +102,7 @@ Run tests in parallel threads.
|
|
|
102
102
|
npx codeceptjs run-workers 3
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
## Run Rerun <Badge text="Since
|
|
105
|
+
## Run Rerun <Badge text="Since 3.3.6" type="warning"/>
|
|
106
106
|
|
|
107
107
|
Run tests multiple times to detect and fix flaky tests.
|
|
108
108
|
|
|
@@ -160,6 +160,8 @@ npx codeceptjs dry-run --steps --bootstrap
|
|
|
160
160
|
|
|
161
161
|
## Run Multiple
|
|
162
162
|
|
|
163
|
+
> ⚠️ prefer using run-workers instead
|
|
164
|
+
|
|
163
165
|
Run multiple suites. Unlike `run-workers` spawns processes to execute tests.
|
|
164
166
|
[Requires additional configuration](/advanced#multiple-browsers-execution) and can be used to execute tests in multiple browsers.
|
|
165
167
|
|
|
@@ -223,7 +225,7 @@ TypeScript Definitions allows IDEs to provide autocompletion when writing tests.
|
|
|
223
225
|
|
|
224
226
|
```sh
|
|
225
227
|
npx codeceptjs def
|
|
226
|
-
npx codeceptjs def --config path/to/codecept.
|
|
228
|
+
npx codeceptjs def --config path/to/codecept.conf.js
|
|
227
229
|
```
|
|
228
230
|
|
|
229
231
|
After doing that IDE should provide autocompletion for `I` object inside `Scenario` and `within` blocks.
|
package/docs/configuration.md
CHANGED
|
@@ -11,8 +11,8 @@ After running `codeceptjs init` it should be saved in test root.
|
|
|
11
11
|
|
|
12
12
|
| Name | Type | Description |
|
|
13
13
|
| :------ | :------ | :------ |
|
|
14
|
-
| `bootstrap?` | () => `Promise`<`void`\> \| `boolean` \| `string` | [Execute code before](https://codecept.io/bootstrap/) tests are run. Can be either JS module file or async function: ```bootstrap: async () => server.launch(), ``` or ```bootstrap: 'bootstrap.js', ``` |
|
|
15
|
-
| `bootstrapAll?` | () => `Promise`<`void`\> \| `boolean` \| `string` | [Execute code before launching tests in parallel mode](https://codecept.io/bootstrap/#bootstrapall-teardownall) |
|
|
14
|
+
| `bootstrap?` | (() => `Promise`<`void`\>) \| `boolean` \| `string` | [Execute code before](https://codecept.io/bootstrap/) tests are run. Can be either JS module file or async function: ```bootstrap: async () => server.launch(), ``` or ```bootstrap: 'bootstrap.js', ``` |
|
|
15
|
+
| `bootstrapAll?` | (() => `Promise`<`void`\>) \| `boolean` \| `string` | [Execute code before launching tests in parallel mode](https://codecept.io/bootstrap/#bootstrapall-teardownall) |
|
|
16
16
|
| `gherkin?` | { `features`: `string` \| `string`[] ; `steps`: `string`[] } | Enable [BDD features](https://codecept.io/bdd/#configuration). Sample configuration: ```gherkin: { features: "./features/*.feature", steps: ["./step_definitions/steps.js"] } ``` |
|
|
17
17
|
| `gherkin.features` | `string` \| `string`[] | load feature files by pattern. Multiple patterns can be specified as array |
|
|
18
18
|
| `gherkin.steps` | `string`[] | load step definitions from JS files |
|
|
@@ -24,8 +24,8 @@ After running `codeceptjs init` it should be saved in test root.
|
|
|
24
24
|
| `output` | `string` | Where to store failure screenshots, artifacts, etc ```output: './output' ``` |
|
|
25
25
|
| `plugins?` | `any` | Enable CodeceptJS plugins. Example: ```plugins: { autoDelay: { enabled: true } } ``` |
|
|
26
26
|
| `require?` | `string`[] | [Require additional JS modules](https://codecept.io/configuration/#require) Example: ``` require: ["should"] ``` |
|
|
27
|
-
| `teardown?` | () => `Promise`<`void`\> \| `boolean` \| `string` | [Execute code after tests](https://codecept.io/bootstrap/) finished. Can be either JS module file or async function: ```teardown: async () => server.stop(), ``` or ```teardown: 'teardown.js', ``` |
|
|
28
|
-
| `teardownAll?` | () => `Promise`<`void`\> \| `boolean` \| `string` | [Execute JS code after finishing tests in parallel mode](https://codecept.io/bootstrap/#bootstrapall-teardownall) |
|
|
27
|
+
| `teardown?` | (() => `Promise`<`void`\>) \| `boolean` \| `string` | [Execute code after tests](https://codecept.io/bootstrap/) finished. Can be either JS module file or async function: ```teardown: async () => server.stop(), ``` or ```teardown: 'teardown.js', ``` |
|
|
28
|
+
| `teardownAll?` | (() => `Promise`<`void`\>) \| `boolean` \| `string` | [Execute JS code after finishing tests in parallel mode](https://codecept.io/bootstrap/#bootstrapall-teardownall) |
|
|
29
29
|
| `tests` | `string` | Pattern to locate CodeceptJS tests. Allows to enter glob pattern or an Array<string> of patterns to match tests / test file names. For tests in JavaScript: ```tests: 'tests/**.test.js' ``` For tests in TypeScript: ```tests: 'tests/**.test.ts' ``` |
|
|
30
30
|
| `timeout?` | `number` | Set default tests timeout in seconds. Tests will be killed on no response after timeout. ```timeout: 20, ``` |
|
|
31
31
|
| `translation?` | `string` | Enable [localized test commands](https://codecept.io/translation/) |
|
|
@@ -99,7 +99,7 @@ exports.config = {
|
|
|
99
99
|
dashboardPage: new DashboardPage()
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
// here goes config as it was in codecept.
|
|
102
|
+
// here goes config as it was in codecept.conf.ts
|
|
103
103
|
// ....
|
|
104
104
|
};
|
|
105
105
|
```
|
package/docs/helpers/Appium.md
CHANGED
|
@@ -23,7 +23,7 @@ Launch the daemon: `appium`
|
|
|
23
23
|
|
|
24
24
|
## Helper configuration
|
|
25
25
|
|
|
26
|
-
This helper should be configured in codecept.
|
|
26
|
+
This helper should be configured in codecept.conf.ts or codecept.conf.js
|
|
27
27
|
|
|
28
28
|
- `app`: Application path. Local path or remote URL to an .ipa or .apk file, or a .zip containing one of these. Alias to desiredCapabilities.appPackage
|
|
29
29
|
- `host`: (default: 'localhost') Appium host
|
|
@@ -433,12 +433,14 @@ Start an arbitrary Android activity during a session.
|
|
|
433
433
|
I.startActivity('io.selendroid.testapp', '.RegisterUserActivity');
|
|
434
434
|
```
|
|
435
435
|
|
|
436
|
+
Appium: support only Android
|
|
437
|
+
|
|
436
438
|
#### Parameters
|
|
437
439
|
|
|
438
|
-
- `appPackage`
|
|
439
|
-
- `appActivity`
|
|
440
|
+
- `appPackage` **[string][4]**
|
|
441
|
+
- `appActivity` **[string][4]**
|
|
440
442
|
|
|
441
|
-
Returns **[Promise][5]<void>**
|
|
443
|
+
Returns **[Promise][5]<void>**
|
|
442
444
|
|
|
443
445
|
### setNetworkConnection
|
|
444
446
|
|
|
@@ -822,7 +824,7 @@ I.appendField('#myTextField', 'appended');
|
|
|
822
824
|
|
|
823
825
|
- `field` **([string][4] \| [object][8])** located by label|name|CSS|XPath|strict locator
|
|
824
826
|
- `value` **[string][4]** text value to append.
|
|
825
|
-
|
|
827
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
826
828
|
|
|
827
829
|
### checkOption
|
|
828
830
|
|
|
@@ -841,7 +843,7 @@ I.checkOption('agree', '//form');
|
|
|
841
843
|
|
|
842
844
|
- `field` **([string][4] \| [object][8])** checkbox located by label | name | CSS | XPath | strict locator.
|
|
843
845
|
- `context` **([string][4]? | [object][8])** (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
844
|
-
|
|
846
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
|
|
845
847
|
|
|
846
848
|
### click
|
|
847
849
|
|
|
@@ -871,7 +873,7 @@ I.click({css: 'nav a.login'});
|
|
|
871
873
|
|
|
872
874
|
- `locator` **([string][4] \| [object][8])** clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
873
875
|
- `context` **([string][4]? | [object][8] | null)** (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
874
|
-
|
|
876
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
|
|
875
877
|
|
|
876
878
|
### dontSeeCheckboxIsChecked
|
|
877
879
|
|
|
@@ -886,7 +888,7 @@ I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
|
886
888
|
#### Parameters
|
|
887
889
|
|
|
888
890
|
- `field` **([string][4] \| [object][8])** located by label|name|CSS|XPath|strict locator.
|
|
889
|
-
|
|
891
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
890
892
|
|
|
891
893
|
### dontSeeElement
|
|
892
894
|
|
|
@@ -899,7 +901,7 @@ I.dontSeeElement('.modal'); // modal is not shown
|
|
|
899
901
|
#### Parameters
|
|
900
902
|
|
|
901
903
|
- `locator` **([string][4] \| [object][8])** located by CSS|XPath|Strict locator.
|
|
902
|
-
|
|
904
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
903
905
|
|
|
904
906
|
### dontSeeInField
|
|
905
907
|
|
|
@@ -915,7 +917,7 @@ I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
|
915
917
|
|
|
916
918
|
- `field` **([string][4] \| [object][8])** located by label|name|CSS|XPath|strict locator.
|
|
917
919
|
- `value` **[string][4]** value to check.
|
|
918
|
-
|
|
920
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
919
921
|
|
|
920
922
|
### dontSee
|
|
921
923
|
|
|
@@ -931,7 +933,7 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
|
|
|
931
933
|
|
|
932
934
|
- `text` **[string][4]** which is not present.
|
|
933
935
|
- `context` **([string][4] \| [object][8])?** (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
934
|
-
|
|
936
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
|
|
935
937
|
|
|
936
938
|
### fillField
|
|
937
939
|
|
|
@@ -953,7 +955,7 @@ I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
|
953
955
|
|
|
954
956
|
- `field` **([string][4] \| [object][8])** located by label|name|CSS|XPath|strict locator.
|
|
955
957
|
- `value` **([string][4] \| [object][8])** text value to fill.
|
|
956
|
-
|
|
958
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
957
959
|
|
|
958
960
|
### grabTextFromAll
|
|
959
961
|
|
|
@@ -1071,7 +1073,7 @@ Returns **[Promise][5]<[string][4]>** attribute value
|
|
|
1071
1073
|
|
|
1072
1074
|
### saveScreenshot
|
|
1073
1075
|
|
|
1074
|
-
Saves a screenshot to ouput folder (set in codecept.
|
|
1076
|
+
Saves a screenshot to ouput folder (set in codecept.conf.ts or codecept.conf.js).
|
|
1075
1077
|
Filename is relative to output folder.
|
|
1076
1078
|
|
|
1077
1079
|
```js
|
|
@@ -1098,7 +1100,7 @@ I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "cent
|
|
|
1098
1100
|
|
|
1099
1101
|
- `locator` **([string][4] \| [object][8])** located by CSS|XPath|strict locator.
|
|
1100
1102
|
- `scrollIntoViewOptions` **ScrollIntoViewOptions** see [https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView][15].
|
|
1101
|
-
|
|
1103
|
+
⚠️ returns a _promise_ which is synchronized internally by recorderSupported only for web testing
|
|
1102
1104
|
|
|
1103
1105
|
### seeCheckboxIsChecked
|
|
1104
1106
|
|
|
@@ -1113,7 +1115,7 @@ I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
|
1113
1115
|
#### Parameters
|
|
1114
1116
|
|
|
1115
1117
|
- `field` **([string][4] \| [object][8])** located by label|name|CSS|XPath|strict locator.
|
|
1116
|
-
|
|
1118
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1117
1119
|
|
|
1118
1120
|
### seeElement
|
|
1119
1121
|
|
|
@@ -1127,7 +1129,7 @@ I.seeElement('#modal');
|
|
|
1127
1129
|
#### Parameters
|
|
1128
1130
|
|
|
1129
1131
|
- `locator` **([string][4] \| [object][8])** located by CSS|XPath|strict locator.
|
|
1130
|
-
|
|
1132
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1131
1133
|
|
|
1132
1134
|
### seeInField
|
|
1133
1135
|
|
|
@@ -1145,7 +1147,7 @@ I.seeInField('#searchform input','Search');
|
|
|
1145
1147
|
|
|
1146
1148
|
- `field` **([string][4] \| [object][8])** located by label|name|CSS|XPath|strict locator.
|
|
1147
1149
|
- `value` **[string][4]** value to check.
|
|
1148
|
-
|
|
1150
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder
|
|
1149
1151
|
|
|
1150
1152
|
### see
|
|
1151
1153
|
|
|
@@ -1162,7 +1164,7 @@ I.see('Register', {css: 'form.register'}); // use strict locator
|
|
|
1162
1164
|
|
|
1163
1165
|
- `text` **[string][4]** expected on page.
|
|
1164
1166
|
- `context` **([string][4]? | [object][8])** (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1165
|
-
|
|
1167
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
|
|
1166
1168
|
|
|
1167
1169
|
### selectOption
|
|
1168
1170
|
|
|
@@ -1189,7 +1191,7 @@ I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
|
1189
1191
|
|
|
1190
1192
|
- `select` **([string][4] \| [object][8])** field located by label|name|CSS|XPath|strict locator.
|
|
1191
1193
|
- `option` **([string][4] \| [Array][6]<any>)** visible text or value of option.
|
|
1192
|
-
|
|
1194
|
+
⚠️ returns a _promise_ which is synchronized internally by recorderSupported only for web testing
|
|
1193
1195
|
|
|
1194
1196
|
### waitForElement
|
|
1195
1197
|
|
|
@@ -1205,7 +1207,7 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
|
1205
1207
|
|
|
1206
1208
|
- `locator` **([string][4] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1207
1209
|
- `sec` **[number][10]?** (optional, `1` by default) time in seconds to wait
|
|
1208
|
-
|
|
1210
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
|
|
1209
1211
|
|
|
1210
1212
|
### waitForVisible
|
|
1211
1213
|
|
|
@@ -1220,7 +1222,7 @@ I.waitForVisible('#popup');
|
|
|
1220
1222
|
|
|
1221
1223
|
- `locator` **([string][4] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1222
1224
|
- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait
|
|
1223
|
-
|
|
1225
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder (optional, default `1`)
|
|
1224
1226
|
|
|
1225
1227
|
### waitForInvisible
|
|
1226
1228
|
|
|
@@ -1235,7 +1237,7 @@ I.waitForInvisible('#popup');
|
|
|
1235
1237
|
|
|
1236
1238
|
- `locator` **([string][4] \| [object][8])** element located by CSS|XPath|strict locator.
|
|
1237
1239
|
- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait
|
|
1238
|
-
|
|
1240
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder (optional, default `1`)
|
|
1239
1241
|
|
|
1240
1242
|
### waitForText
|
|
1241
1243
|
|
|
@@ -1253,7 +1255,7 @@ I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
|
1253
1255
|
- `text` **[string][4]** to wait for.
|
|
1254
1256
|
- `sec` **[number][10]** (optional, `1` by default) time in seconds to wait (optional, default `1`)
|
|
1255
1257
|
- `context` **([string][4] \| [object][8])?** (optional) element located by CSS|XPath|strict locator.
|
|
1256
|
-
|
|
1258
|
+
⚠️ returns a _promise_ which is synchronized internally by recorder (optional, default `null`)
|
|
1257
1259
|
|
|
1258
1260
|
[1]: http://codecept.io/helpers/WebDriver/
|
|
1259
1261
|
|