testcafe 2.3.1 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/LICENSE +1 -1
- package/README.md +40 -46
- package/lib/api/test-controller/execution-context.js +4 -2
- package/lib/browser/connection/gateway.js +43 -1
- package/lib/browser/connection/index.js +24 -10
- package/lib/browser/connection/service-routes.js +3 -1
- package/lib/browser/provider/built-in/dedicated/chrome/index.js +19 -5
- package/lib/browser/provider/index.js +4 -1
- package/lib/client/automation/deps/hammerhead.js +24 -0
- package/lib/client/automation/deps/testcafe-core.js +24 -0
- package/lib/client/automation/index.js +251 -54
- package/lib/client/automation/index.min.js +1 -1
- package/lib/client/automation/playback/press/get-key-info.js +44 -0
- package/lib/client/automation/playback/press/utils.js +142 -0
- package/lib/client/automation/utils/get-key-code.js +15 -0
- package/lib/client/automation/utils/get-key-identifier.js +14 -0
- package/lib/client/automation/utils/is-letter.js +7 -0
- package/lib/client/automation/utils/key-identifier-maps.js +93 -0
- package/lib/client/browser/idle-page/index.js +7 -2
- package/lib/client/core/index.js +46 -3
- package/lib/client/core/index.min.js +1 -1
- package/lib/client/driver/index.js +45 -17
- package/lib/client/driver/index.min.js +1 -1
- package/lib/client/test-run/index.js.mustache +34 -30
- package/lib/client/ui/index.js +3230 -48
- package/lib/client/ui/index.min.js +1 -1
- package/lib/client/ui/sprite.svg +15 -0
- package/lib/client/ui/styles.css +183 -41
- package/lib/live/test-runner.js +4 -2
- package/lib/proxyless/api-base.js +3 -2
- package/lib/proxyless/client/event-descriptor.js +67 -0
- package/lib/proxyless/client/input.js +36 -0
- package/lib/proxyless/client/key-press/utils.js +31 -0
- package/lib/proxyless/client/types.js +1 -1
- package/lib/proxyless/client/utils.js +32 -2
- package/lib/proxyless/cookie-provider.js +31 -3
- package/lib/proxyless/errors.js +20 -0
- package/lib/proxyless/index.js +2 -10
- package/lib/proxyless/request-pipeline/index.js +32 -3
- package/lib/proxyless/resource-injector.js +5 -4
- package/lib/proxyless/types.js +3 -2
- package/lib/proxyless/utils/cdp.js +4 -3
- package/lib/reporter/index.js +2 -1
- package/lib/runner/bootstrapper.js +8 -1
- package/lib/runner/index.js +57 -44
- package/lib/shared/utils/is-file-protocol.js +2 -2
- package/lib/test-run/commands/actions.js +2 -2
- package/lib/test-run/cookies/base.js +4 -1
- package/lib/test-run/cookies/provider.js +9 -2
- package/lib/test-run/execute-js-expression/index.js +4 -2
- package/lib/test-run/index.js +17 -12
- package/lib/test-run/request/create-request-options.js +23 -12
- package/lib/test-run/request/send.js +2 -3
- package/lib/utils/check-is-vm.js +58 -0
- package/package.json +9 -6
- package/lib/proxyless/client/event-simulator.js +0 -40
|
@@ -1 +1 @@
|
|
|
1
|
-
window["%hammerhead%"].utils.removeInjectedScript(),function Ue(Me){var Ae=Me.document;!function(s,o,t){var e="default"in s?s.default:s,i="default"in o?o.default:o;t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var u={uiRoot:null,element:function(){return this.uiRoot||(this.uiRoot=Ae.createElement("div"),s.shadowUI.getRoot().appendChild(this.uiRoot)),this.uiRoot},hide:function(){this.uiRoot&&(this.uiRoot.style.visibility="hidden")},show:function(){this.uiRoot&&(this.uiRoot.style.visibility="")},remove:function(){var t=s.shadowUI.getRoot();s.nativeMethods.nodeParentNodeGetter.call(t).removeChild(t)}},h=e.shadowUI,c=e.utils.browser,a=e.utils.featureDetection,d=e.nativeMethods,p=e.eventSandbox.eventSimulator,m=e.eventSandbox.listeners,f=i.positionUtils,g=i.domUtils,v=i.styleUtils,y=i.eventUtils,C=i.arrayUtils,E=i.selectController,_="tcOptionList",r="disabled",w=c.isIE?30:20;function S(t){var e=d.eventTargetGetter.call(t),i=E.currentEl;(e||t.srcElement)===i||g.containsElement(i,e)||g.containsElement(E.optionList,e)||I()}function x(t,e,i){var n,s=d.eventTargetGetter.call(t),o=C.indexOf(E.options,s);o<0||(i(),(n=-1<s.className.indexOf(r))&&c.isWebKit||function(t,e){var i=E.currentEl,n=i.selectedIndex,s=i.getElementsByTagName("option")[t],o=!e&&t!==n;o&&!c.isIE&&(i.selectedIndex=t),c.isFirefox||c.isIE||!o||(p.input(i),p.change(i)),(c.isFirefox||c.isIE)&&p.mousedown(c.isFirefox?s:i),a.isTouchDevice||p.mouseup(c.isFirefox?s:i),(c.isFirefox||c.isIE)&&o&&(c.isIE&&(i.selectedIndex=t),c.isIE||p.input(i),p.change(i)),a.isTouchDevice||p.click(c.isFirefox||c.isIE?s:i),e||I()}(o,n))}function I(){g.remove(E.optionList),y.unbind(Ae,"mousedown",S),E.clear()}var n=Object.freeze({__proto__:null,expandOptionList:function(t){var e=t.children;if(e.length&&!t.disabled){if(E.currentEl){var i=t===E.currentEl;if(I(),i)return}var n=E.currentEl=t,s=E.optionList=Ae.createElement("div");u.element().appendChild(s),h.addClass(s,_),E.createChildren(e,s),m.addInternalEventBeforeListener(Me,["click"],x),d.setTimeout.call(Me,function(){y.bind(Ae,"mousedown",S)},0),v.set(s,{position:"absolute",fontSize:v.get(n,"fontSize"),fontFamily:v.get(n,"fontFamily"),minWidth:v.getWidth(n)+"px",left:f.getOffsetPosition(n).left+"px",height:g.getSelectVisibleChildren(t).length>w?v.getOptionHeight(t)*w:""});var o,a=f.getOffsetPosition(n).top,r=v.getHeight(s),l=a+v.getHeight(n)+2;l+r>v.getScrollTop(Me)+v.getHeight(Me)&&(o=a-3-r)>=v.getScrollTop(Me)&&(l=o),v.set(s,"top",l+"px")}},collapseOptionList:I,scrollOptionListByChild:function(t){var e,i,n,s,o,a,r=g.getSelectParent(t);r&&(e=v.getSelectElementSize(r),i=v.getOptionHeight(r),n=0,o=(s=Math.max(v.getScrollTop(r)/i,0))+e-1,(a=g.getChildVisibleIndex(r,t))<s?(n=i*(s-a),v.setScrollTop(r,Math.max(v.getScrollTop(r)-n,0))):o<a&&(n=i*(a-o),v.setScrollTop(r,v.getScrollTop(r)+n)))},getSelectChildCenter:function(t){var e=g.getSelectParent(t);if(!e)return{x:0,y:0};var i=v.getOptionHeight(e),n=f.getElementRectangle(t);return{x:Math.round(n.left+n.width/2),y:Math.round(n.top+i/2)}},switchOptionsByKeys:function(t,e){var i=v.getSelectElementSize(t),n=!v.hasDimensions(h.select("."+_)[0]);if(/down|up/.test(e)||!c.isIE&&(i<=1||c.isFirefox)&&(n||c.isFirefox)&&/left|right/.test(e)){for(var s=t.querySelectorAll("option"),o=[],a=0;a<s.length;a++){var r=s[a].parentElement;s[a].disabled||"optgroup"===g.getTagName(r)&&r.disabled||o.push(s[a])}var l=C.indexOf(o,s[t.selectedIndex])+(/down|right/.test(e)?1:-1);0<=l&&l<o.length&&(t.selectedIndex=C.indexOf(s,o[l]),c.isIE||p.input(t),p.change(t))}}}),l="Loading page...",b="modal-background",B="loading-text",T="loading-icon",U=null,M=null,A=null,V=!1;function D(){function t(){var t=o.styleUtils.getHeight(Me),e=o.styleUtils.getWidth(Me);o.styleUtils.set(U,"width",e+"px"),o.styleUtils.set(U,"height",t+"px"),o.styleUtils.set(A,{left:Math.round((e-o.styleUtils.getWidth(A))/2)+"px",top:Math.round((t-o.styleUtils.getHeight(A))/2)+"px"})}t(),o.eventUtils.bind(Me,"resize",t)}function R(){var t,e,i,n;t=u.element(),U=Ae.createElement("div"),t.appendChild(U),s.shadowUI.addClass(U,b),M=Ae.createElement("div"),s.nativeMethods.nodeTextContentSetter.call(M,l),t.appendChild(M),s.shadowUI.addClass(M,B),A=Ae.createElement("div"),o.styleUtils.set(A,"visibility","hidden"),t.appendChild(A),s.shadowUI.addClass(A,T),D(),e=o.styleUtils.getHeight(Me),i=o.styleUtils.getWidth(Me),(n=!o.styleUtils.hasDimensions(M))&&(o.styleUtils.set(M,"visibility","hidden"),o.styleUtils.set(M,"display","block")),o.styleUtils.set(M,{left:Math.max((i-o.styleUtils.getWidth(M))/2,0)+"px",top:Math.max((e-o.styleUtils.getHeight(M))/2,0)+"px"}),n&&(o.styleUtils.set(M,"display","none"),o.styleUtils.set(M,"visibility","")),V=!0}var P=Object.freeze({__proto__:null,initAndShowLoadingText:function(){function t(){R(),o.styleUtils.set(U,"opacity",.8),o.styleUtils.set(U,"display","block"),o.styleUtils.set(M,"display","block"),e=!0}var e=!1,i=function(){e||(Ae.body?t():s.nativeMethods.setTimeout.call(Me,i,0))};i(),o.eventUtils.documentReady().then(function(){e||t()})},show:function(t){V||R(),o.styleUtils.set(U,"opacity",t?0:.7),o.styleUtils.set(U,"display","block")},hide:function(){V&&(o.styleUtils.set(M,"display","none"),o.styleUtils.set(U,"display","none"))},showLoadingIcon:function(){o.styleUtils.set(A,"visibility","visible")},hideLoadingIcon:function(){o.styleUtils.set(A,"visibility","hidden")}}),k=e.shadowUI,W=i.styleUtils,O="success",F=(N.prototype.setValue=function(t){t="number"!=typeof t?0:Math.min(Math.max(t,0),100),W.set(this.valueElement,"width",t+"%")},N.prototype.setSuccess=function(t){t?k.addClass(this.containerElement,O):k.removeClass(this.containerElement,O)},N);function N(t){this.containerElement=Ae.createElement("div"),this.valueElement=Ae.createElement("div"),t.appendChild(this.containerElement),this.containerElement.appendChild(this.valueElement),k.addClass(this.containerElement,"progress-bar"),k.addClass(this.valueElement,"value")}var H=e.shadowUI,L=e.nativeMethods,q=i.eventUtils,z=i.styleUtils,G="progress-panel",j="title",K="content",Y=(X._getInvisibleElementProperty=function(t,e){var i="none"===z.get(t,"display");i&&z.set(t,"display","block");var n=t[e];return i&&z.set(t,"display","none"),n},X._showAtWindowCenter=function(t){var e=X._getInvisibleElementProperty(t,"offsetHeight"),i=X._getInvisibleElementProperty(t,"offsetWidth"),n=Math.round(z.getHeight(Me)/2-e/2),s=Math.round(z.getWidth(Me)/2-i/2);z.set(t,{left:s+"px",top:n+"px"})},X.prototype._setCurrentProgress=function(){var t=Math.round((L.dateNow()-this.startTime)/this.maxTimeout*100);this.progressBar.setValue(t)},X.prototype._setSuccess=function(t){this.progressBar.setSuccess(t)},X.prototype._stopAnimation=function(){L.clearInterval.call(Me,this.animationInterval)},X.prototype._animate=function(t,e,i,n){var s,o,a,r=this,l=L.dateNow(),u=i?0:1;i&&(z.set(t,"opacity",u),z.set(t,"display","block")),this._stopAnimation(),this.animationInterval=L.setInterval.call(Me,function(){s=L.dateNow()-l,o=Math.min(s/e,1),a=.5-Math.cos(o*Math.PI)/2,z.set(t,"opacity",u+(i?a:-a)),1===o&&(r._stopAnimation(),n&&n())},10)},X.prototype._showPanel=function(){q.bind(Me,"resize",this.disposePanel),this._animate(this.panelDiv,200,!0)},X.prototype._hidePanel=function(t){var e=this;this.startTime=null,q.unbind(Me,"resize",this.disposePanel),this._animate(this.panelDiv,t?0:600,!1,function(){return z.set(e.panelDiv,"display","none")})},X.prototype.show=function(t,e){var i=this;this.startTime=L.dateNow(),this.maxTimeout=e,L.nodeTextContentSetter.call(this.titleDiv,t),this._setSuccess(!1),this.openingTimeout=L.setTimeout.call(Me,function(){i.openingTimeout=null,i._setCurrentProgress(),i._showPanel(),i.updateInterval=L.setInterval.call(Me,function(){return i._setCurrentProgress()},100)},300)},X.prototype.close=function(t){var e=this;t&&this._setSuccess(!0),this.openingTimeout&&(L.clearTimeout.call(Me,this.openingTimeout),this.openingTimeout=null),this.updateInterval&&(L.clearInterval.call(Me,this.updateInterval),this.updateInterval=null),t?this.startTime&&L.dateNow()-this.startTime<1e3?L.setTimeout.call(Me,function(){L.setTimeout.call(Me,function(){return e._hidePanel(!1)},200)},100):L.setTimeout.call(Me,function(){return e._hidePanel(!1)},200):this._hidePanel(!0)},X);function X(){var t=this;this.startTime=null,this.openingTimeout=null,this.updateInterval=null,this.animationInterval=null,this.panelDiv=Ae.createElement("div"),u.element().appendChild(this.panelDiv),this.titleDiv=Ae.createElement("div"),this.panelDiv.appendChild(this.titleDiv),this.contentDiv=Ae.createElement("div"),this.panelDiv.appendChild(this.contentDiv),H.addClass(this.panelDiv,G),H.addClass(this.titleDiv,j),H.addClass(this.contentDiv,K),X._showAtWindowCenter(this.panelDiv),this.progressBar=new F(this.contentDiv),this.disposePanel=function(){return X._showAtWindowCenter(t.panelDiv)}}var J=function(t,e){return(J=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)};function Q(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}J(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var Z=e.shadowUI,$=e.nativeMethods,tt=i.styleUtils,et="determinate",it=(nt.prototype._setCurrentProgress=function(){var t=($.dateNow()-this.startTime)/this.maxTimeout,e=Math.min(Math.max(t,0),1),i=tt.getWidth(this.progressBar),n=Math.round(i*e);tt.set(this.firstValueElement,"width",n+"px")},nt.prototype.start=function(t,e){var i=this;Z.addClass(this.progressBar,et),this.maxTimeout=t,this.startTime=e||$.dateNow(),this._setCurrentProgress(),this.animationInterval=$.setInterval.call(Me,function(){return i._setCurrentProgress()},10)},nt.prototype.stop=function(){this.animationInterval&&($.clearInterval.call(Me,this.animationInterval),this.animationInterval=null)},nt.prototype.reset=function(){tt.set(this.firstValueElement,"width",0),Z.removeClass(this.progressBar,et)},nt);function nt(t,e){this.progressBar=t,this.firstValueElement=e,this.maxTimeout=null,this.startTime=null,this.animationInterval=null}function st(t,e,i){if(e.x===t.x)return 0;var n=(e.y-t.y)/(e.x-t.x),s=t.x*(t.y-e.y)/(e.x-t.x)+t.y;return Math.round(n*i+s)}var ot=e.shadowUI,at=e.nativeMethods,rt=i.styleUtils,lt={time:2800,points:[.815,.395],positionByCompletePercent:{0:{left:-35,right:100},.6:{left:100,right:-90},1:{left:100,right:-90}}},ut={time:3e3,points:[.84,1],positionByCompletePercent:{0:{left:-200,right:100},.6:{left:107,right:-8},1:{left:107,right:-8}}},ht=0,ct=.6,dt=1,pt="indeterminate",mt=(ft._updateValueAnimation=function(t,e,i){var n,s,o,a,r,l,u,h,c,d,p=i.time,m=i.points,f=i.positionByCompletePercent,g=at.dateNow()-t,v=(n=g/p,s=m[0],o=m[1],3*Math.pow(1-n,2)*n*s+3*(1-n)*n*n*o+n*n*n),y=(h=(l=(a=v)<ct)?ct:dt,c=(r=f)[u=l?ht:ct],d=r[h],{left:st({x:u,y:c.left},{x:h,y:d.left},a),right:st({x:u,y:c.right},{x:h,y:d.right},a)}),C=y.left,E=y.right;rt.set(e,"left",Math.round(C)+"%"),rt.set(e,"right",Math.round(E)+"%")},ft.prototype._clearFirstValueAnimation=function(){this.animationInterval&&(at.clearInterval.call(Me,this.animationInterval),this.animationInterval=null),rt.set(this.firstValue,"left","-35%"),rt.set(this.firstValue,"right","100%")},ft.prototype._clearSecondValueAnimation=function(){this.secondValueAnimationInterval&&(at.clearInterval.call(Me,this.secondValueAnimationInterval),this.secondValueAnimationInterval=null),rt.set(this.secondValue,"left","-200%"),rt.set(this.secondValue,"right","100%")},ft.prototype._startFirstValueAnimation=function(){var t=this;this._clearFirstValueAnimation();var e=at.dateNow();this.animationInterval=at.setInterval.call(Me,function(){ft._updateValueAnimation(e,t.firstValue,lt)},10)},ft.prototype._startSecondValueAnimation=function(){var t=this;this._clearSecondValueAnimation();var e=at.dateNow();this.secondValueAnimationInterval=at.setInterval.call(Me,function(){ft._updateValueAnimation(e,t.secondValue,ut)},10)},ft.prototype._startAnimation=function(){var t=this;this._startFirstValueAnimation(),this.secondValueAnimationTimeout=at.setTimeout.call(Me,function(){return t._startSecondValueAnimation()},1e3),this.restartAnimationTimeout=at.setTimeout.call(Me,function(){return t._startAnimation()},1950)},ft.prototype._stopAnimation=function(){this._clearFirstValueAnimation(),this._clearSecondValueAnimation(),this.secondValueAnimationTimeout&&(at.clearInterval.call(Me,this.secondValueAnimationTimeout),this.secondValueAnimationTimeout=null),this.restartAnimationTimeout&&(at.clearInterval.call(Me,this.restartAnimationTimeout),this.restartAnimationTimeout=null)},ft.prototype.start=function(){ot.addClass(this.progressBar,pt),this._startAnimation()},ft.prototype.stop=function(){ot.removeClass(this.progressBar,pt),this._stopAnimation()},ft);function ft(t,e,i){this.progressBar=t,this.firstValue=e,this.secondValue=i,this.animationInterval=null,this.secondValueAnimationInterval=null,this.secondValueAnimationTimeout=null,this.restartAnimationTimeout=null}var gt=e.shadowUI,vt=i.styleUtils,yt=(Ct.prototype._create=function(t){this.progressBar=Ae.createElement("div"),gt.addClass(this.progressBar,"progress-bar"),t.appendChild(this.progressBar);var e=Ae.createElement("div");gt.addClass(e,"value-container"),this.progressBar.appendChild(e),this.firstValueElement=Ae.createElement("div"),gt.addClass(this.firstValueElement,"value"),e.appendChild(this.firstValueElement),this.secondValueElement=Ae.createElement("div"),gt.addClass(this.secondValueElement,"value"),e.appendChild(this.secondValueElement)},Ct.prototype.show=function(){vt.set(this.progressBar,"visibility","visible")},Ct.prototype.hide=function(){vt.set(this.progressBar,"visibility","hidden")},Ct);function Ct(t){this.progressBar=null,this.firstValueElement=null,this.secondValueElement=null,this._create(t),this.determinateIndicator=new it(this.progressBar,this.firstValueElement),this.indeterminateIndicator=new mt(this.progressBar,this.firstValueElement,this.secondValueElement)}var Et,_t="start-waiting-element",wt="end-waiting-element-request",St="end-waiting-element-response",xt="start-waiting-assertion-retries",It="end-waiting-assertion-retries-request",bt="end-waiting-assertion-retries-response",Bt="step",Tt="resume",Ut=e.Promise,Mt=e.shadowUI,At=e.nativeMethods,Vt=e.eventSandbox.message,Dt=e.utils.browser,Rt=e.utils.featureDetection,Pt=e.eventSandbox.listeners,kt=i.styleUtils,Wt=i.eventUtils,Ot=i.domUtils,Ft=i.serviceUtils,Nt=i.arrayUtils,Ht="waiting-element-failed",Lt="waiting-element-success",qt="%testCafeStatusPrefix%",zt=(Q(Gt,Et=Ft.EventEmitter),Object.defineProperty(Gt.prototype,"visibleHeight",{get:function(){return this.maxHeight=Math.max(this.maxHeight,kt.getHeight(this.statusBar)),this.maxHeight},enumerable:!1,configurable:!0}),Gt.prototype._createButton=function(t,e){var i=Ae.createElement("div"),n=Ae.createElement("div"),s=Ae.createElement("span");return At.nodeTextContentSetter.call(s,t),Mt.addClass(i,"button"),Mt.addClass(i,e),Mt.addClass(n,"button-icon"),Dt.isSafari&&(s.style.position="relative",s.style.top="1px"),i.appendChild(n),i.appendChild(s),i},Gt.prototype._createIconArea=function(){this.icon=Ae.createElement("div"),Mt.addClass(this.icon,"icon"),this.statusBar.appendChild(this.icon)},Gt.prototype._createInformationArea=function(){this.infoContainer=Ae.createElement("div"),Mt.addClass(this.infoContainer,"info-container"),this.statusBar.appendChild(this.infoContainer);var t=Ae.createElement("div");Mt.addClass(t,"info-text-container"),this.infoContainer.appendChild(t);var e=Ae.createElement("div");Mt.addClass(e,"status-container"),t.appendChild(e),this.statusDiv=Ae.createElement("div"),this.statusDiv=Ae.createElement("div"),At.nodeTextContentSetter.call(this.statusDiv,this._getFullStatusText("Loading Web Page...")),Mt.addClass(this.statusDiv,"status"),Mt.addClass(this.statusDiv,"info"),e.appendChild(this.statusDiv);var i=Ae.createElement("div");At.nodeTextContentSetter.call(i,"".concat(this.fixtureName," - ").concat(this.testName)),Mt.addClass(i,"fixture"),Mt.addClass(i,"info"),e.appendChild(i);var n=Ae.createElement("div");At.nodeTextContentSetter.call(n,this.userAgent),Mt.addClass(n,"user-agent"),t.appendChild(n)},Gt.prototype._createActionsArea=function(){var t=this;this.actionsContainer=Ae.createElement("div"),Mt.addClass(this.actionsContainer,"actions-container"),this.statusBar.appendChild(this.actionsContainer),this.buttons=Ae.createElement("div"),Mt.addClass(this.buttons,"buttons"),this.actionsContainer.appendChild(this.buttons),this.unlockButton=this._createButton("Unlock Page","locked"),this.resumeButton=this._createButton("Resume","resume"),this.nextButton=this._createButton("Next Action","step"),this.finishButton=this._createButton("Finish","finish"),this.buttons.appendChild(this.unlockButton),this.buttons.appendChild(this.resumeButton),this.buttons.appendChild(this.nextButton),this.actionsContainer.style.display="none",this._bindClickOnce([this.unlockButton],function(){Mt.removeClass(t.unlockButton,"locked"),Mt.addClass(t.unlockButton,"unlocked"),At.nodeTextContentSetter.call(t.unlockButton.querySelector("span"),"Page unlocked"),t.state.locked=!1,t.emit(t.UNLOCK_PAGE_BTN_CLICK,{})}),this.unlockButton.style.display="none"},Gt.prototype._create=function(){this.statusBar=Ae.createElement("div"),Mt.addClass(this.statusBar,"status-bar"),this._createIconArea(),this._createInformationArea(),this._createActionsArea(),this.progressBar=new yt(this.infoContainer),this.progressBar.indeterminateIndicator.start(),this.progressBar.show(),u.element().appendChild(this.statusBar),this._bindHandlers(),this.state.created=!0},Gt.prototype._createBeforeReady=function(){var t,e=this;this.state.created||(t=Me).top!==t||(Ae.body?this._create():At.setTimeout.call(Me,function(){return e._createBeforeReady()},0))},Gt.prototype._animate=function(t){var e,i,n,s=this,o=At.dateNow(),a=parseInt(kt.get(this.statusBar,"opacity"),10)||0;this._stopAnimation(),t&&(kt.set(this.statusBar,"visibility",""),this.state.hidden=!1),this.animationInterval=At.setInterval.call(Me,function(){e=At.dateNow()-o,i=Math.min(e/500,1),n=.5-Math.cos(i*Math.PI)/2,kt.set(s.statusBar,"opacity",a+(t?n:-n)),1===i&&(s._stopAnimation(),t||(kt.set(s.statusBar,"visibility","hidden"),s.state.hidden=!0),s.state.showing=!1,s.state.hiding=!1)},10)},Gt.prototype._stopAnimation=function(){this.animationInterval&&(At.clearInterval.call(Me,this.animationInterval),this.animationInterval=null)},Gt.prototype._fadeOut=function(){this.state.hiding||this.state.debugging||(this.state.showing=!1,this.state.hiding=!0,this._animate())},Gt.prototype._fadeIn=function(){this.state.showing||this.state.debugging||(this.state.hiding=!1,this.state.showing=!0,this._animate(!0))},Gt.prototype._bindHandlers=function(){var e=this;Pt.initElementListening(Me,["resize"]),Pt.addInternalEventBeforeListener(Me,["resize"],function(){e.windowHeight=Me.innerHeight}),Pt.addFirstInternalEventBeforeListener(Me,["mousemove","mouseout","touchmove"],function(t){"mouseout"!==t.type||t.relatedTarget?"mousemove"!==t.type&&"touchmove"!==t.type||(t.clientY>e.windowHeight-e.visibleHeight?e._fadeOut(t):e.state.hidden&&e._fadeIn(t)):e._fadeIn(t)})},Gt.prototype._bindClickOnce=function(i,n){var s=this,o=Rt.isTouchDevice?"touchstart":"mousedown",a=function(t){var e=At.eventTargetGetter.call(t);Nt.find(i,function(t){return Ot.containsElement(t,e)})?(Wt.preventDefault(t),Pt.removeInternalEventBeforeListener(Me,[o],a),n(t)):Ot.containsElement(s.statusBar,e)&&Wt.preventDefault(t)};Pt.addInternalEventBeforeListener(Me,[o],a)},Gt.prototype._initChildListening=function(){var i=this;Vt.on(Vt.SERVICE_MSG_RECEIVED_EVENT,function(t){var e=t.message;e.cmd===_t?i.showWaitingElementStatus(e.timeout):e.cmd===wt?i.hideWaitingElementStatus(e.waitingSuccess).then(function(){return Vt.sendServiceMsg({cmd:St},t.source)}):e.cmd===xt?i.showWaitingAssertionRetriesStatus(e.timeout):e.cmd===It&&i.hideWaitingAssertionRetriesStatus(e.waitingSuccess).then(function(){return Vt.sendServiceMsg({cmd:bt},t.source)})})},Gt.prototype._resetState=function(){this.state.debugging=!1,this.actionsContainer.style.display="none",this.unlockButton.style.display="none",At.nodeTextContentSetter.call(this.statusDiv,this._getFullStatusText("")),this.progressBar.hide()},Gt.prototype._getFullStatusText=function(t){var e=this.contextStorage.getItem(qt)||"";return e+(e&&t?". ":"")+t},Gt.prototype._showWaitingStatus=function(){var t=this.state.assertionRetries?"Waiting for assertion execution...":"Waiting for element to appear...";At.nodeTextContentSetter.call(this.statusDiv,this._getFullStatusText(t)),this.progressBar.show()},Gt.prototype._hideWaitingStatus=function(e){var i=this;return new Ut(function(t){At.setTimeout.call(Me,function(){i.state.waiting||i.state.debugging||(Mt.removeClass(i.statusBar,Lt),Mt.removeClass(i.statusBar,Ht),i.progressBar.determinateIndicator.reset(),i._resetState()),t()},e?0:500)})},Gt.prototype._showDebuggingStatus=function(t){var s=this;return new Ut(function(n){s.state.debugging=!0,s.state.locked=!0,t?(s.buttons.removeChild(s.nextButton),s.buttons.removeChild(s.resumeButton),s.buttons.appendChild(s.finishButton),At.nodeTextContentSetter.call(s.statusDiv,s._getFullStatusText("Test failed")),Mt.removeClass(s.statusBar,Lt),Mt.addClass(s.statusBar,Ht)):At.nodeTextContentSetter.call(s.statusDiv,s._getFullStatusText("Debugging test...")),s.actionsContainer.style.display="",s.unlockButton.style.display="",s._bindClickOnce([s.resumeButton,s.nextButton,s.finishButton],function(t){var e=At.eventTargetGetter.call(t),i=Ot.containsElement(s.nextButton,e);s._resetState(),n(i?Bt:Tt)})})},Gt.prototype._setWaitingStatus=function(t,e){var i=this;this.state.waiting=!0,this.progressBar.determinateIndicator.start(t,e),this.showingTimeout=At.setTimeout.call(Me,function(){i.showingTimeout=null,i._showWaitingStatus()},300)},Gt.prototype._resetWaitingStatus=function(t){this.state.waiting=!1,this.progressBar.determinateIndicator.stop(),t?Mt.addClass(this.statusBar,Lt):Mt.addClass(this.statusBar,Ht);var e=this.showingTimeout&&t;return this.showingTimeout&&(At.clearTimeout.call(Me,this.showingTimeout),this.showingTimeout=null,t||this._showWaitingStatus()),this._hideWaitingStatus(e)},Gt.prototype.hidePageLoadingStatus=function(){this.state.created||this._create(),this.progressBar.indeterminateIndicator.stop(),this._resetState()},Gt.prototype.showDebuggingStatus=function(t){return this._stopAnimation(),kt.set(this.statusBar,"opacity",1),kt.set(this.statusBar,"visibility",""),this.state.hiden=!1,this._showDebuggingStatus(t)},Gt.prototype.showWaitingElementStatus=function(t){this.state.assertionRetries||this._setWaitingStatus(t)},Gt.prototype.hideWaitingElementStatus=function(t){return this.state.assertionRetries?Ut.resolve():this._resetWaitingStatus(t)},Gt.prototype.showWaitingAssertionRetriesStatus=function(t,e){this.state.assertionRetries=!0,this._setWaitingStatus(t,e)},Gt.prototype.hideWaitingAssertionRetriesStatus=function(t){var e=this;return this._resetWaitingStatus(t).then(function(){e.state.assertionRetries=!1})},Gt.prototype.setStatusPrefix=function(t){this.contextStorage.setItem(qt,t),At.nodeTextContentSetter.call(this.statusDiv,this._getFullStatusText(""))},Gt);function Gt(t,e,i,n){var s=Et.call(this)||this;return s.UNLOCK_PAGE_BTN_CLICK="testcafe|ui|status-bar|unlock-page-btn-click",s.userAgent=t,s.fixtureName=e,s.testName=i,s.contextStorage=n,s.statusBar=null,s.infoContainer=null,s.actionsContainer=null,s.icon=null,s.resumeButton=null,s.finishButton=null,s.nextButton=null,s.statusDiv=null,s.buttons=null,s.progressBar=null,s.animationInterval=null,s.showingTimeout=null,s.windowHeight=Ae.documentElement?kt.getHeight(Me):Me.innerHeight,s.maxHeight=0,s.state={created:!1,showing:!1,hiding:!1,debugging:!1,waiting:!1,assertionRetries:!1,hidden:!1},s.currentView=null,s._createBeforeReady(),s._initChildListening(),s}var jt,Kt=i.sendRequestToFrame,Yt=e.eventSandbox.message,Xt=(Q(Jt,jt=zt),Jt.prototype.showWaitingElementStatus=function(t){Yt.sendServiceMsg({cmd:_t,timeout:t},Me.top)},Jt.prototype.hideWaitingElementStatus=function(t){return Kt({cmd:wt,waitingSuccess:t},St,Me.top)},Jt.prototype.showWaitingAssertionRetriesStatus=function(t){Yt.sendServiceMsg({cmd:xt,timeout:t},Me.top)},Jt.prototype.hideWaitingAssertionRetriesStatus=function(t){return Kt({cmd:It,waitingSuccess:t},bt,Me.top)},Jt);function Jt(){return jt.call(this)||this}var Qt="ui|cursor|move|request",Zt="ui|cursor|leftbuttondown|request",$t="ui|cursor|rightbuttondown|request",te="ui|cursor|buttonup|request",ee="ui|cursor|move|response",ie="ui|cursor|leftbuttondown|response",ne="ui|cursor|rightbuttondown|response",se="ui|cursor|buttonup|response",oe=e.Promise,ae=e.shadowUI,re=e.utils.browser,le=e.utils.featureDetection,ue=e.eventSandbox.message,he=i.styleUtils,ce=i.positionUtils,de="l-mouse-down",pe="r-mouse-down",me=[de,pe].join(" ");ue.on(ue.SERVICE_MSG_RECEIVED_EVENT,function(t){var e=t.message;switch(e.cmd){case Qt:e.shouldRender||(fe.shouldRender=e.shouldRender),fe.move(ce.getIframePointRelativeToParentFrame({x:e.x,y:e.y},t.source)).then(function(){return ue.sendServiceMsg({cmd:ee},t.source)});break;case Zt:fe.leftButtonDown().then(function(){return ue.sendServiceMsg({cmd:ie},t.source)});break;case $t:fe.rightButtonDown().then(function(){return ue.sendServiceMsg({cmd:ne},t.source)});break;case te:fe.buttonUp().then(function(){return ue.sendServiceMsg({cmd:se},t.source)})}});var fe={cursorElement:null,x:50,y:50,pointerOffsetX:0,pointerOffsetY:0,shouldRender:!0,_createElement:function(){this.cursorElement=Ae.createElement("div"),ae.addClass(this.cursorElement,"cursor"),le.isTouchDevice&&!re.isIE&&(ae.addClass(this.cursorElement,"touch"),this.pointerOffsetX=Math.ceil(he.getWidth(this.cursorElement)/2),this.pointerOffsetY=Math.ceil(he.getHeight(this.cursorElement)/2)),u.element().appendChild(this.cursorElement)},_ensureCursorElement:function(){return!!this.shouldRender&&(this.cursorElement||this._createElement(),!0)},isVisible:function(){return this.cursorElement&&"hidden"!==he.get(this.cursorElement,"visibility")},hide:function(){this._ensureCursorElement()&&this.isVisible()&&he.set(this.cursorElement,"visibility","hidden")},show:function(){this._ensureCursorElement()&&he.set(this.cursorElement,"visibility","")},move:function(t){return this._ensureCursorElement()&&(this.x=t.x,this.y=t.y,he.set(this.cursorElement,{left:this.x-this.pointerOffsetX+"px",top:this.y-this.pointerOffsetY+"px"})),oe.resolve()},leftButtonDown:function(){return this._ensureCursorElement()&&(ae.removeClass(this.cursorElement,me),ae.addClass(this.cursorElement,de)),oe.resolve()},rightButtonDown:function(){return this._ensureCursorElement()&&(ae.removeClass(this.cursorElement,me),ae.addClass(this.cursorElement,pe)),oe.resolve()},buttonUp:function(){return this._ensureCursorElement()&&ae.removeClass(this.cursorElement,me),oe.resolve()}},ge=e.utils.browser.isIE?1:0,ve={move:function(t){var e={cmd:Qt,x:t.x+ge,y:t.y+ge,shouldRender:this.shouldRender};return o.sendRequestToFrame(e,ee,Me.parent)},leftButtonDown:function(){return o.sendRequestToFrame({cmd:Zt},ie,Me.parent)},rightButtonDown:function(){return o.sendRequestToFrame({cmd:$t},ne,Me.parent)},buttonUp:function(){return o.sendRequestToFrame({cmd:te},se,Me.parent)}},ye={screenshotMark:null,_createMark:function(){this.screenshotMark=Ae.createElement("img"),s.shadowUI.addClass(this.screenshotMark,"screenshot-mark"),this.screenshotMark.style.right=10/Me.devicePixelRatio+"px",this.screenshotMark.style.width=32/Me.devicePixelRatio+"px",this.screenshotMark.style.height=10/Me.devicePixelRatio+"px",this.hide(),s.shadowUI.getRoot().appendChild(this.screenshotMark)},hide:function(){this.screenshotMark&&(this.screenshotMark.style.visibility="hidden")},show:function(t){this.screenshotMark||this._createMark(),s.nativeMethods.imageSrcSetter.call(this.screenshotMark,t),this.screenshotMark.style.visibility=""}},Ce=e.Promise,Ee=e.eventSandbox.message,_e=i.sendRequestToFrame,we="ui|hide|request",Se="ui|hide|response",xe="ui|show|request",Ie="ui|show|response";Ee.on(Ee.SERVICE_MSG_RECEIVED_EVENT,function(t){t.message.cmd===we?(u.hide(),Ee.sendServiceMsg({cmd:Se},t.source)):t.message.cmd===xe&&(u.show(),Ee.sendServiceMsg({cmd:Ie},t.source))});var be={};be.uiRoot=u,be.cursorUI=fe,be.iframeCursorUI=ve,be.selectElement=n,be.modalBackground=P,be.ProgressPanel=Y,be.StatusBar=zt,be.IframeStatusBar=Xt,be.hide=function(t){return t?_e({cmd:we},Se,Me.top):(u.hide(),Ce.resolve())},be.show=function(t){return t?_e({cmd:xe},Ie,Me.top):(u.show(),Ce.resolve())},be.showScreenshotMark=function(t){return ye.show(t)},be.hideScreenshotMark=function(){return ye.hide()};var Be=e.nativeMethods,Te=e.EVENTS.evalIframeScript;Be.objectDefineProperty(Me,"%testCafeUI%",{configurable:!0,value:be}),e.on(Te,function(t){return Ue(Be.contentWindowGetter.call(t.iframe))})}(Me["%hammerhead%"],Me["%testCafeCore%"],Me["%hammerhead%"].Promise)}(window);
|
|
1
|
+
window["%hammerhead%"].utils.removeInjectedScript(),function Ll(zl){var Hl=zl.document;!function(u,c,e){var t="default"in u?u.default:u,n="default"in c?c.default:c;e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var h={uiRoot:null,container:null,element:function(){return this.uiRoot||(this.uiRoot=Hl.createElement("div"),u.shadowUI.getRoot().appendChild(this.uiRoot)),this.uiRoot},panelsContainer:function(){return this.container||(this.container=Hl.createElement("div"),u.shadowUI.addClass(this.container,"panels-container"),this.element().appendChild(this.container)),this.container},insertFirstChildToPanelsContainer:function(t){var e=this.panelsContainer(),n=u.nativeMethods.nodeFirstChildGetter.call(e);e.insertBefore(t,n)},hide:function(){this.uiRoot&&(this.uiRoot.style.visibility="hidden")},show:function(){this.uiRoot&&(this.uiRoot.style.visibility="")},remove:function(){var t=u.shadowUI.getRoot();u.nativeMethods.nodeParentNodeGetter.call(t).removeChild(t)}},d=t.shadowUI,p=t.utils.browser,o=t.utils.featureDetection,f=t.nativeMethods,m=t.eventSandbox.eventSimulator,v=t.eventSandbox.listeners,g=n.positionUtils,y=n.domUtils,_=n.styleUtils,C=n.eventUtils,b=n.arrayUtils,E=n.selectController,w="tcOptionList",a="disabled",S=p.isIE?30:20;function T(t){var e=f.eventTargetGetter.call(t),n=E.currentEl;(e||t.srcElement)===n||y.containsElement(n,e)||y.containsElement(E.optionList,e)||I()}function x(t,e,n){var i,r=f.eventTargetGetter.call(t),s=b.indexOf(E.options,r);s<0||(n(),(i=-1<r.className.indexOf(a))&&p.isWebKit||function(t,e){var n=E.currentEl,i=n.selectedIndex,r=n.getElementsByTagName("option")[t],s=!e&&t!==i;s&&!p.isIE&&(n.selectedIndex=t),p.isFirefox||p.isIE||!s||(m.input(n),m.change(n)),(p.isFirefox||p.isIE)&&m.mousedown(p.isFirefox?r:n),o.isTouchDevice||m.mouseup(p.isFirefox?r:n),(p.isFirefox||p.isIE)&&s&&(p.isIE&&(n.selectedIndex=t),p.isIE||m.input(n),m.change(n)),o.isTouchDevice||m.click(p.isFirefox||p.isIE?r:n),e||I()}(s,i))}function I(){y.remove(E.optionList),C.unbind(Hl,"mousedown",T),E.clear()}var i=Object.freeze({__proto__:null,expandOptionList:function(t){var e=t.children;if(e.length&&!t.disabled){if(E.currentEl){var n=t===E.currentEl;if(I(),n)return}var i=E.currentEl=t,r=E.optionList=Hl.createElement("div");h.element().appendChild(r),d.addClass(r,w),E.createChildren(e,r),v.addInternalEventBeforeListener(zl,["click"],x),f.setTimeout.call(zl,function(){C.bind(Hl,"mousedown",T)},0),_.set(r,{position:"absolute",fontSize:_.get(i,"fontSize"),fontFamily:_.get(i,"fontFamily"),minWidth:_.getWidth(i)+"px",left:g.getOffsetPosition(i).left+"px",height:y.getSelectVisibleChildren(t).length>S?_.getOptionHeight(t)*S:""});var s,o=g.getOffsetPosition(i).top,a=_.getHeight(r),l=o+_.getHeight(i)+2;l+a>_.getScrollTop(zl)+_.getHeight(zl)&&(s=o-3-a)>=_.getScrollTop(zl)&&(l=s),_.set(r,"top",l+"px")}},collapseOptionList:I,scrollOptionListByChild:function(t){var e,n,i,r,s,o,a=y.getSelectParent(t);a&&(e=_.getSelectElementSize(a),n=_.getOptionHeight(a),i=0,s=(r=Math.max(_.getScrollTop(a)/n,0))+e-1,(o=y.getChildVisibleIndex(a,t))<r?(i=n*(r-o),_.setScrollTop(a,Math.max(_.getScrollTop(a)-i,0))):s<o&&(i=n*(o-s),_.setScrollTop(a,_.getScrollTop(a)+i)))},getSelectChildCenter:function(t){var e=y.getSelectParent(t);if(!e)return{x:0,y:0};var n=_.getOptionHeight(e),i=g.getElementRectangle(t);return{x:Math.round(i.left+i.width/2),y:Math.round(i.top+n/2)}},switchOptionsByKeys:function(t,e){var n=_.getSelectElementSize(t),i=!_.hasDimensions(d.select("."+w)[0]);if(/down|up/.test(e)||!p.isIE&&(n<=1||p.isFirefox)&&(i||p.isFirefox)&&/left|right/.test(e)){for(var r=t.querySelectorAll("option"),s=[],o=0;o<r.length;o++){var a=r[o].parentElement;r[o].disabled||"optgroup"===y.getTagName(a)&&a.disabled||s.push(r[o])}var l=b.indexOf(s,r[t.selectedIndex])+(/down|right/.test(e)?1:-1);0<=l&&l<s.length&&(t.selectedIndex=b.indexOf(r,s[l]),p.isIE||m.input(t),m.change(t))}}}),r="Loading page...",s="modal-background",l="loading-text",A="loading-icon",M=null,B=null,N=null,R=!1;function U(){function t(){var t=c.styleUtils.getHeight(zl),e=c.styleUtils.getWidth(zl);c.styleUtils.set(M,"width",e+"px"),c.styleUtils.set(M,"height",t+"px"),c.styleUtils.set(N,{left:Math.round((e-c.styleUtils.getWidth(N))/2)+"px",top:Math.round((t-c.styleUtils.getHeight(N))/2)+"px"})}t(),c.eventUtils.bind(zl,"resize",t)}function D(){var t,e,n,i;t=h.element(),M=Hl.createElement("div"),t.appendChild(M),u.shadowUI.addClass(M,s),B=Hl.createElement("div"),u.nativeMethods.nodeTextContentSetter.call(B,r),t.appendChild(B),u.shadowUI.addClass(B,l),N=Hl.createElement("div"),c.styleUtils.set(N,"visibility","hidden"),t.appendChild(N),u.shadowUI.addClass(N,A),U(),e=c.styleUtils.getHeight(zl),n=c.styleUtils.getWidth(zl),(i=!c.styleUtils.hasDimensions(B))&&(c.styleUtils.set(B,"visibility","hidden"),c.styleUtils.set(B,"display","block")),c.styleUtils.set(B,{left:Math.max((n-c.styleUtils.getWidth(B))/2,0)+"px",top:Math.max((e-c.styleUtils.getHeight(B))/2,0)+"px"}),i&&(c.styleUtils.set(B,"display","none"),c.styleUtils.set(B,"visibility","")),R=!0}var k=Object.freeze({__proto__:null,initAndShowLoadingText:function(){function t(){D(),c.styleUtils.set(M,"opacity",.8),c.styleUtils.set(M,"display","block"),c.styleUtils.set(B,"display","block"),e=!0}var e=!1,n=function(){e||(Hl.body?t():u.nativeMethods.setTimeout.call(zl,n,0))};n(),c.eventUtils.documentReady().then(function(){e||t()})},show:function(t){R||D(),c.styleUtils.set(M,"opacity",t?0:.7),c.styleUtils.set(M,"display","block")},hide:function(){R&&(c.styleUtils.set(B,"display","none"),c.styleUtils.set(M,"display","none"))},showLoadingIcon:function(){c.styleUtils.set(N,"visibility","visible")},hideLoadingIcon:function(){c.styleUtils.set(N,"visibility","hidden")}}),V=t.shadowUI,O=n.styleUtils,P="success",F=($.prototype.setValue=function(t){t="number"!=typeof t?0:Math.min(Math.max(t,0),100),O.set(this.valueElement,"width",t+"%")},$.prototype.setSuccess=function(t){t?V.addClass(this.containerElement,P):V.removeClass(this.containerElement,P)},$);function $(t){this.containerElement=Hl.createElement("div"),this.valueElement=Hl.createElement("div"),t.appendChild(this.containerElement),this.containerElement.appendChild(this.valueElement),V.addClass(this.containerElement,"progress-bar"),V.addClass(this.valueElement,"value")}var L=t.shadowUI,z=t.nativeMethods,H=n.eventUtils,W=n.styleUtils,j="progress-panel",q="title",G="content",Y=(X._getInvisibleElementProperty=function(t,e){var n="none"===W.get(t,"display");n&&W.set(t,"display","block");var i=t[e];return n&&W.set(t,"display","none"),i},X._showAtWindowCenter=function(t){var e=X._getInvisibleElementProperty(t,"offsetHeight"),n=X._getInvisibleElementProperty(t,"offsetWidth"),i=Math.round(W.getHeight(zl)/2-e/2),r=Math.round(W.getWidth(zl)/2-n/2);W.set(t,{left:r+"px",top:i+"px"})},X.prototype._setCurrentProgress=function(){var t=Math.round((z.dateNow()-this.startTime)/this.maxTimeout*100);this.progressBar.setValue(t)},X.prototype._setSuccess=function(t){this.progressBar.setSuccess(t)},X.prototype._stopAnimation=function(){z.clearInterval.call(zl,this.animationInterval)},X.prototype._animate=function(t,e,n,i){var r,s,o,a=this,l=z.dateNow(),u=n?0:1;n&&(W.set(t,"opacity",u),W.set(t,"display","block")),this._stopAnimation(),this.animationInterval=z.setInterval.call(zl,function(){r=z.dateNow()-l,s=Math.min(r/e,1),o=.5-Math.cos(s*Math.PI)/2,W.set(t,"opacity",u+(n?o:-o)),1===s&&(a._stopAnimation(),i&&i())},10)},X.prototype._showPanel=function(){H.bind(zl,"resize",this.disposePanel),this._animate(this.panelDiv,200,!0)},X.prototype._hidePanel=function(t){var e=this;this.startTime=null,H.unbind(zl,"resize",this.disposePanel),this._animate(this.panelDiv,t?0:600,!1,function(){return W.set(e.panelDiv,"display","none")})},X.prototype.show=function(t,e){var n=this;this.startTime=z.dateNow(),this.maxTimeout=e,z.nodeTextContentSetter.call(this.titleDiv,t),this._setSuccess(!1),this.openingTimeout=z.setTimeout.call(zl,function(){n.openingTimeout=null,n._setCurrentProgress(),n._showPanel(),n.updateInterval=z.setInterval.call(zl,function(){return n._setCurrentProgress()},100)},300)},X.prototype.close=function(t){var e=this;t&&this._setSuccess(!0),this.openingTimeout&&(z.clearTimeout.call(zl,this.openingTimeout),this.openingTimeout=null),this.updateInterval&&(z.clearInterval.call(zl,this.updateInterval),this.updateInterval=null),t?this.startTime&&z.dateNow()-this.startTime<1e3?z.setTimeout.call(zl,function(){z.setTimeout.call(zl,function(){return e._hidePanel(!1)},200)},100):z.setTimeout.call(zl,function(){return e._hidePanel(!1)},200):this._hidePanel(!0)},X);function X(){var t=this;this.startTime=null,this.openingTimeout=null,this.updateInterval=null,this.animationInterval=null,this.panelDiv=Hl.createElement("div"),h.element().appendChild(this.panelDiv),this.titleDiv=Hl.createElement("div"),this.panelDiv.appendChild(this.titleDiv),this.contentDiv=Hl.createElement("div"),this.panelDiv.appendChild(this.contentDiv),L.addClass(this.panelDiv,j),L.addClass(this.titleDiv,q),L.addClass(this.contentDiv,G),X._showAtWindowCenter(this.panelDiv),this.progressBar=new F(this.contentDiv),this.disposePanel=function(){return X._showAtWindowCenter(t.panelDiv)}}var K=function(t,e){return(K=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function J(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}K(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function Q(t,o,a,l){return new(a=a||e)(function(n,e){function i(t){try{s(l.next(t))}catch(t){e(t)}}function r(t){try{s(l.throw(t))}catch(t){e(t)}}function s(t){var e;t.done?n(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(i,r)}s((l=l.apply(t,o||[])).next())})}function Z(n,i){var r,s,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function t(e){return function(t){return function(e){if(r)throw new TypeError("Generator is already executing.");for(;l&&e[l=0]&&(a=0),a;)try{if(r=1,s&&(o=2&e[0]?s.return:e[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,e[1])).done)return o;switch(s=0,o&&(e=[2&e[0],o.value]),e[0]){case 0:case 1:o=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,s=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(o=0<(o=a.trys).length&&o[o.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!o||e[1]>o[0]&&e[1]<o[3])){a.label=e[1];break}if(6===e[0]&&a.label<o[1]){a.label=o[1],o=e;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(e);break}o[2]&&a.ops.pop(),a.trys.pop();continue}e=i.call(n,a)}catch(t){e=[6,t],s=0}finally{r=o=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}var tt=t.shadowUI,et=t.nativeMethods,nt=n.styleUtils,it="determinate",rt=(st.prototype._setCurrentProgress=function(){var t=(et.dateNow()-this.startTime)/this.maxTimeout,e=Math.min(Math.max(t,0),1),n=nt.getWidth(this.progressBar),i=Math.round(n*e);nt.set(this.firstValueElement,"width",i+"px")},st.prototype.start=function(t,e){var n=this;tt.addClass(this.progressBar,it),this.maxTimeout=t,this.startTime=e||et.dateNow(),this._setCurrentProgress(),this.animationInterval=et.setInterval.call(zl,function(){return n._setCurrentProgress()},10)},st.prototype.stop=function(){this.animationInterval&&(et.clearInterval.call(zl,this.animationInterval),this.animationInterval=null)},st.prototype.reset=function(){nt.set(this.firstValueElement,"width",0),tt.removeClass(this.progressBar,it)},st);function st(t,e){this.progressBar=t,this.firstValueElement=e,this.maxTimeout=null,this.startTime=null,this.animationInterval=null}function ot(t,e,n){if(e.x===t.x)return 0;var i=(e.y-t.y)/(e.x-t.x),r=t.x*(t.y-e.y)/(e.x-t.x)+t.y;return Math.round(i*n+r)}var at=t.shadowUI,lt=t.nativeMethods,ut=n.styleUtils,ct={time:2800,points:[.815,.395],positionByCompletePercent:{0:{left:-35,right:100},.6:{left:100,right:-90},1:{left:100,right:-90}}},ht={time:3e3,points:[.84,1],positionByCompletePercent:{0:{left:-200,right:100},.6:{left:107,right:-8},1:{left:107,right:-8}}},dt=0,pt=.6,ft=1,mt="indeterminate",vt=(gt._updateValueAnimation=function(t,e,n){var i,r,s,o,a,l,u,c,h,d,p=n.time,f=n.points,m=n.positionByCompletePercent,v=lt.dateNow()-t,g=(i=v/p,r=f[0],s=f[1],3*Math.pow(1-i,2)*i*r+3*(1-i)*i*i*s+i*i*i),y=(c=(l=(o=g)<pt)?pt:ft,h=(a=m)[u=l?dt:pt],d=a[c],{left:ot({x:u,y:h.left},{x:c,y:d.left},o),right:ot({x:u,y:h.right},{x:c,y:d.right},o)}),_=y.left,C=y.right;ut.set(e,"left",Math.round(_)+"%"),ut.set(e,"right",Math.round(C)+"%")},gt.prototype._clearFirstValueAnimation=function(){this.animationInterval&&(lt.clearInterval.call(zl,this.animationInterval),this.animationInterval=null),ut.set(this.firstValue,"left","-35%"),ut.set(this.firstValue,"right","100%")},gt.prototype._clearSecondValueAnimation=function(){this.secondValueAnimationInterval&&(lt.clearInterval.call(zl,this.secondValueAnimationInterval),this.secondValueAnimationInterval=null),ut.set(this.secondValue,"left","-200%"),ut.set(this.secondValue,"right","100%")},gt.prototype._startFirstValueAnimation=function(){var t=this;this._clearFirstValueAnimation();var e=lt.dateNow();this.animationInterval=lt.setInterval.call(zl,function(){gt._updateValueAnimation(e,t.firstValue,ct)},10)},gt.prototype._startSecondValueAnimation=function(){var t=this;this._clearSecondValueAnimation();var e=lt.dateNow();this.secondValueAnimationInterval=lt.setInterval.call(zl,function(){gt._updateValueAnimation(e,t.secondValue,ht)},10)},gt.prototype._startAnimation=function(){var t=this;this._startFirstValueAnimation(),this.secondValueAnimationTimeout=lt.setTimeout.call(zl,function(){return t._startSecondValueAnimation()},1e3),this.restartAnimationTimeout=lt.setTimeout.call(zl,function(){return t._startAnimation()},1950)},gt.prototype._stopAnimation=function(){this._clearFirstValueAnimation(),this._clearSecondValueAnimation(),this.secondValueAnimationTimeout&&(lt.clearInterval.call(zl,this.secondValueAnimationTimeout),this.secondValueAnimationTimeout=null),this.restartAnimationTimeout&&(lt.clearInterval.call(zl,this.restartAnimationTimeout),this.restartAnimationTimeout=null)},gt.prototype.start=function(){at.addClass(this.progressBar,mt),this._startAnimation()},gt.prototype.stop=function(){at.removeClass(this.progressBar,mt),this._stopAnimation()},gt);function gt(t,e,n){this.progressBar=t,this.firstValue=e,this.secondValue=n,this.animationInterval=null,this.secondValueAnimationInterval=null,this.secondValueAnimationTimeout=null,this.restartAnimationTimeout=null}var yt=t.shadowUI,_t=n.styleUtils,Ct=(bt.prototype._create=function(t){this.progressBar=Hl.createElement("div"),yt.addClass(this.progressBar,"progress-bar"),t.appendChild(this.progressBar);var e=Hl.createElement("div");yt.addClass(e,"value-container"),this.progressBar.appendChild(e),this.firstValueElement=Hl.createElement("div"),yt.addClass(this.firstValueElement,"value"),e.appendChild(this.firstValueElement),this.secondValueElement=Hl.createElement("div"),yt.addClass(this.secondValueElement,"value"),e.appendChild(this.secondValueElement)},bt.prototype.show=function(){_t.set(this.progressBar,"visibility","visible")},bt.prototype.hide=function(){_t.set(this.progressBar,"visibility","hidden")},bt);function bt(t){this.progressBar=null,this.firstValueElement=null,this.secondValueElement=null,this._create(t),this.determinateIndicator=new rt(this.progressBar,this.firstValueElement),this.indeterminateIndicator=new vt(this.progressBar,this.firstValueElement,this.secondValueElement)}var Et,wt="start-waiting-element",St="end-waiting-element-request",Tt="end-waiting-element-response",xt="start-waiting-assertion-retries",It="end-waiting-assertion-retries-request",At="end-waiting-assertion-retries-response",Mt="step",Bt="resume",Nt=t.Promise,Rt=t.shadowUI,Ut=t.nativeMethods,Dt=t.eventSandbox.message,kt=t.utils.browser,Vt=t.utils.featureDetection,Ot=t.eventSandbox.listeners,Pt=n.styleUtils,Ft=n.eventUtils,$t=n.domUtils,Lt=n.serviceUtils,zt=n.arrayUtils,Ht="waiting-element-failed",Wt="waiting-element-success",jt="%testCafeStatusPrefix%",qt=(J(Gt,Et=Lt.EventEmitter),Object.defineProperty(Gt.prototype,"visibleHeight",{get:function(){return this.maxHeight=Math.max(this.maxHeight,Pt.getHeight(this.statusBar)),this.maxHeight},enumerable:!1,configurable:!0}),Gt.prototype._createButton=function(t,e){var n=Hl.createElement("div"),i=Hl.createElement("div"),r=Hl.createElement("span");return Ut.nodeTextContentSetter.call(r,t),Rt.addClass(n,"button"),Rt.addClass(n,e),Rt.addClass(i,"button-icon"),kt.isSafari&&(r.style.position="relative",r.style.top="1px"),n.appendChild(i),n.appendChild(r),n},Gt.prototype._createIconArea=function(){this.icon=Hl.createElement("div"),Rt.addClass(this.icon,"icon"),this.statusBar.appendChild(this.icon)},Gt.prototype._createInformationArea=function(){this.infoContainer=Hl.createElement("div"),Rt.addClass(this.infoContainer,"info-container"),this.statusBar.appendChild(this.infoContainer);var t=Hl.createElement("div");Rt.addClass(t,"info-text-container"),this.infoContainer.appendChild(t);var e=Hl.createElement("div");Rt.addClass(e,"status-container"),t.appendChild(e),this.statusDiv=Hl.createElement("div"),this.statusDiv=Hl.createElement("div"),Ut.nodeTextContentSetter.call(this.statusDiv,this._getFullStatusText("Loading Web Page...")),Rt.addClass(this.statusDiv,"status"),Rt.addClass(this.statusDiv,"info"),e.appendChild(this.statusDiv);var n=Hl.createElement("div");Ut.nodeTextContentSetter.call(n,"".concat(this.fixtureName," - ").concat(this.testName)),Rt.addClass(n,"fixture"),Rt.addClass(n,"info"),e.appendChild(n);var i=Hl.createElement("div");Ut.nodeTextContentSetter.call(i,this.userAgent),Rt.addClass(i,"user-agent"),t.appendChild(i)},Gt.prototype._createActionsArea=function(){var t=this;this.actionsContainer=Hl.createElement("div"),Rt.addClass(this.actionsContainer,"actions-container"),this.statusBar.appendChild(this.actionsContainer),this.buttons=Hl.createElement("div"),Rt.addClass(this.buttons,"buttons"),this.actionsContainer.appendChild(this.buttons),this.unlockButton=this._createButton("Unlock Page","locked"),this.resumeButton=this._createButton("Resume","resume"),this.nextButton=this._createButton("Next Action","step"),this.finishButton=this._createButton("Finish","finish"),this.buttons.appendChild(this.unlockButton),this.buttons.appendChild(this.resumeButton),this.buttons.appendChild(this.nextButton),this.actionsContainer.style.display="none",this._bindClickOnce([this.unlockButton],function(){Rt.removeClass(t.unlockButton,"locked"),Rt.addClass(t.unlockButton,"unlocked"),Ut.nodeTextContentSetter.call(t.unlockButton.querySelector("span"),"Page unlocked"),t.state.locked=!1,t.emit(t.UNLOCK_PAGE_BTN_CLICK,{})}),this.unlockButton.style.display="none"},Gt.prototype._create=function(){this.statusBar=Hl.createElement("div"),Rt.addClass(this.statusBar,"status-bar"),this._createIconArea(),this._createInformationArea(),this._createActionsArea(),this.progressBar=new Ct(this.infoContainer),this.progressBar.indeterminateIndicator.start(),this.progressBar.show(),h.panelsContainer().appendChild(this.statusBar),this._bindHandlers(),this.state.created=!0},Gt.prototype._createBeforeReady=function(){var t,e=this;this.state.created||(t=zl).top!==t||(Hl.body?this._create():Ut.setTimeout.call(zl,function(){return e._createBeforeReady()},0))},Gt.prototype._animate=function(t){var e,n,i,r=this,s=Ut.dateNow(),o=parseInt(Pt.get(this.statusBar,"opacity"),10)||0;this._stopAnimation(),t&&(Pt.set(this.statusBar,"visibility",""),this.state.hidden=!1),this.animationInterval=Ut.setInterval.call(zl,function(){e=Ut.dateNow()-s,n=Math.min(e/500,1),i=.5-Math.cos(n*Math.PI)/2,Pt.set(r.statusBar,"opacity",o+(t?i:-i)),1===n&&(r._stopAnimation(),t||(Pt.set(r.statusBar,"visibility","hidden"),r.state.hidden=!0),r.state.showing=!1,r.state.hiding=!1)},10)},Gt.prototype._stopAnimation=function(){this.animationInterval&&(Ut.clearInterval.call(zl,this.animationInterval),this.animationInterval=null)},Gt.prototype._fadeOut=function(){this.state.hiding||this.state.debugging||(this.state.showing=!1,this.state.hiding=!0,this._animate())},Gt.prototype._fadeIn=function(){this.state.showing||this.state.debugging||(this.state.hiding=!1,this.state.showing=!0,this._animate(!0))},Gt.prototype._bindHandlers=function(){var e=this;Ot.initElementListening(zl,["resize"]),Ot.addInternalEventBeforeListener(zl,["resize"],function(){e.windowHeight=zl.innerHeight}),Ot.addFirstInternalEventBeforeListener(zl,["mousemove","mouseout","touchmove"],function(t){"mouseout"!==t.type||t.relatedTarget?"mousemove"!==t.type&&"touchmove"!==t.type||(t.clientY>e.windowHeight-e.visibleHeight?e._fadeOut(t):e.state.hidden&&e._fadeIn(t)):e._fadeIn(t)})},Gt.prototype._bindClickOnce=function(n,i){var r=this,s=Vt.isTouchDevice?"touchstart":"mousedown",o=function(t){var e=Ut.eventTargetGetter.call(t);zt.find(n,function(t){return $t.containsElement(t,e)})?(Ft.preventDefault(t),Ot.removeInternalEventBeforeListener(zl,[s],o),i(t)):$t.containsElement(r.statusBar,e)&&Ft.preventDefault(t)};Ot.addInternalEventBeforeListener(zl,[s],o)},Gt.prototype._initChildListening=function(){var n=this;Dt.on(Dt.SERVICE_MSG_RECEIVED_EVENT,function(t){var e=t.message;e.cmd===wt?n.showWaitingElementStatus(e.timeout):e.cmd===St?n.hideWaitingElementStatus(e.waitingSuccess).then(function(){return Dt.sendServiceMsg({cmd:Tt},t.source)}):e.cmd===xt?n.showWaitingAssertionRetriesStatus(e.timeout):e.cmd===It&&n.hideWaitingAssertionRetriesStatus(e.waitingSuccess).then(function(){return Dt.sendServiceMsg({cmd:At},t.source)})})},Gt.prototype._resetState=function(){this.state.debugging=!1,this.actionsContainer.style.display="none",this.unlockButton.style.display="none",Ut.nodeTextContentSetter.call(this.statusDiv,this._getFullStatusText("")),this.progressBar.hide()},Gt.prototype._getFullStatusText=function(t){var e=this.contextStorage.getItem(jt)||"";return e+(e&&t?". ":"")+t},Gt.prototype._showWaitingStatus=function(){var t=this.state.assertionRetries?"Waiting for assertion execution...":"Waiting for element to appear...";Ut.nodeTextContentSetter.call(this.statusDiv,this._getFullStatusText(t)),this.progressBar.show()},Gt.prototype._hideWaitingStatus=function(e){var n=this;return new Nt(function(t){Ut.setTimeout.call(zl,function(){n.state.waiting||n.state.debugging||(Rt.removeClass(n.statusBar,Wt),Rt.removeClass(n.statusBar,Ht),n.progressBar.determinateIndicator.reset(),n._resetState()),t()},e?0:500)})},Gt.prototype._showDebuggingStatus=function(t){var r=this;return new Nt(function(i){r.state.debugging=!0,r.state.locked=!0,t?(r.buttons.removeChild(r.nextButton),r.buttons.removeChild(r.resumeButton),r.buttons.appendChild(r.finishButton),Ut.nodeTextContentSetter.call(r.statusDiv,r._getFullStatusText("Test failed")),Rt.removeClass(r.statusBar,Wt),Rt.addClass(r.statusBar,Ht)):Ut.nodeTextContentSetter.call(r.statusDiv,r._getFullStatusText("Debugging test...")),r.actionsContainer.style.display="",r.unlockButton.style.display="",r._bindClickOnce([r.resumeButton,r.nextButton,r.finishButton],function(t){var e=Ut.eventTargetGetter.call(t),n=$t.containsElement(r.nextButton,e);r._resetState(),i(n?Mt:Bt)})})},Gt.prototype._setWaitingStatus=function(t,e){var n=this;this.state.waiting=!0,this.progressBar.determinateIndicator.start(t,e),this.showingTimeout=Ut.setTimeout.call(zl,function(){n.showingTimeout=null,n._showWaitingStatus()},300)},Gt.prototype._resetWaitingStatus=function(t){this.state.waiting=!1,this.progressBar.determinateIndicator.stop(),t?Rt.addClass(this.statusBar,Wt):Rt.addClass(this.statusBar,Ht);var e=this.showingTimeout&&t;return this.showingTimeout&&(Ut.clearTimeout.call(zl,this.showingTimeout),this.showingTimeout=null,t||this._showWaitingStatus()),this._hideWaitingStatus(e)},Gt.prototype.hidePageLoadingStatus=function(){this.state.created||this._create(),this.progressBar.indeterminateIndicator.stop(),this._resetState()},Gt.prototype.showDebuggingStatus=function(t){return this._stopAnimation(),Pt.set(this.statusBar,"opacity",1),Pt.set(this.statusBar,"visibility",""),this.state.hiden=!1,this._showDebuggingStatus(t)},Gt.prototype.showWaitingElementStatus=function(t){this.state.assertionRetries||this._setWaitingStatus(t)},Gt.prototype.hideWaitingElementStatus=function(t){return this.state.assertionRetries?Nt.resolve():this._resetWaitingStatus(t)},Gt.prototype.showWaitingAssertionRetriesStatus=function(t,e){this.state.assertionRetries=!0,this._setWaitingStatus(t,e)},Gt.prototype.hideWaitingAssertionRetriesStatus=function(t){var e=this;return this._resetWaitingStatus(t).then(function(){e.state.assertionRetries=!1})},Gt.prototype.setStatusPrefix=function(t){this.contextStorage.setItem(jt,t),Ut.nodeTextContentSetter.call(this.statusDiv,this._getFullStatusText(""))},Gt);function Gt(t,e,n,i){var r=Et.call(this)||this;return r.UNLOCK_PAGE_BTN_CLICK="testcafe|ui|status-bar|unlock-page-btn-click",r.userAgent=t,r.fixtureName=e,r.testName=n,r.contextStorage=i,r.statusBar=null,r.infoContainer=null,r.actionsContainer=null,r.icon=null,r.resumeButton=null,r.finishButton=null,r.nextButton=null,r.statusDiv=null,r.buttons=null,r.progressBar=null,r.animationInterval=null,r.showingTimeout=null,r.windowHeight=Hl.documentElement?Pt.getHeight(zl):zl.innerHeight,r.maxHeight=0,r.state={created:!1,showing:!1,hiding:!1,debugging:!1,waiting:!1,assertionRetries:!1,hidden:!1},r.currentView=null,r._createBeforeReady(),r._initChildListening(),r}var Yt,Xt=n.sendRequestToFrame,Kt=t.eventSandbox.message,Jt=(J(Qt,Yt=qt),Qt.prototype.showWaitingElementStatus=function(t){Kt.sendServiceMsg({cmd:wt,timeout:t},zl.top)},Qt.prototype.hideWaitingElementStatus=function(t){return Xt({cmd:St,waitingSuccess:t},Tt,zl.top)},Qt.prototype.showWaitingAssertionRetriesStatus=function(t){Kt.sendServiceMsg({cmd:xt,timeout:t},zl.top)},Qt.prototype.hideWaitingAssertionRetriesStatus=function(t){return Xt({cmd:It,waitingSuccess:t},At,zl.top)},Qt);function Qt(){return Yt.call(this)||this}var Zt="ui|cursor|move|request",te="ui|cursor|leftbuttondown|request",ee="ui|cursor|rightbuttondown|request",ne="ui|cursor|buttonup|request",ie="ui|cursor|move|response",re="ui|cursor|leftbuttondown|response",se="ui|cursor|rightbuttondown|response",oe="ui|cursor|buttonup|response",ae=t.Promise,le=t.shadowUI,ue=t.utils.browser,ce=t.utils.featureDetection,he=t.eventSandbox.message,de=n.styleUtils,pe=n.positionUtils,fe="l-mouse-down",me="r-mouse-down",ve=[fe,me].join(" ");he.on(he.SERVICE_MSG_RECEIVED_EVENT,function(t){var e=t.message;switch(e.cmd){case Zt:e.shouldRender||(ge.shouldRender=e.shouldRender),ge.move(pe.getIframePointRelativeToParentFrame({x:e.x,y:e.y},t.source)).then(function(){return he.sendServiceMsg({cmd:ie},t.source)});break;case te:ge.leftButtonDown().then(function(){return he.sendServiceMsg({cmd:re},t.source)});break;case ee:ge.rightButtonDown().then(function(){return he.sendServiceMsg({cmd:se},t.source)});break;case ne:ge.buttonUp().then(function(){return he.sendServiceMsg({cmd:oe},t.source)})}});var ge={cursorElement:null,x:50,y:50,pointerOffsetX:0,pointerOffsetY:0,shouldRender:!0,_createElement:function(){this.cursorElement=Hl.createElement("div"),le.addClass(this.cursorElement,"cursor"),ce.isTouchDevice&&!ue.isIE&&(le.addClass(this.cursorElement,"touch"),this.pointerOffsetX=Math.ceil(de.getWidth(this.cursorElement)/2),this.pointerOffsetY=Math.ceil(de.getHeight(this.cursorElement)/2)),h.element().appendChild(this.cursorElement)},_ensureCursorElement:function(){return!!this.shouldRender&&(this.cursorElement||this._createElement(),!0)},isVisible:function(){return this.cursorElement&&"hidden"!==de.get(this.cursorElement,"visibility")},hide:function(){this._ensureCursorElement()&&this.isVisible()&&de.set(this.cursorElement,"visibility","hidden")},show:function(){this._ensureCursorElement()&&de.set(this.cursorElement,"visibility","")},move:function(t){return this._ensureCursorElement()&&(this.x=t.x,this.y=t.y,de.set(this.cursorElement,{left:this.x-this.pointerOffsetX+"px",top:this.y-this.pointerOffsetY+"px"})),ae.resolve()},leftButtonDown:function(){return this._ensureCursorElement()&&(le.removeClass(this.cursorElement,ve),le.addClass(this.cursorElement,fe)),ae.resolve()},rightButtonDown:function(){return this._ensureCursorElement()&&(le.removeClass(this.cursorElement,ve),le.addClass(this.cursorElement,me)),ae.resolve()},buttonUp:function(){return this._ensureCursorElement()&&le.removeClass(this.cursorElement,ve),ae.resolve()}},ye=t.utils.browser.isIE?1:0,_e={move:function(t){var e={cmd:Zt,x:t.x+ye,y:t.y+ye,shouldRender:this.shouldRender};return c.sendRequestToFrame(e,ie,zl.parent)},leftButtonDown:function(){return c.sendRequestToFrame({cmd:te},re,zl.parent)},rightButtonDown:function(){return c.sendRequestToFrame({cmd:ee},se,zl.parent)},buttonUp:function(){return c.sendRequestToFrame({cmd:ne},oe,zl.parent)}},Ce={screenshotMark:null,_createMark:function(){this.screenshotMark=Hl.createElement("img"),u.shadowUI.addClass(this.screenshotMark,"screenshot-mark"),this.screenshotMark.style.right=10/zl.devicePixelRatio+"px",this.screenshotMark.style.width=32/zl.devicePixelRatio+"px",this.screenshotMark.style.height=10/zl.devicePixelRatio+"px",this.hide(),u.shadowUI.getRoot().appendChild(this.screenshotMark)},hide:function(){this.screenshotMark&&(this.screenshotMark.style.visibility="hidden")},show:function(t){this.screenshotMark||this._createMark(),u.nativeMethods.imageSrcSetter.call(this.screenshotMark,t),this.screenshotMark.style.visibility=""}},be=t.shadowUI,Ee=t.nativeMethods;function we(t){var e=t.tag,n=void 0===e?"div":e,i=t.class,r=t.src,s=t.text,o=t.type,a=t.value,l=Hl.createElement(n);return o&&Ee.setAttribute.call(l,"type",o),a&&Ee.inputValueSetter.call(l,a),r&&Ee.setAttribute.call(l,"src",r),i&&be.addClass(l,i),s&&Ee.nodeTextContentSetter.call(l,s),l}var Se=n.styleUtils;function Te(t,e){for(var n in e)Se.set(t,n,e[n])}var xe={tag:"input",type:"button",value:"Pick",class:"pick-button"},Ie={tag:"input",type:"text",class:"selector-input"},Ae={class:"match-indicator",text:"No Matching Elements"},Me={class:"expand-selector-list"},Be={class:"selector-input-container"},Ne={tag:"input",type:"button",value:"Copy"},Re={class:"selectors-list"},Ue={class:"selector-inspector-panel"},De={class:"element-frame"},ke={class:"tooltip"},Ve={class:"arrow"},Oe={tag:"input",type:"text",class:"auxiliary-input"};function Pe(t){var e;t.parentElement||(e=h.panelsContainer(),h.element().insertBefore(t,e))}function Fe(t){t.parentElement&&h.element().removeChild(t)}var $e,Le=zl["%testCafeCore%"],ze=function(t,e){void 0===e&&(e=!1),this.type=t,this.editable=e,this.disabled=void 0},He=(J(We,$e=ze),We);function We(t){return $e.call(this,t.toLowerCase(),!0)||this}var je={edited:"$edited$",byTagName:"$tagName$",byId:"id",byText:"$text$",byClassAttr:"class",byAttr:"$attr$",byTagTree:"$dom$"},qe=[new ze(je.byTagName),new ze(je.byId),new ze(je.byText),new ze(je.byClassAttr),new ze(je.byAttr),new ze(je.byTagTree)],Ge=je.byTagTree,Ye=Object.freeze({__proto__:null,CustomSelectorRule:He,DEFAULT_SELECTOR_RULES:qe,RULE_TYPE:je,SelectorRule:ze,UNSWITCHABLE_RULE_TYPE:Ge}),Xe=(Ke.prototype.concat=function(t){return t.type===this.type?new Ke(this.type,this.filter.concat(" ",t.filter)):null},Ke);function Ke(t,e){this.type=t,this.filter=e}var Je="index",Qe="tag",Ze="attr",tn=Le.domUtils,en=Le.arrayUtils;function nn(t,e){var n=tn.getElementIndexInParent(e,t),i=new Xe(Qe,tn.getTagName(t));return 0===n?[i]:[i,new Xe(Je,n)]}function rn(t,e){for(var n=t.parentElement,i=[];n;){if(n===e)return i;i.push(n),n=n.parentElement}return i}var sn=Le.domUtils,on=Le.arrayUtils,an=(Object.defineProperty(ln.prototype,"isCustom",{get:function(){return this.ancestorSelectorDescriptor?this.isCustomRule||this.ancestorSelectorDescriptor.isCustomRule:this.isCustomRule},enumerable:!1,configurable:!0}),ln.prototype._getStringArrayRepresentation=function(){return function(t){for(var e=[],n=0,i=t;n<i.length;n++){var r,s=i[n];0===on.indexOf(t,s)?e.push("Selector('".concat(s.filter,"')")):"text"===s.type?e.push(".withText('".concat(s.filter,"')")):s.type===Je?e.push(".nth(".concat(s.filter,")")):s.type===Qe?e.push(".find('".concat(s.filter,"')")):s.type===Ze&&(r=s.filter.attrValueRe?", ".concat(s.filter.attrValueRe):"",e.push(".withAttribute('".concat(s.filter.attrName,"'").concat(r,")")))}return e}(this._concatFilterOptions())},ln.prototype._addFilterByIndex=function(t){var e;1<t.length&&0!==(e=on.indexOf(t,this.element))&&this.filterOptions.push(new Xe(Je,e))},ln.prototype._concatFilterOptions=function(){var t=this.ancestorSelectorDescriptor,e=[];t&&(e=t._concatFilterOptions()),this.cssSelector&&e.push(new Xe(Qe,this.cssSelector));var n=on.concat(e,this.filterOptions);return on.reduce(n,function(t,e){if(e.type===Qe&&t.length){var n=t[t.length-1];if(n.type===Qe)return t[t.length-1]=n.concat(e),t}return t.push(e),t},[])},ln.prototype._getElements=function(){if(this.ruleType===je.byTagTree)return[this.element];var t=this.ancestorSelectorDescriptor?this.ancestorSelectorDescriptor.element:sn.findDocument(this.element),e=null;if(this.cssSelector)try{var n=zl.eval("(function(){return '".concat(this.cssSelector,"';})();")),e=on.from(t.querySelectorAll(n))}catch(t){return null}else e=[t];return 0===(e=e.length&&this.filter?this.filter(e):e).length||-1===on.indexOf(e,this.element)?[]:e},ln.createFromInstance=function(t,e){return new ln({ancestorSelectorDescriptor:e,cssSelector:t.cssSelector,element:t.element,filter:t.filter,filterOptions:[].concat(t.filterOptions||[]),isCustomRule:t.isCustomRule,ruleType:t.ruleType})},ln.prototype.makeUnique=function(){var t=this.ancestorSelectorDescriptor,e=t?t._getElements():[],n=!t||e?this._getElements():null;n&&(t&&t._addFilterByIndex(e),this._addFilterByIndex(n),this.stringArray=this._getStringArrayRepresentation())},ln);function ln(t){this.ruleType=t.ruleType,this.isCustomRule=t.isCustomRule,this.element=t.element,this.ancestorSelectorDescriptor=t.ancestorSelectorDescriptor,this.cssSelector=t.cssSelector,this.filterOptions=on.concat([],t.filterOptions||[]),this.filter=t.filter,this.stringArray=this._getStringArrayRepresentation()}var un=(cn.prototype._init=function(){},cn.prototype._shouldCreate=function(){throw new Error("Not implemented")},cn.prototype._getDescriptor=function(){throw new Error("Not implemented")},cn.prototype.create=function(t,e){return this.element=t,this._init(),this._shouldCreate(e)?this._getDescriptor(e):null},cn);function cn(t){this.type=t,this.element=null}var hn,dn=Le.domUtils,pn=/html|body/,fn=/header|footer|main/,mn=(J(vn,hn=un),vn.prototype._init=function(){this.tagName=dn.getTagName(this.element)},vn.prototype._shouldCreate=function(){return this.useTopLevelParents&&pn.test(this.tagName)||fn.test(this.tagName)},vn.prototype._getDescriptor=function(){return new an({ruleType:this.type,element:this.element,cssSelector:this.tagName})},vn);function vn(t){void 0===t&&(t=!0);var e=hn.call(this,je.byTagName)||this;return e.tagName="",e.useTopLevelParents=t,e}function gn(t){return t.replace(/\\/g,"\\\\\\$&").replace(/'/g,"\\\\\\$&").replace(/(\!|#|"|\$|%|&|\(|\||\)|\*|\+|,|\.|\/|:|;|<|=|>|\?|@|\[|\]|\^|`|{|\||}|~)/g,"\\\\$&")}function yn(t){return t.replace(/'|"|\\|\||\-|\*|\?|\+|\^|\$|\[|\]/g,"\\$&").replace(/\(|\)/g,"\\S")}var _n=zl["%hammerhead%"],Cn=/[\\^$*+?.()|[\]{}]/g,bn=Le.selectorAttributeFilter,En=Le.arrayUtils,wn=_n.nativeMethods;function Sn(t){return"string"==typeof t?new RegExp(t.replace(Cn,"\\$&")):t}var Tn=Le.domUtils,xn=Le.arrayUtils,In=/\$ctl\d+|ctl\d+\$|_ctl\d+|ctl\d+_|^ctl\d+$/g,An="!!!!!separator!!!!!",Mn="!!!!!anyNumber!!!!!",Bn=new RegExp(An,"g"),Nn=new RegExp(Mn,"g"),Rn=/\s{2,}/g,Un="class";function Dn(t,e,n,i,r){return new an({ancestorSelectorDescriptor:r,cssSelector:n,element:e,filter:(o=(s=i).attrName,a=s.attrValueRe,function(t){return En.filter(t,function(t){return bn(t,0,void 0,Sn(o),Sn(a))})}),filterOptions:new Xe(Ze,i),ruleType:t});var s,o,a}function kn(t,e,n,i){var r=Tn.getTagName(e),s="",o=null;return xn.forEach(n,function(t){var e=t.name,n=t.value,i=!1,r=!1;50<n.replace(Rn," ").length&&(n=n.substr(0,50),i=!0),In.test(n)&&(r=!0,n=n.replace(In,function(t){return t.replace(/\d+/,Mn)})),Rn.test(n)&&(r=!0,n=n.replace(Rn,An)),r?o||(n=(n=yn(n)).replace(Nn,"\\d+").replace(Bn,"\\s+"),o={attrName:e,attrValueRe:new RegExp(n)}):(n=e===Un?gn(n).trimEnd():n.replace(/\\/g,"\\\\\\$&").replace(/'/g,"\\\\\\$&").replace(/"/g,"\\\\$&"),s+=e!==Un||i?"[".concat(e).concat(i?"^":"").concat(n?'="'.concat(n,'"'):"","]"):(" "+n).replace(/\s+/g,"."))}),o?Dn(t,e,s||r,o,i):new an({ruleType:t,element:e,ancestorSelectorDescriptor:i,cssSelector:s})}var Vn,On=Le.domUtils,Pn=/_ctl\d+|ctl\d+_|^ctl\d+$/g,Fn=(J($n,Vn=un),$n.prototype._init=function(){this.idAttr=this.element.getAttribute("id")},$n.prototype._shouldCreate=function(){return!!this.idAttr},$n.prototype._getDescriptor=function(){if(Pn.test(this.idAttr)){var t=(t=yn(this.idAttr)).replace(Pn,function(t){return t.replace(/\d+/,"\\d+")}),e=On.getTagName(this.element),n={attrName:"id",attrValueRe:new RegExp(t)};return Dn(je.byId,this.element,e,n)}return new an({ruleType:je.byId,element:this.element,cssSelector:"#"+gn(this.idAttr).replace(/\s/g,"\\\\ ")})},$n);function $n(){var t=Vn.call(this,je.byId)||this;return t.idAttr=null,t}var Ln=Le.domUtils,zn=_n.utils.trim,Hn=_n.nativeMethods,Wn=/^i$|^b$|^big$|^small$|^em$|^strong$|^dfn$|^code$|^samp$|^kbd$|^var$|^cite$|^abbr$|^acronym$|^sub$|^sup$|span$|^bdo$|^address$|^div$|^a$|^object$|^p$|^h\d$|^pre$|^q$|^ins$|^del$|^dt$|^dd$|^li$|^label$|^option$|^fieldset$|^legend$|^button$|^caption$|^td$|^th$|^title$/,jn=50,qn=/['"\\]/g,Gn=/\r?\n|\r/i;function Yn(t){t=t.trim().replace(qn,"\\$&");var e=Gn.exec(t),n=e?e.index:t.length;return zn(t.substring(0,Math.min(n,jn)))}var Xn,Kn=Le.domUtils,Jn=(J(Qn,Xn=un),Qn.prototype._init=function(){this.elementText=function(t){var e=Ln.isHtmlElement(t)?Hn.htmlElementInnerTextGetter.call(t):t.innerText;if(e)return Yn(e);if(Ln.isOptionElement(t)){var n=Hn.nodeTextContentGetter.call(t);return n?Yn(n):""}return""}(this.element)},Qn.prototype._shouldCreate=function(){return t=this.element,e=this.elementText,Wn.test(Ln.getTagName(t))?(e=zn(e.replace(/\s+/g," ")),/\S/.test(e)):"";var t,e},Qn.prototype._getDescriptor=function(){return new an({ruleType:this.type,element:this.element,cssSelector:Kn.getTagName(this.element),filterOptions:new Xe("text",this.elementText),filter:(e=this.elementText,function(t){return En.filter(t,function(t){return-1<(wn.htmlElementInnerTextGetter.call(t)||wn.nodeTextContentGetter.call(t)).indexOf(e)})})});var e},Qn);function Qn(){var t=Xn.call(this,je.byText)||this;return t.elementText="",t}var Zn=Le.domUtils,ti=Le.arrayUtils,ei=_n.nativeMethods,ni="%testcafe-stored-attributes%",ii=/(^alt$|^name$|^class$|^title$|^data-\S+)/,ri=/^data-ga\S+/;function si(t,e){void 0===e&&(e=[]);var n=t[ni];if(n)return ti.filter(n,function(t){return t.name!==Un});for(var i,r=ei.elementAttributesGetter.call(t),s=[],o=0;o<r.length;o++)(i=r[o]).nodeName!==Un&&function(t,e){void 0===e&&(e=[]);var n=t.nodeName;return t.nodeValue&&ii.test(n)&&-1===ti.indexOf(e,n)&&!ri.test(n)&&!Zn.isHammerheadAttr(n)}(i,e)&&s.push({name:i.nodeName,value:i.nodeValue});return s}var oi,ai=(J(li,oi=un),li.prototype._init=function(){this.elementAttributes=si(this.element,this.customAttrNames)},li.prototype._shouldCreate=function(){return!!this.elementAttributes.length},li.prototype._getDescriptor=function(){return kn(this.type,this.element,this.elementAttributes)},li);function li(t){void 0===t&&(t=[]);var e=oi.call(this,je.byAttr)||this;return e.customAttrNames=t,e.elementAttributes=[],e}var ui,ci=(J(hi,ui=un),hi.prototype._init=function(){this.className=function(t,e){for(var n,i=t[ni]||ei.elementAttributesGetter.call(t),r=0;r<i.length;r++)if((n=i[r]).name===e&&n.value)return n.value;return null}(this.element,Un)},hi.prototype._shouldCreate=function(){return!!this.className},hi.prototype._getDescriptor=function(){return kn(this.type,this.element,[{name:Un,value:this.className}])},hi);function hi(){var t=ui.call(this,je.byClassAttr)||this;return t.className="",t}var di,pi,fi=Le.domUtils,mi=Le.arrayUtils,vi=(J(gi,di=un),gi.prototype._shouldCreate=function(t){var e=t?t.element:fi.findDocument(this.element).body;return this.parents=rn(this.element,e),this.parents.push(e),this.parents.length},gi.prototype._getDescriptor=function(t){var e,n="",i=[];return e=this.element,/html|body/.test(tn.getTagName(e).toLowerCase())?i.push(new Xe(Qe,fi.getTagName(this.element))):i=function(t,e){for(var n=en.reverse(nn(t,e[0])),i=e.length,r=0;r<i-1;r++){var s=nn(e[r],e[r+1]),o=s[0],a=s[1];a&&n.push(a),n.push(o)}return en.reverse(n)}(this.element,this.parents),t?new an({ruleType:this.type,element:this.element,ancestorSelectorDescriptor:t,filterOptions:i}):(i.length&&(n=i[0].filter,mi.splice(i,0,1)),new an({ruleType:this.type,element:this.element,cssSelector:n,filterOptions:i}))},gi);function gi(){var t=di.call(this,je.byTagTree)||this;return t.parents=[],t}var yi,_i=((pi={})[je.byTagName]=new mn,pi[je.byId]=new Fn,pi[je.byText]=new Jn,pi[je.byClassAttr]=new ci,pi[je.byAttr]=new ai,pi[je.byTagTree]=new vi,pi),Ci=(J(bi,yi=un),bi.prototype._init=function(){var t=function(t,e){var n=t["%testcafe-custom-stored-attributes%"];if(n){var i=ti.find(n,function(t){return t.name===e});return i||null}return t.hasAttribute(e)?{name:e,value:t.getAttribute(e)}:null}(this.element,this.attrName);this.elementAttributes=t?[t]:[]},bi.prototype._shouldCreate=function(){return!!this.elementAttributes.length},bi.prototype._getDescriptor=function(){var t=kn(this.type,this.element,this.elementAttributes);return t.isCustomRule=!0,t},bi);function bi(t){var e=yi.call(this,t)||this;return e.attrName=t,e.elementAttributes=[],e}var Ei=Le.arrayUtils,wi=[je.byTagName,je.byId,je.byClassAttr,je.byAttr],Si=[je.byText,je.byClassAttr,je.byAttr,je.byTagTree];function Ti(t){return t.isCustomRule||-1!==Ei.indexOf(Si,t.ruleType)&&t.ruleType!==je.byTagTree}function xi(t){return t.editable||-1!==Ei.indexOf(wi,t.type)}var Ii=" > ";function Ai(t,e){return e?e+Ii+t:t}var Mi=1;function Bi(t){for(var e,n={},i=Mi,r=0,s=t;r<s.length;r++){var o=s[r];if(n[o.type]=i++,xi(o))for(var a=0,l=t;a<l.length;a++){var u=l[a];!(e=u).editable&&-1===Ei.indexOf(Si,e.type)||(n[Ai(u.type,o.type)]=i++)}}return n}var Ni=Le.domUtils,Ri=Le.arrayUtils;function Ui(t,e,n){for(var i=[],r=0,s=e;r<s.length;r++){var o=s[r].create(t,n);o&&i.push(o)}return i}function Di(t,e){for(var n=[],i=0,r=e;i<r.length;i++){var s=function(t,e){for(var n=0,i=t;n<i.length;n++){var r=i[n],s=e.create(r);if(s)return s}return null}(t,r[i]);s&&n.push(s)}return n}function ki(t){for(var n=[],e=0,i=t;e<i.length;e++){var r=i[e],s=function(e){return function(t,e){for(var n=t.length,i=0;i<n;i++)if(e(t[i]))return i;return-1}(n,function(t){return Ri.join(t.stringArray,"")===Ri.join(e.stringArray,"")})}(r);-1===s?n.push(r):n[s].priority>r.priority&&Ri.splice(n,s,1,r)}return n}function Vi(t){function e(t){return t&&t.ancestorSelectorDescriptor?t.ancestorSelectorDescriptor.ruleType:null}for(var n=Ri.filter(t,function(t){return!t.isCustom}),i=Ri.filter(n,function(t){return t.ancestorSelectorDescriptor}),r=i.length,s=10-(n.length-r),o=r-1;s<r;){for(var a=e(i[o]);e(i[o-1])===a&&(Ri.remove(t,i[o]),!(--r<=s));)o--;o--}}function Oi(t){void 0===t&&(t=qe),this.rules=Ri.filter(t,function(t){return!t.disabled});var e=Oi._processRules(this.rules),n=e.customRules,i=e.defaultRules;this.customRules=n,this.defaultRules=i,this.customAttrNames=[],this.customSelectorCreators=[],this.elementSelectorCreators=[],this.ancestorSelectorCreators=[],this._createCustomSelectorCreators(),this._createElementSelectorCreators(),this._createAncestorSelectorCreators(),this.rulePriority=Bi(this.rules)}var Pi=(Oi._priorityComparator=function(t,e){return t.priority-e.priority},Oi._getSelectorType=function(t){var e=t.ancestorSelectorDescriptor,n=e?e.ruleType:"";return Ai(t.ruleType,n)},Oi._processRules=function(t){var e=[],n=[];return Ri.filter(t,function(t){t.editable?n.push(t):e.push(t)}),{customRules:n,defaultRules:e}},Oi.prototype._createCustomSelectorCreators=function(){var e=this;Ri.forEach(this.customRules,function(t){e.customAttrNames.push(t.type),e.customSelectorCreators.push(new Ci(t.type))})},Oi.prototype._createElementSelectorCreators=function(){var n=this,i=[];Ri.forEach(this.defaultRules,function(t){var e=t.type===je.byAttr?new ai(n.customAttrNames):_i[t.type];i.push(e)}),this.elementSelectorCreators=Ri.concat(i,this.customSelectorCreators)},Oi.prototype._createAncestorSelectorCreators=function(){for(var t=0,e=this.customRules;t<e.length;t++){var n=e[t];this.ancestorSelectorCreators.push(new Ci(n.type))}for(var i=0,r=this.defaultRules;i<r.length;i++)xi(n=r[i])&&(n.type===je.byTagName?this.ancestorSelectorCreators.push(new mn(!1)):this.ancestorSelectorCreators.push(_i[n.type]))},Oi.prototype._generateCompoundSelectorDescriptor=function(t,e,n){for(var i=Ri.filter(n,Ti),r=[],s=null,o=null,a=0,l=Di(e,this.ancestorSelectorCreators);a<l.length;a++){for(var u=l[a],c=0,h=i;c<h.length;c++){var d=h[c],o=an.createFromInstance(u),s=an.createFromInstance(d,o);r.push(s)}o=an.createFromInstance(u),s=Ui(t,[_i[je.byTagTree]],u),r=Ri.concat(r,s)}return r},Oi.prototype._cleanAndSortDescriptors=function(t){for(var e=[],n=0,i=t;n<i.length;n++){var r=i[n];r.makeUnique();var s=Oi._getSelectorType(r),o=this.rulePriority[s];null!==o&&(r.priority=o,e.push(r))}return Vi(e=(e=ki(e)).sort(Oi._priorityComparator)),e},Oi.prototype._generateDescriptors=function(t){var e=Ui(t,this.elementSelectorCreators),n=rn(t,Ni.findDocument(t).body),i=this._generateCompoundSelectorDescriptor(t,n,e),r=Ri.concat(e,i);return this._cleanAndSortDescriptors(r)},Oi.prototype.generate=function(t){var e=this._generateDescriptors(t);return Ri.map(e,function(t){var e=t.stringArray,n=t.ruleType,i=t.ancestorSelectorDescriptor,r={value:Ri.join(e,""),rules:[n]};return i&&r.rules.push(i.ruleType),r})},Oi.RULES=Ye,new Oi);function Fi(){this.targets=new Map}var $i=(Fi.prototype._remove=function(t,e){this.targets.delete(t),Fe(e)},Fi.prototype._setPosition=function(t,e){for(var n,i,r,s=(n=t.getBoundingClientRect(),i=zl.pageYOffset||Hl.documentElement.scrollTop,r=zl.pageXOffset||Hl.documentElement.scrollLeft,{top:n.top+i,left:n.left+r,height:n.height,width:n.width,bottom:n.bottom+i,right:n.right+r}),o={},a=0,l=["top","left","width","height"];a<l.length;a++){var u=l[a];o[u]=s[u]+"px"}Te(e,o)},Fi.prototype.highlight=function(t){var e;t&&!this.targets.has(t)&&(e=we(De),this.targets.set(t,e),this._setPosition(t,e),Pe(e))},Fi.prototype.stopHighlighting=function(){var n=this;this.targets.forEach(function(t,e){return n._remove(e,t)})},new Fi),Li=t.nativeMethods;function zi(){this._createElements()}var Hi,Wi=(zi.prototype._createElements=function(){this.tooltip=we(ke),this.arrow=we(Ve)},zi.prototype._setTooltipText=function(t){Li.nodeTextContentSetter.call(this.tooltip,t)},zi.prototype._getTooltipLeft=function(t,e,n,i){return n<=t?i:n-e<=t?n+i-t:e+i},zi.prototype._getArrowLeft=function(t,e,n,i){return n-e<=t+12?n+i-t:e+i+12},zi.prototype._getVerticalPostionStyles=function(t,e,n,i){var r={},s={},o=Hl.documentElement.scrollTop,a=t.height+e.height;return n.top>=a?(r.top=n.top+o-a+"px",s.top=n.top+o-e.height+"px",s.transform="none",s.visibility="visible"):i.height-n.bottom>=a?(r.top=n.bottom+o+e.height+"px",s.top=n.bottom+o+"px",s.transform="rotate(180deg)",s.visibility="visible"):(r.top=i.height+o-t.height+"px",s.top=o+"px",s.transform="node",s.visibility="hidden"),{tooltip:r,arrow:s}},zi.prototype._getElementsStyles=function(t){var e=this.tooltip.getBoundingClientRect(),n=this.arrow.getBoundingClientRect(),i=t.getBoundingClientRect(),r={width:Hl.documentElement.clientWidth,height:Hl.documentElement.clientHeight},s=this._getVerticalPostionStyles(e,n,i,r),o=Hl.documentElement.scrollLeft;return s.tooltip.left=this._getTooltipLeft(e.width,i.left,r.width,o)+"px",s.arrow.left=this._getArrowLeft(n.width,i.left,r.width,o)+"px",s},zi.prototype._placeElements=function(t){var e=this._getElementsStyles(t);Te(this.tooltip,e.tooltip),Te(this.arrow,e.arrow)},zi.prototype.show=function(t,e){this._setTooltipText(t),this._placeElements(e),Pe(this.tooltip),Pe(this.arrow)},zi.prototype.hide=function(){Fe(this.tooltip),Fe(this.arrow)},new zi),ji=t.eventSandbox.listeners,qi=n.styleUtils,Gi=n.serviceUtils,Yi="element-piked";function Xi(){var t=Hi.call(this)||this;return t.hiddenTestCafeElements=new Map,t.handlers={onClick:t._getClickHandler(),onMouseMove:t._getMouseMoveHandler()},t}var Ki=(J(Xi,Hi=Gi.EventEmitter),Xi.prototype._hideTestCafeElements=function(){for(var t=0,e=h.element().children;t<e.length;t++){var n=e[t],i=qi.get(n,"visibility");this.hiddenTestCafeElements.set(n,i),qi.set(n,"visibility","hidden")}},Xi.prototype._showTestCafeElements=function(){this.hiddenTestCafeElements.forEach(function(t,e){qi.set(e,"visibility",t)}),this.hiddenTestCafeElements.clear()},Xi.prototype._getClickHandler=function(){var t=this;return function(){t._showTestCafeElements(),ji.removeInternalEventBeforeListener(zl,["mousemove"],t.handlers.onMouseMove),ji.removeInternalEventBeforeListener(zl,["click"],t.handlers.onClick),t.emit(Yi,t.actualSelectors),Wi.hide()}},Xi.prototype._getMouseMoveHandler=function(){var r=this;return function(t){var e=t.clientX,n=t.clientY,i=Hl.elementFromPoint(e,n);i&&i!==r.actualTarget&&(r.actualTarget=i,r.actualSelectors=Pi.generate(i),$i.stopHighlighting(),$i.highlight(i),Wi.show(r.actualSelectors[0].value,i))}},Xi.prototype.start=function(t){this._hideTestCafeElements(),ji.initElementListening(zl,["mousemove","click"]),ji.addFirstInternalEventBeforeListener(zl,["mousemove"],this.handlers.onMouseMove),ji.addFirstInternalEventBeforeListener(zl,["click"],this.handlers.onClick),this.handlers.onMouseMove(t)},new Xi),Ji=n.eventUtils,Qi=function(){this.element=we(xe),Ji.bind(this.element,"click",function(t){return Ki.start(t)})};function Zi(t){return t}var tr,er=(function(t){function n(t){return!!o[t]}function i(t,e){this.references=t,this.transforms=e,this.circularCandidates=[],this.circularCandidatesDescrs=[],this.circularRefCount=0}var s=/^#*@(t|r)$/,r=(0,eval)("this"),o={Int8Array:"function"==typeof Int8Array?Int8Array:void 0,Uint8Array:"function"==typeof Uint8Array?Uint8Array:void 0,Uint8ClampedArray:"function"==typeof Uint8ClampedArray?Uint8ClampedArray:void 0,Int16Array:"function"==typeof Int16Array?Int16Array:void 0,Uint16Array:"function"==typeof Uint16Array?Uint16Array:void 0,Int32Array:"function"==typeof Int32Array?Int32Array:void 0,Uint32Array:"function"==typeof Uint32Array?Uint32Array:void 0,Float32Array:"function"==typeof Float32Array?Float32Array:void 0,Float64Array:"function"==typeof Float64Array?Float64Array:void 0},a="function"==typeof ArrayBuffer,l="function"==typeof Map,u="function"==typeof Set,c="function"==typeof Buffer,h=Array.prototype.slice,e={serialize:function(t){return JSON.stringify(t)},deserialize:function(t){return JSON.parse(t)}};function d(t,e){this.references=t,this.transformMap=e,this.activeTransformsStack=[],this.visitedRefs=Object.create(null)}i._createRefMark=function(t){var e=Object.create(null);return e["@r"]=t,e},i.prototype._createCircularCandidate=function(t,e,n){this.circularCandidates.push(t),this.circularCandidatesDescrs.push({parent:e,key:n,refIdx:-1})},i.prototype._applyTransform=function(t,e,n,i){var r=Object.create(null),s=i.toSerializable(t);return"object"==typeof s&&this._createCircularCandidate(t,e,n),r["@t"]=i.type,r.data=this._handleValue(s,e,n),r},i.prototype._handleArray=function(t){for(var e=[],n=0;n<t.length;n++)e[n]=this._handleValue(t[n],e,n);return e},i.prototype._handlePlainObject=function(n){var i=this,r=Object.create(null);return Object.getOwnPropertyNames(n).forEach(function(t){var e=s.test(t)?"#"+t:t;r[e]=i._handleValue(n[t],r,e)}),r},i.prototype._handleObject=function(t,e,n){return this._createCircularCandidate(t,e,n),Array.isArray(t)?this._handleArray(t):this._handlePlainObject(t)},i.prototype._ensureCircularReference=function(t){var e=this.circularCandidates.indexOf(t);if(-1<e){var n=this.circularCandidatesDescrs[e];return-1===n.refIdx&&(n.refIdx=n.parent?++this.circularRefCount:0),i._createRefMark(n.refIdx)}return null},i.prototype._handleValue=function(t,e,n){var i=typeof t,r="object"==i&&null!==t;if(r){var s=this._ensureCircularReference(t);if(s)return s}for(var o=0;o<this.transforms.length;o++){var a=this.transforms[o];if(a.shouldTransform(i,t))return this._applyTransform(t,e,n,a)}return r?this._handleObject(t,e,n):t},i.prototype.transform=function(){for(var t=[this._handleValue(this.references,null,null)],e=0;e<this.circularCandidatesDescrs.length;e++){var n=this.circularCandidatesDescrs[e];0<n.refIdx&&(t[n.refIdx]=n.parent[n.key],n.parent[n.key]=i._createRefMark(n.refIdx))}return t},d.prototype._handlePlainObject=function(e){var t,n=this,i=Object.create(null),r=Object.getOwnPropertyNames(e);for(t in r.forEach(function(t){n._handleValue(e[t],e,t),s.test(t)&&(i[t.substring(1)]=e[t],delete e[t])}),i)e[t]=i[t]},d.prototype._handleTransformedObject=function(t,e,n){var i=t["@t"],r=this.transformMap[i];if(!r)throw new Error("Can't find transform for \""+i+'" type.');this.activeTransformsStack.push(t),this._handleValue(t.data,t,"data"),this.activeTransformsStack.pop(),e[n]=r.fromSerializable(t.data)},d.prototype._handleCircularSelfRefDuringTransform=function(t,e,n){var i=this.references,r=void 0;Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get:function(){return void 0===r&&(r=i[t]),r},set:function(t){return r=t}})},d.prototype._handleCircularRef=function(t,e,n){-1<this.activeTransformsStack.indexOf(this.references[t])?this._handleCircularSelfRefDuringTransform(t,e,n):(this.visitedRefs[t]||(this.visitedRefs[t]=!0,this._handleValue(this.references[t],this.references,t)),e[n]=this.references[t])},d.prototype._handleValue=function(t,e,n){if("object"==typeof t&&null!==t){var i=t["@r"];if(void 0!==i)this._handleCircularRef(i,e,n);else if(t["@t"])this._handleTransformedObject(t,e,n);else if(Array.isArray(t))for(var r=0;r<t.length;r++)this._handleValue(t[r],t,r);else this._handlePlainObject(t)}},d.prototype.transform=function(){return this.visitedRefs[0]=!0,this._handleValue(this.references[0],this.references,0),this.references[0]};var p=[{type:"[[NaN]]",shouldTransform:function(t,e){return"number"===t&&isNaN(e)},toSerializable:function(){return""},fromSerializable:function(){return NaN}},{type:"[[undefined]]",shouldTransform:function(t){return"undefined"===t},toSerializable:function(){return""},fromSerializable:function(){}},{type:"[[Date]]",shouldTransform:function(t,e){return e instanceof Date},toSerializable:function(t){return t.getTime()},fromSerializable:function(t){var e=new Date;return e.setTime(t),e}},{type:"[[RegExp]]",shouldTransform:function(t,e){return e instanceof RegExp},toSerializable:function(t){var e={src:t.source,flags:""};return t.global&&(e.flags+="g"),t.ignoreCase&&(e.flags+="i"),t.multiline&&(e.flags+="m"),e},fromSerializable:function(t){return new RegExp(t.src,t.flags)}},{type:"[[Error]]",shouldTransform:function(t,e){return e instanceof Error},toSerializable:function(t){return{name:t.name,message:t.message,stack:t.stack}},fromSerializable:function(t){var e=new(r[t.name]||Error)(t.message);return e.stack=t.stack,e}},{type:"[[ArrayBuffer]]",shouldTransform:function(t,e){return a&&e instanceof ArrayBuffer},toSerializable:function(t){var e=new Int8Array(t);return h.call(e)},fromSerializable:function(t){if(a){var e=new ArrayBuffer(t.length);return new Int8Array(e).set(t),e}return t}},{type:"[[Buffer]]",shouldTransform:function(t,e){return c&&e instanceof Buffer},toSerializable:function(t){return h.call(t)},fromSerializable:function(t){return c?Buffer.from(t):t}},{type:"[[TypedArray]]",shouldTransform:function(t,e){return Object.keys(o).some(function(t){return n(t)&&e instanceof o[t]})},toSerializable:function(t){return{ctorName:t.constructor.name,arr:h.call(t)}},fromSerializable:function(t){return n(t.ctorName)?new o[t.ctorName](t.arr):t.arr}},{type:"[[Map]]",shouldTransform:function(t,e){return l&&e instanceof Map},toSerializable:function(t){var n=[];return t.forEach(function(t,e){n.push(e),n.push(t)}),n},fromSerializable:function(t){if(l){for(var e=new Map,n=0;n<t.length;n+=2)e.set(t[n],t[n+1]);return e}for(var i=[],r=0;r<t.length;r+=2)i.push([t[n],t[n+1]]);return i}},{type:"[[Set]]",shouldTransform:function(t,e){return u&&e instanceof Set},toSerializable:function(t){var e=[];return t.forEach(function(t){e.push(t)}),e},fromSerializable:function(t){if(u){for(var e=new Set,n=0;n<t.length;n++)e.add(t[n]);return e}return t}}],f=t.exports=function(t){this.transforms=[],this.transformsMap=Object.create(null),this.serializer=t||e,this.addTransforms(p)};f.prototype.addTransforms=function(t){t=Array.isArray(t)?t:[t];for(var e=0;e<t.length;e++){var n=t[e];if(this.transformsMap[n.type])throw new Error('Transform with type "'+n.type+'" was already added.');this.transforms.push(n),this.transformsMap[n.type]=n}return this},f.prototype.removeTransforms=function(t){t=Array.isArray(t)?t:[t];for(var e=0;e<t.length;e++){var n=t[e],i=this.transforms.indexOf(n);-1<i&&this.transforms.splice(i,1),delete this.transformsMap[n.type]}return this},f.prototype.encode=function(t){var e=new i(t,this.transforms).transform();return this.serializer.serialize(e)},f.prototype.decode=function(t){var e=this.serializer.deserialize(t);return new d(e,this.transformsMap).transform()}}(tr={exports:{}}),tr.exports);function nr(t){return new er({serialize:Zi,deserialize:Zi}).addTransforms(t)}function ir(t,e){this.code=t,this.isTestCafeError=!0,this.callsite=e||null}var rr,sr,or="E1",ar="E4",lr="E5",ur="E9",cr="E10",hr="E11",dr="E12",pr="E24",fr="E26",mr="E27",vr="E28",gr="E29",yr="E30",_r="E31",Cr="E32",br="E33",Er="E34",wr="E35",Sr="E36",Tr="E37",xr="E39",Ir="E40",Ar="E41",Mr="E42",Br="E43",Nr="E44",Rr="E45",Ur="E46",Dr="E49",kr="E50",Vr="E51",Or="E52",Pr="E57",Fr="E64",$r="E65",Lr="E68",zr="E69",Hr="E70",Wr="E71",jr="E72",qr="E73",Gr="E74",Yr="E76",Xr="E77",Kr="E78",Jr="E82",Qr="E83",Zr="E90",ts="E91",es="E92",ns="E93",is="E94",rs="E95",ss="E97",os="E99",as="E100",ls="E101",us=(J(cs,rr=ir),cs);function cs(t,e,n){var i=rr.call(this,t)||this;return i.optionName=e,i.actualValue=n,i}function hs(t,e){var n=sr.call(this,Dr,e)||this;return n.instantiationCallsiteName=t,n}J(hs,sr=ir);var ds,ps=(J(fs,ds=ir),fs);function fs(t,e){var n=ds.call(this,kr,e)||this;return n.instantiationCallsiteName=t,n}var ms,vs=(J(gs,ms=ir),gs);function gs(t,e,n){var i=void 0===e?{}:e,r=i.apiFnChain,s=i.apiFnIndex,o=i.reason,a=ms.call(this,t,n)||this;return a.apiFnChain=r,a.apiFnIndex=s,a.reason=o,a}var ys,_s,Cs,bs=(J(Es,ys=ir),Es);function Es(t){return ys.call(this,Vr,t)||this}function ws(t,e){return _s.call(this,Or,e,t)||this}function Ss(t,e){var n=Cs.call(this,or)||this;return n.errStack=t,n.pageDestUrl=e,n}J(ws,_s=vs),J(Ss,Cs=ir);var Ts,xs=(J(Is,Ts=ir),Is);function Is(t,e,n){var i=Ts.call(this,ar,n)||this;return i.errMsg=String(e),i.instantiationCallsiteName=t,i}var As,Ms,Bs,Ns,Rs,Us,Ds,ks,Vs,Os,Ps,Fs,$s,Ls,zs,Hs,Ws,js,qs,Gs,Ys,Xs,Ks,Js,Qs,Zs,to,eo,no,io,ro,so,oo,ao,lo,uo,co,ho,po,fo,mo,vo,go,yo,_o,Co,bo,Eo,wo,So,To,xo,Io=(J(Ao,As=ir),Ao);function Ao(t,e,n,i){var r=As.call(this,lr,i)||this;return r.errMsg=String(e),r.property=n,r.instantiationCallsiteName=t,r}function Mo(t){var e=Ms.call(this,Fr)||this;return e.errMsg=String(t),e}function Bo(t,e){var n=Bs.call(this,$r)||this;return n.errMsg=String(t),n.moduleName=e,n}function No(t,e){return Ns.call(this,ur,t,e)||this}function Ro(t,e){return Rs.call(this,cr,t,e)||this}function Uo(t,e){return Us.call(this,hr,t,e)||this}function Do(t,e){return Ds.call(this,dr,t,e)||this}function ko(t,e){return ks.call(this,Zr,t,e)||this}function Vo(t,e){return Vs.call(this,ss,t,e)||this}function Oo(t,e){return Os.call(this,ts,t,e)||this}function Po(t,e){return Ps.call(this,es,t,e)||this}function Fo(t,e){return Fs.call(this,ns,t,e)||this}function $o(t,e){return $s.call(this,is,t,e)||this}function Lo(t,e){return Ls.call(this,rs,t,e)||this}function zo(t,e){return zs.call(this,os,t,e)||this}function Ho(t,e,n){var i=Hs.call(this,as)||this;return i.objectName=t,i.propertyName=e,i.availableProperties=n,i}function Wo(t,e){return Ws.call(this,pr,e,t)||this}function jo(t,e){return js.call(this,fr,e,t)||this}function qo(t){var e=qs.call(this,mr)||this;return e.nodeDescription=t,e}function Go(t,e){var n=Gs.call(this,vr,e)||this;return n.argumentName=t,n}function Yo(t){return Ys.call(this,ls,t)||this}function Xo(t,e){var n=Xs.call(this,gr,e)||this;return n.argumentName=t,n}function Ko(t,e){var n=Ks.call(this,yr)||this;return n.argumentName=t,n.nodeDescription=e,n}function Jo(){return Js.call(this,_r)||this}function Qo(){return Qs.call(this,Cr)||this}function Zo(t){var e=Zs.call(this,br)||this;return e.argumentName=t,e}function ta(){return to.call(this,wr)||this}function ea(t){var e=eo.call(this,Sr)||this;return e.argumentName=t,e}function na(t,e){var n=no.call(this,Tr)||this;return n.filePaths=t,n.scannedFilePaths=e,n}function ia(){return io.call(this,Er)||this}function ra(t,e){var n=ro.call(this,Ar)||this;return n.properties=t?"scrollTargetY property":e?"scrollTargetX property":"scrollTargetX and scrollTargetY properties",n}function sa(t,e){var n=so.call(this,Pr)||this;return t<=0?e<=0?(n.verb="are",n.dimensions="width and height"):(n.verb="is",n.dimensions="width"):(n.verb="is",n.dimensions="height"),n}function oa(t){return oo.call(this,Ir,t)||this}function aa(){return ao.call(this,xr)||this}function la(){return lo.call(this,Mr)||this}function ua(){return uo.call(this,zr)||this}function ca(){return co.call(this,Lr)||this}function ha(){return ho.call(this,Hr)||this}function da(){return po.call(this,Wr)||this}function pa(){return fo.call(this,qr)||this}function fa(){return mo.call(this,Jr)||this}function ma(t){var e=vo.call(this,Kr)||this;return e.errMsg=t,e}function va(){return go.call(this,Gr)||this}function ga(){return yo.call(this,Yr)||this}function ya(){return _o.call(this,Xr)||this}function _a(){return Co.call(this,jr)||this}function Ca(){return bo.call(this,Qr)||this}function ba(){return Eo.call(this,Br)||this}function Ea(){return wo.call(this,Nr)||this}function wa(t,e){var n=So.call(this,Rr)||this;return n.dialogType=t,n.pageUrl=e,n}function Sa(t,e,n){var i=To.call(this,Ur)||this;return i.dialogType=t,i.errMsg=e,i.pageUrl=n,i}J(Mo,Ms=ir),J(Bo,Bs=ir),J(No,Ns=us),J(Ro,Rs=us),J(Uo,Us=us),J(Do,Ds=us),J(ko,ks=us),J(Vo,Vs=us),J(Oo,Os=us),J(Po,Ps=us),J(Fo,Fs=us),J($o,$s=us),J(Lo,Ls=us),J(zo,zs=us),J(Ho,Hs=ir),J(Wo,Ws=vs),J(jo,js=vs),J(qo,qs=ir),J(Go,Gs=vs),J(Yo,Ys=ir),J(Xo,Xs=vs),J(Ko,Ks=ir),J(Jo,Js=ir),J(Qo,Qs=ir),J(Zo,Zs=ir),J(ta,to=ir),J(ea,eo=ir),J(na,no=ir),J(ia,io=ir),J(ra,ro=ir),J(sa,so=ir),J(oa,oo=ir),J(aa,ao=ir),J(la,lo=ir),J(ua,uo=ir),J(ca,co=ir),J(ha,ho=ir),J(da,po=ir),J(pa,fo=ir),J(fa,mo=ir),J(ma,vo=ir),J(va,go=ir),J(ga,yo=ir),J(ya,_o=ir),J(_a,Co=ir),J(Ca,bo=ir),J(ba,Eo=ir),J(Ea,wo=ir),J(wa,So=ir),J(Sa,To=ir);var Ta=1,xa=2,Ia=3,Aa=((xo={})[Ta]=/^\.filterVisible\(\)$/,xo[xa]=/^\.filterHidden\(\)$/,xo[Ia]=/^\.nth\(\d+\)$/,xo);function Ma(){this._err=null}var Ba=(Object.defineProperty(Ma.prototype,"error",{get:function(){return this._err},set:function(t){null===this._err&&(this._err=t)},enumerable:!1,configurable:!0}),Ma.prototype.filter=function(t,e,n){if(e.filterVisible&&(t=t.filter(c.positionUtils.isElementVisible),this._assertFilterError(t,n,Ta)),e.filterHidden&&(t=t.filter(function(t){return!c.positionUtils.isElementVisible(t)}),this._assertFilterError(t,n,xa)),e.counterMode)return null===e.index?t.length:Ma._getNodeByIndex(t,e.index)?1:0;var i;if(e.collectionMode)return null!==e.index&&(t=(i=Ma._getNodeByIndex(t,e.index))?[i]:[],this._assertFilterError(t,n,Ia)),t;var r=Ma._getNodeByIndex(t,e.index||0);return r||(this.error=Ma._getErrorItem(n,Ia)),r},Ma.prototype.cast=function(t){if(null==t)return[];if(t instanceof u.nativeMethods.Node)return[t];if(function(t){if(u.nativeMethods.isArray(t)){for(var e=0;e<t.length;e++)if(!(t[e]instanceof u.nativeMethods.Node))return;return 1}}(t))return t;if((e=t)instanceof u.nativeMethods.HTMLCollection||e instanceof u.nativeMethods.NodeList)return function(t){for(var e=t.length,n=[],i=0;i<e;i++)n.push(t[i]);return n}(t);var e;throw new bs},Ma.prototype._assertFilterError=function(t,e,n){0===t.length&&(this.error=Ma._getErrorItem(e,n))},Ma._getErrorItem=function(t,e){var n=t.apiFnChain,i=t.apiFnID;if(e)for(var r=i;r<n.length;r++)if(Aa[e].test(n[r]))return r;return null},Ma._getNodeByIndex=function(t,e){return e<0?t[t.length+e]:t[e]},new Ma);function Na(t,e){return new u.nativeMethods.Function("fnCode","__dependencies$","Promise","RegExp",'"use strict"; return eval(fnCode)')(t,e,u.Promise,RegExp)}var Ra=(Ua.prototype.shouldTransform=function(t){return"function"===t},Ua.prototype.toSerializable=function(){return""},Ua.prototype.fromSerializable=function(t){var e=t.fnCode,n=t.dependencies;return"filterOptions"in n&&(n.selectorFilter=Ba),Na(e,n)},Ua);function Ua(){this.type="Function"}var Da=(ka.prototype.shouldTransform=function(t,e){if(e instanceof u.nativeMethods.Node)throw new ps(this._instantiationCallsiteName);return!1},ka.prototype.toSerializable=function(){},ka.prototype.fromSerializable=function(){},ka);function ka(t){this.type="Node",this._instantiationCallsiteName=t}var Va=(Oa.prototype.getResult=function(){var e=this;return u.Promise.resolve().then(function(){var t=e.replicator.decode(e.command.args);return e._executeFn(t)}).catch(function(t){throw t.isTestCafeError||(t=new xs(e.command.instantiationCallsiteName,t)),t})},Oa.prototype.encodeResult=function(t){return this.replicator.encode(t)},Oa.prototype._createReplicator=function(){return nr([new Da(this.command.instantiationCallsiteName),new Ra])},Oa.prototype._executeFn=function(t){return this.fn.apply(zl,t)},Oa);function Oa(t){this.command=t,this.replicator=this._createReplicator(),this.dependencies=this.replicator.decode(t.dependencies),this.fn=Na(t.fnCode,this.dependencies)}var Pa=["nodeType","textContent","childNodeCount","hasChildNodes","childElementCount","hasChildElements"],Fa=["tagName","attributes"],$a=["tagName","visible","focused","attributes","boundingClientRect","classNames","style","innerText","namespaceURI","id","value","checked","selected","selectedIndex","scrollWidth","scrollHeight","scrollLeft","scrollTop","offsetWidth","offsetHeight","offsetLeft","offsetTop","clientWidth","clientHeight","clientLeft","clientTop"],La={childNodeCount:function(t){return t.childNodes.length},hasChildNodes:function(t){return!!La.childNodeCount(t)},childElementCount:function(t){var e=t.children;if(e)return e.length;for(var n=0,i=t.childNodes.length,r=0;r<i;r++)1===t.childNodes[r].nodeType&&n++;return n},hasChildElements:function(t){return!!La.childElementCount(t)}},za=(Ha.prototype._initializeProperties=function(t,e,n){for(var i=0,r=e;i<r.length;i++){var s=r[i],o=n[s];this[s]=o?o(t):t[s]}},Ha);function Ha(){}var Wa,ja=(J(qa,Wa=za),qa);function qa(t){var e=Wa.call(this)||this;return e._initializeProperties(t,Pa,La),e}var Ga,Ya={tagName:function(t){return t.tagName.toLowerCase()},visible:function(t){return c.positionUtils.isElementVisible(t)},focused:function(t){return u.utils.dom.getActiveElement()===t},attributes:function(t){for(var e=t.attributes,n={},i=e.length-1;0<=i;i--)n[e[i].name]=e[i].value;return n},boundingClientRect:function(t){var e=t.getBoundingClientRect();return{left:e.left,right:e.right,top:e.top,bottom:e.bottom,width:e.width,height:e.height}},classNames:function(t){var e=t.className;return"string"==typeof e.animVal&&(e=e.animVal),e.replace(/^\s+|\s+$/g,"").split(/\s+/g)},style:function(t){for(var e={},n=zl.getComputedStyle(t),i=0;i<n.length;i++){var r=n[i];e[r]=n[r]}return e},innerText:function(t){return t.innerText}};function Xa(t){var e=Ga.call(this)||this;return e._initializeProperties(t,Fa,Ya),e}J(Xa,Ga=za);var Ka,Ja=(J(Qa,Ka=ja),Qa);function Qa(t){var e=Ka.call(this,t)||this;return e._initializeProperties(t,$a,Ya),e}var Za=(tl.prototype._extend=function(t,e){for(var n=0,i=u.nativeMethods.objectKeys(this._customDOMProperties);n<i.length;n++){var r=i[n];try{t[r]=this._customDOMProperties[r](e)}catch(t){throw new Io(this._instantiationCallsiteName,t,r)}}},tl.prototype.shouldTransform=function(t,e){return e instanceof u.nativeMethods.Node},tl.prototype.toSerializable=function(t){var e=new(1===t.nodeType?Ja:ja)(t);return this._extend(e,t),e},tl.prototype.fromSerializable=function(){},tl);function tl(t,e){void 0===t&&(t={}),this.type="Node",this._customDOMProperties=t,this._instantiationCallsiteName=e}var el,nl=(J(il,el=Va),il.prototype._createReplicator=function(){return nr([new Ra])},il.prototype._getTimeoutErrorParams=function(t){return{apiFnIndex:Ba.error,apiFnChain:this.command.apiFnChain,reason:c.positionUtils.getHiddenReason(t)}},il.prototype._getTimeoutError=function(t){return t?this.createIsInvisibleError:this.createNotFoundError},il.prototype._validateElement=function(o,a){var l=this;return u.Promise.resolve().then(function(){return el.prototype._executeFn.call(l,o)}).then(function(t){var e=t,n=!!e,i=!l.command.visibilityCheck||e&&c.positionUtils.isElementVisible(e),r=u.nativeMethods.dateNow()-a>=l.timeout;if(n&&(i||u.utils.dom.isShadowRoot(e)))return e;if(!r)return c.delay(200).then(function(){return l._validateElement(o,a)});var s=l.getVisibleValueMode?null:l._getTimeoutError(n);if(s)throw s(l._getTimeoutErrorParams(e));return null})},il.prototype._executeFn=function(t){return this.counterMode?el.prototype._executeFn.call(this,t):this._validateElement(t,u.nativeMethods.dateNow())},il);function il(t,e,n,i,r){var s,o=el.call(this,t)||this;o.createNotFoundError=i,o.createIsInvisibleError=r,o.timeout="number"==typeof t.timeout?t.timeout:e,o.counterMode=o.dependencies.filterOptions.counterMode,o.getVisibleValueMode=o.dependencies.filterOptions.getVisibleValueMode,o.dependencies.selectorFilter=Ba,n&&(s=u.nativeMethods.dateNow()-n,o.timeout=Math.max(o.timeout-s,0));var a=o.dependencies.customDOMProperties;return o.replicator.addTransforms([new Za(a,t.instantiationCallsiteName)]),o}var rl={testCafeDriver:"%testCafeDriver%",testCafeIframeDriver:"%testCafeIframeDriver%",testCafeEmbeddingUtils:"%testCafeEmbeddingUtils%",testCafeDriverInstance:"%testCafeDriverInstance%"},sl=5e3;function ol(){return null}function al(){return null}function ll(e){return Q(this,void 0,void 0,function(){return Z(this,function(t){switch(t.label){case 0:return[4,function(n){return Q(this,void 0,void 0,function(){var e;return Z(this,function(t){return e=zl[rl.testCafeDriverInstance].communicationUrls,[2,c.browser.parseSelector(e.parseSelector,u.createNativeXHR,n)]})})}(e)];case 1:return[2,function(n){return Q(this,void 0,void 0,function(){var e;return Z(this,function(t){switch(t.label){case 0:return e=u.nativeMethods.date(),[4,new nl(n,sl,e,ol,al).getResult()];case 1:return[2,t.sent()]}})})}(t.sent()).catch(function(){return null})]}})})}var ul,cl=t.eventSandbox.listeners,hl=n.serviceUtils,dl="list-changed",pl="selector-selected";function fl(){var e=ul.call(this)||this;return e._pickedSelectors=[],e.element=we(Re),Ki.on(Yi,function(t){e.pickedSelectors=t}),e}var ml=(J(fl,ul=hl.EventEmitter),Object.defineProperty(fl.prototype,"pickedSelectors",{get:function(){return this._pickedSelectors},set:function(t){void 0===t&&(t=[]),this._pickedSelectors!==t&&(this._pickedSelectors=t,this.emit(dl,t))},enumerable:!1,configurable:!0}),fl.prototype._renderSelectors=function(){var n=this;this.pickedSelectors.forEach(function(t){var e=we({text:t.value,class:"selector-value"});n.element.appendChild(e)}),this.renderedSelectors=this.pickedSelectors},fl.prototype._clear=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.renderedSelectors=null},fl.prototype._addClickListener=function(){var e=this,n=function(t){Fe(e.element),t.target.parentElement===e.element&&e.emit(pl,t.target.innerText),cl.removeInternalEventBeforeListener(zl,["click"],n)};cl.addFirstInternalEventBeforeListener(zl,["click"],n)},fl.prototype.show=function(t){var e,n=t.left,i=t.bottom,r=t.width;this.pickedSelectors&&0!==this.pickedSelectors.length&&(this.pickedSelectors!==this.renderedSelectors&&(this._clear(),this._renderSelectors()),e={left:n+"px",bottom:i+"px",width:r+"px"},Pe(this.element),Te(this.element,e),this._addClickListener())},fl.prototype.clear=function(){this.pickedSelectors=null},new fl),vl=t.nativeMethods,gl=t.shadowUI,yl=n.eventUtils,_l="enabled",Cl={notFound:"not-found",invalid:"invalid",ok:"ok"},bl=(Object.defineProperty(El.prototype,"value",{get:function(){return vl.inputValueGetter.call(this.input)},set:function(t){vl.inputValueSetter.call(this.input,t)},enumerable:!1,configurable:!0}),El.prototype._createElements=function(){this.element=we(Be),this.input=we(Ie),this.indicator=we(Ae),this.expandButton=we(Me),this.element.appendChild(this.input),this.element.appendChild(this.indicator),this.element.appendChild(this.expandButton)},El.prototype._addEventListeners=function(){var e=this;yl.bind(this.expandButton,"click",function(){return e._expandSelectorsList()}),yl.bind(this.input,"input",function(){return e._onSelectorTyped()}),yl.bind(this.input,"focus",function(){return e._onFocusInput()}),yl.bind(this.input,"blur",function(){return $i.stopHighlighting()}),ml.on(dl,function(t){e._updateExpandButton(t)}),ml.on(pl,function(t){e._setSelectorInputValue({value:t})}),Ki.on(Yi,function(t){e._setSelectorInputValue(t[0])})},El.prototype._setMatchIndicatorText=function(t){vl.nodeTextContentSetter.call(this.indicator,t)},El.prototype._setMatchIndicatorClass=function(t){for(var e in Cl)gl.removeClass(this.indicator,Cl[e]);gl.addClass(this.indicator,t)},El.prototype._indicateMatches=function(t){return null===t?(this._setMatchIndicatorText("Invalid Selector"),void this._setMatchIndicatorClass(Cl.invalid)):0===t.length?(this._setMatchIndicatorText("No Matching Elements"),void this._setMatchIndicatorClass(Cl.notFound)):(this._setMatchIndicatorText("Found: ".concat(t.length)),void this._setMatchIndicatorClass(Cl.ok))},El.prototype._highlightElements=function(t){for(var e=0,n=t;e<n.length;e++){var i=n[e];$i.highlight(i)}},El.prototype._setSelectorInputValue=function(t){this.value=t.value,this.input.focus()},El.prototype._expandSelectorsList=function(){var t=this.element.getBoundingClientRect(),e=t.left,n=t.top,i={left:e,width:t.width,bottom:Hl.documentElement.clientHeight-n+1};ml.show(i)},El.prototype._updateExpandButton=function(t){t&&t.length?gl.addClass(this.expandButton,_l):gl.removeClass(this.expandButton,_l)},El.prototype._onSelectorTyped=function(){ml.clear(),this._onFocusInput()},El.prototype._onFocusInput=function(){return Q(this,void 0,void 0,function(){var e;return Z(this,function(t){switch(t.label){case 0:return $i.stopHighlighting(),this.value?[4,ll(this.value)]:(this._indicateMatches([]),[2]);case 1:return e=t.sent(),this._indicateMatches(e),this._highlightElements(e),[2]}})})},El);function El(){this._createElements(),this._addEventListeners()}var wl=t.nativeMethods,Sl=n.eventUtils,Tl="Copy",xl="Copied!",Il=(Al.prototype._copySelector=function(){var t,e;t=this.sourceElement.value,Pe(e=we(Oe)),e.value=t,e.select(),Hl.execCommand("copy"),Fe(e),this._animate()},Al.prototype._animate=function(){var t=this;this._changeAppearance(xl,"bold"),wl.setTimeout.call(zl,function(){return t._resetAppearance()},1200)},Al.prototype._resetAppearance=function(){this._changeAppearance(Tl,"")},Al.prototype._changeAppearance=function(t,e){wl.inputValueSetter.call(this.element,t),Te(this.element,{fontWeight:e})},Al);function Al(t){var e=this;this.element=we(Ne),this.sourceElement=t,Sl.bind(this.element,"click",function(){return e._copySelector()})}var Ml=(Bl.prototype.show=function(){this.element.parentElement||h.insertFirstChildToPanelsContainer(this.element),Te(this.element,{display:"flex"})},Bl.prototype.hide=function(){Te(this.element,{display:"none"})},Bl);function Bl(){this.elementPicker=Ki,this.element=we(Ue);var t=new Qi,e=new bl,n=new Il(e);this.element.appendChild(t.element),this.element.appendChild(e.element),this.element.appendChild(n.element)}var Nl=t.Promise,Rl=t.eventSandbox.message,Ul=n.sendRequestToFrame,Dl="ui|hide|request",kl="ui|hide|response",Vl="ui|show|request",Ol="ui|show|response";Rl.on(Rl.SERVICE_MSG_RECEIVED_EVENT,function(t){t.message.cmd===Dl?(h.hide(),Rl.sendServiceMsg({cmd:kl},t.source)):t.message.cmd===Vl&&(h.show(),Rl.sendServiceMsg({cmd:Ol},t.source))});var Pl={};Pl.uiRoot=h,Pl.cursorUI=ge,Pl.iframeCursorUI=_e,Pl.selectElement=i,Pl.modalBackground=k,Pl.ProgressPanel=Y,Pl.StatusBar=qt,Pl.IframeStatusBar=Jt,Pl.SelectorInspectorPanel=Ml,Pl.hide=function(t){return t?Ul({cmd:Dl},kl,zl.top):(h.hide(),Nl.resolve())},Pl.show=function(t){return t?Ul({cmd:Vl},Ol,zl.top):(h.show(),Nl.resolve())},Pl.showScreenshotMark=function(t){return Ce.show(t)},Pl.hideScreenshotMark=function(){return Ce.hide()};var Fl=t.nativeMethods,$l=t.EVENTS.evalIframeScript;Fl.objectDefineProperty(zl,"%testCafeUI%",{configurable:!0,value:Pl}),t.on($l,function(t){return Ll(Fl.contentWindowGetter.call(t.iframe))})}(zl["%hammerhead%"],zl["%testCafeCore%"],zl["%hammerhead%"].Promise)}(window);
|
package/lib/client/ui/sprite.svg
CHANGED
|
@@ -39,4 +39,19 @@
|
|
|
39
39
|
<path d="M11 8L20 15L11 22V8Z" fill="white"/>
|
|
40
40
|
</svg>
|
|
41
41
|
</g>
|
|
42
|
+
<g class="sprite" id="arrow-down">
|
|
43
|
+
<svg width="16" height="8" viewBox="0 0 16 8" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
44
|
+
<path d="M0 0h16L8 8 0 0z" fill="#667599"/>
|
|
45
|
+
</svg>
|
|
46
|
+
</g>
|
|
47
|
+
<g class="sprite" id="expand-button">
|
|
48
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
49
|
+
<path d="M6 8h8 L10 12Z" fill="#2D3F53"/>
|
|
50
|
+
</svg>
|
|
51
|
+
</g>
|
|
52
|
+
<g class="sprite" id="disabled-expand-button">
|
|
53
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
54
|
+
<path d="M6 8h8 L10 12Z" fill="#b4b9be"/>
|
|
55
|
+
</svg>
|
|
56
|
+
</g>
|
|
42
57
|
</svg>
|