Skip to content

Commit 5b835f3

Browse files
Mykhailo BodnarchukMykhailo Bodnarchuk
authored andcommitted
Merge branch 'master' into codeceptjs-v3.0
2 parents 212d61f + df17d37 commit 5b835f3

27 files changed

+225
-84
lines changed

.github/workflows/playwright.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,5 @@ jobs:
4444
run: "BROWSER=firefox node ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug"
4545
- name: run webkit tests
4646
run: "BROWSER=webkit node ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug"
47+
- name: run unit tests
48+
run: ./node_modules/.bin/mocha test/helper/Playwright_test.js

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ env:
1313
- HELPER=ProtractorWeb
1414
- HELPER=WebDriver
1515
- HELPER=TestCafe
16-
- HELPER=Playwright
1716
addons:
1817
apt:
1918
packages:

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ tryTo(() => I.click('Accept', '.cookies'));
5555
```
5656
* **Possible breaking change** In semantic locators `[` char indicates CSS selector.
5757

58+
## 2.6.4
59+
60+
* [Playwright] **Playwright 1.0 support** by @Georgegriff.
5861

5962
## 2.6.3
6063

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ RUN apt-get update && apt-get install -y wget --no-install-recommends \
1919
&& apt-get update \
2020
&& apt-get install -y google-chrome-unstable \
2121
--no-install-recommends \
22+
&& apt-get install -y libgbm1 \
2223
&& rm -rf /var/lib/apt/lists/* \
2324
&& apt-get purge --auto-remove -y curl \
2425
&& rm -rf /src/*.deb

docs/custom-helpers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ async clickOnEveryElement(locator) {
210210
}
211211
```
212212

213-
In this case `el` will be an instance of [ElementHandle](https://github.com/microsoft/playwright/blob/v0.12.1/docs/api.md#class-elementhandle) which is similar for Playwright & [Puppeteer](https://pptr.dev/#?product=Puppeteer&version=v2.1.1&show=api-class-elementhandle).
213+
In this case `el` will be an instance of [ElementHandle](https://playwright.dev/#version=master&path=docs%2Fapi.md&q=class-elementhandle) which is similar for Playwright & [Puppeteer](https://pptr.dev/#?product=Puppeteer&version=master&show=api-class-elementhandle).
214214

215215
> ℹ There are more `_locate*` methods in each helper. Take a look on documentation of a helper you use to see which exact method it exposes.
216216

docs/helpers/Appium.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,7 @@ I.seeInSource('<h1>Green eggs &amp; ham</h1>');
15021502
### grabSource
15031503

15041504
Retrieves page source and returns it to test.
1505-
Resumes test execution, so should be used inside an async function.
1505+
Resumes test execution, so **should be used inside async function with `await`** operator.
15061506

15071507
```js
15081508
let pageSource = await I.grabSource();
@@ -1578,6 +1578,7 @@ I.seeAttributesOnElements('//form', { method: "post"});
15781578
### grabNumberOfVisibleElements
15791579

15801580
Grab number of visible elements by locator.
1581+
Resumes test execution, so **should be used inside async function with `await`** operator.
15811582

15821583
```js
15831584
let numOfElements = await I.grabNumberOfVisibleElements('p');
@@ -1746,6 +1747,7 @@ I.switchTo(); // switch back to main page
17461747
### grabNumberOfOpenTabs
17471748

17481749
Grab number of open tabs.
1750+
Resumes test execution, so **should be used inside async function with `await`** operator.
17491751

17501752
```js
17511753
let tabs = await I.grabNumberOfOpenTabs();
@@ -1798,11 +1800,14 @@ I.setGeoLocation(121.21, 11.56, 10);
17981800
### grabGeoLocation
17991801

18001802
Return the current geo location
1803+
Resumes test execution, so **should be used inside async function with `await`** operator.
18011804

18021805
```js
18031806
let geoLocation = await I.grabGeoLocation();
18041807
```
18051808

1809+
Returns **[Promise][13]&lt;{latitude: [number][8], longitude: [number][8], altitude: [number][8]}>**
1810+
18061811
### grabElementBoundingRect
18071812

18081813
Grab the width, height, location of given locator.

docs/helpers/Nightmare.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ Returns **[Promise][8]&lt;[Array][10]&lt;[string][3]>>** attribute value
454454
455455
Gets a cookie object by name.
456456
If none provided gets all cookies.
457-
Resumes test execution, so **should be used inside async with `await`** operator.
457+
Resumes test execution, so **should be used inside async function with `await`** operator.
458458
459459
```js
460460
let cookie = await I.grabCookie('auth');
@@ -541,6 +541,7 @@ Returns **[Promise][8]&lt;[Array][10]&lt;[string][3]>>** HTML code for an elemen
541541
### grabNumberOfVisibleElements
542542
543543
Grab number of visible elements by locator.
544+
Resumes test execution, so **should be used inside async function with `await`** operator.
544545
545546
```js
546547
let numOfElements = await I.grabNumberOfVisibleElements('p');

docs/helpers/Playwright.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ Uses [Playwright][1] library to run tests inside:
1919

2020
This helper works with a browser out of the box with no additional tools required to install.
2121

22-
Requires `playwright` package version ^0.12.1 to be installed:
22+
Requires `playwright` package version ^1 to be installed:
2323

24-
npm i playwright@^0.12.1 --save
24+
npm i playwright@^1 --save
2525

2626
## Configuration
2727

@@ -38,7 +38,7 @@ This helper should be configured in codecept.json or codecept.conf.js
3838
- `keepBrowserState`: - keep browser state between tests when `restart` is set to false.
3939
- `keepCookies`: - keep cookies between tests when `restart` is set to false.
4040
- `waitForAction`: (optional) how long to wait after click, doubleClick or PressKey actions in ms. Default: 100.
41-
- `waitForNavigation`: . When to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `networkidle0`, `networkidle2`. Choose one of those options is possible. See [Playwright API][2].
41+
- `waitForNavigation`: . When to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `networkidle`. Choose one of those options is possible. See [Playwright API][2].
4242
- `pressKeyDelay`: . Delay between key presses in ms. Used when calling Playwrights page.type(...) in fillField/appendField
4343
- `getPageTimeout` config option to set maximum navigation time in milliseconds.
4444
- `waitForTimeout`: (optional) default wait* timeout in ms. Default: 1000.
@@ -698,7 +698,7 @@ Returns **[Promise][9]&lt;[Array][10]&lt;any>>**
698698

699699
Gets a cookie object by name.
700700
If none provided gets all cookies.
701-
Resumes test execution, so **should be used inside async with `await`** operator.
701+
Resumes test execution, so **should be used inside async function with `await`** operator.
702702

703703
```js
704704
let cookie = await I.grabCookie('auth');
@@ -843,6 +843,7 @@ Returns **[Promise][9]&lt;[Array][10]&lt;[string][7]>>** HTML code for an elemen
843843
### grabNumberOfOpenTabs
844844

845845
Grab number of open tabs.
846+
Resumes test execution, so **should be used inside async function with `await`** operator.
846847

847848
```js
848849
let tabs = await I.grabNumberOfOpenTabs();
@@ -853,6 +854,7 @@ Returns **[Promise][9]&lt;[number][8]>** number of open tabs
853854
### grabNumberOfVisibleElements
854855

855856
Grab number of visible elements by locator.
857+
Resumes test execution, so **should be used inside async function with `await`** operator.
856858

857859
```js
858860
let numOfElements = await I.grabNumberOfVisibleElements('p');
@@ -888,7 +890,7 @@ Returns **[Promise][9]&lt;([string][7] | null)>**
888890
### grabSource
889891

890892
Retrieves page source and returns it to test.
891-
Resumes test execution, so should be used inside an async function.
893+
Resumes test execution, so **should be used inside async function with `await`** operator.
892894

893895
```js
894896
let pageSource = await I.grabSource();
@@ -1600,6 +1602,7 @@ I.waitForClickable('.btn.continue', 5); // wait for 5 secs
16001602
#### Parameters
16011603

16021604
- `locator` **([string][7] | [object][5])** element located by CSS|XPath|strict locator.
1605+
- `waitTimeout`
16031606
- `sec` **[number][8]?** (optional, `1` by default) time in seconds to wait
16041607

16051608
### waitForDetached
@@ -1852,7 +1855,7 @@ I.waitUrlEquals('http://127.0.0.1:8000/info');
18521855

18531856
[11]: https://codecept.io/helpers/FileSystem
18541857

1855-
[12]: https://github.com/microsoft/playwright/blob/v0.12.1/docs/api.md#browsernewpageoptions
1858+
[12]: https://github.com/microsoft/playwright/blob/master/docs/api.md#browsernewpageoptions
18561859

18571860
[13]: #fillfield
18581861

docs/helpers/Protractor.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ Returns **[Promise][13]&lt;[Array][14]&lt;any>>** all browser logs
614614
615615
Gets a cookie object by name.
616616
If none provided gets all cookies.
617-
Resumes test execution, so **should be used inside async with `await`** operator.
617+
Resumes test execution, so **should be used inside async function with `await`** operator.
618618
619619
```js
620620
let cookie = await I.grabCookie('auth');
@@ -708,6 +708,7 @@ Returns **[Promise][13]&lt;[Array][14]&lt;[string][9]>>** HTML code for an eleme
708708
### grabNumberOfOpenTabs
709709
710710
Grab number of open tabs.
711+
Resumes test execution, so **should be used inside async function with `await`** operator.
711712
712713
```js
713714
let tabs = await I.grabNumberOfOpenTabs();
@@ -718,6 +719,7 @@ Returns **[Promise][13]&lt;[number][7]>** number of open tabs
718719
### grabNumberOfVisibleElements
719720
720721
Grab number of visible elements by locator.
722+
Resumes test execution, so **should be used inside async function with `await`** operator.
721723
722724
```js
723725
let numOfElements = await I.grabNumberOfVisibleElements('p');
@@ -751,7 +753,7 @@ await I.grabPopupText();
751753
### grabSource
752754
753755
Retrieves page source and returns it to test.
754-
Resumes test execution, so should be used inside an async function.
756+
Resumes test execution, so **should be used inside async function with `await`** operator.
755757
756758
```js
757759
let pageSource = await I.grabSource();

docs/helpers/Puppeteer.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ Returns **[Promise][13]&lt;[Array][14]&lt;any>>**
788788
789789
Gets a cookie object by name.
790790
If none provided gets all cookies.
791-
Resumes test execution, so **should be used inside async with `await`** operator.
791+
Resumes test execution, so **should be used inside async function with `await`** operator.
792792
793793
```js
794794
let cookie = await I.grabCookie('auth');
@@ -941,6 +941,7 @@ Returns **[Promise][13]&lt;[Array][14]&lt;[string][8]>>** HTML code for an eleme
941941
### grabNumberOfOpenTabs
942942
943943
Grab number of open tabs.
944+
Resumes test execution, so **should be used inside async function with `await`** operator.
944945
945946
```js
946947
let tabs = await I.grabNumberOfOpenTabs();
@@ -951,6 +952,7 @@ Returns **[Promise][13]&lt;[number][10]>** number of open tabs
951952
### grabNumberOfVisibleElements
952953
953954
Grab number of visible elements by locator.
955+
Resumes test execution, so **should be used inside async function with `await`** operator.
954956
955957
```js
956958
let numOfElements = await I.grabNumberOfVisibleElements('p');
@@ -991,7 +993,7 @@ Returns **[Promise][13]&lt;([string][8] | null)>**
991993
### grabSource
992994
993995
Retrieves page source and returns it to test.
994-
Resumes test execution, so should be used inside an async function.
996+
Resumes test execution, so **should be used inside async function with `await`** operator.
995997
996998
```js
997999
let pageSource = await I.grabSource();

0 commit comments

Comments
 (0)