@serenity-js/web 3.0.0-rc.10 → 3.0.0-rc.13
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 +297 -0
- package/lib/screenplay/abilities/BrowseTheWeb.d.ts +2 -5
- package/lib/screenplay/abilities/BrowseTheWeb.js.map +1 -1
- package/lib/screenplay/interactions/Switch.d.ts +90 -96
- package/lib/screenplay/interactions/Switch.js +106 -137
- package/lib/screenplay/interactions/Switch.js.map +1 -1
- package/lib/screenplay/models/Page.d.ts +8 -4
- package/lib/screenplay/models/Page.js.map +1 -1
- package/lib/screenplay/models/PageElement.d.ts +26 -1
- package/lib/screenplay/models/PageElement.js.map +1 -1
- package/lib/screenplay/models/Switchable.d.ts +27 -0
- package/lib/screenplay/models/Switchable.js +3 -0
- package/lib/screenplay/models/Switchable.js.map +1 -0
- package/lib/screenplay/models/SwitchableOrigin.d.ts +21 -0
- package/lib/screenplay/models/SwitchableOrigin.js +3 -0
- package/lib/screenplay/models/SwitchableOrigin.js.map +1 -0
- package/lib/screenplay/models/index.d.ts +2 -0
- package/lib/screenplay/models/index.js +2 -0
- package/lib/screenplay/models/index.js.map +1 -1
- package/package.json +9 -30
- package/src/screenplay/abilities/BrowseTheWeb.ts +4 -15
- package/src/screenplay/interactions/Switch.ts +108 -142
- package/src/screenplay/models/Page.ts +8 -4
- package/src/screenplay/models/PageElement.ts +29 -1
- package/src/screenplay/models/Switchable.ts +29 -0
- package/src/screenplay/models/SwitchableOrigin.ts +22 -0
- package/src/screenplay/models/index.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,303 @@
|
|
|
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.13](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.12...v3.0.0-rc.13) (2022-03-02)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **web:** combined Frame and PageElement so they can be Switch-ed to ([1b7ab7c](https://github.com/serenity-js/serenity-js/commit/1b7ab7c828034a14ba801cbfa97acc203fd55adf)), closes [#82](https://github.com/serenity-js/serenity-js/issues/82) [#227](https://github.com/serenity-js/serenity-js/issues/227) [#233](https://github.com/serenity-js/serenity-js/issues/233) [#365](https://github.com/serenity-js/serenity-js/issues/365)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [3.0.0-rc.12](https://github.com/serenity-js/serenity-js/compare/v2.33.2...v3.0.0-rc.12) (2022-02-23)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
# [3.0.0-rc.11](https://github.com/serenity-js/serenity-js/compare/v2.33.1...v3.0.0-rc.11) (2022-02-13)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* **web:** made the constructor of BrowseTheWeb protected, since it's an abstract class ([dbfbed0](https://github.com/serenity-js/serenity-js/commit/dbfbed02923bc1c589e588429c163ffbc7b13a34))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Features
|
|
30
|
+
|
|
31
|
+
* **web:** support for working with frames and an interaction to Switch.to(frameOrPage) ([ef73ef2](https://github.com/serenity-js/serenity-js/commit/ef73ef273f8a17e48d396d5ef03f6b761b136c9a)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
# [3.0.0-rc.10](https://github.com/serenity-js/serenity-js/compare/v2.33.0...v3.0.0-rc.10) (2022-02-03)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
# [3.0.0-rc.9](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.8...v3.0.0-rc.9) (2022-02-01)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
# [3.0.0-rc.8](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.7...v3.0.0-rc.8) (2022-01-28)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
# [3.0.0-rc.7](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.6...v3.0.0-rc.7) (2022-01-28)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
### Features
|
|
51
|
+
|
|
52
|
+
* **assertions:** isPresent works with any Optional ([cea75dc](https://github.com/serenity-js/serenity-js/commit/cea75dc1c728e45e06a87aaf9c1573a237334285)), closes [#1103](https://github.com/serenity-js/serenity-js/issues/1103)
|
|
53
|
+
* **core:** `f` and `d` question description formatters ([c9f3fad](https://github.com/serenity-js/serenity-js/commit/c9f3fadd86ec0196f2cdbf76d9628bbef0a3fcba))
|
|
54
|
+
* **core:** replaced `Adapter` with `QuestionAdapter` and introduced `Optional` ([8d84ad3](https://github.com/serenity-js/serenity-js/commit/8d84ad3863e3c726533d0f21934fb1e2fa8b3022)), closes [#1103](https://github.com/serenity-js/serenity-js/issues/1103)
|
|
55
|
+
* **core:** support for Optional chaining, expectation isPresent, refactored Expectations ([1841ee5](https://github.com/serenity-js/serenity-js/commit/1841ee5fc48cfa403ddc53358f75764d9a010c21)), closes [#1099](https://github.com/serenity-js/serenity-js/issues/1099) [#1099](https://github.com/serenity-js/serenity-js/issues/1099) [#1103](https://github.com/serenity-js/serenity-js/issues/1103)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
# [3.0.0-rc.6](https://github.com/serenity-js/serenity-js/compare/v2.32.7...v3.0.0-rc.6) (2022-01-10)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
# [3.0.0-rc.5](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.4...v3.0.0-rc.5) (2022-01-07)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### Features
|
|
67
|
+
|
|
68
|
+
* **web:** support for advanced PageElement locator patterns ([c1ff8b7](https://github.com/serenity-js/serenity-js/commit/c1ff8b7539ebc1da8f79ea2b6d17bb01c42f443d)), closes [#1084](https://github.com/serenity-js/serenity-js/issues/1084)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
# [3.0.0-rc.4](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.3...v3.0.0-rc.4) (2021-12-30)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
### Features
|
|
76
|
+
|
|
77
|
+
* **web:** ElementExpectation makes it easier to define custom PageElement-related Expectations ([92ebf7d](https://github.com/serenity-js/serenity-js/commit/92ebf7db720d0fe88ddbe17b9958fa993b1fd02e))
|
|
78
|
+
* **web:** Text.ofAll accepts mapped PageElements ([5314246](https://github.com/serenity-js/serenity-js/commit/5314246305fa3f62446d5ec718f36354152be68d))
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
# [3.0.0-rc.3](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.2...v3.0.0-rc.3) (2021-12-29)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
### Bug Fixes
|
|
86
|
+
|
|
87
|
+
* **core:** refactored Mappable so that it's easier to implement filters ([176e0cd](https://github.com/serenity-js/serenity-js/commit/176e0cd0303d63271477b2b7a8e7b0572dda99a0)), closes [#1074](https://github.com/serenity-js/serenity-js/issues/1074)
|
|
88
|
+
* **deps:** updated tiny-types to 1.17.0 ([3187051](https://github.com/serenity-js/serenity-js/commit/3187051594158b4b450c82e851e417fd2ed21652))
|
|
89
|
+
* **web:** corrected synchronisation in Web questions and interactions ([c3a0ad1](https://github.com/serenity-js/serenity-js/commit/c3a0ad16de311e71d7e82e4f463baa0ca6b18863))
|
|
90
|
+
* **web:** Photographer skips taking a screenshot if the Window is closed (DevTools protocol) ([b682577](https://github.com/serenity-js/serenity-js/commit/b682577ad649046fc1a4cd61a7315e11d60dcf32))
|
|
91
|
+
* **web:** refactored Selector and NativeElementLocator classes to simplify the implementation ([f0c8f11](https://github.com/serenity-js/serenity-js/commit/f0c8f113433958877d36f13d0bc7f355ea68d280))
|
|
92
|
+
* **web:** simplified the selectors ([b167e42](https://github.com/serenity-js/serenity-js/commit/b167e422eb66556845c31d5847b9fd33b707c764)), closes [#1074](https://github.com/serenity-js/serenity-js/issues/1074)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
### Features
|
|
96
|
+
|
|
97
|
+
* **core:** new implementation of List.where filters ([45b3c80](https://github.com/serenity-js/serenity-js/commit/45b3c8080ca467ac6362e5217e7899ca36a04cdc)), closes [#1074](https://github.com/serenity-js/serenity-js/issues/1074)
|
|
98
|
+
* **web:** isVisible checks if the element is in viewport and not hidden behind other elements ([429040f](https://github.com/serenity-js/serenity-js/commit/429040fb32b04cd4bc7524100635203fd8128eb6))
|
|
99
|
+
* **web:** new PageElement retrieval model based on Selectors ([48bd94f](https://github.com/serenity-js/serenity-js/commit/48bd94f3c29707b66dcf81a7522f7529b6f9fcfb))
|
|
100
|
+
* **web:** re-introduced PageElements.where DSL and universal By selectors ([39fe0a1](https://github.com/serenity-js/serenity-js/commit/39fe0a10edf7f652e93911159e4a4689c36d6876)), closes [#1081](https://github.com/serenity-js/serenity-js/issues/1081)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
# [3.0.0-rc.2](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.1...v3.0.0-rc.2) (2021-12-09)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
# [3.0.0-rc.1](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.0...v3.0.0-rc.1) (2021-12-09)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
# [3.0.0-rc.0](https://github.com/serenity-js/serenity-js/compare/v2.32.5...v3.0.0-rc.0) (2021-12-08)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
### Bug Fixes
|
|
116
|
+
|
|
117
|
+
* **core:** 3.0 RC ([469d54e](https://github.com/serenity-js/serenity-js/commit/469d54e4f81ef430566b93852e3174826f8ef672)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
118
|
+
* **core:** renamed "Model" type to "Adapter" to better reflect its purpose ([b4ea7a1](https://github.com/serenity-js/serenity-js/commit/b4ea7a100fac2c896990bf15cbc906de641196b8)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
119
|
+
* **web:** added missing export ([c5ffc0a](https://github.com/serenity-js/serenity-js/commit/c5ffc0a83905c99ea0020577503170c427fdb9f2)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
120
|
+
* **webdriverio:** separated UIElement.hoverOver from UIElement.scrollIntoView ([cf4ca2c](https://github.com/serenity-js/serenity-js/commit/cf4ca2c531e0f90f9a27917e322359c13bfbc6e6))
|
|
121
|
+
* **web:** ensure all Web interactions extend the same base class ([b358c0b](https://github.com/serenity-js/serenity-js/commit/b358c0b67c1de11af63e1e2142d3613692769cd6))
|
|
122
|
+
* **web:** fixed the interaction to Select ([10b7b74](https://github.com/serenity-js/serenity-js/commit/10b7b7446743b5866a1b458577ea7d2e11bf5a8f))
|
|
123
|
+
* **web:** optimised PhotoTakingStrategy ([085b7f7](https://github.com/serenity-js/serenity-js/commit/085b7f716033b22207af47edac58c896f46af62d))
|
|
124
|
+
* **web:** removed incorrect export ([ebf80c0](https://github.com/serenity-js/serenity-js/commit/ebf80c019af4db2a847e4b98599bce02b8acef23))
|
|
125
|
+
* **web:** removed incorrect import ([90cb025](https://github.com/serenity-js/serenity-js/commit/90cb0251a00a7bff098376110dcec2f9f2c5d5c0))
|
|
126
|
+
* **web:** removed window-specific APIs from BrowseTheWeb that got replaced by Page ([918f447](https://github.com/serenity-js/serenity-js/commit/918f447c1d8f326fbf5730f1aa61108045556212)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
127
|
+
* **web:** renamed Element and associated classes to PageElement to avoid name conflicts ([1e4204b](https://github.com/serenity-js/serenity-js/commit/1e4204b5507469e6574c87a6d84454e39e8a813e))
|
|
128
|
+
* **web:** renamed PageElementList to PageElements to improve readability ([a9903a7](https://github.com/serenity-js/serenity-js/commit/a9903a7389b00106ef94d2bdb9f86a7fd04be541)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
129
|
+
* **web:** standardised getters across PageElement implementations ([336472b](https://github.com/serenity-js/serenity-js/commit/336472b1a6882412f6a88483e51266909a1d51d0))
|
|
130
|
+
* **web:** wordsmithing of interface names ([5a1e76a](https://github.com/serenity-js/serenity-js/commit/5a1e76a9c162370e17238fcccc9f08e109d543c3))
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
### Features
|
|
134
|
+
|
|
135
|
+
* **core:** question.about produces "props" that proxy the methods of the underlying model ([f771872](https://github.com/serenity-js/serenity-js/commit/f771872c56b487e404002c3800fc8f3baaed804f))
|
|
136
|
+
* **protractor:** compatibility with @serenity-js/web ([9df4db2](https://github.com/serenity-js/serenity-js/commit/9df4db27a6e0ae62bf0d0e679a170d4865041043)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
137
|
+
* **web:** a common way to run the tests for all the web adapters ([c7e584a](https://github.com/serenity-js/serenity-js/commit/c7e584a9bf288ebc7781affdb720097527e8ed3a))
|
|
138
|
+
* **web:** added Page.viewportSize and Page.setViewportSize methods ([4cabbe2](https://github.com/serenity-js/serenity-js/commit/4cabbe21a7fbac3457c6a6ea3d4442a62c3f1f3c))
|
|
139
|
+
* **web:** all Screenplay APIs migrated from @serenity-js/webdriverio to @serenity-js/web ([7b6b95d](https://github.com/serenity-js/serenity-js/commit/7b6b95dc255446c29ae213ba2a1d142d426d16c8))
|
|
140
|
+
* **webdriverio:** support for native WebdriverIO services ([8d5ad22](https://github.com/serenity-js/serenity-js/commit/8d5ad22594cdb2ebddedc58a30259ca8430e360c))
|
|
141
|
+
* **web:** interaction to set a Cookie ([c056439](https://github.com/serenity-js/serenity-js/commit/c056439746a8f57c3edd937b8862f2babb70e94e)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
142
|
+
* **web:** introduced UIElementQuestion to help ensure no NPEs in UI-related questions ([fe29121](https://github.com/serenity-js/serenity-js/commit/fe29121118d630e9fbd73dca85496e20948e26e0))
|
|
143
|
+
* **web:** migrated Photographer from @serenity-js/protractor to @serenity-js/web ([4506dac](https://github.com/serenity-js/serenity-js/commit/4506dacebdf955c32c4eff17bf9982c8e45e2925)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
144
|
+
* **web:** ModalDialog available for both Protractor and WebdriverIO adapters ([ef3c566](https://github.com/serenity-js/serenity-js/commit/ef3c566aed12b52aa22c54058992d369172b8597)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
145
|
+
* **web:** new module @serenity-js/web to provide Web-related Screenplay Pattern APIs ([bead861](https://github.com/serenity-js/serenity-js/commit/bead8612af1a5c99b775e680a3904f44d0281cf9))
|
|
146
|
+
* **web:** page provides an abstraction around browser window ([2e70a3b](https://github.com/serenity-js/serenity-js/commit/2e70a3b6af2e8cc49255820e8a1aaffcc71b76a8))
|
|
147
|
+
* **web:** Page.url() and Page.title() replace Website.url() and Website.title() ([49fe009](https://github.com/serenity-js/serenity-js/commit/49fe0094422ab53ec67d4ba303f80c33e382eebd)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
148
|
+
* **web:** removed Target in favour of PageElement ([69496c4](https://github.com/serenity-js/serenity-js/commit/69496c47c4a1ec7b92e7ab6c83da1559e926f28e)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
149
|
+
* **web:** support for switching browsing context ([a73a635](https://github.com/serenity-js/serenity-js/commit/a73a635f93183d67229acde78e74526564008869)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
150
|
+
* **web:** support for working with cookies ([39cde6d](https://github.com/serenity-js/serenity-js/commit/39cde6de7a36d27a8b1c596493efbec94900af6b)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
### BREAKING CHANGES
|
|
154
|
+
|
|
155
|
+
* **core:** Introduced @serenity-js/web - a shared library for Serenity/JS Web integration
|
|
156
|
+
modules such as @serenity-js/protractor and @serenity-js/webdriverio. Dropped support for Node 12.
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
# [3.0.0-rc.11](https://github.com/serenity-js/serenity-js/compare/v2.33.1...v3.0.0-rc.11) (2022-02-13)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
### Bug Fixes
|
|
166
|
+
|
|
167
|
+
* **web:** made the constructor of BrowseTheWeb protected, since it's an abstract class ([dbfbed0](https://github.com/serenity-js/serenity-js/commit/dbfbed02923bc1c589e588429c163ffbc7b13a34))
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
### Features
|
|
171
|
+
|
|
172
|
+
* **web:** support for working with frames and an interaction to Switch.to(frameOrPage) ([ef73ef2](https://github.com/serenity-js/serenity-js/commit/ef73ef273f8a17e48d396d5ef03f6b761b136c9a)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
# [3.0.0-rc.10](https://github.com/serenity-js/serenity-js/compare/v2.33.0...v3.0.0-rc.10) (2022-02-03)
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
# [3.0.0-rc.9](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.8...v3.0.0-rc.9) (2022-02-01)
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
# [3.0.0-rc.8](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.7...v3.0.0-rc.8) (2022-01-28)
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
# [3.0.0-rc.7](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.6...v3.0.0-rc.7) (2022-01-28)
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
### Features
|
|
192
|
+
|
|
193
|
+
* **assertions:** isPresent works with any Optional ([cea75dc](https://github.com/serenity-js/serenity-js/commit/cea75dc1c728e45e06a87aaf9c1573a237334285)), closes [#1103](https://github.com/serenity-js/serenity-js/issues/1103)
|
|
194
|
+
* **core:** `f` and `d` question description formatters ([c9f3fad](https://github.com/serenity-js/serenity-js/commit/c9f3fadd86ec0196f2cdbf76d9628bbef0a3fcba))
|
|
195
|
+
* **core:** replaced `Adapter` with `QuestionAdapter` and introduced `Optional` ([8d84ad3](https://github.com/serenity-js/serenity-js/commit/8d84ad3863e3c726533d0f21934fb1e2fa8b3022)), closes [#1103](https://github.com/serenity-js/serenity-js/issues/1103)
|
|
196
|
+
* **core:** support for Optional chaining, expectation isPresent, refactored Expectations ([1841ee5](https://github.com/serenity-js/serenity-js/commit/1841ee5fc48cfa403ddc53358f75764d9a010c21)), closes [#1099](https://github.com/serenity-js/serenity-js/issues/1099) [#1099](https://github.com/serenity-js/serenity-js/issues/1099) [#1103](https://github.com/serenity-js/serenity-js/issues/1103)
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
# [3.0.0-rc.6](https://github.com/serenity-js/serenity-js/compare/v2.32.7...v3.0.0-rc.6) (2022-01-10)
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
# [3.0.0-rc.5](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.4...v3.0.0-rc.5) (2022-01-07)
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
### Features
|
|
208
|
+
|
|
209
|
+
* **web:** support for advanced PageElement locator patterns ([c1ff8b7](https://github.com/serenity-js/serenity-js/commit/c1ff8b7539ebc1da8f79ea2b6d17bb01c42f443d)), closes [#1084](https://github.com/serenity-js/serenity-js/issues/1084)
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
# [3.0.0-rc.4](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.3...v3.0.0-rc.4) (2021-12-30)
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
### Features
|
|
217
|
+
|
|
218
|
+
* **web:** ElementExpectation makes it easier to define custom PageElement-related Expectations ([92ebf7d](https://github.com/serenity-js/serenity-js/commit/92ebf7db720d0fe88ddbe17b9958fa993b1fd02e))
|
|
219
|
+
* **web:** Text.ofAll accepts mapped PageElements ([5314246](https://github.com/serenity-js/serenity-js/commit/5314246305fa3f62446d5ec718f36354152be68d))
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
# [3.0.0-rc.3](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.2...v3.0.0-rc.3) (2021-12-29)
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
### Bug Fixes
|
|
227
|
+
|
|
228
|
+
* **core:** refactored Mappable so that it's easier to implement filters ([176e0cd](https://github.com/serenity-js/serenity-js/commit/176e0cd0303d63271477b2b7a8e7b0572dda99a0)), closes [#1074](https://github.com/serenity-js/serenity-js/issues/1074)
|
|
229
|
+
* **deps:** updated tiny-types to 1.17.0 ([3187051](https://github.com/serenity-js/serenity-js/commit/3187051594158b4b450c82e851e417fd2ed21652))
|
|
230
|
+
* **web:** corrected synchronisation in Web questions and interactions ([c3a0ad1](https://github.com/serenity-js/serenity-js/commit/c3a0ad16de311e71d7e82e4f463baa0ca6b18863))
|
|
231
|
+
* **web:** Photographer skips taking a screenshot if the Window is closed (DevTools protocol) ([b682577](https://github.com/serenity-js/serenity-js/commit/b682577ad649046fc1a4cd61a7315e11d60dcf32))
|
|
232
|
+
* **web:** refactored Selector and NativeElementLocator classes to simplify the implementation ([f0c8f11](https://github.com/serenity-js/serenity-js/commit/f0c8f113433958877d36f13d0bc7f355ea68d280))
|
|
233
|
+
* **web:** simplified the selectors ([b167e42](https://github.com/serenity-js/serenity-js/commit/b167e422eb66556845c31d5847b9fd33b707c764)), closes [#1074](https://github.com/serenity-js/serenity-js/issues/1074)
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
### Features
|
|
237
|
+
|
|
238
|
+
* **core:** new implementation of List.where filters ([45b3c80](https://github.com/serenity-js/serenity-js/commit/45b3c8080ca467ac6362e5217e7899ca36a04cdc)), closes [#1074](https://github.com/serenity-js/serenity-js/issues/1074)
|
|
239
|
+
* **web:** isVisible checks if the element is in viewport and not hidden behind other elements ([429040f](https://github.com/serenity-js/serenity-js/commit/429040fb32b04cd4bc7524100635203fd8128eb6))
|
|
240
|
+
* **web:** new PageElement retrieval model based on Selectors ([48bd94f](https://github.com/serenity-js/serenity-js/commit/48bd94f3c29707b66dcf81a7522f7529b6f9fcfb))
|
|
241
|
+
* **web:** re-introduced PageElements.where DSL and universal By selectors ([39fe0a1](https://github.com/serenity-js/serenity-js/commit/39fe0a10edf7f652e93911159e4a4689c36d6876)), closes [#1081](https://github.com/serenity-js/serenity-js/issues/1081)
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
# [3.0.0-rc.2](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.1...v3.0.0-rc.2) (2021-12-09)
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
# [3.0.0-rc.1](https://github.com/serenity-js/serenity-js/compare/v3.0.0-rc.0...v3.0.0-rc.1) (2021-12-09)
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
# [3.0.0-rc.0](https://github.com/serenity-js/serenity-js/compare/v2.32.5...v3.0.0-rc.0) (2021-12-08)
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
### Bug Fixes
|
|
257
|
+
|
|
258
|
+
* **core:** 3.0 RC ([469d54e](https://github.com/serenity-js/serenity-js/commit/469d54e4f81ef430566b93852e3174826f8ef672)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
259
|
+
* **core:** renamed "Model" type to "Adapter" to better reflect its purpose ([b4ea7a1](https://github.com/serenity-js/serenity-js/commit/b4ea7a100fac2c896990bf15cbc906de641196b8)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
260
|
+
* **web:** added missing export ([c5ffc0a](https://github.com/serenity-js/serenity-js/commit/c5ffc0a83905c99ea0020577503170c427fdb9f2)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
261
|
+
* **webdriverio:** separated UIElement.hoverOver from UIElement.scrollIntoView ([cf4ca2c](https://github.com/serenity-js/serenity-js/commit/cf4ca2c531e0f90f9a27917e322359c13bfbc6e6))
|
|
262
|
+
* **web:** ensure all Web interactions extend the same base class ([b358c0b](https://github.com/serenity-js/serenity-js/commit/b358c0b67c1de11af63e1e2142d3613692769cd6))
|
|
263
|
+
* **web:** fixed the interaction to Select ([10b7b74](https://github.com/serenity-js/serenity-js/commit/10b7b7446743b5866a1b458577ea7d2e11bf5a8f))
|
|
264
|
+
* **web:** optimised PhotoTakingStrategy ([085b7f7](https://github.com/serenity-js/serenity-js/commit/085b7f716033b22207af47edac58c896f46af62d))
|
|
265
|
+
* **web:** removed incorrect export ([ebf80c0](https://github.com/serenity-js/serenity-js/commit/ebf80c019af4db2a847e4b98599bce02b8acef23))
|
|
266
|
+
* **web:** removed incorrect import ([90cb025](https://github.com/serenity-js/serenity-js/commit/90cb0251a00a7bff098376110dcec2f9f2c5d5c0))
|
|
267
|
+
* **web:** removed window-specific APIs from BrowseTheWeb that got replaced by Page ([918f447](https://github.com/serenity-js/serenity-js/commit/918f447c1d8f326fbf5730f1aa61108045556212)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
268
|
+
* **web:** renamed Element and associated classes to PageElement to avoid name conflicts ([1e4204b](https://github.com/serenity-js/serenity-js/commit/1e4204b5507469e6574c87a6d84454e39e8a813e))
|
|
269
|
+
* **web:** renamed PageElementList to PageElements to improve readability ([a9903a7](https://github.com/serenity-js/serenity-js/commit/a9903a7389b00106ef94d2bdb9f86a7fd04be541)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
270
|
+
* **web:** standardised getters across PageElement implementations ([336472b](https://github.com/serenity-js/serenity-js/commit/336472b1a6882412f6a88483e51266909a1d51d0))
|
|
271
|
+
* **web:** wordsmithing of interface names ([5a1e76a](https://github.com/serenity-js/serenity-js/commit/5a1e76a9c162370e17238fcccc9f08e109d543c3))
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
### Features
|
|
275
|
+
|
|
276
|
+
* **core:** question.about produces "props" that proxy the methods of the underlying model ([f771872](https://github.com/serenity-js/serenity-js/commit/f771872c56b487e404002c3800fc8f3baaed804f))
|
|
277
|
+
* **protractor:** compatibility with @serenity-js/web ([9df4db2](https://github.com/serenity-js/serenity-js/commit/9df4db27a6e0ae62bf0d0e679a170d4865041043)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
278
|
+
* **web:** a common way to run the tests for all the web adapters ([c7e584a](https://github.com/serenity-js/serenity-js/commit/c7e584a9bf288ebc7781affdb720097527e8ed3a))
|
|
279
|
+
* **web:** added Page.viewportSize and Page.setViewportSize methods ([4cabbe2](https://github.com/serenity-js/serenity-js/commit/4cabbe21a7fbac3457c6a6ea3d4442a62c3f1f3c))
|
|
280
|
+
* **web:** all Screenplay APIs migrated from @serenity-js/webdriverio to @serenity-js/web ([7b6b95d](https://github.com/serenity-js/serenity-js/commit/7b6b95dc255446c29ae213ba2a1d142d426d16c8))
|
|
281
|
+
* **webdriverio:** support for native WebdriverIO services ([8d5ad22](https://github.com/serenity-js/serenity-js/commit/8d5ad22594cdb2ebddedc58a30259ca8430e360c))
|
|
282
|
+
* **web:** interaction to set a Cookie ([c056439](https://github.com/serenity-js/serenity-js/commit/c056439746a8f57c3edd937b8862f2babb70e94e)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
283
|
+
* **web:** introduced UIElementQuestion to help ensure no NPEs in UI-related questions ([fe29121](https://github.com/serenity-js/serenity-js/commit/fe29121118d630e9fbd73dca85496e20948e26e0))
|
|
284
|
+
* **web:** migrated Photographer from @serenity-js/protractor to @serenity-js/web ([4506dac](https://github.com/serenity-js/serenity-js/commit/4506dacebdf955c32c4eff17bf9982c8e45e2925)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
285
|
+
* **web:** ModalDialog available for both Protractor and WebdriverIO adapters ([ef3c566](https://github.com/serenity-js/serenity-js/commit/ef3c566aed12b52aa22c54058992d369172b8597)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
286
|
+
* **web:** new module @serenity-js/web to provide Web-related Screenplay Pattern APIs ([bead861](https://github.com/serenity-js/serenity-js/commit/bead8612af1a5c99b775e680a3904f44d0281cf9))
|
|
287
|
+
* **web:** page provides an abstraction around browser window ([2e70a3b](https://github.com/serenity-js/serenity-js/commit/2e70a3b6af2e8cc49255820e8a1aaffcc71b76a8))
|
|
288
|
+
* **web:** Page.url() and Page.title() replace Website.url() and Website.title() ([49fe009](https://github.com/serenity-js/serenity-js/commit/49fe0094422ab53ec67d4ba303f80c33e382eebd)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
289
|
+
* **web:** removed Target in favour of PageElement ([69496c4](https://github.com/serenity-js/serenity-js/commit/69496c47c4a1ec7b92e7ab6c83da1559e926f28e)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
290
|
+
* **web:** support for switching browsing context ([a73a635](https://github.com/serenity-js/serenity-js/commit/a73a635f93183d67229acde78e74526564008869)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
291
|
+
* **web:** support for working with cookies ([39cde6d](https://github.com/serenity-js/serenity-js/commit/39cde6de7a36d27a8b1c596493efbec94900af6b)), closes [#805](https://github.com/serenity-js/serenity-js/issues/805)
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
### BREAKING CHANGES
|
|
295
|
+
|
|
296
|
+
* **core:** Introduced @serenity-js/web - a shared library for Serenity/JS Web integration
|
|
297
|
+
modules such as @serenity-js/protractor and @serenity-js/webdriverio. Dropped support for Node 12.
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
6
303
|
# [3.0.0-rc.10](https://github.com/serenity-js/serenity-js/compare/v2.33.0...v3.0.0-rc.10) (2022-02-03)
|
|
7
304
|
|
|
8
305
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ability, Duration, UsesAbilities } from '@serenity-js/core';
|
|
2
2
|
import { Key } from '../../input';
|
|
3
|
-
import { Cookie, CookieData, Locator, ModalDialog, Page,
|
|
3
|
+
import { Cookie, CookieData, Locator, ModalDialog, Page, Selector } from '../models';
|
|
4
4
|
import { BrowserCapabilities } from './BrowserCapabilities';
|
|
5
5
|
export declare abstract class BrowseTheWeb<Native_Element_Type = any, Native_Root_Element_Type = unknown> implements Ability {
|
|
6
6
|
protected locators: Map<new (...args: unknown[]) => Selector, (selector: Selector) => Locator<Native_Element_Type, Native_Root_Element_Type>>;
|
|
@@ -14,7 +14,7 @@ export declare abstract class BrowseTheWeb<Native_Element_Type = any, Native_Roo
|
|
|
14
14
|
* @return {BrowseTheWeb}
|
|
15
15
|
*/
|
|
16
16
|
static as<NET = any, NRET = unknown>(actor: UsesAbilities): BrowseTheWeb<NET, NRET>;
|
|
17
|
-
constructor(locators: Map<new (...args: unknown[]) => Selector, (selector: Selector) => Locator<Native_Element_Type, Native_Root_Element_Type>>);
|
|
17
|
+
protected constructor(locators: Map<new (...args: unknown[]) => Selector, (selector: Selector) => Locator<Native_Element_Type, Native_Root_Element_Type>>);
|
|
18
18
|
abstract navigateTo(destination: string): Promise<void>;
|
|
19
19
|
abstract navigateBack(): Promise<void>;
|
|
20
20
|
abstract navigateForward(): Promise<void>;
|
|
@@ -47,7 +47,4 @@ export declare abstract class BrowseTheWeb<Native_Element_Type = any, Native_Roo
|
|
|
47
47
|
abstract setCookie(cookieData: CookieData): Promise<void>;
|
|
48
48
|
abstract deleteAllCookies(): Promise<void>;
|
|
49
49
|
abstract modalDialog(): Promise<ModalDialog>;
|
|
50
|
-
abstract switchToFrame(targetOrIndex: PageElement | number | string): Promise<void>;
|
|
51
|
-
abstract switchToParentFrame(): Promise<void>;
|
|
52
|
-
abstract switchToDefaultContent(): Promise<void>;
|
|
53
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowseTheWeb.js","sourceRoot":"","sources":["../../../src/screenplay/abilities/BrowseTheWeb.ts"],"names":[],"mappings":";;;AAAA,4CAAoF;AAMpF,MAAsB,YAAY;
|
|
1
|
+
{"version":3,"file":"BrowseTheWeb.js","sourceRoot":"","sources":["../../../src/screenplay/abilities/BrowseTheWeb.ts"],"names":[],"mappings":";;;AAAA,4CAAoF;AAMpF,MAAsB,YAAY;IAe9B,YACc,QAAmI;QAAnI,aAAQ,GAAR,QAAQ,CAA2H;IAEjJ,CAAC;IAhBD;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,CAA4B,KAAoB;QACrD,OAAO,KAAK,CAAC,SAAS,CAAC,YAAY,CAA4B,CAAC;IACpE,CAAC;IAgBD,MAAM,CAAC,QAAkB;QACrB,KAAK,MAAM,CAAE,IAAI,EAAE,cAAc,CAAE,IAAI,IAAI,CAAC,QAAQ,EAAE;YAClD,IAAI,QAAQ,YAAY,IAAI,EAAE;gBAC1B,OAAO,cAAc,CAAC,QAAQ,CAAC,CAAC;aACnC;SACJ;QAED,MAAM,IAAI,iBAAU,CAAC,IAAA,QAAC,EAAC,GAAI,QAAS,wBAAyB,IAAI,CAAC,WAAW,CAAC,IAAK,EAAE,CAAC,CAAC;IAC3F,CAAC;CA0CJ;AA/ED,oCA+EC"}
|
|
@@ -1,150 +1,144 @@
|
|
|
1
1
|
import { Activity, Answerable, AnswersQuestions, Interaction, Task, UsesAbilities } from '@serenity-js/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Switchable } from '../models';
|
|
3
3
|
/**
|
|
4
4
|
* @desc
|
|
5
5
|
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
6
|
-
* to switch to a
|
|
7
|
-
* [inline frame](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe),
|
|
8
|
-
* or browser window/tab.
|
|
6
|
+
* to switch the context for future activities to a {@link Switchable}, such as {@link Page} or {@link PageElement}.
|
|
9
7
|
*
|
|
10
|
-
*
|
|
8
|
+
* Please note that when the {@link PageElement} implementing {@link Switchable} represents an {@link iframe},
|
|
9
|
+
* using {@link Switch} will result in switching the top-level browsing context to that {@link iframe}.
|
|
11
10
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* class LoginForm {
|
|
16
|
-
* static iframe = Target.the('login form').located(by.tagName('iframe'));
|
|
17
|
-
* static usernameField = Target.the('username field').located(by.css('[data-test="username"]'));
|
|
18
|
-
* static passwordField = Target.the('password field').located(by.css('[data-test="password"]'));
|
|
19
|
-
* static submitButton = Target.the('submit button').located(by.css(`button[type='submit']`));
|
|
20
|
-
* }
|
|
21
|
-
*
|
|
22
|
-
* @example <caption>Switch to an iframe and back</caption>
|
|
11
|
+
* When the {@link PageElement} represents any other {@link HTMLElement}, using {@link Switch}
|
|
12
|
+
* sets {@link HTMLElement#focus} on the specified element, if it can be focused.
|
|
13
|
+
* The focused element is the element which will receive keyboard {@link Press} events by default.
|
|
23
14
|
*
|
|
15
|
+
* @example <caption>Perform activities in the context of an iframe</caption>
|
|
24
16
|
* import { actorCalled } from '@serenity-js/core';
|
|
25
|
-
* import {
|
|
26
|
-
* import {
|
|
27
|
-
*
|
|
28
|
-
* actorCalled('Francesca')
|
|
29
|
-
* .whoCan(BrowseTheWeb.using(protractor.browser))
|
|
30
|
-
* .attemptsTo(
|
|
31
|
-
* Switch.toFrame(LoginForm.iframe),
|
|
17
|
+
* import { By, Click, Enter, PageElement, Switch } from '@serenity-js/web';
|
|
18
|
+
* import { BrowseTheWebWithWebdriverIO } from '@serenity-js/webdriverio';
|
|
32
19
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
20
|
+
* // Lean Page Object describing a login form, embedded in an iframe
|
|
21
|
+
* class LoginForm {
|
|
22
|
+
* static iframe = () =>
|
|
23
|
+
* PageElement.located(By.css('iframe'))
|
|
24
|
+
* .describedAs('login form');
|
|
36
25
|
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
26
|
+
* static usernameField = () =>
|
|
27
|
+
* PageElement.located(By.css('[data-testid="username"]'))
|
|
28
|
+
* .describedAs('username field');
|
|
39
29
|
*
|
|
40
|
-
*
|
|
30
|
+
* static passwordField = () =>
|
|
31
|
+
* PageElement.located(By.css('[data-testid="password"]'))
|
|
32
|
+
* .describedAs('password field');
|
|
41
33
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
34
|
+
* static submitButton = () =>
|
|
35
|
+
* PageElement.located(By.css('button[type="submit"]'))
|
|
36
|
+
* .describedAs('submit button');
|
|
37
|
+
* }
|
|
45
38
|
*
|
|
46
39
|
* actorCalled('Francesca')
|
|
47
|
-
* .whoCan(
|
|
40
|
+
* .whoCan(BrowseTheWebWithWebdriverIO.using(browser))
|
|
48
41
|
* .attemptsTo(
|
|
49
|
-
* Switch.
|
|
42
|
+
* Switch.to(LoginForm.iframe).and(
|
|
50
43
|
* Enter.theValue('francesca@example.org').into(LoginForm.usernameField),
|
|
51
44
|
* Enter.theValue('correct-horse-battery-staple').into(LoginForm.passwordField),
|
|
52
45
|
* Click.on(LoginForm.submitButton),
|
|
53
|
-
* )
|
|
54
|
-
*
|
|
55
|
-
* );
|
|
46
|
+
* )
|
|
47
|
+
* )
|
|
56
48
|
*
|
|
57
|
-
* @example <caption>
|
|
49
|
+
* @example <caption>Perform activities in the context of another page</caption>
|
|
58
50
|
*
|
|
59
51
|
* import { actorCalled } from '@serenity-js/core';
|
|
60
|
-
* import {
|
|
61
|
-
* import {
|
|
52
|
+
* import { Click, Enter, Switch } from '@serenity-js/web';
|
|
53
|
+
* import { BrowseTheWebWithWebdriverIO } from '@serenity-js/webdriverio';
|
|
62
54
|
*
|
|
63
55
|
* actorCalled('Francesca')
|
|
64
|
-
* .whoCan(
|
|
56
|
+
* .whoCan(BrowseTheWebWithWebdriverIO.using(browser))
|
|
65
57
|
* .attemptsTo(
|
|
66
|
-
* Switch.
|
|
67
|
-
*
|
|
68
|
-
* // perform some activities in the context of the new window
|
|
58
|
+
* Switch.to(Page.whichName(startsWith('popup'))).and(
|
|
59
|
+
* // perform some activities in the context of the new window
|
|
69
60
|
*
|
|
70
|
-
*
|
|
61
|
+
* // optionally, close the window
|
|
62
|
+
* Page.current().close(),
|
|
63
|
+
* ),
|
|
71
64
|
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
65
|
+
* // Note that switching back to the original page happens automatically
|
|
66
|
+
* // after the last activity from the list finishes
|
|
67
|
+
* )
|
|
74
68
|
*
|
|
75
|
-
* @example <caption>Perform activities in the context of a
|
|
69
|
+
* @example <caption>Perform activities in the context of a focused page element</caption>
|
|
76
70
|
*
|
|
71
|
+
* import { Ensure, equals } from '@serenity-js/assertions';
|
|
77
72
|
* import { actorCalled } from '@serenity-js/core';
|
|
78
|
-
* import {
|
|
79
|
-
* import {
|
|
73
|
+
* import { Key, PageElement, Press, Switch, Value } from '@serenity-js/web';
|
|
74
|
+
* import { BrowseTheWebWithWebdriverIO } from '@serenity-js/webdriverio';
|
|
75
|
+
*
|
|
76
|
+
* const inputField = () =>
|
|
77
|
+
* PageElement.located(By.css('input'));
|
|
80
78
|
*
|
|
81
79
|
* actorCalled('Francesca')
|
|
82
|
-
* .whoCan(
|
|
80
|
+
* .whoCan(BrowseTheWebWithWebdriverIO.using(browser))
|
|
83
81
|
* .attemptsTo(
|
|
84
|
-
* Switch.
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* Close.currentWindow()
|
|
82
|
+
* Switch.to(inputField()).and(
|
|
83
|
+
* Press.the('h', 'e', 'l', 'l', 'o'),
|
|
84
|
+
* Press.the(Key.Tab),
|
|
88
85
|
* ),
|
|
86
|
+
* Ensure.that(Value.of(inputField()), equals('hello'))
|
|
87
|
+
* )
|
|
89
88
|
*
|
|
90
|
-
*
|
|
91
|
-
* );
|
|
89
|
+
* @extends {@serenity-js/core/lib/screenplay~Interaction}
|
|
92
90
|
*
|
|
93
|
-
* @see {@link Close}
|
|
94
91
|
* @see {@link BrowseTheWeb}
|
|
92
|
+
* @see {@link Switchable}
|
|
93
|
+
* @see {@link SwitchableOrigin}
|
|
95
94
|
*/
|
|
96
|
-
export declare class Switch {
|
|
95
|
+
export declare class Switch extends Interaction {
|
|
96
|
+
private readonly switchable;
|
|
97
97
|
/**
|
|
98
98
|
* @desc
|
|
99
|
-
*
|
|
100
|
-
* for future
|
|
101
|
-
* or an [inline frame](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe)
|
|
102
|
-
* identified by its name, index or `Question<ElementFinder>`.
|
|
103
|
-
*
|
|
104
|
-
* @param {Answerable<ElementFinder | number | string>} targetOrIndex
|
|
99
|
+
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
100
|
+
* to switch the context for future activities to a {@link Switchable}, such as {@link Page} or {@link PageElement}.
|
|
105
101
|
*
|
|
106
|
-
* @
|
|
102
|
+
* @param {Answerable<Switchable>} switchable
|
|
107
103
|
*
|
|
108
|
-
* @
|
|
109
|
-
* @see {@link Switch.toDefaultContent}
|
|
110
|
-
* @see {@link Target}
|
|
104
|
+
* @returns {Switch}
|
|
111
105
|
*/
|
|
112
|
-
static
|
|
106
|
+
static to(switchable: Answerable<Switchable>): Switch;
|
|
107
|
+
/**
|
|
108
|
+
* @param {Answerable<Switchable>} switchable
|
|
109
|
+
*/
|
|
110
|
+
constructor(switchable: Answerable<Switchable>);
|
|
113
111
|
/**
|
|
114
112
|
* @desc
|
|
115
|
-
*
|
|
116
|
-
* for future
|
|
117
|
-
*
|
|
113
|
+
* Instructs the {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
114
|
+
* to switch the context for future activities to a {@link Switchable}, such as {@link Page} or {@link PageElement},
|
|
115
|
+
* performs a sequence of `activities`, and then switch the context back.
|
|
118
116
|
*
|
|
119
|
-
*
|
|
117
|
+
* @param {Array<@serenity-js/core/lib/screenplay~Activity>} activities
|
|
118
|
+
* A sequence of activities to perform
|
|
120
119
|
*
|
|
121
|
-
* @returns {@serenity-js/core/lib/screenplay~
|
|
122
|
-
*
|
|
123
|
-
* @see {@link Switch.toFrame}
|
|
124
|
-
* @see https://w3c.github.io/webdriver/#switch-to-parent-frame
|
|
125
|
-
* @see https://w3c.github.io/webdriver/#dfn-current-browsing-context
|
|
120
|
+
* @returns {@serenity-js/core/lib/screenplay~Task}
|
|
126
121
|
*/
|
|
127
|
-
|
|
122
|
+
and(...activities: Activity[]): Task;
|
|
128
123
|
/**
|
|
129
124
|
* @desc
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
* when a page contains [`iframe`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe)s.
|
|
125
|
+
* Makes the provided {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
126
|
+
* perform this {@link @serenity-js/core/lib/screenplay~Activity}.
|
|
133
127
|
*
|
|
134
|
-
* @
|
|
128
|
+
* @param {UsesAbilities & AnswersQuestions} actor
|
|
129
|
+
* @returns {Promise<void>}
|
|
135
130
|
*
|
|
136
|
-
* @see {@link
|
|
131
|
+
* @see {@link @serenity-js/core/lib/screenplay/actor~Actor}
|
|
132
|
+
* @see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities}
|
|
133
|
+
* @see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions}
|
|
134
|
+
* @see {@link @serenity-js/core/lib/screenplay~Activity}
|
|
135
|
+
*/
|
|
136
|
+
performAs(actor: UsesAbilities & AnswersQuestions): Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* @desc
|
|
139
|
+
* Generates a description to be used when reporting this {@link @serenity-js/core/lib/screenplay~Activity}.
|
|
140
|
+
*
|
|
141
|
+
* @returns {string}
|
|
137
142
|
*/
|
|
138
|
-
static toDefaultContent(): Interaction;
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* @package
|
|
142
|
-
*/
|
|
143
|
-
declare class SwitchToFrame extends Interaction {
|
|
144
|
-
private readonly targetOrIndex;
|
|
145
|
-
constructor(targetOrIndex: Answerable<PageElement | number | string>);
|
|
146
|
-
and(...activities: Activity[]): Task;
|
|
147
|
-
performAs(actor: UsesAbilities & AnswersQuestions): PromiseLike<void>;
|
|
148
143
|
toString(): string;
|
|
149
144
|
}
|
|
150
|
-
export {};
|