codeceptjs 2.1.3 → 2.2.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 +125 -37
- package/README.md +15 -22
- package/bin/codecept.js +4 -1
- package/docs/acceptance.md +44 -1
- package/docs/advanced.md +1 -1
- package/docs/angular.md +6 -9
- package/docs/basics.md +388 -75
- package/docs/bdd.md +4 -3
- package/docs/best.md +1 -1
- package/docs/books.md +31 -0
- package/docs/build/Appium.js +215 -176
- package/docs/build/Nightmare.js +618 -489
- package/docs/build/Polly.js +189 -0
- package/docs/build/Protractor.js +747 -608
- package/docs/build/Puppeteer.js +914 -633
- package/docs/build/REST.js +1 -1
- package/docs/build/TestCafe.js +1835 -0
- package/docs/build/WebDriver.js +861 -805
- package/docs/build/WebDriverIO.js +616 -617
- package/docs/changelog.md +410 -316
- package/docs/commands.md +6 -6
- package/docs/community-helpers.md +2 -0
- package/docs/detox.md +235 -0
- package/docs/examples.md +23 -0
- package/docs/helpers/ApiDataFactory.md +11 -10
- package/docs/helpers/Appium.md +130 -61
- package/docs/helpers/Detox.md +579 -0
- package/docs/helpers/FileSystem.md +2 -1
- package/docs/helpers/Mochawesome.md +1 -0
- package/docs/helpers/Nightmare.md +348 -128
- package/docs/helpers/Polly.md +85 -0
- package/docs/helpers/Protractor.md +451 -184
- package/docs/helpers/Puppeteer-firefox.md +55 -0
- package/docs/helpers/Puppeteer.md +619 -183
- package/docs/helpers/REST.md +17 -16
- package/docs/helpers/SeleniumWebdriver.md +9 -8
- package/docs/helpers/TestCafe.md +1168 -0
- package/docs/helpers/WebDriver.md +600 -291
- package/docs/helpers/WebDriverIO.md +393 -278
- package/docs/helpers.md +37 -18
- package/docs/locators.md +2 -0
- package/docs/mobile-react-native-locators.md +64 -0
- package/docs/mobile.md +5 -0
- package/docs/plugins.md +54 -13
- package/docs/puppeteer.md +74 -26
- package/docs/quickstart.md +47 -12
- package/docs/react.md +67 -0
- package/docs/reports.md +1 -1
- package/docs/{webapi/_keys.mustache → shared/keys.mustache} +0 -0
- package/docs/shared/react.mustache +1 -0
- package/docs/testcafe.md +157 -0
- package/docs/videos.md +19 -0
- package/docs/webapi/amOnPage.mustache +1 -1
- package/docs/webapi/appendField.mustache +2 -2
- package/docs/webapi/attachFile.mustache +2 -2
- package/docs/webapi/checkOption.mustache +2 -2
- package/docs/webapi/clearCookie.mustache +1 -1
- package/docs/webapi/clearField.mustache +1 -1
- package/docs/webapi/click.mustache +2 -2
- package/docs/webapi/clickLink.mustache +3 -3
- package/docs/webapi/dontSee.mustache +6 -3
- package/docs/webapi/dontSeeCheckboxIsChecked.mustache +7 -1
- package/docs/webapi/dontSeeCookie.mustache +5 -1
- package/docs/webapi/dontSeeCurrentUrlEquals.mustache +6 -1
- package/docs/webapi/dontSeeElement.mustache +5 -1
- package/docs/webapi/dontSeeElementInDOM.mustache +5 -1
- package/docs/webapi/dontSeeInCurrentUrl.mustache +1 -1
- package/docs/webapi/dontSeeInField.mustache +7 -2
- package/docs/webapi/dontSeeInSource.mustache +5 -1
- package/docs/webapi/dontSeeInTitle.mustache +5 -1
- package/docs/webapi/doubleClick.mustache +2 -2
- package/docs/webapi/downloadFile.mustache +2 -2
- package/docs/webapi/dragAndDrop.mustache +2 -2
- package/docs/webapi/dragSlider.mustache +2 -2
- package/docs/webapi/executeAsyncScript.mustache +1 -1
- package/docs/webapi/executeScript.mustache +1 -1
- package/docs/webapi/fillField.mustache +2 -2
- package/docs/webapi/grabAttributeFrom.mustache +3 -2
- package/docs/webapi/grabBrowserLogs.mustache +3 -1
- package/docs/webapi/grabCookie.mustache +2 -1
- package/docs/webapi/grabCssPropertyFrom.mustache +3 -2
- package/docs/webapi/grabCurrentUrl.mustache +3 -1
- package/docs/webapi/grabDataFromPerformanceTiming.mustache +19 -0
- package/docs/webapi/grabHTMLFrom.mustache +2 -1
- package/docs/webapi/grabNumberOfOpenTabs.mustache +4 -2
- package/docs/webapi/grabNumberOfVisibleElements.mustache +3 -2
- package/docs/webapi/grabPageScrollPosition.mustache +3 -1
- package/docs/webapi/grabSource.mustache +3 -1
- package/docs/webapi/grabTextFrom.mustache +2 -1
- package/docs/webapi/grabTitle.mustache +3 -1
- package/docs/webapi/grabValueFrom.mustache +2 -1
- package/docs/webapi/moveCursorTo.mustache +3 -3
- package/docs/webapi/pressKey.mustache +1 -1
- package/docs/webapi/resizeWindow.mustache +2 -2
- package/docs/webapi/rightClick.mustache +2 -2
- package/docs/webapi/saveScreenshot.mustache +3 -3
- package/docs/webapi/say.mustache +2 -2
- package/docs/webapi/scrollPageToBottom.mustache +1 -1
- package/docs/webapi/scrollPageToTop.mustache +1 -1
- package/docs/webapi/scrollTo.mustache +3 -3
- package/docs/webapi/see.mustache +2 -2
- package/docs/webapi/seeAttributesOnElements.mustache +3 -3
- package/docs/webapi/seeCheckboxIsChecked.mustache +2 -1
- package/docs/webapi/seeCookie.mustache +1 -1
- package/docs/webapi/seeCssPropertiesOnElements.mustache +2 -2
- 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 +2 -2
- package/docs/webapi/seeInSource.mustache +1 -1
- package/docs/webapi/seeInTitle.mustache +5 -1
- package/docs/webapi/seeNumberOfElements.mustache +10 -0
- package/docs/webapi/seeNumberOfVisibleElements.mustache +2 -2
- package/docs/webapi/selectOption.mustache +2 -2
- package/docs/webapi/setCookie.mustache +1 -1
- package/docs/webapi/switchTo.mustache +6 -1
- package/docs/webapi/uncheckOption.mustache +2 -2
- package/docs/webapi/wait.mustache +1 -2
- package/docs/webapi/waitForDetached.mustache +3 -3
- package/docs/webapi/waitForElement.mustache +2 -2
- package/docs/webapi/waitForEnabled.mustache +1 -1
- package/docs/webapi/waitForFunction.mustache +3 -3
- package/docs/webapi/waitForInvisible.mustache +3 -3
- package/docs/webapi/waitForText.mustache +3 -3
- package/docs/webapi/waitForValue.mustache +3 -3
- package/docs/webapi/waitForVisible.mustache +3 -3
- package/docs/webapi/waitInUrl.mustache +2 -2
- package/docs/webapi/waitNumberOfVisibleElements.mustache +3 -3
- package/docs/webapi/waitToHide.mustache +3 -3
- package/docs/webapi/waitUntil.mustache +3 -3
- package/docs/webapi/waitUrlEquals.mustache +2 -2
- package/docs/webdriver.md +453 -0
- package/lib/codecept.js +11 -9
- package/lib/command/definitions.js +183 -30
- package/lib/command/gherkin/snippets.js +29 -9
- package/lib/command/init.js +31 -9
- package/lib/command/run-multiple.js +46 -59
- package/lib/command/utils.js +1 -1
- package/lib/container.js +30 -4
- package/lib/data/dataScenarioConfig.js +18 -0
- package/lib/helper/Appium.js +24 -24
- package/lib/helper/Nightmare.js +81 -84
- package/lib/helper/Polly.js +189 -0
- package/lib/helper/Protractor.js +96 -86
- package/lib/helper/Puppeteer.js +238 -113
- package/lib/helper/REST.js +1 -1
- package/lib/helper/TestCafe.js +1257 -0
- package/lib/helper/WebDriver.js +217 -277
- package/lib/helper/WebDriverIO.js +75 -75
- package/lib/helper/clientscripts/nightmare.js +8 -0
- package/lib/helper/extras/React.js +55 -0
- package/lib/helper/testcafe/testControllerHolder.js +42 -0
- package/lib/helper/testcafe/testcafe-utils.js +63 -0
- package/lib/history.js +39 -0
- package/lib/hooks.js +25 -1
- package/lib/interfaces/gherkin.js +17 -1
- package/lib/interfaces/scenarioConfig.js +2 -2
- package/lib/listener/config.js +3 -3
- package/lib/locator.js +6 -0
- package/lib/pause.js +22 -1
- package/lib/plugin/allure.js +63 -0
- package/lib/plugin/autoLogin.js +65 -16
- package/lib/plugin/puppeteerCoverage.js +6 -1
- package/lib/plugin/stepByStepReport.js +4 -3
- package/lib/scenario.js +23 -17
- package/lib/step.js +5 -2
- package/lib/ui.js +1 -1
- package/lib/utils.js +70 -20
- package/package.json +20 -19
- package/translations/de-DE.js +69 -0
- package/translations/index.js +1 -0
- package/docs/video.md +0 -26
package/docs/helpers/REST.md
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
id: REST
|
|
3
3
|
title: REST
|
|
4
4
|
---
|
|
5
|
+
|
|
5
6
|
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
6
7
|
|
|
7
8
|
## REST
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
Extends Helper
|
|
10
11
|
|
|
11
12
|
REST helper allows to send additional requests to the REST API during acceptance tests.
|
|
12
13
|
[Axios][1] library is used to perform requests.
|
|
@@ -52,7 +53,7 @@ Executes axios request
|
|
|
52
53
|
|
|
53
54
|
#### Parameters
|
|
54
55
|
|
|
55
|
-
- `request`
|
|
56
|
+
- `request` any
|
|
56
57
|
|
|
57
58
|
### \_url
|
|
58
59
|
|
|
@@ -60,7 +61,7 @@ Generates url based on format sent (takes endpoint + url if latter lacks 'http')
|
|
|
60
61
|
|
|
61
62
|
#### Parameters
|
|
62
63
|
|
|
63
|
-
- `url`
|
|
64
|
+
- `url` any
|
|
64
65
|
|
|
65
66
|
### sendDeleteRequest
|
|
66
67
|
|
|
@@ -72,8 +73,8 @@ I.sendDeleteRequest('/api/users/1');
|
|
|
72
73
|
|
|
73
74
|
#### Parameters
|
|
74
75
|
|
|
75
|
-
- `url`
|
|
76
|
-
- `headers`
|
|
76
|
+
- `url` any
|
|
77
|
+
- `headers` [object][2]
|
|
77
78
|
|
|
78
79
|
### sendGetRequest
|
|
79
80
|
|
|
@@ -85,8 +86,8 @@ I.sendGetRequest('/api/users.json');
|
|
|
85
86
|
|
|
86
87
|
#### Parameters
|
|
87
88
|
|
|
88
|
-
- `url`
|
|
89
|
-
- `headers`
|
|
89
|
+
- `url` any
|
|
90
|
+
- `headers` [object][2]
|
|
90
91
|
|
|
91
92
|
### sendPatchRequest
|
|
92
93
|
|
|
@@ -98,9 +99,9 @@ I.sendPatchRequest('/api/users.json', { "email": "user@user.com" });
|
|
|
98
99
|
|
|
99
100
|
#### Parameters
|
|
100
101
|
|
|
101
|
-
- `url`
|
|
102
|
-
- `payload`
|
|
103
|
-
- `headers`
|
|
102
|
+
- `url` [string][3]
|
|
103
|
+
- `payload` [object][2]
|
|
104
|
+
- `headers` [object][2]
|
|
104
105
|
|
|
105
106
|
### sendPostRequest
|
|
106
107
|
|
|
@@ -112,9 +113,9 @@ I.sendPostRequest('/api/users.json', { "email": "user@user.com" });
|
|
|
112
113
|
|
|
113
114
|
#### Parameters
|
|
114
115
|
|
|
115
|
-
- `url`
|
|
116
|
-
- `payload`
|
|
117
|
-
- `headers`
|
|
116
|
+
- `url` any
|
|
117
|
+
- `payload` any
|
|
118
|
+
- `headers` [object][2]
|
|
118
119
|
|
|
119
120
|
### sendPutRequest
|
|
120
121
|
|
|
@@ -126,9 +127,9 @@ I.sendPutRequest('/api/users.json', { "email": "user@user.com" });
|
|
|
126
127
|
|
|
127
128
|
#### Parameters
|
|
128
129
|
|
|
129
|
-
- `url`
|
|
130
|
-
- `payload`
|
|
131
|
-
- `headers`
|
|
130
|
+
- `url` [string][3]
|
|
131
|
+
- `payload` [object][2]
|
|
132
|
+
- `headers` [object][2]
|
|
132
133
|
|
|
133
134
|
### setRequestTimeout
|
|
134
135
|
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
id: SeleniumWebdriver
|
|
3
3
|
title: SeleniumWebdriver
|
|
4
4
|
---
|
|
5
|
+
|
|
5
6
|
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
6
7
|
|
|
7
8
|
## SeleniumWebdriver
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
Extends Helper
|
|
10
11
|
|
|
11
12
|
SeleniumWebdriver helper is based on the official [Selenium Webdriver JS][1]
|
|
12
13
|
library. It implements common web api methods (amOnPage, click, see).
|
|
@@ -35,16 +36,16 @@ This helper should be configured in codecept.json or codecept.conf.js
|
|
|
35
36
|
- `browser` - browser in which perform testing
|
|
36
37
|
- `driver` - which protractor driver to use (local, direct, session, hosted, sauce, browserstack). By default set to 'hosted' which requires selenium server to be started.
|
|
37
38
|
- `restart` - restart browser between tests (default: true).
|
|
38
|
-
- `smartWait`: (optional)
|
|
39
|
-
- `disableScreenshots`
|
|
40
|
-
- `uniqueScreenshotNames`
|
|
41
|
-
- `keepBrowserState`
|
|
42
|
-
- `keepCookies`
|
|
39
|
+
- `smartWait`: (optional) enables SmartWait; wait for additional milliseconds for element to appear. Enable for 5 secs: "smartWait": 5000
|
|
40
|
+
- `disableScreenshots` - don't save screenshot on failure
|
|
41
|
+
- `uniqueScreenshotNames` - option to prevent screenshot override if you have scenarios with the same name in different suites
|
|
42
|
+
- `keepBrowserState` - keep browser state between tests when `restart` set to false.
|
|
43
|
+
- `keepCookies` - keep cookies between tests when `restart` set to false.\
|
|
43
44
|
- `seleniumAddress` - Selenium address to connect (default: [http://localhost:4444/wd/hub][7])
|
|
44
|
-
- `waitForTimeout`: (optional) sets default wait time in _ms_ for all `wait
|
|
45
|
+
- `waitForTimeout`: (optional) sets default wait time in _ms_ for all `wait` functions. 1000 by default;
|
|
45
46
|
- `scriptTimeout`: (optional) sets default timeout for scripts in `executeAsync`. 1000 by default.
|
|
46
47
|
- `windowSize`: (optional) default window size. Set to `maximize` or a dimension in the format `640x480`.
|
|
47
|
-
- `manualStart`
|
|
48
|
+
- `manualStart` - do not start browser before a test, start it manually inside a helper with `this.helpers["WebDriverIO"]._startBrowser()`
|
|
48
49
|
- `capabilities`: {} - list of [Desired Capabilities][8]
|
|
49
50
|
|
|
50
51
|
Example:
|