@serenity-js/playwright 3.41.2 → 3.42.1

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.
Files changed (154) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/esm/ExtraBrowserContextOptions.d.ts +36 -0
  3. package/esm/ExtraBrowserContextOptions.d.ts.map +1 -0
  4. package/esm/ExtraBrowserContextOptions.js +2 -0
  5. package/esm/ExtraBrowserContextOptions.js.map +1 -0
  6. package/esm/index.d.ts +4 -0
  7. package/esm/index.d.ts.map +1 -0
  8. package/esm/index.js +4 -0
  9. package/esm/index.js.map +1 -0
  10. package/esm/screenplay/abilities/BrowseTheWebWithPlaywright.d.ts +163 -0
  11. package/esm/screenplay/abilities/BrowseTheWebWithPlaywright.d.ts.map +1 -0
  12. package/esm/screenplay/abilities/BrowseTheWebWithPlaywright.js +168 -0
  13. package/esm/screenplay/abilities/BrowseTheWebWithPlaywright.js.map +1 -0
  14. package/esm/screenplay/abilities/index.d.ts +2 -0
  15. package/esm/screenplay/abilities/index.d.ts.map +1 -0
  16. package/esm/screenplay/abilities/index.js +2 -0
  17. package/esm/screenplay/abilities/index.js.map +1 -0
  18. package/esm/screenplay/index.d.ts +3 -0
  19. package/esm/screenplay/index.d.ts.map +1 -0
  20. package/esm/screenplay/index.js +3 -0
  21. package/esm/screenplay/index.js.map +1 -0
  22. package/esm/screenplay/models/PlaywrightBrowsingSession.d.ts +32 -0
  23. package/esm/screenplay/models/PlaywrightBrowsingSession.d.ts.map +1 -0
  24. package/esm/screenplay/models/PlaywrightBrowsingSession.js +54 -0
  25. package/esm/screenplay/models/PlaywrightBrowsingSession.js.map +1 -0
  26. package/esm/screenplay/models/PlaywrightBrowsingSessionWithBrowser.d.ts +18 -0
  27. package/esm/screenplay/models/PlaywrightBrowsingSessionWithBrowser.d.ts.map +1 -0
  28. package/esm/screenplay/models/PlaywrightBrowsingSessionWithBrowser.js +38 -0
  29. package/esm/screenplay/models/PlaywrightBrowsingSessionWithBrowser.js.map +1 -0
  30. package/esm/screenplay/models/PlaywrightBrowsingSessionWithPage.d.ts +21 -0
  31. package/esm/screenplay/models/PlaywrightBrowsingSessionWithPage.d.ts.map +1 -0
  32. package/esm/screenplay/models/PlaywrightBrowsingSessionWithPage.js +44 -0
  33. package/esm/screenplay/models/PlaywrightBrowsingSessionWithPage.js.map +1 -0
  34. package/esm/screenplay/models/PlaywrightCookie.d.ts +15 -0
  35. package/esm/screenplay/models/PlaywrightCookie.d.ts.map +1 -0
  36. package/esm/screenplay/models/PlaywrightCookie.js +41 -0
  37. package/esm/screenplay/models/PlaywrightCookie.js.map +1 -0
  38. package/esm/screenplay/models/PlaywrightModalDialogHandler.d.ts +19 -0
  39. package/esm/screenplay/models/PlaywrightModalDialogHandler.d.ts.map +1 -0
  40. package/esm/screenplay/models/PlaywrightModalDialogHandler.js +48 -0
  41. package/esm/screenplay/models/PlaywrightModalDialogHandler.js.map +1 -0
  42. package/esm/screenplay/models/PlaywrightPage.d.ts +54 -0
  43. package/esm/screenplay/models/PlaywrightPage.d.ts.map +1 -0
  44. package/esm/screenplay/models/PlaywrightPage.js +190 -0
  45. package/esm/screenplay/models/PlaywrightPage.js.map +1 -0
  46. package/esm/screenplay/models/PlaywrightPageElement.d.ts +33 -0
  47. package/esm/screenplay/models/PlaywrightPageElement.d.ts.map +1 -0
  48. package/esm/screenplay/models/PlaywrightPageElement.js +198 -0
  49. package/esm/screenplay/models/PlaywrightPageElement.js.map +1 -0
  50. package/esm/screenplay/models/index.d.ts +8 -0
  51. package/esm/screenplay/models/index.d.ts.map +1 -0
  52. package/esm/screenplay/models/index.js +8 -0
  53. package/esm/screenplay/models/index.js.map +1 -0
  54. package/esm/screenplay/models/locators/PlaywrightLocator.d.ts +31 -0
  55. package/esm/screenplay/models/locators/PlaywrightLocator.d.ts.map +1 -0
  56. package/esm/screenplay/models/locators/PlaywrightLocator.js +166 -0
  57. package/esm/screenplay/models/locators/PlaywrightLocator.js.map +1 -0
  58. package/esm/screenplay/models/locators/PlaywrightRootLocator.d.ts +39 -0
  59. package/esm/screenplay/models/locators/PlaywrightRootLocator.d.ts.map +1 -0
  60. package/esm/screenplay/models/locators/PlaywrightRootLocator.js +48 -0
  61. package/esm/screenplay/models/locators/PlaywrightRootLocator.js.map +1 -0
  62. package/esm/screenplay/models/locators/index.d.ts +3 -0
  63. package/esm/screenplay/models/locators/index.d.ts.map +1 -0
  64. package/esm/screenplay/models/locators/index.js +3 -0
  65. package/esm/screenplay/models/locators/index.js.map +1 -0
  66. package/esm/screenplay/promised.d.ts +10 -0
  67. package/esm/screenplay/promised.d.ts.map +1 -0
  68. package/esm/screenplay/promised.js +12 -0
  69. package/esm/screenplay/promised.js.map +1 -0
  70. package/esm/selector-engines/PlaywrightSelectorEngine.d.ts +5 -0
  71. package/esm/selector-engines/PlaywrightSelectorEngine.d.ts.map +1 -0
  72. package/esm/selector-engines/PlaywrightSelectorEngine.js +2 -0
  73. package/esm/selector-engines/PlaywrightSelectorEngine.js.map +1 -0
  74. package/esm/selector-engines/SerenitySelectorEngines.d.ts +14 -0
  75. package/esm/selector-engines/SerenitySelectorEngines.d.ts.map +1 -0
  76. package/esm/selector-engines/SerenitySelectorEngines.js +40 -0
  77. package/esm/selector-engines/SerenitySelectorEngines.js.map +1 -0
  78. package/esm/selector-engines/index.d.ts +2 -0
  79. package/esm/selector-engines/index.d.ts.map +1 -0
  80. package/esm/selector-engines/index.js +2 -0
  81. package/esm/selector-engines/index.js.map +1 -0
  82. package/lib/index.d.ts +3 -3
  83. package/lib/index.d.ts.map +1 -1
  84. package/lib/index.js +3 -3
  85. package/lib/index.js.map +1 -1
  86. package/lib/package.json +1 -0
  87. package/lib/screenplay/abilities/BrowseTheWebWithPlaywright.d.ts +1 -1
  88. package/lib/screenplay/abilities/BrowseTheWebWithPlaywright.d.ts.map +1 -1
  89. package/lib/screenplay/abilities/BrowseTheWebWithPlaywright.js +3 -3
  90. package/lib/screenplay/abilities/BrowseTheWebWithPlaywright.js.map +1 -1
  91. package/lib/screenplay/abilities/index.d.ts +1 -1
  92. package/lib/screenplay/abilities/index.d.ts.map +1 -1
  93. package/lib/screenplay/abilities/index.js +1 -1
  94. package/lib/screenplay/abilities/index.js.map +1 -1
  95. package/lib/screenplay/index.d.ts +2 -2
  96. package/lib/screenplay/index.d.ts.map +1 -1
  97. package/lib/screenplay/index.js +2 -2
  98. package/lib/screenplay/index.js.map +1 -1
  99. package/lib/screenplay/models/PlaywrightBrowsingSession.d.ts +3 -3
  100. package/lib/screenplay/models/PlaywrightBrowsingSession.d.ts.map +1 -1
  101. package/lib/screenplay/models/PlaywrightBrowsingSession.js +7 -6
  102. package/lib/screenplay/models/PlaywrightBrowsingSession.js.map +1 -1
  103. package/lib/screenplay/models/PlaywrightBrowsingSessionWithBrowser.d.ts +3 -3
  104. package/lib/screenplay/models/PlaywrightBrowsingSessionWithBrowser.d.ts.map +1 -1
  105. package/lib/screenplay/models/PlaywrightBrowsingSessionWithBrowser.js +2 -2
  106. package/lib/screenplay/models/PlaywrightBrowsingSessionWithBrowser.js.map +1 -1
  107. package/lib/screenplay/models/PlaywrightBrowsingSessionWithPage.d.ts +3 -3
  108. package/lib/screenplay/models/PlaywrightBrowsingSessionWithPage.d.ts.map +1 -1
  109. package/lib/screenplay/models/PlaywrightBrowsingSessionWithPage.js +5 -5
  110. package/lib/screenplay/models/PlaywrightBrowsingSessionWithPage.js.map +1 -1
  111. package/lib/screenplay/models/PlaywrightPage.d.ts +3 -3
  112. package/lib/screenplay/models/PlaywrightPage.d.ts.map +1 -1
  113. package/lib/screenplay/models/PlaywrightPage.js +11 -11
  114. package/lib/screenplay/models/PlaywrightPage.js.map +1 -1
  115. package/lib/screenplay/models/PlaywrightPageElement.js +1 -1
  116. package/lib/screenplay/models/PlaywrightPageElement.js.map +1 -1
  117. package/lib/screenplay/models/index.d.ts +7 -7
  118. package/lib/screenplay/models/index.d.ts.map +1 -1
  119. package/lib/screenplay/models/index.js +7 -7
  120. package/lib/screenplay/models/index.js.map +1 -1
  121. package/lib/screenplay/models/locators/PlaywrightLocator.d.ts +1 -1
  122. package/lib/screenplay/models/locators/PlaywrightLocator.d.ts.map +1 -1
  123. package/lib/screenplay/models/locators/PlaywrightLocator.js +8 -8
  124. package/lib/screenplay/models/locators/PlaywrightLocator.js.map +1 -1
  125. package/lib/screenplay/models/locators/PlaywrightRootLocator.d.ts +2 -1
  126. package/lib/screenplay/models/locators/PlaywrightRootLocator.d.ts.map +1 -1
  127. package/lib/screenplay/models/locators/PlaywrightRootLocator.js +2 -2
  128. package/lib/screenplay/models/locators/PlaywrightRootLocator.js.map +1 -1
  129. package/lib/screenplay/models/locators/index.d.ts +2 -2
  130. package/lib/screenplay/models/locators/index.d.ts.map +1 -1
  131. package/lib/screenplay/models/locators/index.js +2 -2
  132. package/lib/screenplay/models/locators/index.js.map +1 -1
  133. package/lib/selector-engines/index.d.ts +1 -1
  134. package/lib/selector-engines/index.d.ts.map +1 -1
  135. package/lib/selector-engines/index.js +1 -1
  136. package/lib/selector-engines/index.js.map +1 -1
  137. package/package.json +25 -9
  138. package/src/index.ts +3 -3
  139. package/src/screenplay/abilities/BrowseTheWebWithPlaywright.ts +2 -2
  140. package/src/screenplay/abilities/index.ts +1 -1
  141. package/src/screenplay/index.ts +2 -2
  142. package/src/screenplay/models/PlaywrightBrowsingSession.ts +5 -4
  143. package/src/screenplay/models/PlaywrightBrowsingSessionWithBrowser.ts +3 -3
  144. package/src/screenplay/models/PlaywrightBrowsingSessionWithPage.ts +4 -4
  145. package/src/screenplay/models/PlaywrightPage.ts +8 -8
  146. package/src/screenplay/models/PlaywrightPageElement.ts +2 -2
  147. package/src/screenplay/models/index.ts +7 -7
  148. package/src/screenplay/models/locators/PlaywrightLocator.ts +4 -4
  149. package/src/screenplay/models/locators/PlaywrightRootLocator.ts +5 -2
  150. package/src/screenplay/models/locators/index.ts +2 -2
  151. package/src/selector-engines/SerenitySelectorEngines.ts +1 -1
  152. package/src/selector-engines/index.ts +1 -1
  153. package/tsconfig-cjs.build.json +18 -0
  154. package/tsconfig-esm.build.json +18 -0
