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
|
@@ -6,6 +6,6 @@ I.scrollTo('footer');
|
|
|
6
6
|
I.scrollTo('#submit', 5, 5);
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
@param locator located by CSS|XPath|strict locator.
|
|
10
|
-
@param offsetX (optional) X-axis offset.
|
|
11
|
-
@param offsetY (optional) Y-axis offset.
|
|
9
|
+
@param {string|object} locator located by CSS|XPath|strict locator.
|
|
10
|
+
@param {number} offsetX (optional, `0` by default) X-axis offset.
|
|
11
|
+
@param {number} offsetY (optional, `0` by default) Y-axis offset.
|
package/docs/webapi/see.mustache
CHANGED
|
@@ -6,5 +6,5 @@ I.see('Welcome'); // text welcome on a page
|
|
|
6
6
|
I.see('Welcome', '.content'); // text inside .content div
|
|
7
7
|
I.see('Register', {css: 'form.register'}); // use strict locator
|
|
8
8
|
```
|
|
9
|
-
@param text expected on page.
|
|
10
|
-
@param context (optional) element located by CSS|Xpath|strict locator in which to search for text.
|
|
9
|
+
@param {string} text expected on page.
|
|
10
|
+
@param {string|object} context (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Checks that all elements with given locator have given attributes.
|
|
2
2
|
|
|
3
3
|
```js
|
|
4
|
-
I.seeAttributesOnElements('//form', {
|
|
4
|
+
I.seeAttributesOnElements('//form', { method: "post"});
|
|
5
5
|
```
|
|
6
6
|
|
|
7
|
-
@param locator located by CSS|XPath|strict locator.
|
|
8
|
-
@param
|
|
7
|
+
@param {string|object} locator located by CSS|XPath|strict locator.
|
|
8
|
+
@param {object} attributes attributes and their values to check.
|
|
@@ -5,4 +5,5 @@ I.seeCheckboxIsChecked('Agree');
|
|
|
5
5
|
I.seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms
|
|
6
6
|
I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
7
7
|
```
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
@param {string|object} field located by label|name|CSS|XPath|strict locator.
|
|
@@ -4,5 +4,5 @@ Checks that all elements with given locator have given CSS properties.
|
|
|
4
4
|
I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
|
|
5
5
|
```
|
|
6
6
|
|
|
7
|
-
@param locator located by CSS|XPath|strict locator.
|
|
8
|
-
@param cssProperties object with CSS properties and their values to check.
|
|
7
|
+
@param {string|object} locator located by CSS|XPath|strict locator.
|
|
8
|
+
@param {object} cssProperties object with CSS properties and their values to check.
|
|
@@ -7,5 +7,5 @@ I.seeInField({css: 'form textarea'},'Type your comment here');
|
|
|
7
7
|
I.seeInField('form input[type=hidden]','hidden_value');
|
|
8
8
|
I.seeInField('#searchform input','Search');
|
|
9
9
|
```
|
|
10
|
-
@param field located by label|name|CSS|XPath|strict locator.
|
|
11
|
-
@param value value to check.
|
|
10
|
+
@param {string|object} field located by label|name|CSS|XPath|strict locator.
|
|
11
|
+
@param {string} value value to check.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Asserts that an element appears a given number of times in the DOM.
|
|
2
|
+
Element is located by label or name or CSS or XPath.
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
```js
|
|
6
|
+
I.seeNumberOfElements('#submitBtn', 1);
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
@param {string|object} locator element located by CSS|XPath|strict locator.
|
|
10
|
+
@param {number} num number of elements.
|
|
@@ -5,5 +5,5 @@ Element is located by CSS or XPath.
|
|
|
5
5
|
I.seeNumberOfVisibleElements('.buttons', 3);
|
|
6
6
|
```
|
|
7
7
|
|
|
8
|
-
@param locator element located by CSS|XPath|strict locator.
|
|
9
|
-
@param num number of elements.
|
|
8
|
+
@param {string|object} locator element located by CSS|XPath|strict locator.
|
|
9
|
+
@param {number} num number of elements.
|
|
@@ -16,5 +16,5 @@ Provide an array for the second argument to select multiple options.
|
|
|
16
16
|
```js
|
|
17
17
|
I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
18
18
|
```
|
|
19
|
-
@param select field located by label|name|CSS|XPath|strict locator.
|
|
20
|
-
@param option visible text or value of option.
|
|
19
|
+
@param {string|object} select field located by label|name|CSS|XPath|strict locator.
|
|
20
|
+
@param {string|array} option visible text or value of option.
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
Switches frame or in case of null locator reverts to parent.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
```js
|
|
4
|
+
I.switchTo('iframe'); // switch to first iframe
|
|
5
|
+
I.switchTo(); // switch back to main page
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
@param {string|object} locator (optional, `null` by default) element located by CSS|XPath|strict locator.
|
|
@@ -8,5 +8,5 @@ I.uncheckOption('#agree');
|
|
|
8
8
|
I.uncheckOption('I Agree to Terms and Conditions');
|
|
9
9
|
I.uncheckOption('agree', '//form');
|
|
10
10
|
```
|
|
11
|
-
@param field checkbox located by label | name | CSS | XPath | strict locator.
|
|
12
|
-
@param context (optional) element located by CSS | XPath | strict locator.
|
|
11
|
+
@param {string|object} field checkbox located by label | name | CSS | XPath | strict locator.
|
|
12
|
+
@param {string} context (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Waits for an element to become not attached to the DOM on a page (by default waits for 1sec).
|
|
2
2
|
Element can be located by CSS or XPath.
|
|
3
3
|
|
|
4
|
-
```
|
|
4
|
+
```js
|
|
5
5
|
I.waitForDetached('#popup');
|
|
6
6
|
```
|
|
7
7
|
|
|
8
|
-
@param locator element located by CSS|XPath|strict locator.
|
|
9
|
-
@param sec (optional) time in seconds to wait
|
|
8
|
+
@param {string|object} locator element located by CSS|XPath|strict locator.
|
|
9
|
+
@param {number} sec (optional, `1` by default) time in seconds to wait
|
|
@@ -6,5 +6,5 @@ I.waitForElement('.btn.continue');
|
|
|
6
6
|
I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
@param locator element located by CSS|XPath|strict locator.
|
|
10
|
-
@param sec (optional) time in seconds to wait
|
|
9
|
+
@param {string|object} locator element located by CSS|XPath|strict locator.
|
|
10
|
+
@param {number} sec (optional, `1` by default) time in seconds to wait
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Waits for element to become enabled (by default waits for 1sec).
|
|
2
2
|
Element can be located by CSS or XPath.
|
|
3
3
|
|
|
4
|
-
@param locator element located by CSS|XPath|strict locator.
|
|
4
|
+
@param {string|object} locator element located by CSS|XPath|strict locator.
|
|
5
5
|
@param sec (optional) time in seconds to wait, 1 by default.
|
|
@@ -11,6 +11,6 @@ I.waitForFunction(() => window.requests == 0, 5); // waits for 5 sec
|
|
|
11
11
|
I.waitForFunction((count) => window.requests == count, [3], 5) // pass args and wait for 5 sec
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
@param fn to be executed in browser context.
|
|
15
|
-
@param argsOrSec (optional) arguments for function or seconds.
|
|
16
|
-
@param sec (optional) time in seconds to wait
|
|
14
|
+
@param {string|function} fn to be executed in browser context.
|
|
15
|
+
@param {array|number} argsOrSec (optional, `1` by default) arguments for function or seconds.
|
|
16
|
+
@param {number} sec (optional, `1` by default) time in seconds to wait
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Waits for an element to be removed or become invisible on a page (by default waits for 1sec).
|
|
2
2
|
Element can be located by CSS or XPath.
|
|
3
3
|
|
|
4
|
-
```
|
|
4
|
+
```js
|
|
5
5
|
I.waitForInvisible('#popup');
|
|
6
6
|
```
|
|
7
7
|
|
|
8
|
-
@param locator element located by CSS|XPath|strict locator.
|
|
9
|
-
@param sec (optional) time in seconds to wait
|
|
8
|
+
@param {string|object} locator element located by CSS|XPath|strict locator.
|
|
9
|
+
@param {number} sec (optional, `1` by default) time in seconds to wait
|
|
@@ -7,6 +7,6 @@ I.waitForText('Thank you, form has been submitted');
|
|
|
7
7
|
I.waitForText('Thank you, form has been submitted', 5, '#modal');
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
-
@param text to wait for.
|
|
11
|
-
@param sec (optional) time in seconds to wait
|
|
12
|
-
@param context (optional) element located by CSS|XPath|strict locator.
|
|
10
|
+
@param {string }text to wait for.
|
|
11
|
+
@param {number} sec (optional, `1` by default) time in seconds to wait
|
|
12
|
+
@param {string|object} context (optional) element located by CSS|XPath|strict locator.
|
|
@@ -4,6 +4,6 @@ Waits for the specified value to be in value attribute.
|
|
|
4
4
|
I.waitForValue('//input', "GoodValue");
|
|
5
5
|
```
|
|
6
6
|
|
|
7
|
-
@param field input field.
|
|
8
|
-
@param value expected value.
|
|
9
|
-
@param sec (optional) time in seconds to wait
|
|
7
|
+
@param {string|object} field input field.
|
|
8
|
+
@param {string }value expected value.
|
|
9
|
+
@param {number} sec (optional, `1` by default) time in seconds to wait
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Waits for an element to become visible on a page (by default waits for 1sec).
|
|
2
2
|
Element can be located by CSS or XPath.
|
|
3
3
|
|
|
4
|
-
```
|
|
4
|
+
```js
|
|
5
5
|
I.waitForVisible('#popup');
|
|
6
6
|
```
|
|
7
7
|
|
|
8
|
-
@param locator element located by CSS|XPath|strict locator.
|
|
9
|
-
@param sec (optional) time in seconds to wait
|
|
8
|
+
@param {string|object} locator element located by CSS|XPath|strict locator.
|
|
9
|
+
@param {number} sec (optional, `1` by default) time in seconds to wait
|
|
@@ -4,5 +4,5 @@ Waiting for the part of the URL to match the expected. Useful for SPA to underst
|
|
|
4
4
|
I.waitInUrl('/info', 2);
|
|
5
5
|
```
|
|
6
6
|
|
|
7
|
-
@param urlPart value to check.
|
|
8
|
-
@param sec (optional) time in seconds to wait
|
|
7
|
+
@param {string} urlPart value to check.
|
|
8
|
+
@param {number} sec (optional, `1` by default) time in seconds to wait
|
|
@@ -4,6 +4,6 @@ Waits for a specified number of elements on the page.
|
|
|
4
4
|
I.waitNumberOfVisibleElements('a', 3);
|
|
5
5
|
```
|
|
6
6
|
|
|
7
|
-
@param locator element located by CSS|XPath|strict locator.
|
|
8
|
-
@param num number of elements.
|
|
9
|
-
@param sec (optional) time in seconds to wait
|
|
7
|
+
@param {string|object} locator element located by CSS|XPath|strict locator.
|
|
8
|
+
@param {number} num number of elements.
|
|
9
|
+
@param {number} sec (optional, `1` by default) time in seconds to wait
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Waits for an element to hide (by default waits for 1sec).
|
|
2
2
|
Element can be located by CSS or XPath.
|
|
3
3
|
|
|
4
|
-
```
|
|
4
|
+
```js
|
|
5
5
|
I.waitToHide('#popup');
|
|
6
6
|
```
|
|
7
7
|
|
|
8
|
-
@param locator element located by CSS|XPath|strict locator.
|
|
9
|
-
@param sec (optional) time in seconds to wait
|
|
8
|
+
@param {string|object} locator element located by CSS|XPath|strict locator.
|
|
9
|
+
@param {number} sec (optional, `1` by default) time in seconds to wait
|
|
@@ -5,6 +5,6 @@ I.waitUntil(() => window.requests == 0);
|
|
|
5
5
|
I.waitUntil(() => window.requests == 0, 5);
|
|
6
6
|
```
|
|
7
7
|
|
|
8
|
-
@param fn function which is executed in browser context.
|
|
9
|
-
@param sec (optional) time in seconds to wait
|
|
10
|
-
@param timeoutMsg
|
|
8
|
+
@param {function|string} fn function which is executed in browser context.
|
|
9
|
+
@param {number} sec (optional, `1` by default) time in seconds to wait
|
|
10
|
+
@param {string} [timeoutMsg=''] message to show in case of timeout fail.
|
|
@@ -5,5 +5,5 @@ I.waitUrlEquals('/info', 2);
|
|
|
5
5
|
I.waitUrlEquals('http://127.0.0.1:8000/info');
|
|
6
6
|
```
|
|
7
7
|
|
|
8
|
-
@param urlPart value to check.
|
|
9
|
-
@param sec (optional) time in seconds to wait
|
|
8
|
+
@param {string} urlPart value to check.
|
|
9
|
+
@param {number} sec (optional, `1` by default) time in seconds to wait
|