codeceptjs 2.3.4 → 2.4.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.
- package/CHANGELOG.md +52 -0
- package/README.md +28 -6
- package/bin/codecept.js +42 -0
- package/docs/advanced.md +45 -1
- package/docs/angular.md +3 -3
- package/docs/basics.md +162 -118
- package/docs/bdd.md +30 -5
- package/docs/best.md +8 -6
- package/docs/books.md +6 -1
- package/docs/build/Appium.js +95 -85
- package/docs/build/FileSystem.js +48 -3
- package/docs/build/GraphQL.js +3 -2
- package/docs/build/GraphQLDataFactory.js +1 -0
- package/docs/build/Mochawesome.js +3 -2
- package/docs/build/MockRequest.js +23 -5
- package/docs/build/Nightmare.js +87 -128
- package/docs/build/Protractor.js +107 -155
- package/docs/build/Puppeteer.js +190 -174
- package/docs/build/REST.js +13 -9
- package/docs/build/SeleniumWebdriver.js +0 -17
- package/docs/build/TestCafe.js +164 -158
- package/docs/build/WebDriver.js +236 -211
- package/docs/build/WebDriverIO.js +218 -187
- package/docs/changelog.md +57 -1
- package/docs/commands.md +41 -2
- package/docs/community-helpers.md +12 -1
- package/docs/configuration.md +5 -2
- package/docs/continuous-integration.md +22 -0
- package/docs/{helpers.md → custom-helpers.md} +16 -10
- package/docs/data.md +7 -6
- package/docs/detox.md +6 -6
- package/docs/email.md +4 -2
- package/docs/examples.md +22 -3
- package/docs/helpers/ApiDataFactory.md +15 -13
- package/docs/helpers/Appium.md +1011 -468
- package/docs/helpers/Detox.md +33 -26
- package/docs/helpers/FileSystem.md +43 -13
- package/docs/helpers/GraphQL.md +17 -15
- package/docs/helpers/GraphQLDataFactory.md +15 -13
- package/docs/helpers/Mochawesome.md +3 -1
- package/docs/helpers/MockRequest.md +37 -19
- package/docs/helpers/Nightmare.md +129 -240
- package/docs/helpers/Polly.md +1 -1
- package/docs/helpers/Protractor.md +157 -298
- package/docs/helpers/Puppeteer.md +216 -335
- package/docs/helpers/REST.md +29 -24
- package/docs/helpers/TestCafe.md +137 -235
- package/docs/helpers/WebDriver.md +250 -347
- package/docs/hooks.md +14 -10
- package/docs/index.md +112 -0
- package/docs/installation.md +3 -1
- package/docs/locators.md +19 -8
- package/docs/mobile-react-native-locators.md +2 -2
- package/docs/mobile.md +5 -3
- package/docs/nightmare.md +2 -1
- package/docs/pageobjects.md +4 -2
- package/docs/parallel.md +4 -2
- package/docs/plugins.md +41 -15
- package/docs/puppeteer.md +8 -6
- package/docs/quickstart.md +130 -0
- package/docs/react.md +4 -2
- package/docs/reports.md +6 -4
- package/docs/testcafe.md +10 -8
- package/docs/translation.md +4 -2
- package/docs/ui.md +56 -0
- package/docs/videos.md +11 -2
- package/docs/visual.md +7 -5
- package/docs/vue.md +121 -0
- package/docs/webapi/appendField.mustache +1 -1
- package/docs/webapi/attachFile.mustache +1 -1
- package/docs/webapi/checkOption.mustache +2 -2
- package/docs/webapi/clearCookie.mustache +1 -1
- package/docs/webapi/click.mustache +2 -2
- package/docs/webapi/clickLink.mustache +2 -2
- package/docs/webapi/dontSee.mustache +1 -2
- package/docs/webapi/dontSeeCheckboxIsChecked.mustache +1 -1
- package/docs/webapi/dontSeeElement.mustache +1 -1
- package/docs/webapi/dontSeeElementInDOM.mustache +1 -1
- package/docs/webapi/dontSeeInField.mustache +1 -1
- package/docs/webapi/doubleClick.mustache +2 -2
- package/docs/webapi/downloadFile.mustache +1 -1
- package/docs/webapi/dragSlider.mustache +1 -1
- package/docs/webapi/executeAsyncScript.mustache +2 -1
- package/docs/webapi/executeScript.mustache +2 -1
- package/docs/webapi/fillField.mustache +1 -1
- package/docs/webapi/grabAttributeFrom.mustache +1 -1
- package/docs/webapi/grabBrowserLogs.mustache +1 -1
- package/docs/webapi/grabCookie.mustache +2 -2
- package/docs/webapi/grabCssPropertyFrom.mustache +1 -1
- package/docs/webapi/grabHTMLFrom.mustache +1 -1
- package/docs/webapi/grabNumberOfVisibleElements.mustache +1 -1
- package/docs/webapi/grabPageScrollPosition.mustache +1 -1
- package/docs/webapi/grabTextFrom.mustache +2 -2
- package/docs/webapi/grabValueFrom.mustache +1 -1
- package/docs/webapi/moveCursorTo.mustache +3 -3
- package/docs/webapi/pressKey.mustache +1 -1
- package/docs/webapi/pressKeyWithKeyNormalization.mustache +1 -1
- package/docs/webapi/rightClick.mustache +2 -2
- package/docs/webapi/saveScreenshot.mustache +1 -1
- package/docs/webapi/scrollIntoView.mustache +10 -0
- package/docs/webapi/scrollTo.mustache +3 -3
- package/docs/webapi/see.mustache +1 -1
- package/docs/webapi/seeAttributesOnElements.mustache +1 -1
- package/docs/webapi/seeCheckboxIsChecked.mustache +1 -1
- package/docs/webapi/seeCssPropertiesOnElements.mustache +1 -1
- package/docs/webapi/seeElement.mustache +1 -1
- package/docs/webapi/seeElementInDOM.mustache +1 -1
- package/docs/webapi/seeInField.mustache +1 -1
- package/docs/webapi/seeNumberOfElements.mustache +1 -1
- package/docs/webapi/seeNumberOfVisibleElements.mustache +1 -1
- package/docs/webapi/seeTextEquals.mustache +8 -0
- package/docs/webapi/selectOption.mustache +2 -2
- package/docs/webapi/switchTo.mustache +1 -1
- package/docs/webapi/uncheckOption.mustache +2 -2
- package/docs/webapi/waitForClickable.mustache +10 -0
- package/docs/webapi/waitForDetached.mustache +2 -2
- package/docs/webapi/waitForElement.mustache +2 -2
- package/docs/webapi/waitForEnabled.mustache +2 -2
- package/docs/webapi/waitForFunction.mustache +2 -2
- package/docs/webapi/waitForInvisible.mustache +2 -2
- package/docs/webapi/waitForText.mustache +2 -2
- package/docs/webapi/waitForValue.mustache +1 -1
- package/docs/webapi/waitForVisible.mustache +2 -2
- package/docs/webapi/waitInUrl.mustache +1 -1
- package/docs/webapi/waitNumberOfVisibleElements.mustache +2 -2
- package/docs/webapi/waitToHide.mustache +2 -2
- package/docs/webapi/waitUntil.mustache +3 -2
- package/docs/webapi/waitUrlEquals.mustache +1 -1
- package/docs/webdriver.md +20 -18
- package/docs/wiki/.git/FETCH_HEAD +1 -0
- package/docs/wiki/.git/HEAD +1 -0
- package/docs/wiki/.git/ORIG_HEAD +1 -0
- package/docs/wiki/.git/config +11 -0
- package/docs/wiki/.git/description +1 -0
- package/docs/wiki/.git/hooks/applypatch-msg.sample +15 -0
- package/docs/wiki/.git/hooks/commit-msg.sample +24 -0
- package/docs/wiki/.git/hooks/fsmonitor-watchman.sample +114 -0
- package/docs/wiki/.git/hooks/post-update.sample +8 -0
- package/docs/wiki/.git/hooks/pre-applypatch.sample +14 -0
- package/docs/wiki/.git/hooks/pre-commit.sample +49 -0
- package/docs/wiki/.git/hooks/pre-push.sample +53 -0
- package/docs/wiki/.git/hooks/pre-rebase.sample +169 -0
- package/docs/wiki/.git/hooks/pre-receive.sample +24 -0
- package/docs/wiki/.git/hooks/prepare-commit-msg.sample +42 -0
- package/docs/wiki/.git/hooks/update.sample +128 -0
- package/docs/wiki/.git/index +0 -0
- package/docs/wiki/.git/info/exclude +6 -0
- package/docs/wiki/.git/logs/HEAD +4 -0
- package/docs/wiki/.git/logs/refs/heads/master +4 -0
- package/docs/wiki/.git/logs/refs/remotes/origin/HEAD +1 -0
- package/docs/wiki/.git/logs/refs/remotes/origin/master +3 -0
- package/docs/wiki/.git/objects/00/d216b0774d15db2d0a2a0d4ce249b5251acc55 +3 -0
- package/docs/wiki/.git/objects/09/01d87c5241905fdfe3493cfe8f04df4a2685ea +0 -0
- package/docs/wiki/.git/objects/0d/bdd0c20c4deb6a8cc81dbbf32ecf8c09238983 +2 -0
- package/docs/wiki/.git/objects/1a/c29e4fa82422c52392f22f0f2b8d1a759535bf +0 -0
- package/docs/wiki/.git/objects/27/12f92898d3e8f68e229b6cda76570d6c66d781 +0 -0
- package/docs/wiki/.git/objects/2d/dbe22c257166b648928eeb9460ecfb71ba702d +0 -0
- package/docs/wiki/.git/objects/2f/c942ec3773efd2678d9ff98035c61fcded81a1 +0 -0
- package/docs/wiki/.git/objects/40/a2856342c67796b48911a256b764fb06888b94 +5 -0
- package/docs/wiki/.git/objects/47/53181844fc4dc563cf3aa5e80462243cb58d38 +0 -0
- package/docs/wiki/.git/objects/4e/24a95fb2e4f8ffef51f19b694451a205c06f10 +3 -0
- package/docs/wiki/.git/objects/73/31ebd96f3c7e08a9f63f05a25f939afa0d4de1 +0 -0
- package/docs/wiki/.git/objects/86/19cbb2289caa502e33fccf0ed14eecf6ba2ba0 +0 -0
- package/docs/wiki/.git/objects/a4/72f797d9d74b87c9f71a2b1539d75bb07d1e35 +0 -0
- package/docs/wiki/.git/objects/c9/9f3e4bd227d6b050b2e416f9876df49583dbf6 +0 -0
- package/docs/wiki/.git/objects/ca/e609b4ef3e0ef85fcbe0d68d1a58246584b915 +0 -0
- package/docs/wiki/.git/objects/d5/8386ca72f6d550548f3d71d74e3ac73d5ad488 +0 -0
- package/docs/wiki/.git/objects/d9/c6874a6de524bdafeb563a20d847f4fdd59a86 +0 -0
- package/docs/wiki/.git/objects/f1/c944675bb38b40ae553b0be36c14674c79af54 +0 -0
- package/docs/wiki/.git/objects/pack/pack-28da0fc7e6c08d4c5350717bfbb7b1c53e8198ad.idx +0 -0
- package/docs/wiki/.git/objects/pack/pack-28da0fc7e6c08d4c5350717bfbb7b1c53e8198ad.pack +0 -0
- package/docs/wiki/.git/packed-refs +2 -0
- package/docs/wiki/.git/refs/heads/master +1 -0
- package/docs/wiki/.git/refs/remotes/origin/HEAD +1 -0
- package/docs/wiki/.git/refs/remotes/origin/master +1 -0
- package/docs/wiki/Books-&-Posts.md +27 -0
- package/docs/wiki/Community-Helpers.md +41 -0
- package/docs/wiki/Examples.md +138 -0
- package/docs/wiki/Home.md +11 -0
- package/docs/wiki/Release-process.md +25 -0
- package/docs/wiki/Roadmap.md +23 -0
- package/docs/wiki/Videos.md +19 -0
- package/lib/actor.js +18 -1
- package/lib/assert/error.js +3 -3
- package/lib/codecept.js +9 -6
- package/lib/command/configMigrate.js +7 -6
- package/lib/command/definitions.js +98 -350
- package/lib/command/generate.js +22 -17
- package/lib/command/gherkin/init.js +2 -1
- package/lib/command/gherkin/snippets.js +6 -6
- package/lib/command/gherkin/steps.js +0 -1
- package/lib/command/info.js +40 -0
- package/lib/command/init.js +54 -41
- package/lib/command/run-multiple.js +5 -4
- package/lib/command/run-rerun.js +39 -0
- package/lib/command/run-workers.js +4 -6
- package/lib/command/run.js +8 -18
- package/lib/command/utils.js +23 -2
- package/lib/command/workers/runTests.js +1 -2
- package/lib/config.js +10 -4
- package/lib/container.js +31 -6
- package/lib/data/dataTableArgument.js +31 -0
- package/lib/data/table.js +4 -0
- package/lib/event.js +65 -1
- package/lib/helper/Appium.js +52 -38
- package/lib/helper/FileSystem.js +48 -3
- package/lib/helper/GraphQL.js +3 -2
- package/lib/helper/GraphQLDataFactory.js +1 -0
- package/lib/helper/Mochawesome.js +3 -2
- package/lib/helper/MockRequest.js +23 -5
- package/lib/helper/Nightmare.js +5 -6
- package/lib/helper/Protractor.js +7 -8
- package/lib/helper/Puppeteer.js +76 -20
- package/lib/helper/REST.js +13 -9
- package/lib/helper/SeleniumWebdriver.js +0 -17
- package/lib/helper/TestCafe.js +84 -36
- package/lib/helper/WebDriver.js +113 -59
- package/lib/helper/WebDriverIO.js +43 -59
- package/lib/helper/clientscripts/nightmare.js +66 -4
- package/lib/helper/scripts/isElementClickable.js +24 -0
- package/lib/helper.js +34 -10
- package/lib/history.js +1 -1
- package/lib/hooks.js +2 -1
- package/lib/index.js +19 -0
- package/lib/interfaces/bdd.js +4 -0
- package/lib/interfaces/featureConfig.js +10 -3
- package/lib/interfaces/gherkin.js +6 -2
- package/lib/interfaces/scenarioConfig.js +17 -6
- package/lib/listener/config.js +1 -1
- package/lib/listener/exit.js +6 -0
- package/lib/listener/steps.js +0 -1
- package/lib/listener/trace.js +0 -1
- package/lib/locator.js +67 -2
- package/lib/output.js +53 -0
- package/lib/parser.js +2 -71
- package/lib/pause.js +3 -2
- package/lib/plugin/allure.js +41 -22
- package/lib/plugin/autoLogin.js +4 -1
- package/lib/plugin/pauseOnFail.js +38 -0
- package/lib/plugin/puppeteerCoverage.js +8 -7
- package/lib/plugin/screenshotOnFail.js +13 -8
- package/lib/plugin/stepByStepReport.js +7 -6
- package/lib/plugin/wdio.js +2 -1
- package/lib/recorder.js +85 -7
- package/lib/rerun.js +81 -0
- package/lib/secret.js +6 -0
- package/lib/session.js +9 -2
- package/lib/step.js +37 -2
- package/lib/store.js +5 -1
- package/lib/ui.js +34 -8
- package/lib/utils.js +6 -13
- package/lib/within.js +5 -0
- package/package.json +49 -29
- package/typings/Mocha.d.ts +21 -0
- package/typings/Protractor.d.ts +16 -0
- package/typings/index.d.ts +169 -0
- package/typings/jsdoc.conf.js +34 -0
- package/typings/jsdoc.namespace.js +29 -0
- package/typings/types.d.ts +9827 -0
- package/typings/utils.d.ts +7 -0
- package/docs/acceptance.md +0 -409
- package/docs/api/codecept.md +0 -75
- package/docs/api/config.md +0 -49
- package/docs/api/container.md +0 -66
- package/docs/api/helper.md +0 -116
- package/docs/api/output.md +0 -67
- package/docs/api/recorder.md +0 -63
- package/docs/helpers/SeleniumWebdriver.md +0 -92
- package/docs/helpers/WebDriverIO.md +0 -1671
package/docs/helpers/Detox.md
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
2
|
+
permalink: /helpers/Detox
|
|
3
|
+
sidebar: auto
|
|
3
4
|
title: Detox
|
|
4
5
|
---
|
|
5
6
|
|
|
7
|
+
# Detox
|
|
8
|
+
|
|
9
|
+
|
|
6
10
|
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
7
11
|
|
|
8
12
|
## Detox
|
|
@@ -52,7 +56,7 @@ In `codecept.conf.js` enable Detox helper:
|
|
|
52
56
|
```js
|
|
53
57
|
helpers: {
|
|
54
58
|
Detox: {
|
|
55
|
-
require: '@codeceptjs/detox',
|
|
59
|
+
require: '@codeceptjs/detox-helper',
|
|
56
60
|
configuration: '<detox-configuration-name>',
|
|
57
61
|
}
|
|
58
62
|
}
|
|
@@ -118,7 +122,7 @@ I.click({ ios: 'Save', android: 'SAVE' }, '#main'); // different texts on iOS an
|
|
|
118
122
|
#### Parameters
|
|
119
123
|
|
|
120
124
|
- `locator` **([string][6] \| [object][7])**
|
|
121
|
-
- `context` **([string][6] \| [object][7])** (optional, default `null`)
|
|
125
|
+
- `context` **([string][6] \| [object][7] | null)** (optional, default `null`)
|
|
122
126
|
|
|
123
127
|
### clickAtPoint
|
|
124
128
|
|
|
@@ -133,8 +137,8 @@ I.clickAtPoint('~save', 10, 10); // locate by accessibility id
|
|
|
133
137
|
#### Parameters
|
|
134
138
|
|
|
135
139
|
- `locator` **([string][6] \| [object][7])**
|
|
136
|
-
- `x` **
|
|
137
|
-
- `y` **
|
|
140
|
+
- `x` **[number][9]** horizontal offset (optional, default `0`)
|
|
141
|
+
- `y` **[number][9]** vertical offset (optional, default `0`)
|
|
138
142
|
|
|
139
143
|
### dontSee
|
|
140
144
|
|
|
@@ -150,7 +154,7 @@ I.dontSee('Record deleted', '~message');
|
|
|
150
154
|
#### Parameters
|
|
151
155
|
|
|
152
156
|
- `text` **[string][6]** to check invisibility
|
|
153
|
-
- `context` **([string][6] \| [object][7])** element in which to search for text (optional, default `null`)
|
|
157
|
+
- `context` **([string][6] \| [object][7] | null)** element in which to search for text (optional, default `null`)
|
|
154
158
|
|
|
155
159
|
### dontSeeElement
|
|
156
160
|
|
|
@@ -165,7 +169,7 @@ I.dontSeeElement('~edit', '#menu'); // element inside #menu
|
|
|
165
169
|
#### Parameters
|
|
166
170
|
|
|
167
171
|
- `locator` **([string][6] \| [object][7])** element to locate
|
|
168
|
-
- `context` **([string][6] \| [object][7])** context element (optional, default `null`)
|
|
172
|
+
- `context` **([string][6] \| [object][7] | null)** context element (optional, default `null`)
|
|
169
173
|
|
|
170
174
|
### dontSeeElementExists
|
|
171
175
|
|
|
@@ -217,7 +221,7 @@ I.installApp();
|
|
|
217
221
|
|
|
218
222
|
### launchApp
|
|
219
223
|
|
|
220
|
-
Launches an application. If application instance already exists, use [relaunchApp][
|
|
224
|
+
Launches an application. If application instance already exists, use [relaunchApp][10].
|
|
221
225
|
|
|
222
226
|
```js
|
|
223
227
|
I.launchApp();
|
|
@@ -236,8 +240,8 @@ I.longPress('Update', 2, '#menu'); // locate by text inside #menu, hold for 2 se
|
|
|
236
240
|
#### Parameters
|
|
237
241
|
|
|
238
242
|
- `locator` **([string][6] \| [object][7])** element to locate
|
|
239
|
-
- `sec` **
|
|
240
|
-
- `context` **([string][6] \| [object][7])** context element (optional, default `null`)
|
|
243
|
+
- `sec` **[number][9]** number of seconds to hold tap
|
|
244
|
+
- `context` **([string][6] \| [object][7] | null)** context element (optional, default `null`)
|
|
241
245
|
|
|
242
246
|
### multiTap
|
|
243
247
|
|
|
@@ -257,8 +261,8 @@ I.multiTap('Update', 2, '#menu'); // locate by id
|
|
|
257
261
|
#### Parameters
|
|
258
262
|
|
|
259
263
|
- `locator` **([string][6] \| [object][7])** element to locate
|
|
260
|
-
- `num` **
|
|
261
|
-
- `context` **([string][6] \| [object][7])** context element (optional, default `null`)
|
|
264
|
+
- `num` **[number][9]** number of taps
|
|
265
|
+
- `context` **([string][6] \| [object][7] | null)** context element (optional, default `null`)
|
|
262
266
|
|
|
263
267
|
### relaunchApp
|
|
264
268
|
|
|
@@ -281,7 +285,7 @@ I.runOnAndroid(() => {
|
|
|
281
285
|
|
|
282
286
|
#### Parameters
|
|
283
287
|
|
|
284
|
-
- `fn`
|
|
288
|
+
- `fn` **[Function][11]** a function which will be executed on android
|
|
285
289
|
|
|
286
290
|
### runOnIOS
|
|
287
291
|
|
|
@@ -296,7 +300,7 @@ I.runOnIOS(() => {
|
|
|
296
300
|
|
|
297
301
|
#### Parameters
|
|
298
302
|
|
|
299
|
-
- `fn`
|
|
303
|
+
- `fn` **[Function][11]** a function which will be executed on iOS
|
|
300
304
|
|
|
301
305
|
### saveScreenshot
|
|
302
306
|
|
|
@@ -308,8 +312,7 @@ I.saveScreenshot('main-window.png');
|
|
|
308
312
|
|
|
309
313
|
#### Parameters
|
|
310
314
|
|
|
311
|
-
- `name`
|
|
312
|
-
- `string` name
|
|
315
|
+
- `name` **[string][6]**
|
|
313
316
|
|
|
314
317
|
### scrollDown
|
|
315
318
|
|
|
@@ -373,7 +376,7 @@ I.see('Record deleted', '~message');
|
|
|
373
376
|
#### Parameters
|
|
374
377
|
|
|
375
378
|
- `text` **[string][6]** to check visibility
|
|
376
|
-
- `context` **([string][6] \| [object][7])** element inside which to search for text (optional, default `null`)
|
|
379
|
+
- `context` **([string][6] \| [object][7] | null)** element inside which to search for text (optional, default `null`)
|
|
377
380
|
|
|
378
381
|
### seeElement
|
|
379
382
|
|
|
@@ -388,7 +391,7 @@ I.seeElement('~edit', '#menu'); // element inside #menu
|
|
|
388
391
|
#### Parameters
|
|
389
392
|
|
|
390
393
|
- `locator` **([string][6] \| [object][7])** element to locate
|
|
391
|
-
- `context` **([string][6] \| [object][7])** context element (optional, default `null`)
|
|
394
|
+
- `context` **([string][6] \| [object][7] | null)** context element (optional, default `null`)
|
|
392
395
|
|
|
393
396
|
### seeElementExists
|
|
394
397
|
|
|
@@ -492,7 +495,7 @@ Element can be located by its text or id or accessibility id.
|
|
|
492
495
|
|
|
493
496
|
The second parameter is a context element to narrow the search.
|
|
494
497
|
|
|
495
|
-
Same as [click][
|
|
498
|
+
Same as [click][12]
|
|
496
499
|
|
|
497
500
|
```js
|
|
498
501
|
I.tap('Login'); // locate by text
|
|
@@ -505,7 +508,7 @@ I.tap({ ios: 'Save', android: 'SAVE' }, '#main'); // different texts on iOS and
|
|
|
505
508
|
#### Parameters
|
|
506
509
|
|
|
507
510
|
- `locator` **([string][6] \| [object][7])**
|
|
508
|
-
- `context` **([string][6] \| [object][7])** (optional, default `null`)
|
|
511
|
+
- `context` **([string][6] \| [object][7] | null)** (optional, default `null`)
|
|
509
512
|
|
|
510
513
|
### wait
|
|
511
514
|
|
|
@@ -517,7 +520,7 @@ I.wait(2); // waits for 2 seconds
|
|
|
517
520
|
|
|
518
521
|
#### Parameters
|
|
519
522
|
|
|
520
|
-
- `sec` **
|
|
523
|
+
- `sec` **[number][9]** number of seconds to wait
|
|
521
524
|
|
|
522
525
|
### waitForElement
|
|
523
526
|
|
|
@@ -530,7 +533,7 @@ I.waitForElement('#message', 1); // wait for 1 second
|
|
|
530
533
|
#### Parameters
|
|
531
534
|
|
|
532
535
|
- `locator` **([string][6] \| [object][7])** an element to wait for
|
|
533
|
-
- `sec` **
|
|
536
|
+
- `sec` **[number][9]** number of seconds to wait, 5 by default (optional, default `5`)
|
|
534
537
|
|
|
535
538
|
### waitForElementVisible
|
|
536
539
|
|
|
@@ -543,7 +546,7 @@ I.waitForElementVisible('#message', 1); // wait for 1 second
|
|
|
543
546
|
#### Parameters
|
|
544
547
|
|
|
545
548
|
- `locator` **([string][6] \| [object][7])** an element to wait for
|
|
546
|
-
- `sec` **
|
|
549
|
+
- `sec` **[number][9]** number of seconds to wait (optional, default `5`)
|
|
547
550
|
|
|
548
551
|
### waitToHide
|
|
549
552
|
|
|
@@ -556,7 +559,7 @@ I.waitToHide('#message', 2); // wait for 2 seconds
|
|
|
556
559
|
#### Parameters
|
|
557
560
|
|
|
558
561
|
- `locator` **([string][6] \| [object][7])** an element to wait for
|
|
559
|
-
- `sec` **
|
|
562
|
+
- `sec` **[number][9]** number of seconds to wait (optional, default `5`)
|
|
560
563
|
|
|
561
564
|
[1]: https://github.com/wix/Detox
|
|
562
565
|
|
|
@@ -574,6 +577,10 @@ I.waitToHide('#message', 2); // wait for 2 seconds
|
|
|
574
577
|
|
|
575
578
|
[8]: #tap
|
|
576
579
|
|
|
577
|
-
[9]:
|
|
580
|
+
[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
581
|
+
|
|
582
|
+
[10]: #relaunchApp
|
|
583
|
+
|
|
584
|
+
[11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
|
|
578
585
|
|
|
579
|
-
[
|
|
586
|
+
[12]: #click
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
2
|
+
permalink: /helpers/FileSystem
|
|
3
|
+
editLink: false
|
|
4
|
+
sidebar: auto
|
|
3
5
|
title: FileSystem
|
|
4
6
|
---
|
|
5
7
|
|
|
@@ -7,7 +9,7 @@ title: FileSystem
|
|
|
7
9
|
|
|
8
10
|
## FileSystem
|
|
9
11
|
|
|
10
|
-
Extends Helper
|
|
12
|
+
**Extends Helper**
|
|
11
13
|
|
|
12
14
|
Helper for testing filesystem.
|
|
13
15
|
Can be easily used to check file structures:
|
|
@@ -28,7 +30,7 @@ Starts from a current directory
|
|
|
28
30
|
|
|
29
31
|
#### Parameters
|
|
30
32
|
|
|
31
|
-
- `openPath`
|
|
33
|
+
- `openPath` **[string][1]**
|
|
32
34
|
|
|
33
35
|
### dontSeeFileContentsEqual
|
|
34
36
|
|
|
@@ -36,8 +38,8 @@ Checks that contents of file found by `seeFile` doesn't equal to text.
|
|
|
36
38
|
|
|
37
39
|
#### Parameters
|
|
38
40
|
|
|
39
|
-
- `text`
|
|
40
|
-
- `encoding`
|
|
41
|
+
- `text` **[string][1]**
|
|
42
|
+
- `encoding` **[string][1]**
|
|
41
43
|
|
|
42
44
|
### dontSeeInThisFile
|
|
43
45
|
|
|
@@ -45,8 +47,19 @@ Checks that file found by `seeFile` doesn't include text.
|
|
|
45
47
|
|
|
46
48
|
#### Parameters
|
|
47
49
|
|
|
48
|
-
- `text`
|
|
49
|
-
- `encoding`
|
|
50
|
+
- `text` **[string][1]**
|
|
51
|
+
- `encoding` **[string][1]**
|
|
52
|
+
|
|
53
|
+
### grabFileNames
|
|
54
|
+
|
|
55
|
+
Returns file names in current directory.
|
|
56
|
+
|
|
57
|
+
```js
|
|
58
|
+
I.handleDownloads();
|
|
59
|
+
I.click('Download Files');
|
|
60
|
+
I.amInPath('output/downloads');
|
|
61
|
+
const downloadedFileNames = I.grabFileNames();
|
|
62
|
+
```
|
|
50
63
|
|
|
51
64
|
### seeFile
|
|
52
65
|
|
|
@@ -54,7 +67,7 @@ Checks that file exists
|
|
|
54
67
|
|
|
55
68
|
#### Parameters
|
|
56
69
|
|
|
57
|
-
- `name`
|
|
70
|
+
- `name` **[string][1]**
|
|
58
71
|
|
|
59
72
|
### seeFileContentsEqual
|
|
60
73
|
|
|
@@ -62,8 +75,23 @@ Checks that contents of file found by `seeFile` equal to text.
|
|
|
62
75
|
|
|
63
76
|
#### Parameters
|
|
64
77
|
|
|
78
|
+
- `text` **[string][1]**
|
|
79
|
+
- `encoding` **[string][1]**
|
|
80
|
+
|
|
81
|
+
### seeFileNameMatching
|
|
82
|
+
|
|
83
|
+
Checks that file with a name including given text exists in the current directory.
|
|
84
|
+
|
|
85
|
+
```js
|
|
86
|
+
I.handleDownloads();
|
|
87
|
+
I.click('Download as PDF');
|
|
88
|
+
I.amInPath('output/downloads');
|
|
89
|
+
I.seeFileNameMatching('.pdf');
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
#### Parameters
|
|
93
|
+
|
|
65
94
|
- `text`
|
|
66
|
-
- `encoding`
|
|
67
95
|
|
|
68
96
|
### seeInThisFile
|
|
69
97
|
|
|
@@ -71,8 +99,8 @@ Checks that file found by `seeFile` includes a text.
|
|
|
71
99
|
|
|
72
100
|
#### Parameters
|
|
73
101
|
|
|
74
|
-
- `text`
|
|
75
|
-
- `encoding`
|
|
102
|
+
- `text` **[string][1]**
|
|
103
|
+
- `encoding` **[string][1]**
|
|
76
104
|
|
|
77
105
|
### writeToFile
|
|
78
106
|
|
|
@@ -80,5 +108,7 @@ Writes test to file
|
|
|
80
108
|
|
|
81
109
|
#### Parameters
|
|
82
110
|
|
|
83
|
-
- `name`
|
|
84
|
-
- `text`
|
|
111
|
+
- `name` **[string][1]**
|
|
112
|
+
- `text` **[string][1]**
|
|
113
|
+
|
|
114
|
+
[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
package/docs/helpers/GraphQL.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
2
|
+
permalink: /helpers/GraphQL
|
|
3
|
+
editLink: false
|
|
4
|
+
sidebar: auto
|
|
3
5
|
title: GraphQL
|
|
4
6
|
---
|
|
5
7
|
|
|
@@ -7,7 +9,7 @@ title: GraphQL
|
|
|
7
9
|
|
|
8
10
|
## GraphQL
|
|
9
11
|
|
|
10
|
-
Extends Helper
|
|
12
|
+
**Extends Helper**
|
|
11
13
|
|
|
12
14
|
GraphQL helper allows to send additional requests to a GraphQl endpoint during acceptance tests.
|
|
13
15
|
[Axios][1] library is used to perform requests.
|
|
@@ -47,22 +49,22 @@ this.helpers['GraphQL']._executeQuery({
|
|
|
47
49
|
|
|
48
50
|
- `config`
|
|
49
51
|
|
|
50
|
-
###
|
|
52
|
+
### _executeQuery
|
|
51
53
|
|
|
52
54
|
Executes query via axios call
|
|
53
55
|
|
|
54
56
|
#### Parameters
|
|
55
57
|
|
|
56
|
-
- `request` [object][2]
|
|
58
|
+
- `request` **[object][2]**
|
|
57
59
|
|
|
58
|
-
###
|
|
60
|
+
### _prepareGraphQLRequest
|
|
59
61
|
|
|
60
62
|
Prepares request for axios call
|
|
61
63
|
|
|
62
64
|
#### Parameters
|
|
63
65
|
|
|
64
|
-
- `operation` [object][2]
|
|
65
|
-
- `headers` [object][2]
|
|
66
|
+
- `operation` **[object][2]**
|
|
67
|
+
- `headers` **[object][2]**
|
|
66
68
|
|
|
67
69
|
### sendMutation
|
|
68
70
|
|
|
@@ -88,10 +90,10 @@ I.sendMutation(`
|
|
|
88
90
|
|
|
89
91
|
#### Parameters
|
|
90
92
|
|
|
91
|
-
- `mutation` [String][3]
|
|
92
|
-
- `variables` [object][2] that may go along with the mutation
|
|
93
|
-
- `options` [object][2] are additional query options
|
|
94
|
-
- `headers` [object][2]
|
|
93
|
+
- `mutation` **[String][3]**
|
|
94
|
+
- `variables` **[object][2]** that may go along with the mutation
|
|
95
|
+
- `options` **[object][2]** are additional query options
|
|
96
|
+
- `headers` **[object][2]**
|
|
95
97
|
|
|
96
98
|
### sendQuery
|
|
97
99
|
|
|
@@ -110,10 +112,10 @@ const user = response.data.data;
|
|
|
110
112
|
|
|
111
113
|
#### Parameters
|
|
112
114
|
|
|
113
|
-
- `query` [String][3]
|
|
114
|
-
- `variables` [object][2] that may go along with the query
|
|
115
|
-
- `options` [object][2] are additional query options
|
|
116
|
-
- `headers` [object][2]
|
|
115
|
+
- `query` **[String][3]**
|
|
116
|
+
- `variables` **[object][2]** that may go along with the query
|
|
117
|
+
- `options` **[object][2]** are additional query options
|
|
118
|
+
- `headers` **[object][2]**
|
|
117
119
|
|
|
118
120
|
[1]: https://github.com/axios/axios
|
|
119
121
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
2
|
+
permalink: /helpers/GraphQLDataFactory
|
|
3
|
+
editLink: false
|
|
4
|
+
sidebar: auto
|
|
3
5
|
title: GraphQLDataFactory
|
|
4
6
|
---
|
|
5
7
|
|
|
@@ -7,7 +9,7 @@ title: GraphQLDataFactory
|
|
|
7
9
|
|
|
8
10
|
## GraphQLDataFactory
|
|
9
11
|
|
|
10
|
-
Extends Helper
|
|
12
|
+
**Extends Helper**
|
|
11
13
|
|
|
12
14
|
Helper for managing remote data using GraphQL queries.
|
|
13
15
|
Uses data generators like [rosie][1] or factory girl to create new record.
|
|
@@ -158,25 +160,25 @@ Data of created records are collected and used in the end of a test for the clea
|
|
|
158
160
|
|
|
159
161
|
- `config`
|
|
160
162
|
|
|
161
|
-
###
|
|
163
|
+
### _requestCreate
|
|
162
164
|
|
|
163
165
|
Executes request to create a record to the GraphQL endpoint.
|
|
164
166
|
Can be replaced from a custom helper.
|
|
165
167
|
|
|
166
168
|
#### Parameters
|
|
167
169
|
|
|
168
|
-
- `operation` [string][4]
|
|
169
|
-
- `variables` any to be sent along with the query
|
|
170
|
+
- `operation` **[string][4]**
|
|
171
|
+
- `variables` **any** to be sent along with the query
|
|
170
172
|
|
|
171
|
-
###
|
|
173
|
+
### _requestDelete
|
|
172
174
|
|
|
173
175
|
Executes request to delete a record to the GraphQL endpoint.
|
|
174
176
|
Can be replaced from a custom helper.
|
|
175
177
|
|
|
176
178
|
#### Parameters
|
|
177
179
|
|
|
178
|
-
- `operation` [string][4]
|
|
179
|
-
- `data` any of the record to be deleted.
|
|
180
|
+
- `operation` **[string][4]**
|
|
181
|
+
- `data` **any** of the record to be deleted.
|
|
180
182
|
|
|
181
183
|
### mutateData
|
|
182
184
|
|
|
@@ -192,8 +194,8 @@ const user = await I.mutateData('createUser', { email: 'user@user.com'});
|
|
|
192
194
|
|
|
193
195
|
#### Parameters
|
|
194
196
|
|
|
195
|
-
- `operation` [string][4] to be performed
|
|
196
|
-
- `params` any predefined parameters
|
|
197
|
+
- `operation` **[string][4]** to be performed
|
|
198
|
+
- `params` **any** predefined parameters
|
|
197
199
|
|
|
198
200
|
### mutateMultiple
|
|
199
201
|
|
|
@@ -209,9 +211,9 @@ I.mutateMultiple('createUser', 3, { age: 25 });
|
|
|
209
211
|
|
|
210
212
|
#### Parameters
|
|
211
213
|
|
|
212
|
-
- `operation` [string][4]
|
|
213
|
-
- `times` [number][5]
|
|
214
|
-
- `params` any
|
|
214
|
+
- `operation` **[string][4]**
|
|
215
|
+
- `times` **[number][5]**
|
|
216
|
+
- `params` **any**
|
|
215
217
|
|
|
216
218
|
[1]: https://github.com/rosiejs/rosie
|
|
217
219
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
2
|
+
permalink: /helpers/MockRequest
|
|
3
|
+
editLink: false
|
|
4
|
+
sidebar: auto
|
|
3
5
|
title: MockRequest
|
|
4
6
|
---
|
|
5
7
|
|
|
@@ -7,9 +9,9 @@ title: MockRequest
|
|
|
7
9
|
|
|
8
10
|
## MockRequest
|
|
9
11
|
|
|
10
|
-
Extends Helper
|
|
12
|
+
**Extends Helper**
|
|
11
13
|
|
|
12
|
-
This helper allows to mock requests while running tests in Puppeteer or WebDriver
|
|
14
|
+
This helper allows to **mock requests while running tests in Puppeteer or WebDriver**.
|
|
13
15
|
For instance, you can block calls to 3rd-party services like Google Analytics, CDNs.
|
|
14
16
|
Another way of using is to emulate requests from server by passing prepared data.
|
|
15
17
|
|
|
@@ -34,7 +36,21 @@ helpers: {
|
|
|
34
36
|
}
|
|
35
37
|
```
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
> Partially works with WebDriver helper
|
|
40
|
+
|
|
41
|
+
[Polly config options][2] can be passed as well:
|
|
42
|
+
|
|
43
|
+
```js
|
|
44
|
+
// enable replay mode
|
|
45
|
+
helpers: {
|
|
46
|
+
Puppeteer: {
|
|
47
|
+
// regular Puppeteer config here
|
|
48
|
+
},
|
|
49
|
+
MockRequest: {
|
|
50
|
+
mode: 'replay',
|
|
51
|
+
},
|
|
52
|
+
}
|
|
53
|
+
```
|
|
38
54
|
|
|
39
55
|
### Usage
|
|
40
56
|
|
|
@@ -44,26 +60,26 @@ Use `I.mockRequest` to intercept and mock requests.
|
|
|
44
60
|
|
|
45
61
|
- `config`
|
|
46
62
|
|
|
47
|
-
###
|
|
63
|
+
### _checkAndStartMocking
|
|
48
64
|
|
|
49
65
|
Starts mocking if it's not started yet.
|
|
50
66
|
|
|
51
|
-
###
|
|
67
|
+
### _connectPuppeteer
|
|
52
68
|
|
|
53
69
|
Creates a polly instance by registering puppeteer adapter with the instance
|
|
54
70
|
|
|
55
71
|
#### Parameters
|
|
56
72
|
|
|
57
|
-
- `title` any
|
|
73
|
+
- `title` **any**
|
|
58
74
|
|
|
59
|
-
###
|
|
75
|
+
### _connectWebDriver
|
|
60
76
|
|
|
61
77
|
Creates polly object in the browser window context using xhr and fetch adapters,
|
|
62
78
|
after loading PollyJs and adapter scripts.
|
|
63
79
|
|
|
64
80
|
#### Parameters
|
|
65
81
|
|
|
66
|
-
- `title` any
|
|
82
|
+
- `title` **any**
|
|
67
83
|
|
|
68
84
|
### mockRequest
|
|
69
85
|
|
|
@@ -71,7 +87,7 @@ Mock response status
|
|
|
71
87
|
|
|
72
88
|
```js
|
|
73
89
|
I.mockRequest('GET', '/api/users', 200);
|
|
74
|
-
I.mockRequest('ANY', '/secretsRoutes
|
|
90
|
+
I.mockRequest('ANY', '/secretsRoutes/*', 403);
|
|
75
91
|
I.mockRequest('POST', '/secrets', { secrets: 'fakeSecrets' });
|
|
76
92
|
I.mockRequest('GET', '/api/users/1', 404, 'User not found');
|
|
77
93
|
```
|
|
@@ -84,10 +100,10 @@ I.mockRequest('GET', ['/secrets', '/v2/secrets'], 403);
|
|
|
84
100
|
|
|
85
101
|
#### Parameters
|
|
86
102
|
|
|
87
|
-
- `method` [string][
|
|
88
|
-
- `oneOrMoreUrls` ([string][
|
|
89
|
-
- `dataOrStatusCode` ([number][
|
|
90
|
-
- `additionalData` ([string][
|
|
103
|
+
- `method` **[string][3]** request method. Can be `GET`, `POST`, `PUT`, etc or `ANY`.
|
|
104
|
+
- `oneOrMoreUrls` **([string][3] | [Array][4]<[string][3]>)** url(s) to mock. Can be exact URL, a pattern, or an array of URLs.
|
|
105
|
+
- `dataOrStatusCode` **([number][5] | [string][3] | [object][6])** status code when number provided. A response body otherwise
|
|
106
|
+
- `additionalData` **([string][3] | [object][6])** response body when a status code is set by previous parameter.
|
|
91
107
|
|
|
92
108
|
### startMocking
|
|
93
109
|
|
|
@@ -97,7 +113,7 @@ mocking requests.
|
|
|
97
113
|
|
|
98
114
|
#### Parameters
|
|
99
115
|
|
|
100
|
-
- `title` any
|
|
116
|
+
- `title` **any**
|
|
101
117
|
|
|
102
118
|
### stopMocking
|
|
103
119
|
|
|
@@ -105,10 +121,12 @@ Stops mocking requests.
|
|
|
105
121
|
|
|
106
122
|
[1]: https://netflix.github.io/pollyjs/#/
|
|
107
123
|
|
|
108
|
-
[2]: https://
|
|
124
|
+
[2]: https://netflix.github.io/pollyjs/#/configuration?id=configuration
|
|
125
|
+
|
|
126
|
+
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
109
127
|
|
|
110
|
-
[
|
|
128
|
+
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
111
129
|
|
|
112
|
-
[
|
|
130
|
+
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
113
131
|
|
|
114
|
-
[
|
|
132
|
+
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|