feat: loop through each el in the path except the first and last
This commit is contained in:
@@ -439,9 +439,15 @@ export const getSelectors = async (page: Page, coordinates: Coordinates) => {
|
|||||||
}
|
}
|
||||||
): Generator<Node[]> {
|
): Generator<Node[]> {
|
||||||
if (path.length > 2 && path.length > config.optimizedMinLength) {
|
if (path.length > 2 && path.length > config.optimizedMinLength) {
|
||||||
|
for (let i = 1; i < path.length - 1; i++) {
|
||||||
|
if (scope.counter > config.maxNumberOfTries) {
|
||||||
|
return; // Okay At least I tried!
|
||||||
|
}
|
||||||
|
scope.counter += 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function same(path: Path, input: Element) {
|
function same(path: Path, input: Element) {
|
||||||
return rootDocument.querySelector(selector(path)) === input;
|
return rootDocument.querySelector(selector(path)) === input;
|
||||||
|
|||||||
Reference in New Issue
Block a user