@applitools/snippets
Advanced tools
Comparing version 2.5.0 to 2.5.1
# Changelog | ||
## [2.5.1](https://github.com/Applitools-Dev/sdk/compare/js/snippets@2.5.0...js/snippets@2.5.1) (2024-10-21) | ||
### Bug Fixes | ||
* isStaleElement error ([#2567](https://github.com/Applitools-Dev/sdk/issues/2567)) ([2675086](https://github.com/Applitools-Dev/sdk/commit/2675086aa28589082249e2958942ee29a5f2ef12)) | ||
## [2.5.0](https://github.com/Applitools-Dev/sdk/compare/js/snippets@2.4.27...js/snippets@2.5.0) (2024-09-16) | ||
@@ -4,0 +11,0 @@ |
exports.addElementIds=function(arg){ | ||
var s=function(){"use strict";function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var e=function(t){var e=(void 0===t?[null]:t)[0];if(!(e&&e instanceof Node))return!0;for(var o=e;o;){if(o===document)return!1;if(null===o.parentNode&&o!==document)return!0;o=(null==o.getRootNode?void 0:o.getRootNode().host)||o.parentNode||o.host}return!0};function o(t,r){if(e([t])){var n=function(t){if(null==t||!t.getAttribute)throw new Error("invalid element: "+JSON.stringify(t));var e=t.getAttribute("data-applitools-fallback-selector");if(!e)throw new Error("Failed to recover from stale element");return e}(t),a=document.querySelector(n);if(!a)throw new Error("Failed to recover from stale element - selector found: "+n);return a.setAttribute("data-applitools-selector",r),a.setAttribute("data-applitools-recovered",!0),o(a,r)}!function(t){t.hasAttribute("data-applitools-fallback-selector")||t.setAttribute("data-applitools-fallback-selector",function(t){var e=[];for(;t&&t.nodeType===Node.ELEMENT_NODE;){var o=t.tagName.toLowerCase(),r=[].slice.call(t.parentNode.children||[]).indexOf(t)+1;r>1&&(o+=":nth-child("+r+")"),e.unshift(o),t=t.parentNode}return e.length?e.join(" > "):"html"}(t))}(t);var l=t.getAttribute("data-applitools-selector"),u=l?l+" "+r:r;return t.setAttribute("data-applitools-selector",u),'[data-applitools-selector~="'+r+'"]'}return t((function(t){return t.map((function(t){var e=t[0],r=t[1];return e.map((function(t){var e=function(t){var e=[t];if(t.getRootNode)for(var o=t.getRootNode();o!==document&&o.constructor&&"ShadowRoot"===o.constructor.name;o=o.host.getRootNode())e.push(o.host);return e}(t);return e.map((function(t){return o(t,r)}))}))}))}))}(); | ||
var s=function(){"use strict";function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var e=function(t){var e=(void 0===t?[null]:t)[0];if(!e||!e.nodeType)return!0;for(var o=e;o;){if(o===document)return!1;if(null===o.parentNode&&o!==document)return!0;o=(null==o.getRootNode?void 0:o.getRootNode().host)||o.parentNode||o.host}return!0};function o(t,r){if(e([t])){var n=function(t){if(null==t||!t.getAttribute)throw new Error("invalid element: "+JSON.stringify(t));var e=t.getAttribute("data-applitools-fallback-selector");if(!e)throw new Error("Failed to recover from stale element");return e}(t),a=document.querySelector(n);if(!a)throw new Error("Failed to recover from stale element - selector found: "+n);return a.setAttribute("data-applitools-selector",r),a.setAttribute("data-applitools-recovered",!0),o(a,r)}!function(t){t.hasAttribute("data-applitools-fallback-selector")||t.setAttribute("data-applitools-fallback-selector",function(t){var e=[];for(;t&&t.nodeType===Node.ELEMENT_NODE;){var o=t.tagName.toLowerCase(),r=[].slice.call(t.parentNode.children||[]).indexOf(t)+1;r>1&&(o+=":nth-child("+r+")"),e.unshift(o),t=t.parentNode}return e.length?e.join(" > "):"html"}(t))}(t);var l=t.getAttribute("data-applitools-selector"),u=l?l+" "+r:r;return t.setAttribute("data-applitools-selector",u),'[data-applitools-selector~="'+r+'"]'}return t((function(t){return t.map((function(t){var e=t[0],r=t[1];return e.map((function(t){var e=function(t){var e=[t];if(t.getRootNode)for(var o=t.getRootNode();o!==document&&o.constructor&&"ShadowRoot"===o.constructor.name;o=o.host.getRootNode())e.push(o.host);return e}(t);return e.map((function(t){return o(t,r)}))}))}))}))}(); | ||
return s(arg) | ||
@@ -106,3 +106,3 @@ } | ||
exports.isStaleElement=function(arg){ | ||
var s=function(){"use strict";function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}return t((function(t){var e=(void 0===t?[null]:t)[0];if(!(e&&e instanceof Node))return!0;for(var o=e;o;){if(o===document)return!1;if(null===o.parentNode&&o!==document)return!0;o=(null==o.getRootNode?void 0:o.getRootNode().host)||o.parentNode||o.host}return!0}))}(); | ||
var s=function(){"use strict";function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}return t((function(t){var e=(void 0===t?[null]:t)[0];if(!e||!e.nodeType)return!0;for(var o=e;o;){if(o===document)return!1;if(null===o.parentNode&&o!==document)return!0;o=(null==o.getRootNode?void 0:o.getRootNode().host)||o.parentNode||o.host}return!0}))}(); | ||
return s(arg) | ||
@@ -109,0 +109,0 @@ } |
{ | ||
"name": "@applitools/snippets", | ||
"version": "2.5.0", | ||
"version": "2.5.1", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43256