diff --git a/packages/playwright-core/src/server/injected/domUtils.ts b/packages/playwright-core/src/server/injected/domUtils.ts index b88cb44c0a0f0..563b749fe2215 100644 --- a/packages/playwright-core/src/server/injected/domUtils.ts +++ b/packages/playwright-core/src/server/injected/domUtils.ts @@ -125,3 +125,12 @@ export function isVisibleTextNode(node: Text) { const rect = range.getBoundingClientRect(); return rect.width > 0 && rect.height > 0; } + +export function elementSafeTagName(element: Element) { + // Named inputs, e.g. , will be exposed as fields on the parent
+ `); + expect.soft(await getNameAndRole(page, 'form')).toEqual({ role: 'form', name: 'my form' }); +}); + function toArray(x: any): any[] { return Array.isArray(x) ? x : [x]; }