@@ -0,0 +1,198 @@
1
+ import { LogicError } from '@serenity-js/core';
2
+ import { PageElement, SelectOption } from '@serenity-js/web';
3
+ import * as scripts from '@serenity-js/web/scripts';
4
+ import { ensure, isDefined } from 'tiny-types';
5
+ /**
6
+ * Playwright-specific implementation of [`PageElement`](https://serenity-js.org/api/web/class/PageElement/).
7
+ *
8
+ * @group Models
9
+ */
10
+ export class PlaywrightPageElement extends PageElement {
11
+ of(parent) {
12
+ return new PlaywrightPageElement(this.locator.of(parent.locator));
13
+ }
14
+ closestTo(child) {
15
+ return new PlaywrightPageElement(this.locator.closestTo(child.locator));
16
+ }
17
+ async enterValue(value) {
18
+ const text = [].concat(value).join('');
19
+ const element = await this.nativeElement();
20
+ return element.fill(text);
21
+ }
22
+ async clearValue() {
23
+ try {
24
+ const element = await this.nativeElement();
25
+ await element.fill('');
26
+ }
27
+ catch (error) {
28
+ throw new LogicError(`The input field doesn't seem to have a 'value' attribute that could be cleared`, error);
29
+ }
30
+ }
31
+ async click() {
32
+ const element = await this.nativeElement();
33
+ return element.click();
34
+ }
35
+ async doubleClick() {
36
+ const element = await this.nativeElement();
37
+ return element.dblclick();
38
+ }
39
+ async scrollIntoView() {
40
+ const element = await this.nativeElement();
41
+ return element.scrollIntoViewIfNeeded();
42
+ }
43
+ async hoverOver() {
44
+ const element = await this.nativeElement();
45
+ return element.hover();
46
+ }
47
+ async rightClick() {
48
+ const element = await this.nativeElement();
49
+ return element.click({ button: 'right' });
50
+ }
51
+ async selectOptions(...options) {
52
+ const element = await this.nativeElement();
53
+ const optionsToSelect = options.map(option => ({
54
+ value: option.value,
55
+ label: option.label,
56
+ }));
57
+ await element.selectOption(optionsToSelect);
58
+ }
59
+ async selectedOptions() {
60
+ const element = await this.nativeElement();
61
+ /* c8 ignore start */
62
+ const options = await element.locator('option').evaluateAll((optionNodes) => optionNodes.map((optionNode) => {
63
+ return {
64
+ selected: optionNode.selected,
65
+ disabled: optionNode.disabled,
66
+ label: optionNode.label,
67
+ value: optionNode.value,
68
+ };
69
+ }));
70
+ /* c8 ignore stop */
71
+ return options.map(option => new SelectOption(option.label, option.value, option.selected, option.disabled));
72
+ }
73
+ async dragTo(destination) {
74
+ const elementBeingDragged = await this.nativeElement();
75
+ const destinationElement = await destination.nativeElement();
76
+ // Use force: true to bypass actionability checks on the target element.
77
+ // This is necessary for drop zones that dynamically enable pointer-events
78
+ // only when a drag operation is in progress.
79
+ await elementBeingDragged.dragTo(destinationElement, { force: true });
80
+ }
81
+ async attribute(name) {
82
+ const element = await this.nativeElement();
83
+ return element.getAttribute(name);
84
+ }
85
+ async text() {
86
+ const element = await this.nativeElement();
87
+ return element.innerText();
88
+ }
89
+ async value() {
90
+ const element = await this.nativeElement();
91
+ return element.inputValue();
92
+ }
93
+ async html() {
94
+ const element = await this.nativeElement();
95
+ return element.evaluate(nativeElement => nativeElement.outerHTML);
96
+ }
97
+ async switchTo() {
98
+ try {
99
+ const nativeLocator = await this.nativeElement();
100
+ const element = await nativeLocator.elementHandle();
101
+ const frame = await element.contentFrame();
102
+ if (frame) {
103
+ const locator = this.locator;
104
+ await locator.switchToFrame(nativeLocator);
105
+ return {
106
+ switchBack: async () => {
107
+ await locator.switchToParentFrame();
108
+ }
109
+ };
110
+ }
111
+ /* c8 ignore start */
112
+ const previouslyFocusedElement = await nativeLocator.evaluateHandle((domNode) => {
113
+ const currentlyFocusedElement = document.activeElement;
114
+ domNode.focus();
115
+ return currentlyFocusedElement;
116
+ });
117
+ /* c8 ignore stop */
118
+ return new PreviouslyFocusedElementSwitcher(previouslyFocusedElement);
119
+ }
120
+ catch (error) {
121
+ throw new LogicError(`Couldn't switch to page element located ${this.locator}`, error);
122
+ }
123
+ }
124
+ async isActive() {
125
+ try {
126
+ const element = await this.nativeElement();
127
+ return element.evaluate(domNode => domNode === document.activeElement);
128
+ }
129
+ catch {
130
+ return false;
131
+ }
132
+ }
133
+ async isClickable() {
134
+ try {
135
+ const element = await this.nativeElement();
136
+ await element.click({ trial: true });
137
+ return true;
138
+ }
139
+ catch {
140
+ return false;
141
+ }
142
+ }
143
+ async isEnabled() {
144
+ try {
145
+ const element = await this.nativeElement();
146
+ return element.isEnabled();
147
+ }
148
+ catch {
149
+ return false;
150
+ }
151
+ }
152
+ async isSelected() {
153
+ try {
154
+ const element = await this.nativeElement();
155
+ // works for <option />
156
+ const selected = await element.getAttribute('selected');
157
+ if (selected !== null) {
158
+ return true;
159
+ }
160
+ // works only for checkboxes and radio buttons, throws for other elements
161
+ return await element.isChecked();
162
+ }
163
+ catch {
164
+ return false;
165
+ }
166
+ }
167
+ async isVisible() {
168
+ try {
169
+ const element = await this.nativeElement();
170
+ const isVisible = await element.isVisible();
171
+ if (!isVisible) {
172
+ return false;
173
+ }
174
+ return await element.evaluate(scripts.isVisible);
175
+ }
176
+ catch {
177
+ return false;
178
+ }
179
+ }
180
+ }
181
+ /**
182
+ * @private
183
+ */
184
+ class PreviouslyFocusedElementSwitcher {
185
+ node;
186
+ constructor(node) {
187
+ this.node = node;
188
+ ensure('DOM element', node, isDefined());
189
+ }
190
+ async switchBack() {
191
+ /* c8 ignore start */
192
+ await this.node.evaluate((domNode) => {
193
+ domNode.focus();
194
+ }, this.node);
195
+ /* c8 ignore stop */
196
+ }
197
+ }
198
+ //# sourceMappingURL=PlaywrightPageElement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlaywrightPageElement.js","sourceRoot":"","sources":["../../../src/screenplay/models/PlaywrightPageElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,OAAO,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAI/C;;;;GAIG;AACH,MAAM,OAAO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GAAJ,IAAI,CAAqB;QAClD,MAAM,CAAC,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,UAAU;QACZ,qBAAqB;QACrB,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CACpB,CAAC,OAAoB,EAAE,EAAE;YACrB,OAAO,CAAC,KAAK,EAAE,CAAC;QACpB,CAAC,EACD,IAAI,CAAC,IAAI,CACZ,CAAC;QACF,oBAAoB;IACxB,CAAC;CACJ"}
@@ -0,0 +1,8 @@
1
+ export * from './locators/index.js';
2
+ export * from './PlaywrightBrowsingSession.js';
3
+ export * from './PlaywrightBrowsingSessionWithBrowser.js';
4
+ export * from './PlaywrightBrowsingSessionWithPage.js';
5
+ export * from './PlaywrightCookie.js';
6
+ export * from './PlaywrightPage.js';
7
+ export * from './PlaywrightPageElement.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screenplay/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wCAAwC,CAAC;AACvD,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC"}
@@ -0,0 +1,8 @@
1
+ export * from './locators/index.js';
2
+ export * from './PlaywrightBrowsingSession.js';
3
+ export * from './PlaywrightBrowsingSessionWithBrowser.js';
4
+ export * from './PlaywrightBrowsingSessionWithPage.js';
5
+ export * from './PlaywrightCookie.js';
6
+ export * from './PlaywrightPage.js';
7
+ export * from './PlaywrightPageElement.js';
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/screenplay/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wCAAwC,CAAC;AACvD,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { PageElement, RootLocator, Selector } from '@serenity-js/web';
2
+ import { Locator } from '@serenity-js/web';
3
+ import type * as playwright from 'playwright-core';
4
+ import type { PlaywrightRootLocator } from './PlaywrightRootLocator.js';
5
+ /**
6
+ * Playwright-specific implementation of [`Locator`](https://serenity-js.org/api/web/class/Locator/).
7
+ *
8
+ * @group Models
9
+ */
10
+ export declare class PlaywrightLocator extends Locator<playwright.Locator, string> {
11
+ constructor(parent: RootLocator<playwright.Locator>, selector: Selector);
12
+ protected nativeSelector(): string;
13
+ isPresent(): Promise<boolean>;
14
+ nativeElement(): Promise<playwright.Locator>;
15
+ allNativeElements(): Promise<Array<playwright.Locator>>;
16
+ of(parent: PlaywrightRootLocator): Locator<playwright.Locator, string>;
17
+ closestTo(child: PlaywrightLocator): Locator<playwright.Locator, string>;
18
+ locate(child: PlaywrightLocator): Locator<playwright.Locator, string>;
19
+ element(): PageElement<playwright.Locator>;
20
+ allElements(): Promise<Array<PageElement<playwright.Locator>>>;
21
+ }
22
+ /**
23
+ * @internal
24
+ */
25
+ export declare class PlaywrightExistingElementLocator extends PlaywrightLocator {
26
+ private readonly existingNativeElement;
27
+ constructor(parent: RootLocator<playwright.Locator>, selector: Selector, existingNativeElement: playwright.Locator);
28
+ nativeElement(): Promise<playwright.Locator>;
29
+ allNativeElements(): Promise<Array<playwright.Locator>>;
30
+ }
31
+ //# sourceMappingURL=PlaywrightLocator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlaywrightLocator.d.ts","sourceRoot":"","sources":["../../../../src/screenplay/models/locators/PlaywrightLocator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAyB,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,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,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC;IAI5C,iBAAiB,IAAI,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;CAGhE"}
@@ -0,0 +1,166 @@
1
+ import { f, LogicError } from '@serenity-js/core';
2
+ import { ByCss, ByCssContainingText, ByDeepCss, ById, ByRole, ByTagName, ByXPath, Locator } from '@serenity-js/web';
3
+ import { SerenitySelectorEngines } from '../../../selector-engines/index.js';
4
+ import { promised } from '../../promised.js';
5
+ import { PlaywrightPageElement } from '../PlaywrightPageElement.js';
6
+ /**
7
+ * Playwright-specific implementation of [`Locator`](https://serenity-js.org/api/web/class/Locator/).
8
+ *
9
+ * @group Models
10
+ */
11
+ export class PlaywrightLocator extends Locator {
12
+ constructor(parent, selector) {
13
+ super(parent, selector);
14
+ }
15
+ // todo: refactor; replace with a map and some more generic lookup mechanism
16
+ nativeSelector() {
17
+ if (this.selector instanceof ByCss) {
18
+ return `css=${this.selector.value}`;
19
+ }
20
+ if (this.selector instanceof ByDeepCss) {
21
+ return `css=${this.selector.value}`;
22
+ }
23
+ if (this.selector instanceof ByCssContainingText) {
24
+ return `css=${this.selector.value}:has-text("${this.selector.text}")`;
25
+ }
26
+ if (this.selector instanceof ById) {
27
+ return `id=${this.selector.value}`;
28
+ }
29
+ if (this.selector instanceof ByRole) {
30
+ return getByRoleSelector(this.selector.value, this.selector.options);
31
+ }
32
+ if (this.selector instanceof ByTagName) {
33
+ return `css=${this.selector.value}`;
34
+ }
35
+ if (this.selector instanceof ByXPath) {
36
+ return `xpath=${this.selector.value}`;
37
+ }
38
+ throw new LogicError(f `${this.selector} is not supported by ${this.constructor.name}`);
39
+ }
40
+ async isPresent() {
41
+ try {
42
+ const parentPresent = await this.parent.isPresent();
43
+ if (!parentPresent) {
44
+ return false;
45
+ }
46
+ const parent = await this.parent.nativeElement();
47
+ await parent.locator(this.nativeSelector()).first().waitFor({ state: 'attached', timeout: 250 });
48
+ return true;
49
+ }
50
+ catch (error) {
51
+ if (error.name === 'TimeoutError') {
52
+ return false;
53
+ }
54
+ throw error;
55
+ }
56
+ }
57
+ async nativeElement() {
58
+ const parent = await this.parent.nativeElement();
59
+ return promised(parent.locator(this.nativeSelector()));
60
+ }
61
+ async allNativeElements() {
62
+ const parent = await this.parent.nativeElement();
63
+ if (!parent) {
64
+ return [];
65
+ }
66
+ return promised(parent.locator(this.nativeSelector()).all());
67
+ }
68
+ of(parent) {
69
+ return new PlaywrightLocator(parent, this.selector);
70
+ }
71
+ closestTo(child) {
72
+ return new PlaywrightParentElementLocator(this.parent, this.selector, child);
73
+ }
74
+ locate(child) {
75
+ return new PlaywrightLocator(this, child.selector);
76
+ }
77
+ element() {
78
+ return new PlaywrightPageElement(this);
79
+ }
80
+ async allElements() {
81
+ const elements = await this.allNativeElements();
82
+ return elements.map(childElement => new PlaywrightPageElement(new PlaywrightExistingElementLocator(this.parent, this.selector, childElement)));
83
+ }
84
+ }
85
+ /**
86
+ * @internal
87
+ */
88
+ export class PlaywrightExistingElementLocator extends PlaywrightLocator {
89
+ existingNativeElement;
90
+ constructor(parent, selector, existingNativeElement) {
91
+ super(parent, selector);
92
+ this.existingNativeElement = existingNativeElement;
93
+ }
94
+ async nativeElement() {
95
+ return this.existingNativeElement;
96
+ }
97
+ async allNativeElements() {
98
+ return [this.existingNativeElement];
99
+ }
100
+ }
101
+ class PlaywrightParentElementLocator extends PlaywrightLocator {
102
+ child;
103
+ constructor(parent, selector, child) {
104
+ super(parent, selector);
105
+ this.child = child;
106
+ }
107
+ async nativeElement() {
108
+ const cssSelector = this.asCssSelector(this.selector);
109
+ const child = await this.child.nativeElement();
110
+ return child.locator(`${SerenitySelectorEngines.engineIdOf('closest')}=${cssSelector.value}`);
111
+ }
112
+ async allNativeElements() {
113
+ return [await this.nativeElement()];
114
+ }
115
+ }
116
+ // Playwright doesn't expose the internal locator utilities, so unfortunately we need to re-implement them here.
117
+ // https://github.com/microsoft/playwright/blob/release-1.55/packages/playwright-core/src/utils/isomorphic/locatorUtils.ts#L59
118
+ function getByRoleSelector(role, options = {}) {
119
+ const props = [];
120
+ if (options.checked !== undefined) {
121
+ props.push(['checked', String(options.checked)]);
122
+ }
123
+ if (options.disabled !== undefined) {
124
+ props.push(['disabled', String(options.disabled)]);
125
+ }
126
+ if (options.selected !== undefined) {
127
+ props.push(['selected', String(options.selected)]);
128
+ }
129
+ if (options.expanded !== undefined) {
130
+ props.push(['expanded', String(options.expanded)]);
131
+ }
132
+ if (options.includeHidden !== undefined) {
133
+ props.push(['include-hidden', String(options.includeHidden)]);
134
+ }
135
+ if (options.level !== undefined) {
136
+ props.push(['level', String(options.level)]);
137
+ }
138
+ if (options.name !== undefined) {
139
+ props.push(['name', escapeForAttributeSelector(options.name, !!options.exact)]);
140
+ }
141
+ if (options.pressed !== undefined) {
142
+ props.push(['pressed', String(options.pressed)]);
143
+ }
144
+ return `role=${role}${props.map(([n, v]) => `[${n}=${v}]`).join('')}`;
145
+ }
146
+ // https://github.com/microsoft/playwright/blob/release-1.55/packages/playwright-core/src/utils/isomorphic/stringUtils.ts#L92
147
+ function escapeForAttributeSelector(value, exact) {
148
+ if (typeof value !== 'string') {
149
+ return escapeRegexForSelector(value);
150
+ }
151
+ // However, Playwright attribute selectors do not conform to CSS parsing spec,
152
+ // so we escape them differently.
153
+ return `"${value.replaceAll('\\', '\\\\').replaceAll('"', '\\"')}"${exact ? 's' : 'i'}`;
154
+ }
155
+ // https://github.com/microsoft/playwright/blob/release-1.55/packages/playwright-core/src/utils/isomorphic/stringUtils.ts#L75
156
+ function escapeRegexForSelector(re) {
157
+ // Unicode mode does not allow "identity character escapes", so Playwright does not escape and
158
+ // hopes that it does not contain quotes and/or >> signs.
159
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Character_escape
160
+ if (re['unicode'] || re['unicodeSets']) {
161
+ return String(re);
162
+ }
163
+ // Even number of backslashes followed by the quote -> insert a backslash.
164
+ return String(re).replaceAll(/(^|[^\\])(\\\\)*(["'`])/g, '$1$2\\$3').replaceAll('>>', '\\>\\>');
165
+ }
166
+ //# sourceMappingURL=PlaywrightLocator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlaywrightLocator.js","sourceRoot":"","sources":["../../../../src/screenplay/models/locators/PlaywrightLocator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAGpH,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAGpE;;;;GAIG;AACH,MAAM,OAAO,iBAAkB,SAAQ,OAAmC;IAEtE,YACI,MAAuC,EACvC,QAAkB;QAElB,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC5B,CAAC;IAED,4EAA4E;IAClE,cAAc;QACpB,IAAI,IAAI,CAAC,QAAQ,YAAY,KAAK,EAAE,CAAC;YACjC,OAAO,OAAQ,IAAI,CAAC,QAAQ,CAAC,KAAM,EAAE,CAAC;QAC1C,CAAC;QAED,IAAI,IAAI,CAAC,QAAQ,YAAY,SAAS,EAAE,CAAC;YACrC,OAAO,OAAQ,IAAI,CAAC,QAAQ,CAAC,KAAM,EAAE,CAAC;QAC1C,CAAC;QAED,IAAI,IAAI,CAAC,QAAQ,YAAY,mBAAmB,EAAE,CAAC;YAC/C,OAAO,OAAQ,IAAI,CAAC,QAAQ,CAAC,KAAM,cAAe,IAAI,CAAC,QAAQ,CAAC,IAAK,IAAI,CAAC;QAC9E,CAAC;QAED,IAAI,IAAI,CAAC,QAAQ,YAAY,IAAI,EAAE,CAAC;YA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AC,CAAC,CAAC;IACrD,CAAC;IAED,OAAO,QAAQ,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;AAC1E,CAAC;AAED,6HAA6H;AAC7H,SAAS,0BAA0B,CAAC,KAAsB,EAAE,KAAc;IACtE,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,sBAAsB,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;IACD,8EAA8E;IAC9E,iCAAiC;IACjC,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;AAC5F,CAAC;AAED,6HAA6H;AAC7H,SAAS,sBAAsB,CAAC,EAAU;IACtC,8FAA8F;IAC9F,yDAAyD;IACzD,yGAAyG;IACzG,IAAI,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC;QACrC,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC;IACtB,CAAC;IACD,0EAA0E;IAC1E,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,0BAA0B,EAAE,UAAU,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACpG,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { RootLocator } from '@serenity-js/web';
2
+ import type * as playwright from 'playwright-core';
3
+ type PageFunction<Argument, R> = string | ((arg: Argument) => R | Promise<R>);
4
+ /**
5
+ * Playwright-specific implementation of [`RootLocator`](https://serenity-js.org/api/web/class/RootLocator/).
6
+ *
7
+ * @group Models
8
+ */
9
+ export declare class PlaywrightRootLocator extends RootLocator<playwright.Locator> {
10
+ private readonly page;
11
+ private currentFrame;
12
+ constructor(page: playwright.Page);
13
+ isPresent(): Promise<boolean>;
14
+ nativeElement(): Promise<Pick<playwright.Locator, 'locator'>>;
15
+ /**
16
+ * Evaluates the given `pageFunction` in the context of the current frame.
17
+ * See [`playwright.Frame.evaluate`](https://playwright.dev/docs/api/class-frame#frame-evaluate).
18
+ *
19
+ * @param pageFunction
20
+ * @param arg
21
+ */
22
+ evaluate<R, Arguments>(pageFunction: PageFunction<Arguments, R>, arg: Arguments): Promise<R>;
23
+ /**
24
+ * Switches the current context to the frame identified by the given locator.
25
+ *
26
+ * @param frame
27
+ */
28
+ switchToFrame(frame: playwright.Locator): Promise<void>;
29
+ /**
30
+ * Switches the current context to the parent frame of the current frame.
31
+ */
32
+ switchToParentFrame(): Promise<void>;
33
+ /**
34
+ * Switches the context to the top-level frame.
35
+ */
36
+ switchToMainFrame(): Promise<void>;
37
+ }
38
+ export {};
39
+ //# sourceMappingURL=PlaywrightRootLocator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlaywrightRootLocator.d.ts","sourceRoot":"","sources":["../../../../src/screenplay/models/locators/PlaywrightRootLocator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAOnD,KAAK,YAAY,CAAC,QAAQ,EAAE,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,QAAQ,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9E;;;;GAIG;AACH,qBAAa,qBAAsB,SAAQ,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC;IAI1D,OAAO,CAAC,QAAQ,CAAC,IAAI;IAFjC,OAAO,CAAC,YAAY,CAAmB;gBAEV,IAAI,EAAE,UAAU,CAAC,IAAI;IAK5C,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IAInC,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAI7D;;;;;;OAMG;IACH,QAAQ,CAAC,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC;IAK5F;;;;OAIG;IACG,aAAa,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAK7D;;OAEG;IACG,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAI1C;;OAEG;IACG,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;CAG3C"}
@@ -0,0 +1,48 @@
1
+ import { RootLocator } from '@serenity-js/web';
2
+ import { ensure, isDefined } from 'tiny-types';
3
+ import { promised } from '../../promised.js';
4
+ /**
5
+ * Playwright-specific implementation of [`RootLocator`](https://serenity-js.org/api/web/class/RootLocator/).
6
+ *
7
+ * @group Models
8
+ */
9
+ export class PlaywrightRootLocator extends RootLocator {
10
+ page;
11
+ currentFrame;
12
+ constructor(page) {
13
+ super();
14
+ this.page = page;
15
+ this.currentFrame = this.page.mainFrame();
16
+ }
17
+ async isPresent() {
18
+ return true;
19
+ }
20
+ nativeElement() {
21
+ return promised(this.currentFrame);
22
+ }
23
+ evaluate(pageFunction, arg) {
24
+ return this.currentFrame.evaluate(pageFunction, arg);
25
+ }
26
+ /**
27
+ * Switches the current context to the frame identified by the given locator.
28
+ *
29
+ * @param frame
30
+ */
31
+ async switchToFrame(frame) {
32
+ const element = await frame.elementHandle();
33
+ this.currentFrame = ensure('frame', await element.contentFrame(), isDefined());
34
+ }
35
+ /**
36
+ * Switches the current context to the parent frame of the current frame.
37
+ */
38
+ async switchToParentFrame() {
39
+ this.currentFrame = ensure('parent frame', this.currentFrame.parentFrame(), isDefined());
40
+ }
41
+ /**
42
+ * Switches the context to the top-level frame.
43
+ */
44
+ async switchToMainFrame() {
45
+ this.currentFrame = this.page.mainFrame();
46
+ }
47
+ }
48
+ //# sourceMappingURL=PlaywrightRootLocator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlaywrightRootLocator.js","sourceRoot":"","sources":["../../../../src/screenplay/models/locators/PlaywrightRootLocator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAM7C;;;;GAIG;AACH,MAAM,OAAO,qBAAsB,SAAQ,WAA+B;IAIzC;IAFrB,YAAY,CAAmB;IAEvC,YAA6B,IAAqB;QAC9C,KAAK,EAAE,CAAC;QADiB,SAAI,GAAJ,IAAI,CAAiB;QAE9C,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,SAAS;QACX,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,aAAa;QACT,OAAO,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACvC,CAAC;IAUD,QAAQ,CAAI,YAAmC,EAAE,GAAS;QACtD,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;IACzD,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,aAAa,CAAC,KAAyB;QACzC,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,aAAa,EAAE,CAAC;QAC5C,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;IACnF,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,mBAAmB;QACrB,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,cAAc,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;IAC7F,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,iBAAiB;QACnB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;IAC9C,CAAC;CACJ"}
@@ -0,0 +1,3 @@
1
+ export * from './PlaywrightLocator.js';
2
+ export * from './PlaywrightRootLocator.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/screenplay/models/locators/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './PlaywrightLocator.js';
2
+ export * from './PlaywrightRootLocator.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/screenplay/models/locators/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Playwright 1.33.0 and newer rely on "zones" recorded in the stack trace
3
+ * to establish child-parent relationship between Playwright tasks.
4
+ *
5
+ * This helper function ensures that the stack trace is correctly recorded.
6
+ *
7
+ * @param value
8
+ */
9
+ export declare function promised<T>(value: Promise<T> | T): Promise<T>;
10
+ //# sourceMappingURL=promised.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promised.d.ts","sourceRoot":"","sources":["../../src/screenplay/promised.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAE7D"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Playwright 1.33.0 and newer rely on "zones" recorded in the stack trace
3
+ * to establish child-parent relationship between Playwright tasks.
4
+ *
5
+ * This helper function ensures that the stack trace is correctly recorded.
6
+ *
7
+ * @param value
8
+ */
9
+ export function promised(value) {
10
+ return Promise.resolve().then(() => value);
11
+ }
12
+ //# sourceMappingURL=promised.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promised.js","sourceRoot":"","sources":["../../src/screenplay/promised.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CAAI,KAAqB;IAC7C,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,5 @@
1
+ export interface PlaywrightSelectorEngine {
2
+ query(root: Element, selector: string): HTMLElement;
3
+ queryAll(root: Element, selector: string): Array<HTMLElement>;
4
+ }
5
+ //# sourceMappingURL=PlaywrightSelectorEngine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlaywrightSelectorEngine.d.ts","sourceRoot":"","sources":["../../src/selector-engines/PlaywrightSelectorEngine.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wBAAwB;IACrC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,WAAW,CAAC;IACpD,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC;CACjE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=PlaywrightSelectorEngine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlaywrightSelectorEngine.js","sourceRoot":"","sources":["../../src/selector-engines/PlaywrightSelectorEngine.ts"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ import type { Selectors } from 'playwright-core';
2
+ /**
3
+ * Utility class responsible for registering custom [Playwright selector engines](https://playwright.dev/docs/extensibility)
4
+ * used internally by Serenity/JS.
5
+ *
6
+ * @internal
7
+ */
8
+ export declare class SerenitySelectorEngines {
9
+ private static isRegistered;
10
+ private static readonly engines;
11
+ ensureRegisteredWith(selectors: Selectors): Promise<void>;
12
+ static engineIdOf(engineName: string): string;
13
+ }
14
+ //# sourceMappingURL=SerenitySelectorEngines.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SerenitySelectorEngines.d.ts","sourceRoot":"","sources":["../../src/selector-engines/SerenitySelectorEngines.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIjD;;;;;GAKG;AACH,qBAAa,uBAAuB;IAChC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAS;IACpC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAS5B;IAEG,oBAAoB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAa/D,MAAM,CAAC,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;CAOhD"}