@one2x/playwright-core 1.57.0-alpha.14 → 1.57.0-alpha.16
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/lib/server/dom.js +4 -8
- package/package.json +1 -1
- package/types/types.d.ts +8 -0
package/lib/server/dom.js
CHANGED
|
@@ -183,19 +183,15 @@ class ElementHandle extends js.JSHandle {
|
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
const metadata = [];
|
|
186
|
-
if (ariaRef?.ref)
|
|
186
|
+
if (ariaRef?.ref)
|
|
187
187
|
metadata.push(`ref=${ariaRef.ref}`);
|
|
188
|
-
|
|
189
|
-
if (ariaRef?.role && ariaRef.role !== "generic") {
|
|
188
|
+
if (ariaRef?.role && ariaRef.role !== "generic")
|
|
190
189
|
metadata.push(`role=${ariaRef.role}`);
|
|
191
|
-
}
|
|
192
190
|
const testId = current.getAttribute("data-testid");
|
|
193
|
-
if (testId)
|
|
191
|
+
if (testId)
|
|
194
192
|
metadata.push(`testid=${testId}`);
|
|
195
|
-
|
|
196
|
-
if (metadata.length > 0) {
|
|
193
|
+
if (metadata.length > 0)
|
|
197
194
|
nodeInfo += metadata.map((m) => `[${m}]`).join("");
|
|
198
|
-
}
|
|
199
195
|
path.unshift(nodeInfo);
|
|
200
196
|
current = current.parentElement;
|
|
201
197
|
}
|
package/package.json
CHANGED
package/types/types.d.ts
CHANGED
|
@@ -11413,6 +11413,14 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
|
|
|
11413
11413
|
*/
|
|
11414
11414
|
getAttribute(name: string): Promise<null|string>;
|
|
11415
11415
|
|
|
11416
|
+
/**
|
|
11417
|
+
* **NOTE** Use locator-based methods instead. Read more about [locators](https://playwright.dev/docs/locators).
|
|
11418
|
+
*
|
|
11419
|
+
* Returns a CSS selector-like path representing the element's position in the DOM tree, enhanced with aria-ref
|
|
11420
|
+
* attributes, roles, and test IDs where available.
|
|
11421
|
+
*/
|
|
11422
|
+
getPathWithRefs(): Promise<string>;
|
|
11423
|
+
|
|
11416
11424
|
/**
|
|
11417
11425
|
* **NOTE** Use locator-based [locator.hover([options])](https://playwright.dev/docs/api/class-locator#locator-hover) instead.
|
|
11418
11426
|
* Read more about [locators](https://playwright.dev/docs/locators).
|