@applitools/snippets
Advanced tools
Comparing version 2.4.27 to 2.5.0
# Changelog | ||
## [2.5.0](https://github.com/Applitools-Dev/sdk/compare/js/snippets@2.4.27...js/snippets@2.5.0) (2024-09-16) | ||
### Features | ||
* add playwright fixture ([#2412](https://github.com/Applitools-Dev/sdk/issues/2412)) ([0632e93](https://github.com/Applitools-Dev/sdk/commit/0632e93dd7f53029a8c5f4230d22a05abf5fefd4)) | ||
### Bug Fixes | ||
* stale layout breakpoints elements ([#2479](https://github.com/Applitools-Dev/sdk/issues/2479)) ([f5e4b5a](https://github.com/Applitools-Dev/sdk/commit/f5e4b5ac8077b8c4b7ba67a38c4e58050a55ce75)) | ||
## [2.4.27](https://github.com/Applitools-Dev/sdk/compare/js/snippets@2.4.26...js/snippets@2.4.27) (2024-06-26) | ||
@@ -4,0 +16,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}return t((function(t){var o=t[0],e=t[1];return o.map((function(t,o){var r=[t];if(t.getRootNode)for(var a=t.getRootNode();a!==document&&a.constructor&&"ShadowRoot"===a.constructor.name;a=a.host.getRootNode())r.push(a.host);var n=e[o];return r.map((function(t){var o=t.getAttribute("data-applitools-selector"),e=o?o+" "+n:n;return t.setAttribute("data-applitools-selector",e),'[data-applitools-selector~="'+n+'"]'}))}))}))}(); | ||
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)}))}))}))}))}(); | ||
return s(arg) | ||
@@ -105,2 +105,6 @@ } | ||
} | ||
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}))}(); | ||
return s(arg) | ||
} | ||
exports.lazyLoad=function(arg){ | ||
@@ -107,0 +111,0 @@ var s=function(){"use strict";function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var o=function(t){var o=(void 0===t?[]:t)[0];return o?{x:o.scrollLeft,y:o.scrollTop}:{x:window.scrollX||window.pageXOffset,y:window.scrollY||window.pageYOffset}};var r=function(t){var o=void 0===t?[]:t,r=o[0],n=o[1],e=Object.keys(n).sort(),i=e.reduce((function(t,o){return t[o]={value:r.style.getPropertyValue(o),important:Boolean(r.style.getPropertyPriority(o))},t}),{});return e.forEach((function(t){r.style.setProperty(t,"string"!=typeof n[t]&&n[t]?n[t].value:n[t],n[t]&&n[t].important?"important":"")})),i};var n=function(t){var o=void 0===t?[]:t,n=o[0],e=o[1];n=n||document.documentElement;var i=r([n,{"scroll-behavior":{value:"auto",important:!0}}]);return n.scrollTo?n.scrollTo(e.x,e.y):(n.scrollLeft=e.x,n.scrollTop=e.y),r([n,i]),{x:n.scrollLeft,y:n.scrollTop}},e="__EYES__APPLITOOLS__",i="lazyLoadResult";window[e]=window[e]||{};var l=o,a=n;return t((function(t){var o=void 0===t?[]:t,r=o[0],n=o[1],s=void 0===n?{}:n,u=s.scrollLength,c=s.waitingTime,w=s.maxAmountToScroll;try{if(window[e][i]){var d=window[e][i];return"WIP"!==d.status&&delete window[e][i],JSON.stringify(d)}window[e][i]={status:"WIP"};var v=l(),y=[];y.push({maxAmountToScroll:w,scrollLength:u,waitingTime:c,startingScrollPositionX:v.x,startingScrollPositionY:v.y});var f=Date.now();return function t(o){var n=void 0===o?{}:o,l=n.doneScrolling,s=n.previousScrollResult,d=void 0===s?{}:s;setTimeout((function(){try{if(l){var o=a([r,v]),n=o.x,s=o.y;return y.push({x:n,y:s,msSinceStart:Date.now()-f}),void(window[e][i]={status:"SUCCESS",value:y})}var c=a([r,{x:v.x,y:d.y+u}]),p=c.x,S=c.y;y.push({x:p,y:S,msSinceStart:Date.now()-f}),t({doneScrolling:S===d.y||S===w,previousScrollResult:{x:p,y:S}})}catch(t){window[e][i]={status:"ERROR",error:t}}}),c)}(),JSON.stringify(window[e][i])}catch(t){return window[e][i]={status:"ERROR",error:t},JSON.stringify(window[e][i])}}))}(); |
{ | ||
"name": "@applitools/snippets", | ||
"version": "2.4.27", | ||
"version": "2.5.0", | ||
"repository": { | ||
@@ -33,3 +33,3 @@ "type": "git", | ||
"glob": "^7.1.6", | ||
"playwright": "^1.39.0", | ||
"playwright": "1.39.0", | ||
"rollup": "^4.1.4", | ||
@@ -36,0 +36,0 @@ "webdriverio": "^7.31.1", |
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
42962
197