feat: throw err for non-element node type

This commit is contained in:
karishmas6
2024-06-05 10:44:01 +05:30
parent 01f3381289
commit ebd82480e1

View File

@@ -135,7 +135,11 @@ export const getSelectors = async (page: Page, coordinates: Coordinates) => {
let rootDocument: Document | Element;
function finder(input: Element, options?: Partial<Options>) {
if (input.nodeType !== Node.ELEMENT_NODE) {
throw new Error(`Can't generate CSS selector for non-element node type.`);
}
const defaults: Options = {
root: document.body,
idName: (name: string) => true,