From c2264b66c87269b44446275a6fcdb5606e4b4074 Mon Sep 17 00:00:00 2001 From: Rohit Rajan Date: Wed, 22 Oct 2025 21:04:24 +0530 Subject: [PATCH] fix: child selector gen specificity --- src/helpers/clientSelectorGenerator.ts | 46 -------------------------- 1 file changed, 46 deletions(-) diff --git a/src/helpers/clientSelectorGenerator.ts b/src/helpers/clientSelectorGenerator.ts index d4e5051c..03ad67a2 100644 --- a/src/helpers/clientSelectorGenerator.ts +++ b/src/helpers/clientSelectorGenerator.ts @@ -2713,52 +2713,6 @@ class ClientSelectorGenerator { } } - const testId = element.getAttribute("data-testid"); - if (testId && !addPositionToAll) { - const isCommon = this.isAttributeCommonAcrossLists( - element, - "data-testid", - testId, - otherListElements - ); - if (isCommon) { - return `${tagName}[@data-testid='${testId}']`; - } - } - - if (element.id && !element.id.match(/^\d/) && !addPositionToAll) { - const isCommon = this.isAttributeCommonAcrossLists( - element, - "id", - element.id, - otherListElements - ); - if (isCommon) { - return `${tagName}[@id='${element.id}']`; - } - } - - if (!addPositionToAll) { - for (const attr of Array.from(element.attributes)) { - if ( - attr.name.startsWith("data-") && - attr.name !== "data-testid" && - attr.name !== "data-mx-id" && - attr.value - ) { - const isCommon = this.isAttributeCommonAcrossLists( - element, - attr.name, - attr.value, - otherListElements - ); - if (isCommon) { - return `${tagName}[@${attr.name}='${attr.value}']`; - } - } - } - } - const position = this.getSiblingPosition(element, parent); if (addPositionToAll || classes.length === 0) {