Skip to content

Commit ec22981

Browse files
author
DavertMik
committed
Merge branch '4.x' of github.com:codeceptjs/CodeceptJS into 4.x
2 parents cb436bb + f0c7563 commit ec22981

20 files changed

Lines changed: 921 additions & 605 deletions

Bunoshfile.js

Lines changed: 834 additions & 0 deletions
Large diffs are not rendered by default.

docs/helpers/Playwright.md

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ Type: [object][6]
4646
* `url` **[string][9]?** base url of website to be tested
4747
* `browser` **(`"chromium"` | `"firefox"` | `"webkit"` | `"electron"`)?** a browser to test on, either: `chromium`, `firefox`, `webkit`, `electron`. Default: chromium.
4848
* `show` **[boolean][27]?** show browser window.
49-
* `restart` **([string][9] | [boolean][27])?** restart strategy between tests. Possible values:* 'context' or **false** - restarts [browser context][45] but keeps running browser. Recommended by Playwright team to keep tests isolated.
49+
* `restart` **([string][9] | [boolean][27])?** restart strategy between tests. Possible values:* 'context' or **false** - restarts [browser context][44] but keeps running browser. Recommended by Playwright team to keep tests isolated.
5050
* 'session' or 'keep' - keeps browser context and session, but cleans up cookies and localStorage between tests. The fastest option when running tests in windowed mode. Works with `keepCookies` and `keepBrowserState` options. This behavior was default before CodeceptJS 3.1
51-
* `timeout` **[number][18]?** * [timeout][46] in ms of all Playwright actions .
51+
* `timeout` **[number][18]?** * [timeout][45] in ms of all Playwright actions .
5252
* `disableScreenshots` **[boolean][27]?** don't save screenshot on failure.
5353
* `emulate` **any?** browser in device emulation mode.
5454
* `video` **[boolean][27]?** enables video recording for failed tests; videos are saved into `output/videos` folder
5555
* `keepVideoForPassedTests` **[boolean][27]?** save videos for passed tests; videos are saved into `output/videos` folder
56-
* `trace` **[boolean][27]?** record [tracing information][47] with screenshots and snapshots.
56+
* `trace` **[boolean][27]?** record [tracing information][46] with screenshots and snapshots.
5757
* `keepTraceForPassedTests` **[boolean][27]?** save trace for passed tests.
5858
* `fullPageScreenshots` **[boolean][27]?** make full page screenshots on failure.
5959
* `uniqueScreenshotNames` **[boolean][27]?** option to prevent screenshot override if you have scenarios with the same name in different suites.
@@ -73,13 +73,13 @@ Type: [object][6]
7373
* `chromium` **[object][6]?** pass additional chromium options
7474
* `firefox` **[object][6]?** pass additional firefox options
7575
* `electron` **[object][6]?** (pass additional electron options
76-
* `channel` **any?** (While Playwright can operate against the stock Google Chrome and Microsoft Edge browsers available on the machine. In particular, current Playwright version will support Stable and Beta channels of these browsers. See [Google Chrome & Microsoft Edge][48].
77-
* `ignoreLog` **[Array][10]<[string][9]>?** An array with console message types that are not logged to debug log. Default value is `['warning', 'log']`. E.g. you can set `[]` to log all messages. See all possible [values][49].
76+
* `channel` **any?** (While Playwright can operate against the stock Google Chrome and Microsoft Edge browsers available on the machine. In particular, current Playwright version will support Stable and Beta channels of these browsers. See [Google Chrome & Microsoft Edge][47].
77+
* `ignoreLog` **[Array][10]<[string][9]>?** An array with console message types that are not logged to debug log. Default value is `['warning', 'log']`. E.g. you can set `[]` to log all messages. See all possible [values][48].
7878
* `ignoreHTTPSErrors` **[boolean][27]?** Allows access to untrustworthy pages, e.g. to a page with an expired certificate. Default value is `false`
7979
* `bypassCSP` **[boolean][27]?** bypass Content Security Policy or CSP
8080
* `highlightElement` **[boolean][27]?** highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
8181
* `recordHar` **[object][6]?** record HAR and will be saved to `output/har`. See more of [HAR options][3].
82-
* `testIdAttribute` **[string][9]?** locate elements based on the testIdAttribute. See more of [locate by test id][50].
82+
* `testIdAttribute` **[string][9]?** locate elements based on the testIdAttribute. See more of [locate by test id][49].
8383
* `storageState` **([string][9] | [object][6])?** Playwright storage state (path to JSON file or object)
8484
passed directly to `browser.newContext`.
8585
If a Scenario is declared with a `cookies` option (e.g. `Scenario('name', { cookies: [...] }, fn)`),
@@ -2794,8 +2794,6 @@ Returns **void** automatically synchronized promise through #recorder
27942794

27952795
### waitForVisible
27962796

2797-
This method accepts [React selectors][44].
2798-
27992797
Waits for an element to become visible on a page (by default waits for 1sec).
28002798
Element can be located by CSS or XPath.
28012799

@@ -2959,16 +2957,14 @@ Returns **void** automatically synchronized promise through #recorder
29592957

29602958
[43]: https://playwright.dev/docs/api/class-page#page-wait-for-url
29612959

2962-
[44]: https://codecept.io/react
2963-
2964-
[45]: https://playwright.dev/docs/api/class-browsercontext
2960+
[44]: https://playwright.dev/docs/api/class-browsercontext
29652961

2966-
[46]: https://playwright.dev/docs/api/class-page#page-set-default-timeout
2962+
[45]: https://playwright.dev/docs/api/class-page#page-set-default-timeout
29672963

2968-
[47]: https://playwright.dev/docs/trace-viewer
2964+
[46]: https://playwright.dev/docs/trace-viewer
29692965

2970-
[48]: https://playwright.dev/docs/browsers/#google-chrome--microsoft-edge
2966+
[47]: https://playwright.dev/docs/browsers/#google-chrome--microsoft-edge
29712967

2972-
[49]: https://playwright.dev/docs/api/class-consolemessage#console-message-type
2968+
[48]: https://playwright.dev/docs/api/class-consolemessage#console-message-type
29732969

2974-
[50]: https://playwright.dev/docs/locators#locate-by-test-id
2970+
[49]: https://playwright.dev/docs/locators#locate-by-test-id

docs/helpers/Puppeteer.md

Lines changed: 0 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,6 @@ Should be used in custom helpers:
232232
const elements = await this.helpers['Puppeteer']._locate({name: 'password'});
233233
```
234234

235-
236-
237-
238-
This action supports [React locators](https://codecept.io/react#locators)
239-
240-
241235
#### Parameters
242236

243237
* `locator` &#x20;
@@ -277,12 +271,6 @@ Should be used in custom helpers:
277271
const element = await this.helpers['Puppeteer']._locateElement({name: 'password'});
278272
```
279273

280-
281-
282-
283-
This action supports [React locators](https://codecept.io/react#locators)
284-
285-
286274
#### Parameters
287275

288276
* `locator` &#x20;
@@ -375,10 +363,6 @@ I.appendField('name', 'John', '.form-container');
375363

376364
Returns **void** automatically synchronized promise through #recorder
377365

378-
379-
This action supports [React locators](https://codecept.io/react#locators)
380-
381-
382366
### attachFile
383367

384368
> ⚠ There is an [issue with file upload in Puppeteer 2.1.0 & 2.1.1][7], downgrade to 2.0.0 if you face it.
@@ -536,10 +520,6 @@ I.click({role: 'button', name: 'Submit'});
536520

537521
Returns **void** automatically synchronized promise through #recorder
538522

539-
540-
This action supports [React locators](https://codecept.io/react#locators)
541-
542-
543523
### clickLink
544524

545525
Performs a click on a link and waits for navigation before moving on.
@@ -555,10 +535,6 @@ I.clickLink('Logout', '#nav');
555535

556536
Returns **void** automatically synchronized promise through #recorder
557537

558-
559-
This action supports [React locators](https://codecept.io/react#locators)
560-
561-
562538
### clickXY
563539

564540
Performs click at specific coordinates.
@@ -614,10 +590,6 @@ I.dontSee('Login', '.nav'); // no login inside .nav element
614590

615591
Returns **void** automatically synchronized promise through #recorder
616592

617-
618-
This action supports [React locators](https://codecept.io/react#locators)
619-
620-
621593
### dontSeeCheckboxIsChecked
622594

623595
Verifies that the specified checkbox is not checked.
@@ -698,10 +670,6 @@ I.dontSeeElement('.modal', '#container');
698670

699671
Returns **void** automatically synchronized promise through #recorder
700672

701-
702-
This action supports [React locators](https://codecept.io/react#locators)
703-
704-
705673
### dontSeeElementInDOM
706674

707675
Opposite to `seeElementInDOM`. Checks that element is not on page.
@@ -816,10 +784,6 @@ I.doubleClick('.btn.edit');
816784

817785
Returns **void** automatically synchronized promise through #recorder
818786

819-
820-
This action supports [React locators](https://codecept.io/react#locators)
821-
822-
823787
### downloadFile
824788

825789
This method is **deprecated**.
@@ -863,10 +827,6 @@ I.dragSlider('#slider', -70);
863827

864828
Returns **void** automatically synchronized promise through #recorder
865829

866-
867-
This action supports [React locators](https://codecept.io/react#locators)
868-
869-
870830
### executeAsyncScript
871831

872832
Asynchronous scripts can also be executed with `executeScript` if a function returns a Promise.
@@ -965,10 +925,6 @@ I.fillField('Name', 'John', '#section2');
965925
966926
Returns **void** automatically synchronized promise through #recorder
967927
968-
969-
This action supports [React locators](https://codecept.io/react#locators)
970-
971-
972928
### flushNetworkTraffics
973929
974930
Resets all recorded network requests.
@@ -1034,10 +990,6 @@ I.forceClick({css: 'nav a.login'});
1034990
1035991
Returns **void** automatically synchronized promise through #recorder
1036992
1037-
1038-
This action supports [React locators](https://codecept.io/react#locators)
1039-
1040-
1041993
### grabAttributeFrom
1042994
1043995
Retrieves an attribute from an element located by CSS or XPath and returns it to test.
@@ -1055,10 +1007,6 @@ let hint = await I.grabAttributeFrom('#tooltip', 'title');
10551007
10561008
Returns **[Promise][12]<[string][6]>** attribute value
10571009
1058-
1059-
This action supports [React locators](https://codecept.io/react#locators)
1060-
1061-
10621010
### grabAttributeFromAll
10631011
10641012
Retrieves an array of attributes from elements located by CSS or XPath and returns it to test.
@@ -1075,10 +1023,6 @@ let hints = await I.grabAttributeFromAll('.tooltip', 'title');
10751023
10761024
Returns **[Promise][12]<[Array][17]<[string][6]>>** attribute value
10771025
1078-
1079-
This action supports [React locators](https://codecept.io/react#locators)
1080-
1081-
10821026
### grabBrowserLogs
10831027
10841028
Get JS log from browser.
@@ -1124,10 +1068,6 @@ const value = await I.grabCssPropertyFrom('h3', 'font-weight');
11241068
11251069
Returns **[Promise][12]<[string][6]>** CSS value
11261070
1127-
1128-
This action supports [React locators](https://codecept.io/react#locators)
1129-
1130-
11311071
### grabCssPropertyFromAll
11321072
11331073
Grab array of CSS properties for given locator
@@ -1144,10 +1084,6 @@ const values = await I.grabCssPropertyFromAll('h3', 'font-weight');
11441084
11451085
Returns **[Promise][12]<[Array][17]<[string][6]>>** CSS value
11461086
1147-
1148-
This action supports [React locators](https://codecept.io/react#locators)
1149-
1150-
11511087
### grabCurrentUrl
11521088
11531089
Get current URL from browser.
@@ -1272,11 +1208,6 @@ let numOfElements = await I.grabNumberOfVisibleElements('p');
12721208
12731209
Returns **[Promise][12]<[number][11]>** number of visible elements
12741210
1275-
1276-
1277-
This action supports [React locators](https://codecept.io/react#locators)
1278-
1279-
12801211
### grabPageScrollPosition
12811212
12821213
Retrieves a page scroll position and returns it to test.
@@ -1339,10 +1270,6 @@ If multiple elements found returns first element.
13391270
13401271
Returns **[Promise][12]<[string][6]>** attribute value
13411272
1342-
1343-
This action supports [React locators](https://codecept.io/react#locators)
1344-
1345-
13461273
### grabTextFromAll
13471274
13481275
Retrieves all texts from an element located by CSS or XPath and returns it to test.
@@ -1358,10 +1285,6 @@ let pins = await I.grabTextFromAll('#pin li');
13581285
13591286
Returns **[Promise][12]<[Array][17]<[string][6]>>** attribute value
13601287
1361-
1362-
This action supports [React locators](https://codecept.io/react#locators)
1363-
1364-
13651288
### grabTitle
13661289
13671290
Retrieves a page title and returns it to test.
@@ -1497,10 +1420,6 @@ I.moveCursorTo('#submit', '.container');
14971420
14981421
Returns **void** automatically synchronized promise through #recorder
14991422
1500-
1501-
This action supports [React locators](https://codecept.io/react#locators)
1502-
1503-
15041423
### openNewTab
15051424
15061425
Open new tab and switch to it
@@ -1660,10 +1579,6 @@ I.rightClick('Click me', '.context');
16601579
16611580
Returns **void** automatically synchronized promise through #recorder
16621581
1663-
1664-
This action supports [React locators](https://codecept.io/react#locators)
1665-
1666-
16671582
### saveElementScreenshot
16681583
16691584
Saves screenshot of the specified locator to ouput folder (set in codecept.conf.ts or codecept.conf.js).
@@ -1754,10 +1669,6 @@ I.see('Register', {css: 'form.register'}); // use strict locator
17541669
17551670
Returns **void** automatically synchronized promise through #recorder
17561671
1757-
1758-
This action supports [React locators](https://codecept.io/react#locators)
1759-
1760-
17611672
### seeAttributesOnElements
17621673
17631674
Checks that all elements with given locator have given attributes.
@@ -1773,10 +1684,6 @@ I.seeAttributesOnElements('//form', { method: "post"});
17731684
17741685
Returns **void** automatically synchronized promise through #recorder
17751686
1776-
1777-
This action supports [React locators](https://codecept.io/react#locators)
1778-
1779-
17801687
### seeCheckboxIsChecked
17811688
17821689
Verifies that the specified checkbox is checked.
@@ -1822,10 +1729,6 @@ I.seeCssPropertiesOnElements('h3', { 'font-weight': "bold"});
18221729
18231730
Returns **void** automatically synchronized promise through #recorder
18241731
1825-
1826-
This action supports [React locators](https://codecept.io/react#locators)
1827-
1828-
18291732
### seeCurrentPathEquals
18301733
18311734
Checks that current URL path matches the expected path.
@@ -1882,10 +1785,6 @@ I.seeElement({role: 'dialog'});
18821785
18831786
Returns **void** automatically synchronized promise through #recorder
18841787
1885-
1886-
This action supports [React locators](https://codecept.io/react#locators)
1887-
1888-
18891788
### seeElementInDOM
18901789
18911790
Checks that a given Element is present in the DOM
@@ -1998,10 +1897,6 @@ I.seeNumberOfElements('#submitBtn', 1);
19981897
19991898
Returns **void** automatically synchronized promise through #recorder
20001899
2001-
2002-
This action supports [React locators](https://codecept.io/react#locators)
2003-
2004-
20051900
### seeNumberOfVisibleElements
20061901
20071902
Asserts that an element is visible a given number of times.
@@ -2018,10 +1913,6 @@ I.seeNumberOfVisibleElements('.buttons', 3);
20181913
20191914
Returns **void** automatically synchronized promise through #recorder
20201915
2021-
2022-
This action supports [React locators](https://codecept.io/react#locators)
2023-
2024-
20251916
### seeTextEquals
20261917
20271918
Checks that text is equal to provided one.
@@ -2413,10 +2304,6 @@ I.waitForElement('.btn.continue', 5); // wait for 5 secs
24132304
24142305
Returns **void** automatically synchronized promise through #recorder
24152306
2416-
2417-
This action supports [React locators](https://codecept.io/react#locators)
2418-
2419-
24202307
### waitForEnabled
24212308
24222309
Waits for element to become enabled (by default waits for 1sec).
@@ -2572,10 +2459,6 @@ I.waitForVisible('#popup');
25722459
25732460
Returns **void** automatically synchronized promise through #recorder
25742461
2575-
2576-
This action supports [React locators](https://codecept.io/react#locators)
2577-
2578-
25792462
### waitInUrl
25802463
25812464
Waiting for the part of the URL to match the expected. Useful for SPA to understand that page was changed.
@@ -2607,10 +2490,6 @@ I.waitNumberOfVisibleElements('a', 3);
26072490
26082491
Returns **void** automatically synchronized promise through #recorder
26092492
2610-
2611-
This action supports [React locators](https://codecept.io/react#locators)
2612-
2613-
26142493
### waitToHide
26152494
26162495
Waits for an element to hide (by default waits for 1sec).

0 commit comments

Comments
 (0)