codeceptjs 3.5.11 → 3.5.12-beta.2
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/README.md +3 -3
- package/docs/build/Appium.js +35 -35
- package/docs/build/Nightmare.js +50 -50
- package/docs/build/Playwright.js +100 -72
- package/docs/build/Protractor.js +59 -59
- package/docs/build/Puppeteer.js +96 -69
- package/docs/build/TestCafe.js +48 -48
- package/docs/build/WebDriver.js +223 -105
- package/docs/helpers/Playwright.md +15 -0
- package/docs/helpers/Puppeteer.md +15 -0
- package/docs/helpers/WebDriver.md +340 -266
- package/docs/locators.md +9 -1
- package/docs/webapi/waitForNumberOfTabs.mustache +9 -0
- package/docs/webdriver.md +52 -6
- package/lib/command/run-multiple.js +3 -1
- package/lib/command/run-workers.js +32 -1
- package/lib/command/workers/runTests.js +2 -2
- package/lib/css2xpath/js/css_to_xpath.js +20 -0
- package/lib/css2xpath/js/expression.js +23 -0
- package/lib/css2xpath/js/renderer.js +239 -0
- package/lib/helper/Playwright.js +21 -2
- package/lib/helper/Puppeteer.js +18 -0
- package/lib/helper/WebDriver.js +140 -31
- package/lib/locator.js +31 -4
- package/lib/plugin/retryFailedStep.js +5 -1
- package/lib/plugin/retryTo.js +2 -2
- package/package.json +24 -18
- package/typings/index.d.ts +9 -6
- package/typings/promiseBasedTypes.d.ts +84 -1
- package/typings/types.d.ts +102 -2
package/README.md
CHANGED
|
@@ -304,8 +304,8 @@ Thanks all to those who are and will have contributing to this awesome project!
|
|
|
304
304
|
<a href="https://github.com/APshenkin"><img src="https://avatars.githubusercontent.com/u/14344430?v=4" title="APshenkin" width="80" height="80"></a>
|
|
305
305
|
<a href="https://github.com/fabioel"><img src="https://avatars.githubusercontent.com/u/9824235?v=4" title="fabioel" width="80" height="80"></a>
|
|
306
306
|
<a href="https://github.com/pablopaul"><img src="https://avatars.githubusercontent.com/u/635526?v=4" title="pablopaul" width="80" height="80"></a>
|
|
307
|
-
<a href="https://github.com/Georgegriff"><img src="https://avatars.githubusercontent.com/u/9056958?v=4" title="Georgegriff" width="80" height="80"></a>
|
|
308
307
|
<a href="https://github.com/mirao"><img src="https://avatars.githubusercontent.com/u/12584138?v=4" title="mirao" width="80" height="80"></a>
|
|
308
|
+
<a href="https://github.com/Georgegriff"><img src="https://avatars.githubusercontent.com/u/9056958?v=4" title="Georgegriff" width="80" height="80"></a>
|
|
309
309
|
<a href="https://github.com/KMKoushik"><img src="https://avatars.githubusercontent.com/u/24666922?v=4" title="KMKoushik" width="80" height="80"></a>
|
|
310
310
|
<a href="https://github.com/nikocanvacom"><img src="https://avatars.githubusercontent.com/u/83254493?v=4" title="nikocanvacom" width="80" height="80"></a>
|
|
311
311
|
<a href="https://github.com/elukoyanov"><img src="https://avatars.githubusercontent.com/u/11647141?v=4" title="elukoyanov" width="80" height="80"></a>
|
|
@@ -321,9 +321,9 @@ Thanks all to those who are and will have contributing to this awesome project!
|
|
|
321
321
|
<a href="https://github.com/ngraf"><img src="https://avatars.githubusercontent.com/u/7094389?v=4" title="ngraf" width="80" height="80"></a>
|
|
322
322
|
<a href="https://github.com/maojunxyz"><img src="https://avatars.githubusercontent.com/u/28778042?v=4" title="maojunxyz" width="80" height="80"></a>
|
|
323
323
|
<a href="https://github.com/abhimanyupandian"><img src="https://avatars.githubusercontent.com/u/36107381?v=4" title="abhimanyupandian" width="80" height="80"></a>
|
|
324
|
-
<a href="https://github.com/hatufacci"><img src="https://avatars.githubusercontent.com/u/4963181?v=4" title="hatufacci" width="80" height="80"></a>
|
|
325
324
|
<a href="https://github.com/martomo"><img src="https://avatars.githubusercontent.com/u/1850135?v=4" title="martomo" width="80" height="80"></a>
|
|
326
|
-
<a href="https://github.com/
|
|
325
|
+
<a href="https://github.com/hatufacci"><img src="https://avatars.githubusercontent.com/u/4963181?v=4" title="hatufacci" width="80" height="80"></a>
|
|
326
|
+
<a href="https://github.com/johnyb"><img src="https://avatars.githubusercontent.com/u/86358?v=4" title="johnyb" width="80" height="80"></a>
|
|
327
327
|
|
|
328
328
|
[//]: contributor-faces
|
|
329
329
|
|
package/docs/build/Appium.js
CHANGED
|
@@ -1058,7 +1058,7 @@ class Appium extends Webdriver {
|
|
|
1058
1058
|
*
|
|
1059
1059
|
* [See complete reference](http://webdriver.io/api/mobile/swipe.html)
|
|
1060
1060
|
*
|
|
1061
|
-
* @param {
|
|
1061
|
+
* @param {CodeceptJS.LocatorOrString} locator
|
|
1062
1062
|
* @param {number} xoffset
|
|
1063
1063
|
* @param {number} yoffset
|
|
1064
1064
|
* @param {number} [speed=1000] (optional), 1000 by default
|
|
@@ -1113,7 +1113,7 @@ class Appium extends Webdriver {
|
|
|
1113
1113
|
* I.swipeDown(locator, 1200, 1000); // set offset and speed
|
|
1114
1114
|
* ```
|
|
1115
1115
|
*
|
|
1116
|
-
* @param {
|
|
1116
|
+
* @param {CodeceptJS.LocatorOrString} locator
|
|
1117
1117
|
* @param {number} [yoffset] (optional)
|
|
1118
1118
|
* @param {number} [speed=1000] (optional), 1000 by default
|
|
1119
1119
|
* @return {Promise<void>}
|
|
@@ -1142,7 +1142,7 @@ class Appium extends Webdriver {
|
|
|
1142
1142
|
* I.swipeLeft(locator, 1200, 1000); // set offset and speed
|
|
1143
1143
|
* ```
|
|
1144
1144
|
*
|
|
1145
|
-
* @param {
|
|
1145
|
+
* @param {CodeceptJS.LocatorOrString} locator
|
|
1146
1146
|
* @param {number} [xoffset] (optional)
|
|
1147
1147
|
* @param {number} [speed=1000] (optional), 1000 by default
|
|
1148
1148
|
* @return {Promise<void>}
|
|
@@ -1169,7 +1169,7 @@ class Appium extends Webdriver {
|
|
|
1169
1169
|
* I.swipeRight(locator, 1200, 1000); // set offset and speed
|
|
1170
1170
|
* ```
|
|
1171
1171
|
*
|
|
1172
|
-
* @param {
|
|
1172
|
+
* @param {CodeceptJS.LocatorOrString} locator
|
|
1173
1173
|
* @param {number} [xoffset] (optional)
|
|
1174
1174
|
* @param {number} [speed=1000] (optional), 1000 by default
|
|
1175
1175
|
* @return {Promise<void>}
|
|
@@ -1196,7 +1196,7 @@ class Appium extends Webdriver {
|
|
|
1196
1196
|
* I.swipeUp(locator, 1200, 1000); // set offset and speed
|
|
1197
1197
|
* ```
|
|
1198
1198
|
*
|
|
1199
|
-
* @param {
|
|
1199
|
+
* @param {CodeceptJS.LocatorOrString} locator
|
|
1200
1200
|
* @param {number} [yoffset] (optional)
|
|
1201
1201
|
* @param {number} [speed=1000] (optional), 1000 by default
|
|
1202
1202
|
* @return {Promise<void>}
|
|
@@ -1440,7 +1440,7 @@ class Appium extends Webdriver {
|
|
|
1440
1440
|
* // typing secret
|
|
1441
1441
|
* I.appendField('password', secret('123456'));
|
|
1442
1442
|
* ```
|
|
1443
|
-
* @param {
|
|
1443
|
+
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator
|
|
1444
1444
|
* @param {string} value text value to append.
|
|
1445
1445
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1446
1446
|
*
|
|
@@ -1462,8 +1462,8 @@ class Appium extends Webdriver {
|
|
|
1462
1462
|
* I.checkOption('I Agree to Terms and Conditions');
|
|
1463
1463
|
* I.checkOption('agree', '//form');
|
|
1464
1464
|
* ```
|
|
1465
|
-
* @param {
|
|
1466
|
-
* @param {?
|
|
1465
|
+
* @param {CodeceptJS.LocatorOrString} field checkbox located by label | name | CSS | XPath | strict locator.
|
|
1466
|
+
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS | XPath | strict locator.
|
|
1467
1467
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1468
1468
|
*
|
|
1469
1469
|
*
|
|
@@ -1496,8 +1496,8 @@ class Appium extends Webdriver {
|
|
|
1496
1496
|
* I.click({css: 'nav a.login'});
|
|
1497
1497
|
* ```
|
|
1498
1498
|
*
|
|
1499
|
-
* @param {
|
|
1500
|
-
* @param {?
|
|
1499
|
+
* @param {CodeceptJS.LocatorOrString} locator clickable link or button located by text, or any element located by CSS|XPath|strict locator.
|
|
1500
|
+
* @param {?CodeceptJS.LocatorOrString | null} [context=null] (optional, `null` by default) element to search in CSS|XPath|Strict locator.
|
|
1501
1501
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1502
1502
|
*
|
|
1503
1503
|
*
|
|
@@ -1516,7 +1516,7 @@ class Appium extends Webdriver {
|
|
|
1516
1516
|
* I.dontSeeCheckboxIsChecked('agree'); // located by name
|
|
1517
1517
|
* ```
|
|
1518
1518
|
*
|
|
1519
|
-
* @param {
|
|
1519
|
+
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1520
1520
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1521
1521
|
*
|
|
1522
1522
|
*
|
|
@@ -1533,7 +1533,7 @@ class Appium extends Webdriver {
|
|
|
1533
1533
|
* I.dontSeeElement('.modal'); // modal is not shown
|
|
1534
1534
|
* ```
|
|
1535
1535
|
*
|
|
1536
|
-
* @param {
|
|
1536
|
+
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|Strict locator.
|
|
1537
1537
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1538
1538
|
*
|
|
1539
1539
|
*/
|
|
@@ -1551,8 +1551,8 @@ class Appium extends Webdriver {
|
|
|
1551
1551
|
* I.dontSeeInField({ css: 'form input.email' }, 'user@user.com'); // field by CSS
|
|
1552
1552
|
* ```
|
|
1553
1553
|
*
|
|
1554
|
-
* @param {
|
|
1555
|
-
* @param {
|
|
1554
|
+
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1555
|
+
* @param {CodeceptJS.StringOrSecret} value value to check.
|
|
1556
1556
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1557
1557
|
*
|
|
1558
1558
|
*
|
|
@@ -1573,7 +1573,7 @@ class Appium extends Webdriver {
|
|
|
1573
1573
|
* ```
|
|
1574
1574
|
*
|
|
1575
1575
|
* @param {string} text which is not present.
|
|
1576
|
-
* @param {
|
|
1576
|
+
* @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator in which to perfrom search.
|
|
1577
1577
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1578
1578
|
*
|
|
1579
1579
|
*/
|
|
@@ -1596,8 +1596,8 @@ class Appium extends Webdriver {
|
|
|
1596
1596
|
* // or by strict locator
|
|
1597
1597
|
* I.fillField({css: 'form#login input[name=username]'}, 'John');
|
|
1598
1598
|
* ```
|
|
1599
|
-
* @param {
|
|
1600
|
-
* @param {
|
|
1599
|
+
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1600
|
+
* @param {CodeceptJS.StringOrSecret} value text value to fill.
|
|
1601
1601
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1602
1602
|
*
|
|
1603
1603
|
*
|
|
@@ -1616,7 +1616,7 @@ class Appium extends Webdriver {
|
|
|
1616
1616
|
* let pins = await I.grabTextFromAll('#pin li');
|
|
1617
1617
|
* ```
|
|
1618
1618
|
*
|
|
1619
|
-
* @param {
|
|
1619
|
+
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1620
1620
|
* @returns {Promise<string[]>} attribute value
|
|
1621
1621
|
*
|
|
1622
1622
|
*
|
|
@@ -1635,7 +1635,7 @@ class Appium extends Webdriver {
|
|
|
1635
1635
|
* ```
|
|
1636
1636
|
* If multiple elements found returns first element.
|
|
1637
1637
|
*
|
|
1638
|
-
* @param {
|
|
1638
|
+
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1639
1639
|
* @returns {Promise<string>} attribute value
|
|
1640
1640
|
*
|
|
1641
1641
|
*
|
|
@@ -1653,7 +1653,7 @@ class Appium extends Webdriver {
|
|
|
1653
1653
|
* let numOfElements = await I.grabNumberOfVisibleElements('p');
|
|
1654
1654
|
* ```
|
|
1655
1655
|
*
|
|
1656
|
-
* @param {
|
|
1656
|
+
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1657
1657
|
* @returns {Promise<number>} number of visible elements
|
|
1658
1658
|
*/
|
|
1659
1659
|
async grabNumberOfVisibleElements(locator) {
|
|
@@ -1671,7 +1671,7 @@ class Appium extends Webdriver {
|
|
|
1671
1671
|
* ```js
|
|
1672
1672
|
* let hint = await I.grabAttributeFrom('#tooltip', 'title');
|
|
1673
1673
|
* ```
|
|
1674
|
-
* @param {
|
|
1674
|
+
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1675
1675
|
* @param {string} attr attribute name.
|
|
1676
1676
|
* @returns {Promise<string>} attribute value
|
|
1677
1677
|
*
|
|
@@ -1689,7 +1689,7 @@ class Appium extends Webdriver {
|
|
|
1689
1689
|
* ```js
|
|
1690
1690
|
* let hints = await I.grabAttributeFromAll('.tooltip', 'title');
|
|
1691
1691
|
* ```
|
|
1692
|
-
* @param {
|
|
1692
|
+
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1693
1693
|
* @param {string} attr attribute name.
|
|
1694
1694
|
* @returns {Promise<string[]>} attribute value
|
|
1695
1695
|
*
|
|
@@ -1706,7 +1706,7 @@ class Appium extends Webdriver {
|
|
|
1706
1706
|
* ```js
|
|
1707
1707
|
* let inputs = await I.grabValueFromAll('//form/input');
|
|
1708
1708
|
* ```
|
|
1709
|
-
* @param {
|
|
1709
|
+
* @param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
|
|
1710
1710
|
* @returns {Promise<string[]>} attribute value
|
|
1711
1711
|
*
|
|
1712
1712
|
*
|
|
@@ -1724,7 +1724,7 @@ class Appium extends Webdriver {
|
|
|
1724
1724
|
* ```js
|
|
1725
1725
|
* let email = await I.grabValueFrom('input[name=email]');
|
|
1726
1726
|
* ```
|
|
1727
|
-
* @param {
|
|
1727
|
+
* @param {CodeceptJS.LocatorOrString} locator field located by label|name|CSS|XPath|strict locator.
|
|
1728
1728
|
* @returns {Promise<string>} attribute value
|
|
1729
1729
|
*
|
|
1730
1730
|
*
|
|
@@ -1758,7 +1758,7 @@ class Appium extends Webdriver {
|
|
|
1758
1758
|
* I.scrollIntoView('#submit', { behavior: "smooth", block: "center", inline: "center" });
|
|
1759
1759
|
* ```
|
|
1760
1760
|
*
|
|
1761
|
-
* @param {
|
|
1761
|
+
* @param {LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1762
1762
|
* @param {ScrollIntoViewOptions|boolean} scrollIntoViewOptions either alignToTop=true|false or scrollIntoViewOptions. See https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView.
|
|
1763
1763
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1764
1764
|
*
|
|
@@ -1778,7 +1778,7 @@ class Appium extends Webdriver {
|
|
|
1778
1778
|
* I.seeCheckboxIsChecked({css: '#signup_form input[type=checkbox]'});
|
|
1779
1779
|
* ```
|
|
1780
1780
|
*
|
|
1781
|
-
* @param {
|
|
1781
|
+
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1782
1782
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1783
1783
|
*
|
|
1784
1784
|
*
|
|
@@ -1795,7 +1795,7 @@ class Appium extends Webdriver {
|
|
|
1795
1795
|
* ```js
|
|
1796
1796
|
* I.seeElement('#modal');
|
|
1797
1797
|
* ```
|
|
1798
|
-
* @param {
|
|
1798
|
+
* @param {CodeceptJS.LocatorOrString} locator located by CSS|XPath|strict locator.
|
|
1799
1799
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1800
1800
|
*
|
|
1801
1801
|
*
|
|
@@ -1815,8 +1815,8 @@ class Appium extends Webdriver {
|
|
|
1815
1815
|
* I.seeInField('form input[type=hidden]','hidden_value');
|
|
1816
1816
|
* I.seeInField('#searchform input','Search');
|
|
1817
1817
|
* ```
|
|
1818
|
-
* @param {
|
|
1819
|
-
* @param {
|
|
1818
|
+
* @param {CodeceptJS.LocatorOrString} field located by label|name|CSS|XPath|strict locator.
|
|
1819
|
+
* @param {CodeceptJS.StringOrSecret} value value to check.
|
|
1820
1820
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1821
1821
|
*
|
|
1822
1822
|
*
|
|
@@ -1837,7 +1837,7 @@ class Appium extends Webdriver {
|
|
|
1837
1837
|
* I.see('Register', {css: 'form.register'}); // use strict locator
|
|
1838
1838
|
* ```
|
|
1839
1839
|
* @param {string} text expected on page.
|
|
1840
|
-
* @param {?
|
|
1840
|
+
* @param {?CodeceptJS.LocatorOrString} [context=null] (optional, `null` by default) element located by CSS|Xpath|strict locator in which to search for text.
|
|
1841
1841
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1842
1842
|
*
|
|
1843
1843
|
*
|
|
@@ -1866,7 +1866,7 @@ class Appium extends Webdriver {
|
|
|
1866
1866
|
* ```js
|
|
1867
1867
|
* I.selectOption('Which OS do you use?', ['Android', 'iOS']);
|
|
1868
1868
|
* ```
|
|
1869
|
-
* @param {
|
|
1869
|
+
* @param {LocatorOrString} select field located by label|name|CSS|XPath|strict locator.
|
|
1870
1870
|
* @param {string|Array<*>} option visible text or value of option.
|
|
1871
1871
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1872
1872
|
*
|
|
@@ -1887,7 +1887,7 @@ class Appium extends Webdriver {
|
|
|
1887
1887
|
* I.waitForElement('.btn.continue', 5); // wait for 5 secs
|
|
1888
1888
|
* ```
|
|
1889
1889
|
*
|
|
1890
|
-
* @param {
|
|
1890
|
+
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1891
1891
|
* @param {number} [sec] (optional, `1` by default) time in seconds to wait
|
|
1892
1892
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1893
1893
|
*
|
|
@@ -1906,7 +1906,7 @@ class Appium extends Webdriver {
|
|
|
1906
1906
|
* I.waitForVisible('#popup');
|
|
1907
1907
|
* ```
|
|
1908
1908
|
*
|
|
1909
|
-
* @param {
|
|
1909
|
+
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1910
1910
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
1911
1911
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1912
1912
|
*
|
|
@@ -1925,7 +1925,7 @@ class Appium extends Webdriver {
|
|
|
1925
1925
|
* I.waitForInvisible('#popup');
|
|
1926
1926
|
* ```
|
|
1927
1927
|
*
|
|
1928
|
-
* @param {
|
|
1928
|
+
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
|
|
1929
1929
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
1930
1930
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1931
1931
|
*
|
|
@@ -1948,7 +1948,7 @@ class Appium extends Webdriver {
|
|
|
1948
1948
|
*
|
|
1949
1949
|
* @param {string }text to wait for.
|
|
1950
1950
|
* @param {number} [sec=1] (optional, `1` by default) time in seconds to wait
|
|
1951
|
-
* @param {
|
|
1951
|
+
* @param {CodeceptJS.LocatorOrString} [context] (optional) element located by CSS|XPath|strict locator.
|
|
1952
1952
|
* @returns {void} automatically synchronized promise through #recorder
|
|
1953
1953
|
*
|
|
1954
1954
|
*
|