chore: lint
This commit is contained in:
@@ -754,11 +754,23 @@ export const getNonUniqueSelectors = async (page: Page, coordinates: Coordinates
|
|||||||
|
|
||||||
function getSelectorPath(element: HTMLElement | null): string {
|
function getSelectorPath(element: HTMLElement | null): string {
|
||||||
const path: string[] = [];
|
const path: string[] = [];
|
||||||
while (element && element !== document.body) {
|
let depth = 0;
|
||||||
|
const maxDepth = 2; // Limiting the depth of the selector path
|
||||||
|
|
||||||
|
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++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return path.join(' > ');
|
return path.join(' > ');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -781,6 +793,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.
|
||||||
|
|||||||
Reference in New Issue
Block a user