feat: generate unique css selector based on actin
This commit is contained in:
@@ -448,4 +448,22 @@ export class WorkflowGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private generateSelector = async (page:Page, coordinates:Coordinates, action: ActionType) => {
|
||||||
|
const elementInfo = await getElementInformation(page, coordinates);
|
||||||
|
const bestSelector = getBestSelectorForAction(
|
||||||
|
{
|
||||||
|
type: action,
|
||||||
|
tagName: elementInfo?.tagName as TagName || '',
|
||||||
|
inputType: undefined,
|
||||||
|
value: undefined,
|
||||||
|
selectors: await getSelectors(page, coordinates) || {},
|
||||||
|
timestamp: 0,
|
||||||
|
isPassword: false,
|
||||||
|
hasOnlyText: elementInfo?.hasOnlyText || false,
|
||||||
|
} as Action,
|
||||||
|
);
|
||||||
|
return bestSelector;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user