project/static/tests/project_test_utils.js
2024-04-12 12:07:51 +03:00

7 lines
227 B
JavaScript

/** @odoo-module */
export function getFirstElementForXpath(target, xpath) {
const xPathResult = document.evaluate(xpath, target, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
return xPathResult.singleNodeValue;
}