fix: remove hard-coded selectors for selector path

This commit is contained in:
karishmas6
2024-09-02 11:54:02 +05:30
parent 002e17b596
commit ab7f5f969b

View File

@@ -760,12 +760,6 @@ export const getNonUniqueSelectors = async (page: Page, coordinates: Coordinates
while (element && element !== document.body && depth < maxDepth) { while (element && element !== document.body && depth < maxDepth) {
const selector = getNonUniqueSelector(element); const selector = getNonUniqueSelector(element);
// Stop adding selectors when we reach certain container elements
if (selector.includes('quotes') || selector.includes('container')) {
path.unshift(selector);
break;
}
path.unshift(selector); path.unshift(selector);
element = element.parentElement; element = element.parentElement;
depth++; depth++;
@@ -790,6 +784,7 @@ export const getNonUniqueSelectors = async (page: Page, coordinates: Coordinates
} }
}; };
/** /**
* Returns the first pair from the given workflow that contains the given selector * Returns the first pair from the given workflow that contains the given selector
* inside the where condition, and it is the only selector there. * inside the where condition, and it is the only selector there.