@serenity-js/playwright 3.0.0-rc.24 → 3.0.0-rc.27
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 +19 -31
- package/lib/PlaywrightOptions.d.ts +20 -22
- package/lib/PlaywrightOptions.d.ts.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/screenplay/abilities/BrowseTheWebWithPlaywright.d.ts +36 -45
- package/lib/screenplay/abilities/BrowseTheWebWithPlaywright.d.ts.map +1 -0
- package/lib/screenplay/abilities/BrowseTheWebWithPlaywright.js +35 -45
- package/lib/screenplay/abilities/BrowseTheWebWithPlaywright.js.map +1 -1
- package/lib/screenplay/abilities/index.d.ts +1 -0
- package/lib/screenplay/abilities/index.d.ts.map +1 -0
- package/lib/screenplay/index.d.ts +1 -0
- package/lib/screenplay/index.d.ts.map +1 -0
- package/lib/screenplay/models/PlaywrightBrowsingSession.d.ts +3 -3
- package/lib/screenplay/models/PlaywrightBrowsingSession.d.ts.map +1 -0
- package/lib/screenplay/models/PlaywrightBrowsingSession.js +2 -3
- package/lib/screenplay/models/PlaywrightBrowsingSession.js.map +1 -1
- package/lib/screenplay/models/PlaywrightCookie.d.ts +6 -0
- package/lib/screenplay/models/PlaywrightCookie.d.ts.map +1 -0
- package/lib/screenplay/models/PlaywrightCookie.js +5 -0
- package/lib/screenplay/models/PlaywrightCookie.js.map +1 -1
- package/lib/screenplay/models/PlaywrightModalDialogHandler.d.ts +6 -0
- package/lib/screenplay/models/PlaywrightModalDialogHandler.d.ts.map +1 -0
- package/lib/screenplay/models/PlaywrightModalDialogHandler.js +5 -0
- package/lib/screenplay/models/PlaywrightModalDialogHandler.js.map +1 -1
- package/lib/screenplay/models/PlaywrightPage.d.ts +3 -13
- package/lib/screenplay/models/PlaywrightPage.d.ts.map +1 -0
- package/lib/screenplay/models/PlaywrightPage.js +2 -10
- package/lib/screenplay/models/PlaywrightPage.js.map +1 -1
- package/lib/screenplay/models/PlaywrightPageElement.d.ts +6 -0
- package/lib/screenplay/models/PlaywrightPageElement.d.ts.map +1 -0
- package/lib/screenplay/models/PlaywrightPageElement.js +5 -0
- package/lib/screenplay/models/PlaywrightPageElement.js.map +1 -1
- package/lib/screenplay/models/index.d.ts +1 -0
- package/lib/screenplay/models/index.d.ts.map +1 -0
- package/lib/screenplay/models/locators/PlaywrightLocator.d.ts +7 -1
- package/lib/screenplay/models/locators/PlaywrightLocator.d.ts.map +1 -0
- package/lib/screenplay/models/locators/PlaywrightLocator.js +6 -1
- package/lib/screenplay/models/locators/PlaywrightLocator.js.map +1 -1
- package/lib/screenplay/models/locators/PlaywrightRootLocator.d.ts +7 -1
- package/lib/screenplay/models/locators/PlaywrightRootLocator.d.ts.map +1 -0
- package/lib/screenplay/models/locators/PlaywrightRootLocator.js +5 -0
- package/lib/screenplay/models/locators/PlaywrightRootLocator.js.map +1 -1
- package/lib/screenplay/models/locators/index.d.ts +1 -0
- package/lib/screenplay/models/locators/index.d.ts.map +1 -0
- package/package.json +10 -14
- package/src/PlaywrightOptions.ts +20 -22
- package/src/screenplay/abilities/BrowseTheWebWithPlaywright.ts +35 -45
- package/src/screenplay/models/PlaywrightBrowsingSession.ts +2 -3
- package/src/screenplay/models/PlaywrightCookie.ts +5 -0
- package/src/screenplay/models/PlaywrightModalDialogHandler.ts +5 -0
- package/src/screenplay/models/PlaywrightPage.ts +3 -13
- package/src/screenplay/models/PlaywrightPageElement.ts +5 -0
- package/src/screenplay/models/locators/PlaywrightLocator.ts +7 -2
- package/src/screenplay/models/locators/PlaywrightRootLocator.ts +6 -1
- package/tsconfig.build.json +14 -0
- package/tsconfig.eslint.json +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,77 +3,65 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
# [3.0.0-rc.
|
|
6
|
+
# [3.0.0-rc.27](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.26...v3.0.0-rc.27) (2022-08-26)
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### Bug Fixes
|
|
10
10
|
|
|
11
|
-
* **playwright:**
|
|
11
|
+
* **playwright:** support for Playwright 1.25.1 ([e0ab058](https://github.com/serenity-js/serenity-js/commit/e0ab0583493c05bd1ec31595f12356ab265b7c1a))
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
# [3.0.0-rc.
|
|
17
|
+
# [3.0.0-rc.26](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.25...v3.0.0-rc.26) (2022-08-15)
|
|
18
18
|
|
|
19
|
+
**Note:** Version bump only for package @serenity-js/playwright
|
|
19
20
|
|
|
20
|
-
### Bug Fixes
|
|
21
21
|
|
|
22
|
-
* **node:** support for Node 18 ([73212bc](https://github.com/serenity-js/serenity-js/commit/73212bc9deb1998d871b0720a6b437687b3ceddc)), closes [#1243](https://github.com/serenity-js/serenity-js/issues/1243)
|
|
23
22
|
|
|
24
23
|
|
|
25
24
|
|
|
26
|
-
# [3.0.0-rc.
|
|
25
|
+
# [3.0.0-rc.25](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.24...v3.0.0-rc.25) (2022-08-15)
|
|
27
26
|
|
|
28
27
|
|
|
28
|
+
### Bug Fixes
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
* **core:** extracted common TypeScript configuration ([0108370](https://github.com/serenity-js/serenity-js/commit/0108370a6a7ebb4bcd71773482801d29f5660268))
|
|
31
|
+
* **deps:** updated TinyTypes to 1.19.0 ([f6d53e4](https://github.com/serenity-js/serenity-js/commit/f6d53e4dbbfcb81139bd888ac11441b6344e47f5))
|
|
32
|
+
* **playwright:** corrected internal imports from playwright to playwright-core ([c42e7f3](https://github.com/serenity-js/serenity-js/commit/c42e7f306096747e771ba6b83ce10159c2f043ac))
|
|
33
|
+
* **playwright:** updated Playwright ([3fa7c7e](https://github.com/serenity-js/serenity-js/commit/3fa7c7e03674c3aa71e3d1edd40ec855c1a0cde1))
|
|
34
|
+
* **playwright:** updated Playwright to 1.24.2 ([9283910](https://github.com/serenity-js/serenity-js/commit/9283910ff6fc8edc2926b2544e0e068202505e06))
|
|
31
35
|
|
|
32
36
|
|
|
33
37
|
|
|
34
|
-
# [3.0.0-rc.20](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.19...v3.0.0-rc.20) (2022-07-11)
|
|
35
38
|
|
|
36
39
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
* **web:** renamed PagesContext to BrowsingSession to make the name more descriptive ([6b4e998](https://github.com/serenity-js/serenity-js/commit/6b4e9984d80f8f349f367e59bd0e615cd01703ec)), closes [#1236](https://github.com/serenity-js/serenity-js/issues/1236)
|
|
40
|
+
# [3.0.0-rc.24](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.23...v3.0.0-rc.24) (2022-07-23)
|
|
40
41
|
|
|
41
42
|
|
|
42
|
-
###
|
|
43
|
+
### Bug Fixes
|
|
43
44
|
|
|
44
|
-
* **
|
|
45
|
-
* **playwright:** configurable navigation and interaction timeouts for BrowseTheWebWithPlaywright ([142b78e](https://github.com/serenity-js/serenity-js/commit/142b78ed5c3ede1f61f5a1c5ae72d785c3fe70a9)), closes [#1236](https://github.com/serenity-js/serenity-js/issues/1236)
|
|
46
|
-
* **playwright:** configurable navigation waitUntil timeout ([2458fcb](https://github.com/serenity-js/serenity-js/commit/2458fcb22c946da41ab59cb21ac0d4cc48012da7)), closes [#1236](https://github.com/serenity-js/serenity-js/issues/1236)
|
|
47
|
-
* **playwright:** initial support for Playwright ([87e88a1](https://github.com/serenity-js/serenity-js/commit/87e88a16cdc06477ed25eb83f9597fd370fdc109)), closes [#493](https://github.com/serenity-js/serenity-js/issues/493) [#563](https://github.com/serenity-js/serenity-js/issues/563) [#911](https://github.com/serenity-js/serenity-js/issues/911)
|
|
48
|
-
* **playwright:** interaction to Select option(s) from a <select /> dropdown ([009041d](https://github.com/serenity-js/serenity-js/commit/009041d83e22ddf3fef14670e0e5fd6d11cdfc73)), closes [#1236](https://github.com/serenity-js/serenity-js/issues/1236)
|
|
49
|
-
* **playwright:** interactions to Scroll, Press, and TakeScreenshot ([1c039d2](https://github.com/serenity-js/serenity-js/commit/1c039d2027057f074f3d9be9685489b1512ac63c)), closes [#493](https://github.com/serenity-js/serenity-js/issues/493) [#563](https://github.com/serenity-js/serenity-js/issues/563) [#911](https://github.com/serenity-js/serenity-js/issues/911)
|
|
50
|
-
* **playwright:** isActive check for PlaywrightPageElement ([dbf44eb](https://github.com/serenity-js/serenity-js/commit/dbf44eb7a8bfbeb45e03d9269d8c454e951c11b2)), closes [#1236](https://github.com/serenity-js/serenity-js/issues/1236)
|
|
51
|
-
* **playwright:** support for executing in-browser JavaScript ([630bedd](https://github.com/serenity-js/serenity-js/commit/630beddbf6f782a85e1a15c0b8b57637498dbd91)), closes [#493](https://github.com/serenity-js/serenity-js/issues/493) [#563](https://github.com/serenity-js/serenity-js/issues/563) [#911](https://github.com/serenity-js/serenity-js/issues/911)
|
|
52
|
-
* **playwright:** support for isClickable ([afc8587](https://github.com/serenity-js/serenity-js/commit/afc8587a2ee2af6a4151512dc621473a3a892b7e)), closes [#1236](https://github.com/serenity-js/serenity-js/issues/1236)
|
|
53
|
-
* **playwright:** support for isVisible, plus consistent visibility checks across the board ([2c5c929](https://github.com/serenity-js/serenity-js/commit/2c5c929802f894f9fe59438a01f08b1b7bec3318)), closes [#1236](https://github.com/serenity-js/serenity-js/issues/1236)
|
|
54
|
-
* **playwright:** support for working with cookies ([1215a8f](https://github.com/serenity-js/serenity-js/commit/1215a8f0d2aabd99bdda8be4e136e0c4f6687803)), closes [#1237](https://github.com/serenity-js/serenity-js/issues/1237)
|
|
55
|
-
* **playwright:** support for working with frames ([89d4621](https://github.com/serenity-js/serenity-js/commit/89d46212073a342fe812a3ad2638a2ad0c39b620)), closes [#1236](https://github.com/serenity-js/serenity-js/issues/1236)
|
|
56
|
-
* **web:** introduced PagesContext and implemented PlaywrightPage ([0045a72](https://github.com/serenity-js/serenity-js/commit/0045a726d540871333f644928218aed00bcd372c)), closes [#1236](https://github.com/serenity-js/serenity-js/issues/1236)
|
|
57
|
-
* **web:** new portable APIs to handle ModalDialog windows ([c94d0ec](https://github.com/serenity-js/serenity-js/commit/c94d0ec43d2bc8aa39f8824f5d0f1e1cbcf137a1)), closes [#1236](https://github.com/serenity-js/serenity-js/issues/1236) [#805](https://github.com/serenity-js/serenity-js/issues/805) [#1156](https://github.com/serenity-js/serenity-js/issues/1156)
|
|
58
|
-
* **web:** standardised support for deep CSS selectors across the Web integration modules ([e9e3f28](https://github.com/serenity-js/serenity-js/commit/e9e3f281191fc5c891841b6c8aab41213da3b0f5)), closes [#1238](https://github.com/serenity-js/serenity-js/issues/1238)
|
|
45
|
+
* **playwright:** upgraded Playwright to 1.24.0 ([9f8d491](https://github.com/serenity-js/serenity-js/commit/9f8d491cefd893ed7730c55f4186e4b3ffcc0e1d))
|
|
59
46
|
|
|
60
47
|
|
|
61
48
|
|
|
62
49
|
|
|
63
50
|
|
|
64
|
-
# [3.0.0-rc.
|
|
51
|
+
# [3.0.0-rc.23](https://github.com/serenity-js/serenity-js/compare/v2.33.10...v3.0.0-rc.23) (2022-07-19)
|
|
65
52
|
|
|
66
|
-
**Note:** Version bump only for package @serenity-js/playwright
|
|
67
53
|
|
|
54
|
+
### Bug Fixes
|
|
68
55
|
|
|
56
|
+
* **node:** support for Node 18 ([73212bc](https://github.com/serenity-js/serenity-js/commit/73212bc9deb1998d871b0720a6b437687b3ceddc)), closes [#1243](https://github.com/serenity-js/serenity-js/issues/1243)
|
|
69
57
|
|
|
70
58
|
|
|
71
59
|
|
|
72
|
-
# [3.0.0-rc.
|
|
60
|
+
# [3.0.0-rc.22](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.21...v3.0.0-rc.22) (2022-07-15)
|
|
73
61
|
|
|
74
|
-
**Note:** Version bump only for package @serenity-js/playwright
|
|
75
62
|
|
|
76
63
|
|
|
64
|
+
# [3.0.0-rc.21](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.20...v3.0.0-rc.21) (2022-07-11)
|
|
77
65
|
|
|
78
66
|
|
|
79
67
|
|
|
@@ -1,40 +1,38 @@
|
|
|
1
1
|
import * as playwright from 'playwright-core';
|
|
2
2
|
/**
|
|
3
|
-
* @
|
|
4
|
-
* Playwright-specific options used to configure the ability to {@link BrowseTheWebWithPlaywright}
|
|
3
|
+
* Playwright-specific options used to configure the ability to {@apilink BrowseTheWebWithPlaywright}
|
|
5
4
|
*
|
|
6
|
-
*
|
|
5
|
+
* ## Learn more
|
|
6
|
+
*
|
|
7
|
+
* - [Playwright `BrowserContextOptions`](https://github.com/microsoft/playwright/blob/bd5eddd62e2009a5fe3e270d8fc30bf29cef1296/packages/playwright-core/types/types.d.ts#L15956)
|
|
8
|
+
*
|
|
9
|
+
* @group Configuration
|
|
7
10
|
*/
|
|
8
11
|
export interface PlaywrightOptions extends playwright.BrowserContextOptions {
|
|
9
12
|
/**
|
|
10
|
-
* @
|
|
11
|
-
* This setting will change the default maximum navigation time for the browser context used by {@link BrowseTheWebWithPlaywright}
|
|
12
|
-
*
|
|
13
|
-
* @see https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout
|
|
13
|
+
* Changes the default maximum navigation time for the browser context used by {@apilink BrowseTheWebWithPlaywright}
|
|
14
14
|
*
|
|
15
|
-
*
|
|
15
|
+
* #### Learn more
|
|
16
|
+
* - [Playwright `browserContext.setDefaultNavigationTimeout(timeout)`](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout)
|
|
16
17
|
*/
|
|
17
18
|
defaultNavigationTimeout?: number;
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* - `'commit'` - consider operation to be finished when network response is received and the document started loading.
|
|
20
|
+
* When to consider navigation operation succeeded, defaults to `load`. Events can be either:
|
|
21
|
+
* - `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
|
|
22
|
+
* - `'load'` - consider operation to be finished when the `load` event is fired.
|
|
23
|
+
* - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.
|
|
24
|
+
* - `'commit'` - consider operation to be finished when network response is received and the document started loading.
|
|
25
25
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* @type {?string}
|
|
26
|
+
* #### Learn more
|
|
27
|
+
* - [Playwright `page.goto(url[, options])`](https://playwright.dev/docs/api/class-page#page-goto-option-wait-until)
|
|
29
28
|
*/
|
|
30
29
|
defaultNavigationWaitUntil?: 'load' | 'domcontentloaded' | 'networkidle' | 'commit';
|
|
31
30
|
/**
|
|
32
|
-
*
|
|
33
|
-
* This setting will change the default maximum time for all Playwright methods accepting `timeout` option.
|
|
34
|
-
*
|
|
35
|
-
* @see https://playwright.dev/docs/api/class-page#page-set-default-timeout
|
|
31
|
+
* This setting will change the default maximum time for all Playwright methods accepting `timeout` option.
|
|
36
32
|
*
|
|
37
|
-
*
|
|
33
|
+
* #### Learn more
|
|
34
|
+
* - [Playwright `page.setDefaultTimeout(timeout)`](https://playwright.dev/docs/api/class-page#page-set-default-timeout)
|
|
38
35
|
*/
|
|
39
36
|
defaultTimeout?: number;
|
|
40
37
|
}
|
|
38
|
+
//# sourceMappingURL=PlaywrightOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlaywrightOptions.d.ts","sourceRoot":"","sources":["../src/PlaywrightOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAE9C;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAkB,SAAQ,UAAU,CAAC,qBAAqB;IAEvE;;;;;OAKG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAElC;;;;;;;;;OASG;IACH,0BAA0B,CAAC,EAAE,MAAM,GAAC,kBAAkB,GAAC,aAAa,GAAC,QAAQ,CAAC;IAE9E;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B"}
|
package/lib/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC"}
|
|
@@ -3,69 +3,60 @@ import { BrowserCapabilities, BrowseTheWeb } from '@serenity-js/web';
|
|
|
3
3
|
import * as playwright from 'playwright-core';
|
|
4
4
|
import { PlaywrightOptions } from '../../PlaywrightOptions';
|
|
5
5
|
/**
|
|
6
|
-
* @
|
|
7
|
-
*
|
|
8
|
-
* to interact with web front-ends using [Playwright](https://playwright.dev/).
|
|
6
|
+
* This implementation of the {@apilink Ability|ability} to {@apilink BrowseTheWeb}
|
|
7
|
+
* enables the {@apilink Actor} to interact with web front-ends using [Playwright](https://playwright.dev/).
|
|
9
8
|
*
|
|
10
|
-
*
|
|
11
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
12
|
-
* import { BrowseTheWebWithPlaywright } from '@serenity-js/playwright';
|
|
13
|
-
* import { By, Navigate, PageElement } from '@serenity-js/web';
|
|
14
|
-
* import { Ensure, equals } from '@serenity-js/assertions';
|
|
15
|
-
* import { Browser, chromium } from 'playwright';
|
|
9
|
+
* ## Using Playwright to `BrowseTheWeb`
|
|
16
10
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
13
|
+
* import { BrowseTheWebWithPlaywright } from '@serenity-js/playwright'
|
|
14
|
+
* import { By, Navigate, PageElement } from '@serenity-js/web'
|
|
15
|
+
* import { Ensure, equals } from '@serenity-js/assertions'
|
|
16
|
+
* import { Browser, chromium } from 'playwright'
|
|
20
17
|
*
|
|
21
|
-
*
|
|
18
|
+
* const HomePage = {
|
|
19
|
+
* title: () =>
|
|
20
|
+
* PageElement.located(By.css('h1')).describedAs('title')
|
|
21
|
+
* }
|
|
22
22
|
*
|
|
23
|
-
*
|
|
24
|
-
* .whoCan(BrowseTheWebWithPlaywright.using(browser))
|
|
25
|
-
* .attemptsTo(
|
|
26
|
-
* Navigate.to(`https://serenity-js.org`),
|
|
27
|
-
* Ensure.that(Text.of(HomePage.title), equals('Serenity/JS')),
|
|
28
|
-
* );
|
|
23
|
+
* const browser = await chromium.launch({ headless: true });
|
|
29
24
|
*
|
|
30
|
-
*
|
|
25
|
+
* await actorCalled('Wendy')
|
|
26
|
+
* .whoCan(BrowseTheWebWithPlaywright.using(browser))
|
|
27
|
+
* .attemptsTo(
|
|
28
|
+
* Navigate.to(`https://serenity-js.org`),
|
|
29
|
+
* Ensure.that(Text.of(HomePage.title()), equals('Serenity/JS')),
|
|
30
|
+
* )
|
|
31
|
+
* ```
|
|
31
32
|
*
|
|
32
|
-
*
|
|
33
|
+
* ## Learn more
|
|
34
|
+
* - [Playwright website](https://playwright.dev/)
|
|
35
|
+
* - {@apilink BrowseTheWeb}
|
|
36
|
+
* - {@apilink Ability}
|
|
37
|
+
* - {@apilink Actor}
|
|
33
38
|
*
|
|
34
|
-
* @
|
|
35
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
39
|
+
* @group Abilities
|
|
36
40
|
*/
|
|
37
41
|
export declare class BrowseTheWebWithPlaywright extends BrowseTheWeb<playwright.ElementHandle> implements Discardable {
|
|
38
42
|
protected readonly browser: playwright.Browser;
|
|
39
|
-
/**
|
|
40
|
-
* @param {playwright~Browser} browser
|
|
41
|
-
* @param {PlaywrightOptions} options
|
|
42
|
-
* @returns {BrowseTheWebWithPlaywright}
|
|
43
|
-
*/
|
|
44
43
|
static using(browser: playwright.Browser, options?: PlaywrightOptions): BrowseTheWebWithPlaywright;
|
|
45
|
-
/**
|
|
46
|
-
* @param {playwright~Browser} browser
|
|
47
|
-
* @param {PlaywrightOptions} browserContextOptions
|
|
48
|
-
*/
|
|
49
44
|
protected constructor(browser: playwright.Browser, browserContextOptions?: PlaywrightOptions);
|
|
50
45
|
/**
|
|
51
|
-
* @
|
|
52
|
-
* Automatically closes any open {@link Page}s when the {@link SceneFinishes}
|
|
46
|
+
* Automatically closes any open {@apilink Page|Pages} when the {@apilink SceneFinishes}
|
|
53
47
|
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
48
|
+
* #### Learn more
|
|
49
|
+
* - {@apilink PlaywrightBrowsingSession.closeAllPages}
|
|
50
|
+
* - {@apilink Discardable}
|
|
56
51
|
*/
|
|
57
52
|
discard(): Promise<void>;
|
|
58
53
|
/**
|
|
59
|
-
* @
|
|
60
|
-
* Returns basic meta-data about the browser associated with this ability.
|
|
61
|
-
*
|
|
62
|
-
* **Please note** that since Playwright does not expose information about the operating system
|
|
63
|
-
* the tests are running on, **Serenity/JS assumes that the tests are running locally**
|
|
64
|
-
* and therefore returns the value of Node.js `process.platform` for `platformName`.
|
|
65
|
-
*
|
|
66
|
-
* @returns {Promise<BrowserCapabilities>}
|
|
54
|
+
* Returns {@apilink BrowserCapabilities|basic meta-data} about the browser associated with this ability.
|
|
67
55
|
*
|
|
68
|
-
*
|
|
56
|
+
* **Please note** that since Playwright does not expose information about the operating system
|
|
57
|
+
* the tests are running on, **Serenity/JS assumes that the tests are running locally**
|
|
58
|
+
* and therefore returns the value of Node.js `process.platform` for `platformName`.
|
|
69
59
|
*/
|
|
70
60
|
browserCapabilities(): Promise<BrowserCapabilities>;
|
|
71
61
|
}
|
|
62
|
+
//# sourceMappingURL=BrowseTheWebWithPlaywright.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrowseTheWebWithPlaywright.d.ts","sourceRoot":"","sources":["../../../src/screenplay/abilities/BrowseTheWebWithPlaywright.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,qBAAa,0BAA2B,SAAQ,YAAY,CAAC,UAAU,CAAC,aAAa,CAAE,YAAW,WAAW;IAMnF,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO;IAJpE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,0BAA0B;IAIlG,SAAS,aAAgC,OAAO,EAAE,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAE,iBAAsB;IAInH;;;;;;OAMG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9B;;;;;;OAMG;IACG,mBAAmB,IAAI,OAAO,CAAC,mBAAmB,CAAC;CAO5D"}
|
|
@@ -4,75 +4,65 @@ exports.BrowseTheWebWithPlaywright = void 0;
|
|
|
4
4
|
const web_1 = require("@serenity-js/web");
|
|
5
5
|
const models_1 = require("../models");
|
|
6
6
|
/**
|
|
7
|
-
* @
|
|
8
|
-
*
|
|
9
|
-
* to interact with web front-ends using [Playwright](https://playwright.dev/).
|
|
7
|
+
* This implementation of the {@apilink Ability|ability} to {@apilink BrowseTheWeb}
|
|
8
|
+
* enables the {@apilink Actor} to interact with web front-ends using [Playwright](https://playwright.dev/).
|
|
10
9
|
*
|
|
11
|
-
*
|
|
12
|
-
* import { actorCalled } from '@serenity-js/core';
|
|
13
|
-
* import { BrowseTheWebWithPlaywright } from '@serenity-js/playwright';
|
|
14
|
-
* import { By, Navigate, PageElement } from '@serenity-js/web';
|
|
15
|
-
* import { Ensure, equals } from '@serenity-js/assertions';
|
|
16
|
-
* import { Browser, chromium } from 'playwright';
|
|
10
|
+
* ## Using Playwright to `BrowseTheWeb`
|
|
17
11
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { actorCalled } from '@serenity-js/core'
|
|
14
|
+
* import { BrowseTheWebWithPlaywright } from '@serenity-js/playwright'
|
|
15
|
+
* import { By, Navigate, PageElement } from '@serenity-js/web'
|
|
16
|
+
* import { Ensure, equals } from '@serenity-js/assertions'
|
|
17
|
+
* import { Browser, chromium } from 'playwright'
|
|
21
18
|
*
|
|
22
|
-
*
|
|
19
|
+
* const HomePage = {
|
|
20
|
+
* title: () =>
|
|
21
|
+
* PageElement.located(By.css('h1')).describedAs('title')
|
|
22
|
+
* }
|
|
23
23
|
*
|
|
24
|
-
*
|
|
25
|
-
* .whoCan(BrowseTheWebWithPlaywright.using(browser))
|
|
26
|
-
* .attemptsTo(
|
|
27
|
-
* Navigate.to(`https://serenity-js.org`),
|
|
28
|
-
* Ensure.that(Text.of(HomePage.title), equals('Serenity/JS')),
|
|
29
|
-
* );
|
|
24
|
+
* const browser = await chromium.launch({ headless: true });
|
|
30
25
|
*
|
|
31
|
-
*
|
|
26
|
+
* await actorCalled('Wendy')
|
|
27
|
+
* .whoCan(BrowseTheWebWithPlaywright.using(browser))
|
|
28
|
+
* .attemptsTo(
|
|
29
|
+
* Navigate.to(`https://serenity-js.org`),
|
|
30
|
+
* Ensure.that(Text.of(HomePage.title()), equals('Serenity/JS')),
|
|
31
|
+
* )
|
|
32
|
+
* ```
|
|
32
33
|
*
|
|
33
|
-
*
|
|
34
|
+
* ## Learn more
|
|
35
|
+
* - [Playwright website](https://playwright.dev/)
|
|
36
|
+
* - {@apilink BrowseTheWeb}
|
|
37
|
+
* - {@apilink Ability}
|
|
38
|
+
* - {@apilink Actor}
|
|
34
39
|
*
|
|
35
|
-
* @
|
|
36
|
-
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
40
|
+
* @group Abilities
|
|
37
41
|
*/
|
|
38
42
|
class BrowseTheWebWithPlaywright extends web_1.BrowseTheWeb {
|
|
39
|
-
/**
|
|
40
|
-
* @param {playwright~Browser} browser
|
|
41
|
-
* @param {PlaywrightOptions} browserContextOptions
|
|
42
|
-
*/
|
|
43
43
|
constructor(browser, browserContextOptions = {}) {
|
|
44
44
|
super(new models_1.PlaywrightBrowsingSession(browser, browserContextOptions));
|
|
45
45
|
this.browser = browser;
|
|
46
46
|
}
|
|
47
|
-
/**
|
|
48
|
-
* @param {playwright~Browser} browser
|
|
49
|
-
* @param {PlaywrightOptions} options
|
|
50
|
-
* @returns {BrowseTheWebWithPlaywright}
|
|
51
|
-
*/
|
|
52
47
|
static using(browser, options) {
|
|
53
48
|
return new BrowseTheWebWithPlaywright(browser, options);
|
|
54
49
|
}
|
|
55
50
|
/**
|
|
56
|
-
* @
|
|
57
|
-
* Automatically closes any open {@link Page}s when the {@link SceneFinishes}
|
|
51
|
+
* Automatically closes any open {@apilink Page|Pages} when the {@apilink SceneFinishes}
|
|
58
52
|
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
53
|
+
* #### Learn more
|
|
54
|
+
* - {@apilink PlaywrightBrowsingSession.closeAllPages}
|
|
55
|
+
* - {@apilink Discardable}
|
|
61
56
|
*/
|
|
62
57
|
async discard() {
|
|
63
58
|
await this.session.closeAllPages();
|
|
64
59
|
}
|
|
65
60
|
/**
|
|
66
|
-
* @
|
|
67
|
-
* Returns basic meta-data about the browser associated with this ability.
|
|
68
|
-
*
|
|
69
|
-
* **Please note** that since Playwright does not expose information about the operating system
|
|
70
|
-
* the tests are running on, **Serenity/JS assumes that the tests are running locally**
|
|
71
|
-
* and therefore returns the value of Node.js `process.platform` for `platformName`.
|
|
72
|
-
*
|
|
73
|
-
* @returns {Promise<BrowserCapabilities>}
|
|
61
|
+
* Returns {@apilink BrowserCapabilities|basic meta-data} about the browser associated with this ability.
|
|
74
62
|
*
|
|
75
|
-
*
|
|
63
|
+
* **Please note** that since Playwright does not expose information about the operating system
|
|
64
|
+
* the tests are running on, **Serenity/JS assumes that the tests are running locally**
|
|
65
|
+
* and therefore returns the value of Node.js `process.platform` for `platformName`.
|
|
76
66
|
*/
|
|
77
67
|
async browserCapabilities() {
|
|
78
68
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowseTheWebWithPlaywright.js","sourceRoot":"","sources":["../../../src/screenplay/abilities/BrowseTheWebWithPlaywright.ts"],"names":[],"mappings":";;;AACA,0CAAqE;AAIrE,sCAAsD;AAEtD
|
|
1
|
+
{"version":3,"file":"BrowseTheWebWithPlaywright.js","sourceRoot":"","sources":["../../../src/screenplay/abilities/BrowseTheWebWithPlaywright.ts"],"names":[],"mappings":";;;AACA,0CAAqE;AAIrE,sCAAsD;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAa,0BAA2B,SAAQ,kBAAsC;IAMlF,YAAyC,OAA2B,EAAE,wBAA2C,EAAE;QAC/G,KAAK,CAAC,IAAI,kCAAyB,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAC,CAAC;QADhC,YAAO,GAAP,OAAO,CAAoB;IAEpE,CAAC;IAND,MAAM,CAAC,KAAK,CAAC,OAA2B,EAAE,OAA2B;QACjE,OAAO,IAAI,0BAA0B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAMD;;;;;;OAMG;IACH,KAAK,CAAC,OAAO;QACT,MAAM,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;IACvC,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,mBAAmB;QACrB,OAAO;YACH,WAAW,EAAG,IAAI,CAAC,OAAe,CAAC,YAAY,CAAC,IAAI;YACpD,YAAY,EAAE,OAAO,CAAC,QAAQ;YAC9B,cAAc,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;SACzC,CAAA;IACL,CAAC;CACJ;AAnCD,gEAmCC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screenplay/abilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/screenplay/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC"}
|
|
@@ -3,10 +3,9 @@ import * as playwright from 'playwright-core';
|
|
|
3
3
|
import { PlaywrightOptions } from '../../PlaywrightOptions';
|
|
4
4
|
import { PlaywrightPage } from '../models';
|
|
5
5
|
/**
|
|
6
|
-
* @
|
|
7
|
-
* Playwright-specific implementation of the {@link @serenity-js/web/lib/screenplay/models~BrowsingSession}.
|
|
6
|
+
* Playwright-specific implementation of {@apilink BrowsingSession}.
|
|
8
7
|
*
|
|
9
|
-
* @
|
|
8
|
+
* @group Models
|
|
10
9
|
*/
|
|
11
10
|
export declare class PlaywrightBrowsingSession extends BrowsingSession<PlaywrightPage> {
|
|
12
11
|
protected readonly browser: playwright.Browser;
|
|
@@ -23,3 +22,4 @@ export declare class PlaywrightBrowsingSession extends BrowsingSession<Playwrigh
|
|
|
23
22
|
deleteAllCookies(): Promise<void>;
|
|
24
23
|
private browserContext;
|
|
25
24
|
}
|
|
25
|
+
//# sourceMappingURL=PlaywrightBrowsingSession.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlaywrightBrowsingSession.d.ts","sourceRoot":"","sources":["../../../src/screenplay/models/PlaywrightBrowsingSession.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAoB,cAAc,EAAE,MAAM,WAAW,CAAC;AAE7D;;;;GAIG;AACH,qBAAa,yBAA0B,SAAQ,eAAe,CAAC,cAAc,CAAC;IAKtE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO;IAC9C,SAAS,CAAC,QAAQ,CAAC,qBAAqB,EAAE,iBAAiB;IAJ/D,OAAO,CAAC,+BAA+B,CAA4B;gBAG5C,OAAO,EAAE,UAAU,CAAC,OAAO,EAC3B,qBAAqB,EAAE,iBAAiB;cAK/C,mBAAmB,IAAI,OAAO,CAAC,cAAc,CAAC;IAc9D;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAO9B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKrC,SAAS,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAM5C,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;YAKzB,cAAc;CAuB/B"}
|
|
@@ -5,10 +5,9 @@ const model_1 = require("@serenity-js/core/lib/model");
|
|
|
5
5
|
const web_1 = require("@serenity-js/web");
|
|
6
6
|
const models_1 = require("../models");
|
|
7
7
|
/**
|
|
8
|
-
* @
|
|
9
|
-
* Playwright-specific implementation of the {@link @serenity-js/web/lib/screenplay/models~BrowsingSession}.
|
|
8
|
+
* Playwright-specific implementation of {@apilink BrowsingSession}.
|
|
10
9
|
*
|
|
11
|
-
* @
|
|
10
|
+
* @group Models
|
|
12
11
|
*/
|
|
13
12
|
class PlaywrightBrowsingSession extends web_1.BrowsingSession {
|
|
14
13
|
constructor(browser, browserContextOptions) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlaywrightBrowsingSession.js","sourceRoot":"","sources":["../../../src/screenplay/models/PlaywrightBrowsingSession.ts"],"names":[],"mappings":";;;AAAA,uDAA4D;AAC5D,0CAAuE;AAIv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AED,KAAK,CAAC,gBAAgB;QAClB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAA;QAC3C,MAAM,OAAO,CAAC,YAAY,EAAE,CAAC;IACjC,CAAC;IAEO,KAAK,CAAC,cAAc;;QACxB,IAAI,CAAE,IAAI,CAAC,+BAA+B,EAAE;YACxC,IAAI,CAAC,+BAA+B,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;YAEjG,IAAI,CAAC,+BAA+B,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,EAAC,IAAI,EAAC,EAAE;gBACzD,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBAE9B,IAAI,CAAC,QAAQ,CACT,IAAI,uBAAc,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,qBAAqB,EAAE,qBAAa,CAAC,MAAM,EAAE,CAAC,CACrF,CAAC;YACN,CAAC,CAAC,CAAC;YAEH,IAAI,MAAA,IAAI,CAAC,qBAAqB,0CAAE,wBAAwB,EAAE;gBACtD,IAAI,CAAC,+BAA+B,CAAC,2BAA2B,CAAC,MAAA,IAAI,CAAC,qBAAqB,0CAAE,wBAAwB,CAAC,CAAC;aAC1H;YAED,IAAI,MAAA,IAAI,CAAC,qBAAqB,0CAAE,cAAc,EAAE;gBAC5C,IAAI,CAAC,+BAA+B,CAAC,iBAAiB,CAAC,MAAA,IAAI,CAAC,qBAAqB,0CAAE,cAAc,CAAC,CAAC;aACtG;SACJ;QAED,OAAO,IAAI,CAAC,+BAA+B,CAAC;IAChD,CAAC;CACJ;AA1ED,8DA0EC"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { Cookie, CookieData } from '@serenity-js/web';
|
|
2
2
|
import * as playwright from 'playwright-core';
|
|
3
|
+
/**
|
|
4
|
+
* Playwright-specific implementation of {@apilink Cookie}.
|
|
5
|
+
*
|
|
6
|
+
* @group Models
|
|
7
|
+
*/
|
|
3
8
|
export declare class PlaywrightCookie extends Cookie {
|
|
4
9
|
private readonly context;
|
|
5
10
|
constructor(context: playwright.BrowserContext, cookieName: string);
|
|
6
11
|
delete(): Promise<void>;
|
|
7
12
|
protected read(): Promise<CookieData>;
|
|
8
13
|
}
|
|
14
|
+
//# sourceMappingURL=PlaywrightCookie.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlaywrightCookie.d.ts","sourceRoot":"","sources":["../../../src/screenplay/models/PlaywrightCookie.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAsB,MAAM,kBAAkB,CAAC;AAC1E,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAG9C;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,MAAM;IAGpC,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,UAAU,CAAC,cAAc,EACnD,UAAU,EAAE,MAAM;IAMhB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;cASb,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;CAqB9C"}
|
|
@@ -4,6 +4,11 @@ exports.PlaywrightCookie = void 0;
|
|
|
4
4
|
const core_1 = require("@serenity-js/core");
|
|
5
5
|
const web_1 = require("@serenity-js/web");
|
|
6
6
|
const tiny_types_1 = require("tiny-types");
|
|
7
|
+
/**
|
|
8
|
+
* Playwright-specific implementation of {@apilink Cookie}.
|
|
9
|
+
*
|
|
10
|
+
* @group Models
|
|
11
|
+
*/
|
|
7
12
|
class PlaywrightCookie extends web_1.Cookie {
|
|
8
13
|
constructor(context, cookieName) {
|
|
9
14
|
super(cookieName);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlaywrightCookie.js","sourceRoot":"","sources":["../../../src/screenplay/models/PlaywrightCookie.ts"],"names":[],"mappings":";;;AAAA,4CAA8C;AAC9C,0CAA0E;AAE1E,2CAA+C;AAE/C,MAAa,gBAA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,KAAK;YACvB,MAAM,EAAM,KAAK,CAAC,MAAM;YACxB,IAAI,EAAQ,KAAK,CAAC,IAAI;YACtB,MAAM,EAAM,KAAK,CAAC,OAAO,KAAK,SAAS;gBACnC,CAAC,CAAC,gBAAS,CAAC,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC7D,CAAC,CAAC,SAAS;YACf,QAAQ,EAAI,KAAK,CAAC,QAAQ;YAC1B,MAAM,EAAM,KAAK,CAAC,MAAM;SAC3B,CAAA;IACL,CAAC;CACJ;AAxCD,4CAwCC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { ModalDialogHandler } from '@serenity-js/web';
|
|
2
2
|
import * as playwright from 'playwright-core';
|
|
3
|
+
/**
|
|
4
|
+
* Playwright-specific implementation of {@apilink ModalDialogHandler}.
|
|
5
|
+
*
|
|
6
|
+
* @group Models
|
|
7
|
+
*/
|
|
3
8
|
export declare class PlaywrightModalDialogHandler extends ModalDialogHandler {
|
|
4
9
|
private readonly page;
|
|
5
10
|
private readonly defaultHandler;
|
|
@@ -11,3 +16,4 @@ export declare class PlaywrightModalDialogHandler extends ModalDialogHandler {
|
|
|
11
16
|
reset(): Promise<void>;
|
|
12
17
|
discard(): Promise<void>;
|
|
13
18
|
}
|
|
19
|
+
//# sourceMappingURL=PlaywrightModalDialogHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlaywrightModalDialogHandler.d.ts","sourceRoot":"","sources":["../../../src/screenplay/models/PlaywrightModalDialogHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6E,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACjI,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAE9C;;;;GAIG;AACH,qBAAa,4BAA6B,SAAQ,kBAAkB;IAUpD,OAAO,CAAC,QAAQ,CAAC,IAAI;IARjC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAI1B;IAEL,OAAO,CAAC,cAAc,CAAsD;gBAE/C,IAAI,EAAE,UAAU,CAAC,IAAI;IAU5C,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAO3B,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOzD,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAO5B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAKtB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAGjC"}
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PlaywrightModalDialogHandler = void 0;
|
|
4
4
|
const web_1 = require("@serenity-js/web");
|
|
5
|
+
/**
|
|
6
|
+
* Playwright-specific implementation of {@apilink ModalDialogHandler}.
|
|
7
|
+
*
|
|
8
|
+
* @group Models
|
|
9
|
+
*/
|
|
5
10
|
class PlaywrightModalDialogHandler extends web_1.ModalDialogHandler {
|
|
6
11
|
constructor(page) {
|
|
7
12
|
super();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlaywrightModalDialogHandler.js","sourceRoot":"","sources":["../../../src/screenplay/models/PlaywrightModalDialogHandler.ts"],"names":[],"mappings":";;;AAAA,0CAAiI;AAGjI,MAAa,4BAA6B,SAAQ,wBAAkB;IAUhE,YAA6B,IAAqB;QAC9C,KAAK,EAAE,CAAC;QADiB,SAAI,GAAJ,IAAI,CAAiB;QARjC,mBAAc,GAC3B,KAAK,EAAE,MAAyB,EAAE,EAAE;YAChC,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;YACvB,OAAO,IAAI,0BAAoB,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;QACtD,CAAC,CAAA;QAOD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QAE1C,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,QAA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KAAK,EAAE,MAAyB,EAAE,EAAE;YACtD,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;YACvB,OAAO,IAAI,0BAAoB,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;QACtD,CAAC,CAAA;IACL,CAAC;IAED,KAAK,CAAC,KAAK;QACP,IAAI,CAAC,WAAW,GAAG,IAAI,uBAAiB,EAAE,CAAC;QAC3C,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,OAAO;QACT,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IACjD,CAAC;CACJ;AAjDD,oEAiDC"}
|
|
@@ -6,17 +6,13 @@ import { URL } from 'url';
|
|
|
6
6
|
import { PlaywrightOptions } from '../../PlaywrightOptions';
|
|
7
7
|
import { PlaywrightBrowsingSession } from './PlaywrightBrowsingSession';
|
|
8
8
|
/**
|
|
9
|
-
* @
|
|
10
|
-
* Playwright-specific implementation of the {@link @serenity-js/web/lib/screenplay/models~Page}.
|
|
9
|
+
* Playwright-specific implementation of {@apilink Page}.
|
|
11
10
|
*
|
|
12
|
-
* @
|
|
11
|
+
* @group Models
|
|
13
12
|
*/
|
|
14
13
|
export declare class PlaywrightPage extends Page<playwright.ElementHandle> {
|
|
15
14
|
private readonly page;
|
|
16
15
|
private readonly options;
|
|
17
|
-
/**
|
|
18
|
-
* @private
|
|
19
|
-
*/
|
|
20
16
|
private lastScriptExecutionSummary;
|
|
21
17
|
constructor(session: PlaywrightBrowsingSession, page: playwright.Page, options: PlaywrightOptions, pageId: CorrelationId);
|
|
22
18
|
locate(selector: Selector): PageElement<playwright.ElementHandle>;
|
|
@@ -28,13 +24,6 @@ export declare class PlaywrightPage extends Page<playwright.ElementHandle> {
|
|
|
28
24
|
sendKeys(keys: (string | Key)[]): Promise<void>;
|
|
29
25
|
executeScript<Result, InnerArguments extends any[]>(script: string | ((...parameters: InnerArguments) => Result), ...args: InnerArguments): Promise<Result>;
|
|
30
26
|
executeAsyncScript<Result, Parameters extends any[]>(script: string | ((...args: [...parameters: Parameters, callback: (result: Result) => void]) => void), ...args: Parameters): Promise<Result>;
|
|
31
|
-
/**
|
|
32
|
-
* @desc
|
|
33
|
-
* Returns the last result of calling {@link BrowseTheWebWithPlaywright#executeAsyncScript}
|
|
34
|
-
* or {@link BrowseTheWebWithPlaywright#executeScript}
|
|
35
|
-
*
|
|
36
|
-
* @returns {any}
|
|
37
|
-
*/
|
|
38
27
|
lastScriptExecutionResult<Result = any>(): Result;
|
|
39
28
|
takeScreenshot(): Promise<string>;
|
|
40
29
|
cookie(name: string): Promise<Cookie>;
|
|
@@ -56,3 +45,4 @@ export declare class PlaywrightPage extends Page<playwright.ElementHandle> {
|
|
|
56
45
|
isPresent(): Promise<boolean>;
|
|
57
46
|
private resetState;
|
|
58
47
|
}
|
|
48
|
+
//# sourceMappingURL=PlaywrightPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlaywrightPage.d.ts","sourceRoot":"","sources":["../../../src/screenplay/models/PlaywrightPage.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEtG,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAIxE;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;IAM1D,OAAO,CAAC,QAAQ,CAAC,IAAI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