testcafe
Version:
Automated browser testing for the modern web development stack.
1 lines • 140 kB
JavaScript
!function P(B){var F=B.document;!function(a){"use strict";var d,h,r,m,p,i={".js":[],".json":[],".css":[],".html":[]},u="function"==typeof require?require:null;return m=function(e){var t=new Error("Could not find module '"+e+"'");return t.code="MODULE_NOT_FOUND",t},p=function(e,t,n){var o,r;if("function"==typeof e[t+n])return t+n;for(o=0;r=i[n][o];++o)if("function"==typeof e[t+r])return t+r;return null},d=function(e,t,n,o,r,i){var s,l,a,u,c,f;for("."!==(s=(n=n.split(/[\\/]/)).pop())&&".."!==s||(n.push(s),s="");null!=(l=n.shift());)if(l&&"."!==l&&(".."===l?(e=t.pop(),i=i.slice(0,i.lastIndexOf("/"))):(t.push(e),e=e[l],i+="/"+l),!e))throw m(o);if(s&&"function"!=typeof e[s]&&((f=(f=(f=(f=p(e,s,".js"))||p(e,s,".json"))||p(e,s,".css"))||p(e,s,".html"))?s=f:2!==r&&"object"==typeof e[s]&&(t.push(e),e=e[s],i+="/"+s,s="")),!s)return 1!==r&&e[":mainpath:"]?d(e,t,e[":mainpath:"],o,1,i):d(e,t,"index",o,2,i);if(!(c=e[s]))throw m(o);return c.hasOwnProperty("module")?c.module.exports:(a={},c.module=u={exports:a,id:i+"/"+s},c.call(a,a,u,h(e,t,i)),u.exports)},r=function(e,t,n,o){var r,i=n,s=n.charAt(0),l=0;if("/"===s){if(i=i.slice(1),!(e=a["/"])){if(u)return u(n);throw m(n)}o="/",t=[]}else if("."!==s){if(r=i.split("/",1)[0],!(e=a[r])){if(u)return u(n);throw m(n)}o=r,t=[],(i=i.slice(r.length+1))||(l=(i=e[":mainpath:"])?1:(i="index",2))}return d(e,t,i,n,l,o)},(h=function(t,n,o){return function(e){return r(t,[].concat(n),e,o)}})(a,[],"")}({"testcafe-release":{src:{client:{automation:{"cursor.js":function(e,t,n){e.__esModule=!0;var o=i(n("./deps/testcafe-core")),r=i(n("./deps/testcafe-ui"));function i(e){return e&&e.__esModule?e:{default:e}}var s=o.default.domUtils,l=B.top===B?r.default.cursorUI:r.default.iframeCursorUI;e.default={x:-1,y:-1,currentActiveWindow:B.top,_ensureActiveWindow:function(){if(this.currentActiveWindow!==B&&this.currentActiveWindow!==B.parent){var e=s.findIframeByWindow(this.currentActiveWindow);e&&s.isElementInDocument(e)||(this.currentActiveWindow=B)}},get active(){return this._ensureActiveWindow(),this.currentActiveWindow===B},set activeWindow(e){this.currentActiveWindow=e},get activeWindow(){return this._ensureActiveWindow(),this.currentActiveWindow},get position(){return{x:this.x,y:this.y}},get visible(){return B.top===B&&l.isVisible()},move:function(e,t){return this.x=e,this.y=t,l.move(this.x,this.y)},hide:function(){this.visible&&l.hide()},show:function(){B.top===B&&l.show()},leftButtonDown:function(){return l.leftButtonDown()},rightButtonDown:function(){return l.rightButtonDown()},buttonUp:function(){return l.buttonUp()}},t.exports=e.default},deps:{"hammerhead.js":function(e,t,n){e.__esModule=!0,e.default=B["%hammerhead%"],t.exports=e.default},"testcafe-core.js":function(e,t,n){e.__esModule=!0,e.default=B["%testCafeCore%"],t.exports=e.default},"testcafe-ui.js":function(e,t,n){e.__esModule=!0,e.default=B["%testCafeUI%"],t.exports=e.default}},"errors.js":function(e,t,n){e.__esModule=!0,e.default={elementIsInvisibleError:"elementIsInvisibleError",foundElementIsNotTarget:"foundElementIsNotTarget"},t.exports=e.default},"get-element.js":function(e,t,n){e.__esModule=!0,e.fromPoint=E,e.underCursor=function(){var e=s.default.position;return E(e.x,e.y).then(function(e){return e.element})};var o=l(n("./deps/hammerhead")),r=l(n("./deps/testcafe-core")),i=l(n("./deps/testcafe-ui")),s=l(n("./cursor"));function l(e){return e&&e.__esModule?e:{default:e}}var a=o.default.utils.browser,u=o.default.Promise,c=o.default.nativeMethods,f=r.default.positionUtils,d=r.default.domUtils;function h(e,t,n){var o=null;return i.default.hide(n).then(function(){return o=f.getElementFromPoint(e,t),i.default.show(n)}).then(function(){return o})}function m(e,t,n){var o=f.getElementFromPoint(e,t),r=d.containsElement(n,o)&&c.nodeTextContentGetter.call(o).length;return o&&o===n||r?o:null}function p(e,t){if(!t||!d.isDomElement(t)||!e||e===t)return e;if("tref"===d.getTagName(t))return t;var n="area"===d.getTagName(t)&&d.isImgElement(e);if(a.isFirefox&&n)return function(e,t){var n=d.closest(t,"map");return n&&n.name===e.useMap.substring(1)?t:e}(e,t);var o=d.isAnchorElement(t)||d.getParents(t,"a").length,r=o&&d.containsElement(t,e)&&c.nodeTextContentGetter.call(e).length;if(!o||r||!c.nodeTextContentGetter.call(t).length)return e;var i=t.getBoundingClientRect();return m(i.right-1,i.top+1,t)||m(i.left+1,i.bottom-1,t)||e}function E(n,o,r){var i=B!==B.top,s=null;return h(n,o).then(function(e){s=e;var t=u.resolve(e);return!s&&i&&0<n&&0<o&&(t=t.then(function(){return h(n,o,!0)}).then(function(e){return s=e})),t.then(function(e){return p(e,r)}).then(function(e){return{element:e,corrected:e!==s}})})}},"index.js":function(e,t,n){var o=A(n("./deps/hammerhead")),r=A(n("./playback/scroll")),i=A(n("./playback/click")),s=A(n("./playback/click/select-child")),l=A(n("./playback/dblclick")),a=A(n("./playback/drag/to-offset")),u=A(n("./playback/drag/to-element")),c=A(n("./playback/hover")),f=A(n("./playback/press")),d=A(n("./playback/rclick")),h=A(n("./playback/select/select-text")),m=A(n("./playback/select/select-editable-content")),p=A(n("./playback/type")),E=A(n("./playback/upload")),g=n("../../test-run/commands/options"),v=A(n("./settings")),y=n("./utils/offsets"),S=n("./playback/press/utils"),b=A(n("./playback/select/calculate-select-text-arguments")),_=A(n("./errors")),T=A(n("./cursor"));function A(e){return e&&e.__esModule?e:{default:e}}e.Scroll=r.default,e.Click=i.default,e.SelectChildClick=s.default,e.DblClick=l.default,e.DragToOffset=a.default,e.DragToElement=u.default,e.Hover=c.default,e.Press=f.default,e.RClick=d.default,e.SelectText=h.default,e.SelectEditableContent=m.default,e.Type=p.default,e.Upload=E.default,e.MouseOptions=g.MouseOptions,e.ClickOptions=g.ClickOptions,e.TypeOptions=g.TypeOptions,e.ERROR_TYPES=_.default,e.AutomationSettings=v.default,e.getOffsetOptions=y.getOffsetOptions,e.calculateSelectTextArguments=b.default,e.cursor=T.default,e.getNextFocusableElement=S.getNextFocusableElement,e.get=n;var w=o.default.nativeMethods,x=o.default.EVENTS.evalIframeScript;w.objectDefineProperty(B,"%testCafeAutomation%",{configurable:!0,value:e}),o.default.on(x,function(e){return P(w.contentWindowGetter.call(e.iframe),!0)})},playback:{click:{"click-command.js":function(e,t,n){e.__esModule=!0,e.default=function(e,t){var n=(0,l.getElementBoundToLabel)(t.element),o=m.isSelectElement(t.element),r=m.isOptionElement(t.element),i=m.isLabelElement(t.element)&&n,s=n&&m.isCheckboxElement(n);return o?new T(e,t):r?new x(e,t):s?new O(e,t):i?new S(e,t):new g(e,t)};var o=s(n("../../deps/hammerhead")),r=s(n("../../deps/testcafe-core")),i=s(n("../../deps/testcafe-ui")),l=n("../../utils/utils");function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var f=o.default.utils.browser,d=o.default.eventSandbox.eventSimulator,h=o.default.eventSandbox.listeners,m=r.default.domUtils,p=r.default.styleUtils,E=i.default.selectElement,g=(v.prototype.run=function(){this.eventState.clickElement&&d.click(this.eventState.clickElement,this.eventArgs.options),m.isElementFocusable(this.eventArgs.element)||(0,l.focusByRelatedElement)(this.eventArgs.element)},v);function v(e,t){c(this,v),this.eventState=e,this.eventArgs=t}var y,S=(u(b,y=g),b.prototype.run=function(){function e(e){n=e.target===t.input}var t=this,n=!1;h.addInternalEventListener(B,["focus"],e),y.prototype.run.call(this),h.removeInternalEventListener(B,["focus"],e),m.isElementFocusable(this.label)&&!n&&this._ensureBoundElementFocusRaised()},b.prototype._ensureBoundElementFocusRaised=function(){d.focus(this.input)},b);function b(e,t){c(this,b);var n=a(this,y.call(this,e,t));return n.label=n.eventArgs.element,n.input=(0,l.getElementBoundToLabel)(n.eventArgs.element),n}var _,T=(u(A,_=g),A.prototype.run=function(){_.prototype.run.call(this),this._toggleSelectOptionList()},A.prototype._toggleSelectOptionList=function(){var e=this.eventArgs.element;1===p.getSelectElementSize(e)&&!1!==this.eventState.simulateDefaultBehavior&&(E.isOptionListExpanded(e)?E.collapseOptionList():E.expandOptionList(e))},A);function A(e,t){return c(this,A),a(this,_.call(this,e,t))}var w,x=(u(P,w=g),P.prototype.run=function(){return this.eventArgs.element},P);function P(e,t){return c(this,P),a(this,w.call(this,e,t))}var C,O=(u(R,C=S),R.prototype.run=function(){function e(){t=!0}var t=!1;h.addInternalEventListener(B,["change"],e),C.prototype.run.call(this),h.removeInternalEventListener(B,["change"],e),f.isChrome&&!t&&this._ensureCheckboxStateChanged()},R.prototype._ensureCheckboxStateChanged=function(){this.checkbox.checked=!this.checkbox.checked,d.change(this.checkbox)},R);function R(e,t){c(this,R);var n=a(this,C.call(this,e,t));return n.checkbox=n.input,n}t.exports=e.default},"index.js":function(e,t,n){e.__esModule=!0;var o=c(n("../../deps/hammerhead")),r=c(n("../../deps/testcafe-core")),i=c(n("../visible-element-automation")),s=n("../../utils/utils"),l=c(n("../../cursor")),a=c(n("../../utils/next-tick")),u=c(n("./click-command"));function c(e){return e&&e.__esModule?e:{default:e}}var f,d=o.default.Promise,h=o.default.utils.extend,m=o.default.utils.browser,p=o.default.utils.featureDetection,E=o.default.eventSandbox.eventSimulator,g=o.default.eventSandbox.listeners,v=r.default.domUtils,y=r.default.eventUtils,S=r.default.arrayUtils,b=r.default.delay,_=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(T,f=i.default),T.prototype._bindMousedownHandler=function(){var n=this;y.bind(this.element,"mousedown",function e(t){n.eventState.mousedownPrevented=t.defaultPrevented,y.preventDefault(t),y.unbind(n.element,"mousedown",e)})},T.prototype._bindBlurHandler=function(t){var n=this;y.bind(t,"blur",function e(){n.eventState.blurRaised=!0,y.unbind(t,"blur",e,!0)},!0)},T.prototype._raiseTouchEvents=function(e){p.isTouchDevice&&(E.touchstart(e.element,e.options),E.touchend(e.element,e.options))},T.prototype._mousedown=function(n){var o=this;return this.targetElementParentNodes=v.getParents(n.element),this.mouseDownElement=n.element,l.default.leftButtonDown().then(function(){o._raiseTouchEvents(n);var e=v.getActiveElement();o.activeElementBeforeMouseDown=e;var t=(m.isWebKit||m.isIE)&&v.isSelectElement(o.mouseDownElement);return t&&o._bindMousedownHandler(),o._bindBlurHandler(e),o.eventState.simulateDefaultBehavior=E.mousedown(n.element,n.options),!1===o.eventState.simulateDefaultBehavior&&(o.eventState.simulateDefaultBehavior=t&&!o.eventState.mousedownPrevented),o._ensureActiveElementBlur(e)}).then(function(){return o._focus(n)})},T.prototype._ensureActiveElementBlur=function(t){var n=this;return new d(function(e){v.getActiveElement()===t||n.eventState.blurRaised?e():m.isIE&&m.version<12?(0,a.default)().then(function(){n.eventState.blurRaised||E.blur(t),e()}):(E.blur(t),e())})},T.prototype._focus=function(e){if(!1===this.eventState.simulateDefaultBehavior)return d.resolve();var t=v.isContentEditableElement(this.element)?this.element:e.element,n=!m.isIE||this.activeElementBeforeMouseDown===v.getActiveElement();return(0,s.focusAndSetSelection)(t,n,this.caretPos)},T._getElementForClick=function(e,t,n){var o=v.getParents(t),r=v.isTheSameNode(t,e);return m.isFirefox?r?e:null:r?S.equals(n,o)?e:null:e.contains(t)&&!v.isEditableFormElement(t)?e:t.contains(e)?t:S.getCommonElement(o,n)},T.prototype._mouseup=function(t){var o=this;return l.default.buttonUp().then(function(){return o._getElementForEvent(t)}).then(function(e){t.element=e,o.eventState.clickElement=T._getElementForClick(o.mouseDownElement,e,o.targetElementParentNodes);var n={};return m.isIE||g.addInternalEventListener(B,["mouseup"],function e(t){n=t.timeStamp,g.removeInternalEventListener(B,["mouseup"],e)}),E.mouseup(e,t.options),{timeStamp:n}})},T.prototype._click=function(e){return(0,u.default)(this.eventState,e).run(),e},T.prototype.run=function(e){var i=this,s=null;return this._ensureElement(e).then(function(e){var t=e.element,n=e.clientPoint,o=e.screenPoint,r=e.devicePoint;return s={point:n,screenPoint:o,element:t,options:h({clientX:n.x,clientY:n.y,screenX:r.x,screenY:r.y},i.modifiers)},d.all([b(i.automationSettings.mouseActionStepDelay),i._mousedown(s)])}).then(function(){return i._mouseup(s)}).then(function(e){var t=e.timeStamp;return s.options.timeStamp=t,i._click(s)})},T);function T(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,T);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,f.call(this,e,t));return n.modifiers=t.modifiers,n.caretPos=t.caretPos,n.targetElementParentNodes=[],n.activeElementBeforeMouseDown=null,n.mouseDownElement=null,n.eventState={mousedownPrevented:!1,blurRaised:!1,simulateDefaultBehavior:!0,clickElement:null},n}e.default=_,t.exports=e.default},"select-child.js":function(e,t,n){e.__esModule=!0;var o=c(n("../../deps/hammerhead")),r=c(n("../../deps/testcafe-core")),i=c(n("../../deps/testcafe-ui")),l=c(n("../move")),a=n("../../../../test-run/commands/options"),s=n("../../utils/offsets"),u=c(n("../../settings"));function c(e){return e&&e.__esModule?e:{default:e}}var f=o.default.Promise,d=o.default.utils.browser,h=o.default.utils.featureDetection,m=o.default.eventSandbox.eventSimulator,p=o.default.eventSandbox.focusBlur,E=o.default.nativeMethods,g=r.default.domUtils,v=r.default.styleUtils,y=r.default.delay,S=i.default.selectElement,b=h.isTouchDevice?0:160,_=(T.prototype._calculateEventArguments=function(){var e=this.optionListExpanded?S.getEmulatedChildElement(this.element):this.element,t=1<v.getSelectElementSize(this.parentSelect);return{options:this.modifiers,element:d.isIE&&t?this.parentSelect:e}},T.prototype._getMoveArguments=function(){var e=null,t=null,n=null;if(this.optionListExpanded){e=S.getEmulatedChildElement(this.element);var o=(0,s.getDefaultAutomationOffsets)(e);t=o.offsetX,n=o.offsetY}else{e=F.documentElement;var r=S.getSelectChildCenter(this.element);t=r.x,n=r.y}return{element:e,offsetX:t,offsetY:n,speed:this.speed}},T.prototype._move=function(e){var t=this,n=e.element,o=e.offsetX,r=e.offsetY,i=e.speed,s=new a.MoveOptions({offsetX:o,offsetY:r,speed:i,modifiers:this.modifiers},!1);return new l.default(n,s).run().then(function(){return y(t.automationSettings.mouseActionStepDelay)})},T.prototype._mousedown=function(){var e=this;return d.isFirefox?(m.mousedown(this.eventsArgs.element,this.eventsArgs.options),this.clickCausesChange&&(this.parentSelect.selectedIndex=this.childIndex),this._focus()):d.isIE?(m.mousedown(this.eventsArgs.element,this.eventsArgs.options),this._focus()):this._focus().then(function(){return y(b)}).then(function(){m.mousedown(e.eventsArgs.element,e.eventsArgs.options),e.clickCausesChange&&(e.parentSelect.selectedIndex=e.childIndex)})},T.prototype._focus=function(){var t=this;return new f(function(e){p.focus(t.parentSelect,e,!1,!0)})},T.prototype._mouseup=function(){var e=d.isIE?this.parentSelect:this.eventsArgs.element;m.mouseup(e,this.eventsArgs.options),d.isIE&&this.clickCausesChange&&(this.parentSelect.selectedIndex=this.childIndex);var t=d.isFirefox||d.isSafari||d.isChrome&&53<=d.version,n=t||d.isIE;return t&&this.clickCausesChange&&m.input(this.parentSelect),n&&this.clickCausesChange&&m.change(this.parentSelect),f.resolve()},T.prototype._click=function(){m.click(this.eventsArgs.element,this.eventsArgs.options)},T.prototype.run=function(){var e=this;if(!this.parentSelect)return m.click(this.eventsArgs.element,this.eventsArgs.options),f.resolve();this.optionListExpanded||S.scrollOptionListByChild(this.element);var t=this._getMoveArguments();return this.eventsArgs=this._calculateEventArguments(),v.getSelectElementSize(this.parentSelect)<=1?this._move(t).then(function(){return e._click()}):this._move(t).then(function(){return e._mousedown()}).then(function(){return e._mouseup()}).then(function(){return e._click()})},T);function T(e,t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,T),this.element=e,this.modifiers=t.modifiers,this.caretPos=t.caretPos,this.offsetX=t.offsetX,this.offsetY=t.offsetY,this.speed=t.speed,this.automationSettings=new u.default(t.speed),this.parentSelect=g.getSelectParent(this.element),this.optionListExpanded=!!this.parentSelect&&S.isOptionListExpanded(this.parentSelect),this.childIndex=null,this.clickCausesChange=!1,this.parentSelect){var n=g.isOptionElement(this.element),o=this.parentSelect.selectedIndex;this.childIndex=g.getElementIndexInParent(this.parentSelect,this.element);var r=E.nodeParentNodeGetter.call(this.element),i=g.isOptionGroupElement(r)?r:null,s=this.element.disabled||i&&i.disabled;this.clickCausesChange=n&&!s&&this.childIndex!==o}this.eventsArgs={options:this.modifiers,element:this.element}}e.default=_,t.exports=e.default}},"dblclick.js":function(e,t,n){e.__esModule=!0;var o=u(n("../deps/hammerhead")),r=u(n("../deps/testcafe-core")),i=n("../../../test-run/commands/options"),s=u(n("./visible-element-automation")),l=u(n("./click")),a=u(n("../settings"));function u(e){return e&&e.__esModule?e:{default:e}}var c,f=o.default.utils.featureDetection,d=o.default.utils.browser,h=o.default.eventSandbox.eventSimulator,m=r.default.eventUtils,p=r.default.delay,E=f.isTouchDevice?0:160,g=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(v,c=s.default),v.prototype._firstClick=function(e){var t=this,n=new i.ClickOptions(this.options);n.speed=1;var o=new l.default(this.element,n);return o.on(o.TARGET_ELEMENT_FOUND_EVENT,function(e){return t.emit(t.TARGET_ELEMENT_FOUND_EVENT,e)}),o.run(e).then(function(e){return p(E).then(function(){return e})})},v.prototype._secondClick=function(e){var t=this;d.isIE&&m.bind(F,"focus",m.preventDefault,!0);var n=new i.ClickOptions({offsetX:e.screenPoint.x,offsetY:e.screenPoint.y,caretPos:this.caretPos,modifiers:this.modifiers,speed:1}),o=new l.default(F.documentElement,n);return o.run().then(function(e){return t.eventState.dblClickElement=o.eventState.clickElement,d.isIE&&m.unbind(F,"focus",m.preventDefault,!0),e})},v.prototype._dblClick=function(e){this.eventState.dblClickElement&&h.dblclick(this.eventState.dblClickElement,e.options)},v.prototype.run=function(e){var t=this;return this._firstClick(e).then(function(e){return t._secondClick(e)}).then(function(e){return t._dblClick(e)})},v);function v(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,v);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,c.call(this,e,t));return n.modifiers=t.modifiers,n.caretPos=t.caretPos,n.speed=t.speed,n.automationSettings=new a.default(n.speed),n.offsetX=t.offsetX,n.offsetY=t.offsetY,n.eventArgs=null,n.eventState={dblClickElement:null},n}e.default=g,t.exports=e.default},drag:{"base.js":function(e,t,n){e.__esModule=!0;var o=i(n("../../deps/hammerhead")),s=n("../../deps/testcafe-core"),l=n("../../get-element"),r=i(n("../visible-element-automation")),a=i(n("../move")),u=n("../../../../test-run/commands/options"),c=i(n("../../cursor"));function i(e){return e&&e.__esModule?e:{default:e}}var f,d=o.default.Promise,h=o.default.utils.extend,m=o.default.utils.featureDetection,p=o.default.eventSandbox.eventSimulator,E=o.default.eventSandbox.focusBlur,g=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(v,f=r.default),v.prototype._getEndPoint=function(){throw new Error("Not implemented")},v.prototype._mousedown=function(e){var t=this;return c.default.leftButtonDown().then(function(){return t.simulateDefaultBehavior=p[t.downEvent](e.element,e.options),t._focus(e)})},v.prototype._focus=function(n){var o=this;return new d(function(e){var t=s.domUtils.isContentEditableElement(o.element)?s.contentEditable.findContentEditableParent(o.element):n.element;E.focus(t,e,!1,!0)})},v.prototype._getDestination=function(){throw new Error("Not implemented")},v.prototype._drag=function(){var t=this,e=this._getDestination(),n=e.element,o=e.offsets,r=e.endPoint;this.endPoint=r;var i=new u.MoveOptions({offsetX:o.offsetX,offsetY:o.offsetY,modifiers:this.modifiers,speed:this.speed,minMovingTime:25,holdLeftButton:!0,skipDefaultDragBehavior:!1===this.simulateDefaultBehavior},!1);return new a.default(n,i).run().then(function(e){return t.dragAndDropState=e,(0,s.delay)(t.automationSettings.mouseActionStepDelay)})},v.prototype._mouseup=function(){var i=this;return c.default.buttonUp().then(function(){var n=s.positionUtils.offsetToClientCoords(i.endPoint),o=null,r=h({clientX:n.x,clientY:n.y},i.modifiers);return(0,l.fromPoint)(n.x,n.y).then(function(e){var t=e.element;return(o=t)?(i.dragAndDropState.enabled?(r.dataTransfer=i.dragAndDropState.dataTransfer,i.dragAndDropState.dropAllowed&&p.drop(o,r),p.dragend(i.dragAndDropState.element,r),i.dragAndDropState.dataStore.setProtectedMode()):p[i.upEvent](o,r),(0,l.fromPoint)(n.x,n.y)):o}).then(function(e){var t=e.element;o&&t===o&&!i.dragAndDropState.enabled&&p.click(o,r)})})},v.prototype.run=function(e){var o=this,r=null;return this._ensureElement(e).then(function(e){var t=e.element,n=e.clientPoint;return r={point:n,element:t,options:h({clientX:n.x,clientY:n.y},o.modifiers)},d.all([(0,s.delay)(o.automationSettings.mouseActionStepDelay),o._mousedown(r)])}).then(function(){return o._drag()}).then(function(){return o._mouseup()})},v);function v(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,v);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,f.call(this,e,t));return n.modifiers=t.modifiers,n.speed=t.speed,n.offsetX=t.offsetX,n.offsetY=t.offsetY,n.endPoint=null,n.simulateDefaultBehavior=!0,n.downEvent=m.isTouchDevice?"touchstart":"mousedown",n.upEvent=m.isTouchDevice?"touchend":"mouseup",n.dragAndDropState=null,n}e.default=g,t.exports=e.default},"drag-and-drop-state.js":function(e,t,n){e.__esModule=!0,e.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.enabled=!1,this.dropAllowed=!1,this.element=null,this.dataTransfer=null,this.dataStore=null},t.exports=e.default},"to-element.js":function(e,t,n){e.__esModule=!0;var o=s(n("../../deps/testcafe-core")),r=s(n("./base")),i=n("../../utils/offsets");function s(e){return e&&e.__esModule?e:{default:e}}var l,a=o.default.positionUtils,u=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(c,l=r.default),c.prototype._getDestination=function(){var e=this.destinationElement,t=a.getElementRectangle(e),n=(0,i.getOffsetOptions)(e,this.destinationOffsetX,this.destinationOffsetY);return{element:e,offsets:n,endPoint:{x:t.left+n.offsetX,y:t.top+n.offsetY}}},c);function c(e,t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,l.call(this,e,n));return o.destinationElement=t,o.destinationOffsetX=n.destinationOffsetX,o.destinationOffsetY=n.destinationOffsetY,o}e.default=u,t.exports=e.default},"to-offset.js":function(e,t,n){e.__esModule=!0;var o=s(n("../../deps/testcafe-core")),r=s(n("./base")),i=s(n("../../utils/get-automation-point"));function s(e){return e&&e.__esModule?e:{default:e}}var l,a=o.default.styleUtils,u=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(c,l=r.default),c.prototype._getDestination=function(){var e=(0,i.default)(this.element,this.offsetX,this.offsetY),t=a.getWidth(F),n=a.getHeight(F),o={x:e.x+this.dragOffsetX,y:e.y+this.dragOffsetY};return o={x:Math.min(Math.max(0,o.x),t),y:Math.min(Math.max(0,o.y),n)},{element:F.documentElement,offsets:{offsetX:o.x,offsetY:o.y},endPoint:o}},c);function c(e,t,n,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,l.call(this,e,o));return r.dragOffsetX=t,r.dragOffsetY=n,r}e.default=u,t.exports=e.default}},"hover.js":function(e,t,n){e.__esModule=!0;var o,r,i=n("./visible-element-automation"),s=(o=i)&&o.__esModule?o:{default:o},l=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(a,r=s.default),a.prototype.run=function(e){return this._ensureElement(e,!0)},a);function a(e,t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,r.call(this,e,t))}e.default=l,t.exports=e.default},move:{"event-sequence":{"base.js":function(e,t,n){e.__esModule=!0;var o,r=n("../../../deps/hammerhead"),i=(o=r)&&o.__esModule?o:{default:o},f=n("../../../deps/testcafe-core"),d=i.default.utils.browser,s=(l.prototype.setup=function(){this.dragAndDropMode=!1,this.dropAllowed=!1},l.prototype.leaveElement=function(){},l.prototype.move=function(){},l.prototype.enterElement=function(){},l.prototype.dragAndDrop=function(){},l.prototype.teardown=function(){},l.prototype.run=function(e,t,n,o,r){var i=t&&f.domUtils.isElementInDocument(t),s=t&&f.domUtils.isElementInIframe(t)&&!f.domUtils.getIframeByElement(t);i&&!s||(t=null);var l=e!==t,a=l?f.domUtils.getCommonAncestor(e,t):null;this.setup(),l&&t&&this.leaveElement(e,t,a,n),d.isIE&&this.move(e,n),l&&f.domUtils.isElementInDocument(e)&&this.enterElement(e,t,a,n),d.isIE||this.move(e,n),this.dragAndDrop(o,e,t,n,r),this.teardown(e,n,t);var u=this.dragAndDropMode,c=this.dropAllowed;return this.dragAndDropMode=!1,this.dropAllowed=!1,{dragAndDropMode:u,dropAllowed:c}},l);function l(e){var t=e.moveEvent;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),this.dragAndDropMode=!1,this.dropAllowed=!1,this.moveEvent=t}e.default=s,t.exports=e.default},"create-event-sequence.js":function(e,t,n){e.__esModule=!0,e.default=function(e,t,n){return e?t?new r.default(n):new i.default(n):new o.default(n)};var o=s(n("./move-event-sequence")),r=s(n("./drag-and-drop-move")),i=s(n("./drag-and-drop-first-move"));function s(e){return e&&e.__esModule?e:{default:e}}t.exports=e.default},"drag-and-drop-first-move.js":function(e,t,n){e.__esModule=!0;var o=i(n("../../../deps/hammerhead")),r=i(n("./base")),s=n("./event-behaviors");function i(e){return e&&e.__esModule?e:{default:e}}var l,a=o.default.eventSandbox.eventSimulator,u=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(c,l=r.default),c.prototype.setup=function(){l.prototype.setup.call(this),this.dragAndDropMode=!0},c.prototype.leaveElement=function(e,t,n,o){s.MoveBehaviour.leaveElement(e,t,n,o)},c.prototype.move=function(e,t){s.MoveBehaviour.move(this.moveEvent,e,t)},c.prototype.enterElement=function(e,t,n,o){s.MoveBehaviour.enterElement(e,t,n,o)},c.prototype.dragAndDrop=function(e,t,n,o,r){var i=a.dragstart(e,o);r.setReadOnlyMode(),i?this.dropAllowed=s.DragAndDropBehavior.dragAndDrop(e,t,n,o):this.dragAndDropMode=!1},c.prototype.run=function(e,t,n,o,r){return l.prototype.run.call(this,e,null,n,o,r)},c);function c(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,l.apply(this,arguments))}e.default=u,t.exports=e.default},"drag-and-drop-move.js":function(e,t,n){e.__esModule=!0;var o,r,i=n("./base"),s=(o=i)&&o.__esModule?o:{default:o},l=n("./event-behaviors"),a=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(u,r=s.default),u.prototype.setup=function(){r.prototype.setup.call(this),this.dragAndDropMode=!0},u.prototype.dragAndDrop=function(e,t,n,o){this.dropAllowed=l.DragAndDropBehavior.dragAndDrop(e,t,n,o)},u);function u(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,r.apply(this,arguments))}e.default=a,t.exports=e.default},"event-behaviors.js":function(e,t,n){e.__esModule=!0,e.DragAndDropBehavior=e.MoveBehaviour=void 0;var o,r=n("../../../deps/hammerhead"),i=(o=r)&&o.__esModule?o:{default:o},s=n("../../../deps/testcafe-core");function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=i.default.eventSandbox.eventSimulator,u=i.default.utils.extend,c=i.default.nativeMethods;function f(){l(this,f)}function d(){l(this,d)}e.MoveBehaviour=(f.leaveElement=function(e,t,n,o){a.mouseout(t,u({relatedTarget:e},o));for(var r=t;r&&r!==n;)a.mouseleave(r,u({relatedTarget:e},o)),r=c.nodeParentNodeGetter.call(r)},f.enterElement=function(e,t,n,o){a.mouseover(e,u({relatedTarget:t},o));for(var r=e,i=[];r&&r!==n;)i.push(r),r=c.nodeParentNodeGetter.call(r);i.reverse();for(var s=0;s<i.length;s++)a.mouseenter(i[s],u({relatedTarget:t},o))},f.move=function(e,t,n){a[e](t,n)},f),e.DragAndDropBehavior=(d.dragAndDrop=function(e,t,n,o){return a.drag(e,o),t!==n&&(s.domUtils.isElementInDocument(t)&&(o.relatedTarget=n,a.dragenter(t,o)),n&&(o.relatedTarget=t,a.dragleave(n,o))),!a.dragover(t,o)},d)},"move-event-sequence.js":function(e,t,n){e.__esModule=!0;var o=l(n("../../../deps/hammerhead")),r=n("../../../deps/testcafe-core"),i=l(n("./base")),s=n("./event-behaviors");function l(e){return e&&e.__esModule?e:{default:e}}var a,u=o.default.eventSandbox.eventSimulator,c=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(f,a=i.default),f.prototype.leaveElement=function(e,t,n,o){s.MoveBehaviour.leaveElement(e,t,n,o)},f.prototype.enterElement=function(e,t,n,o){s.MoveBehaviour.enterElement(e,t,n,o)},f.prototype.move=function(e,t){this._needEmulateMoveEvent()&&s.MoveBehaviour.move(this.moveEvent,e,t)},f.prototype.teardown=function(e,t,n){this._needEmulateMoveEvent()&&r.domUtils.isElementInDocument(e)&&e!==n&&u[this.moveEvent](e,t)},f.prototype._needEmulateMoveEvent=function(){return"touchmove"!==this.moveEvent||this.holdLeftButton},f);function f(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,a.call(this,e));return t.holdLeftButton=e.holdLeftButton,t}e.default=c,t.exports=e.default}},"index.js":function(e,t,n){e.__esModule=!0;var o=E(n("../../deps/hammerhead")),r=E(n("../../deps/testcafe-core")),h=n("../../../../test-run/commands/options"),i=E(n("../scroll")),m=E(n("../../cursor")),a=n("../../get-element"),s=E(n("../../utils/get-automation-point")),p=E(n("../../utils/get-line-rect-intersection")),u=E(n("../../utils/get-device-point")),l=E(n("../../utils/next-tick")),c=E(n("../../settings")),f=E(n("../drag/drag-and-drop-state")),d=E(n("./event-sequence/create-event-sequence"));function E(e){return e&&e.__esModule?e:{default:e}}var g=o.default.Promise,v=o.default.nativeMethods,y=o.default.utils.featureDetection,S=o.default.utils.html,b=o.default.utils.url,_=o.default.eventSandbox.eventSimulator,T=o.default.eventSandbox.message,A=o.default.eventSandbox.DataTransfer,w=o.default.eventSandbox.DragDataStore,x=r.default.positionUtils,P=r.default.domUtils,C=r.default.styleUtils,O=r.default.eventUtils,R=r.default.promiseUtils,M=r.default.sendRequestToFrame,I="automation|move|request",U="automation|move|response";T.on(T.SERVICE_MSG_RECEIVED_EVENT,function(e){e.message.cmd===I&&(e.source.parent===B?D.onMoveToIframeRequest(e):(o.default.on(o.default.EVENTS.beforeUnload,function(){return T.sendServiceMsg({cmd:U},e.source)}),D.onMoveOutRequest(e)))});var N=null,D=(k.getTarget=function(e,t,n){var o=!x.containsOffset(e,t,n),r=o?(0,s.default)(e,t,n):{x:t,y:n};return{element:o?F.documentElement:e,offsetX:r.x,offsetY:r.y}},k.onMoveToIframeRequest=function(e){var t={x:e.message.endX,y:e.message.endY},n=e.source,o=P.findIframeByWindow(n),r=C.getBordersWidth(o),i=C.getElementPadding(o),s=x.getIframeClientCoordinates(o),l=x.getIframePointRelativeToParentFrame(t,n),a=m.default.position,u=x.isInRectangle(a,s)?a:(0,p.default)(a,l,s),c={x:u.x-s.left,y:u.y-s.top},f=new k(o,new h.MoveOptions({modifiers:e.message.modifiers,offsetX:c.x+r.left+i.left,offsetY:c.y+r.top+i.top,speed:e.message.speed,skipScrolling:!0},!1)),d={cmd:U,x:c.x,y:c.y};m.default.activeWindow!==n?f.run().then(function(){m.default.activeWindow=n,T.sendServiceMsg(d,n)}):T.sendServiceMsg(d,n)},k.onMoveOutRequest=function(e){var t=e.source,n={left:e.message.left,right:e.message.right,top:e.message.top,bottom:e.message.bottom};if(!e.message.iframeUnderCursor){var o=e.message,r=o.startX,i=o.startY,s=r-n.left,l=i-n.top;return N&&(_.mouseout(N,{clientX:s,clientY:l,relatedTarget:null}),_.mouseleave(N,{clientX:s,clientY:l,relatedTarget:null})),void T.sendServiceMsg({cmd:U},t)}var a=m.default.position,u={x:n.left+a.x,y:n.top+a.y},c={x:e.message.endX,y:e.message.endY},f=(0,p.default)(u,c,n);if(f){var d=new h.MoveOptions({modifiers:e.message.modifiers,offsetX:f.x-n.left,offsetY:f.y-n.top,speed:e.message.speed,skipScrolling:!0},!1);new k(F.documentElement,d).run().then(function(){var e={cmd:U,x:f.x,y:f.y};m.default.activeWindow=t,T.sendServiceMsg(e,t)})}else T.sendServiceMsg({cmd:U,x:n.left,y:n.top},t)},k.prototype._getTargetClientPoint=function(){var e=C.getElementScroll(this.element);if(P.isHtmlElement(this.element))return{x:Math.floor(this.offsetX-e.left),y:Math.floor(this.offsetY-e.top)};var t=x.getClientPosition(this.element),n=this.element.tagName&&P.isBodyElement(this.element);return{x:Math.floor(n?t.x+this.offsetX:t.x+this.offsetX-e.left),y:Math.floor(n?t.y+this.offsetY:t.y+this.offsetY-e.top)}},k.prototype._emulateEvents=function(e){var t=this.holdLeftButton?O.BUTTONS_PARAMETER.leftButton:O.BUTTONS_PARAMETER.noButton,n=(0,u.default)({x:this.x,y:this.y}),o={clientX:this.x,clientY:this.y,screenX:n.x,screenY:n.y,buttons:t,ctrl:this.modifiers.ctrl,alt:this.modifiers.alt,shift:this.modifiers.shift,meta:this.modifiers.meta,dataTransfer:this.dragAndDropState.dataTransfer},r={moveEvent:this.moveEvent,holdLeftButton:this.holdLeftButton},i=(0,d.default)(this.dragAndDropState.enabled,this.firstMovingStepOccured,r).run(e,N,o,this.dragElement,this.dragAndDropState.dataStore),s=i.dragAndDropMode,l=i.dropAllowed;this.firstMovingStepOccured=!0,this.dragAndDropState.enabled=s,this.dragAndDropState.dropAllowed=l,N=e},k.prototype._movingStep=function(){var n=this;if(this.touchMode&&!this.holdLeftButton)this.x=this.endPoint.x,this.y=this.endPoint.y;else if(this.startTime){var e=(Math.min(v.dateNow(),this.endTime)-this.startTime)/(this.endTime-this.startTime);this.x=Math.floor(this.startPoint.x+this.distanceX*e),this.y=Math.floor(this.startPoint.y+this.distanceY*e)}else this.startTime=v.dateNow(),this.endTime=this.startTime+this.movingTime,this.x+=0<this.distanceX?1:-1,this.y+=0<this.distanceY?1:-1;return m.default.move(this.x,this.y).then(a.underCursor).then(function(e){var t=n.holdLeftButton&&n.touchMode?n.dragElement:e;return t?n._emulateEvents(t):null}).then(l.default)},k.prototype._isMovingFinished=function(){return this.x===this.endPoint.x&&this.y===this.endPoint.y},k.prototype._move=function(){var e=this;return this.startPoint=m.default.position,this.x=this.startPoint.x,this.y=this.startPoint.y,this.distanceX=this.endPoint.x-this.startPoint.x,this.distanceY=this.endPoint.y-this.startPoint.y,this.movingTime=Math.max(Math.abs(this.distanceX),Math.abs(this.distanceY))/this.cursorSpeed,this.minMovingTime&&(this.movingTime=Math.max(this.movingTime,this.minMovingTime)),R.whilst(function(){return!e._isMovingFinished()},function(){return e._movingStep()})},k.prototype._scroll=function(){if(this.skipScrolling)return g.resolve();var e=new h.ScrollOptions({offsetX:this.offsetX,offsetY:this.offsetY},!1);return new i.default(this.element,e).run()},k.prototype._moveToCurrentFrame=function(){if(m.default.active)return g.resolve();var e=m.default.position,t=e.x,n=e.y,o=m.default.activeWindow,r=null,i=null,s=null,l={cmd:I,startX:t,startY:n,endX:this.endPoint.x,endY:this.endPoint.y,modifiers:this.modifiers,speed:this.speed};return o.parent===B&&(r=P.findIframeByWindow(o),s=x.getIframeClientCoordinates(r),l.left=s.left,l.top=s.top,l.right=s.right,l.bottom=s.bottom),(0,a.underCursor)().then(function(e){return i=e===r,o.parent===B&&(l.iframeUnderCursor=i),M(l,U,o)}).then(function(e){return m.default.activeWindow=B,i||B.top!==B?m.default.move(e.x,e.y):null})},k.prototype.run=function(){var l=this;return(0,a.underCursor)().then(function(e){l.dragElement=l.holdLeftButton?e:null;var t=function(e){for(var t=e;t;){if(t.draggable)return t;t=v.nodeParentNodeGetter.call(t)}return null}(l.dragElement);if(t&&y.hasDataTransfer&&!l.skipDefaultDragBehavior){l.dragAndDropState.enabled=!0,l.dragElement=t,l.dragAndDropState.element=l.dragElement,l.dragAndDropState.dataStore=new w,l.dragAndDropState.dataTransfer=new A(l.dragAndDropState.dataStore);var n=P.isAnchorElement(l.dragElement);if(n||P.isImgElement(l.dragElement)){var o=n?"href":"src",r=b.parseProxyUrl(l.dragElement[o]),i=r?r.destUrl:l.dragElement[o],s=S.cleanUpHtml(v.elementOuterHTMLGetter.call(l.dragElement));l.dragAndDropState.dataTransfer.setData("text/plain",i),l.dragAndDropState.dataTransfer.setData("text/uri-list",i),l.dragAndDropState.dataTransfer.setData("text/html",s)}}return l._scroll()}).then(function(){var e=l._getTargetClientPoint(),t=e.x,n=e.y,o=C.getWidth(B),r=C.getHeight(B);return 0<=t&&t<=o&&0<=n&&n<=r?(l.endPoint={x:t,y:n},l._moveToCurrentFrame().then(function(){return l._move()})):null}).then(function(){return l.dragAndDropState})},k);function k(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,k),this.touchMode=y.isTouchDevice,this.moveEvent=this.touchMode?"touchmove":"mousemove",this.holdLeftButton=t.holdLeftButton,this.dragElement=null,this.dragAndDropState=new f.default,this.automationSettings=new c.default(t.speed);var n=k.getTarget(e,t.offsetX,t.offsetY);this.element=n.element,this.offsetX=n.offsetX,this.offsetY=n.offsetY,this.speed=t.speed,this.cursorSpeed=this.holdLeftButton?this.automationSettings.draggingSpeed:this.automationSettings.cursorSpeed,this.minMovingTime=t.minMovingTime||null,this.modifiers=t.modifiers||{},this.skipScrolling=t.skipScrolling,this.skipDefaultDragBehavior=t.skipDefaultDragBehavior,this.endPoint=null,this.movingTime=null,this.x=null,this.y=null,this.startTime=null,this.endTime=null,this.distanceX=null,this.distanceY=null,this.firstMovingStepOccured=!1}e.default=D,t.exports=e.default}},press:{"index.js":function(e,t,n){e.__esModule=!0;var o=u(n("../../deps/hammerhead")),l=n("../../deps/testcafe-core"),i=u(n("./key-press-simulator")),a=u(n("./shortcuts")),s=n("./utils"),r=u(n("../../settings"));function u(e){return e&&e.__esModule?e:{default:e}}var c=o.default.Promise,f=o.default.utils.browser,d=o.default.eventSandbox.message,h=o.default.nativeMethods,m="automation|press|request",p="automation|press|response";d.on(d.SERVICE_MSG_RECEIVED_EVENT,function(e){e.message.cmd===m&&(o.default.on(o.default.EVENTS.beforeUnload,function(){return d.sendServiceMsg({cmd:p},e.source)}),new E(e.message.keyCombinations,e.message.options).run().then(function(){return d.sendServiceMsg({cmd:p},e.source)}))});var E=(g._getKeyPressSimulators=function(e){var t=(0,l.getKeyArray)(e),n=(0,s.getActualKeysAndEventKeyProperties)(t),o=n.actualKeys,r=n.eventKeyProperties;return l.arrayUtils.map(o,function(e,t){return new i.default(e,r[t])})},g._getShortcuts=function(e){for(var t=(0,l.getKeyArray)(e.toLowerCase()),n=[],o=[],r=[],i=0;i<t.length;i++)for(o.push(t[i]),r=o.slice();r.length;){var s=r.join("+");a.default[s]?(n.push(s),o=r=[]):r.shift()}return n},g._getShortcutHandlers=function(e){for(var t=g._getShortcuts(e.toLowerCase()),n={},o="",r=null,i=null,s=null,l=0;l<t.length;l++)r=t[l],i=e.indexOf(r),s=r.length,n[o+=e.substring(0,i+s)]=a.default[r],e=e.substring(i+s);return n},g.prototype._down=function(e){this.pressedKeyString+=(this.pressedKeyString?"+":"")+e.key;var t=!e.down(this.modifiersState);return c.resolve(t)},g.prototype._press=function(e,t){var n=this;if(t&&!this.isSelectElement)return(0,l.delay)(this.automationSettings.keyActionStepDelay);var o=this.shortcutHandlers[this.pressedKeyString],r=!1;return o&&!f.isFirefox&&"enter"!==e.key||(r=!e.press(this.modifiersState)),r&&!this.isSelectElement||!o?(0,l.delay)(this.automationSettings.keyActionStepDelay):o((0,s.getDeepActiveElement)(this.topSameDomainDocument)).then(function(){return(0,l.delay)(n.automationSettings.keyActionStepDelay)})},g.prototype._up=function(e){return e.up(this.modifiersState),(0,l.delay)(this.automationSettings.keyActionStepDelay)},g.prototype._runCombination=function(e){var n=this;this.modifiersState={ctrl:!1,alt:!1,shift:!1,meta:!1},this.isSelectElement=l.domUtils.isSelectElement((0,s.getDeepActiveElement)(this.topSameDomainDocument)),this.pressedKeyString="",this.shortcutHandlers=g._getShortcutHandlers(e);var t=g._getKeyPressSimulators(e);return l.promiseUtils.each(t,function(t){return n._down(t).then(function(e){return n._press(t,e)})}).then(function(){return l.arrayUtils.reverse(t),l.promiseUtils.each(t,function(e){return n._up(e)})})},g.prototype.run=function(){var t=this,e=l.domUtils.getActiveElement(),n=l.domUtils.isIframeElement(e);if(B.top===B&&n&&h.contentWindowGetter.call(e)){var o={cmd:m,keyCombinations:this.keyCombinations,options:this.options};return(0,l.sendRequestToFrame)(o,p,h.contentWindowGetter.call(e))}return l.promiseUtils.each(this.keyCombinations,function(e){return t._runCombination(e).then(function(){return(0,l.delay)(t.automationSettings.keyActionStepDelay)})})},g);function g(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,g),this.keyCombinations=e,this.isSelectElement=!1,this.pressedKeyString="",this.modifiersState=null,this.shortcutHandlers=null,this.topSameDomainDocument=l.domUtils.getTopSameDomainWindow(B).document,this.automationSettings=new r.default(t.speed),this.options=t}e.default=E,t.exports=e.default},"key-press-simulator.js":function(e,t,n){e.__esModule=!0;var o=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e};function r(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var i=h(n("../../deps/hammerhead")),c=n("../../deps/testcafe-core"),a=h(n("../type/type-text")),f=n("./utils"),s=h(n("../../utils/get-key-code")),l=h(n("../../utils/get-key-identifier")),u=h(n("../../utils/is-letter")),d=h(n("../../utils/get-key-properties"));function h(e){return e&&e.__esModule?e:{default:e}}var m=i.default.utils.browser,p=i.default.utils.extend,E=i.default.eventSandbox.eventSimulator,g=(v._isKeyActivatedInputElement=function(e){return c.domUtils.isInputElement(e)&&/button|submit|reset|radio|checkbox/.test(e.type)},v.prototype._type=function(e,t){var n=e!==this.storedActiveElement,o=!n,r=e,i=c.domUtils.isEditableElement(e),s=c.domUtils.isEditableElement(this.storedActiveElement);try{if(n){var l=c.domUtils.isElementInIframe(e)===c.domUtils.isElementInIframe(this.storedActiveElement)||s;o=(!m.isFirefox||s)&&(!m.isWebKit||l)}}catch(e){}o&&(!m.isIE&&n&&s&&i&&(r=this.storedActiveElement),(0,a.default)(r,t))},v.prototype._addKeyPropertyToEventOptions=function(e){return p(e,(0,d.default)("keypress"===e.type,this.keyProperty,this.keyIdentifierProperty)),e},v.prototype.down=function(e){this.storedActiveElement=(0,f.getDeepActiveElement)(this.topSameDomainDocument),this.modifierKeyCode&&(e[this.sanitizedKey]=!0),e.shift&&this.isLetter&&(this.keyProperty=(0,f.changeLetterCase)(this.keyProperty));var t={keyCode:this.keyCode,type:"keydown"};return this._addKeyPropertyToEventOptions(t),E.keydown(this.storedActiveElement,p(t,e))},v.prototype.press=function(e){if(!this.isChar&&!this.specialKeyCode)return!0;var t=(0,f.getDeepActiveElement)(this.topSameDomainDocument),n=this.isChar?(0,f.getChar)(this.sanitizedKey,e.shift):null,o=this.specialKeyCode||n.charCodeAt(0),r=t!==this.storedActiveElement;if(m.isWebKit&&r&&c.domUtils.isElementInIframe(t)!==c.domUtils.isElementInIframe(this.storedActiveElement))return!0;this.storedActiveElement=t;var i={keyCode:o,charCode:o,type:"keypress"};this._addKeyPropertyToEventOptions(i);var s=m.isAndroid||E.keypress(t,p(i,e));if(!s)return s;t=(0,f.getDeepActiveElement)(this.topSameDomainDocument),!n||e.ctrl||e.alt||this._type(t,n);var l=v._isKeyActivatedInputElement(t),a=c.domUtils.isButtonElement(t),u=m.isSafari&&0<=m.compareVersions([m.webkitVersion,"603.1.30"]);return m.isFirefox||u||!l&&!a||"enter"!==this.sanitizedKey||t.click(),s},v.prototype.up=function(e){this.modifierKeyCode&&(e[this.sanitizedKey]=!1);var t={keyCode:this.keyCode,type:"keyup"};this._addKeyPropertyToEventOptions(t);var n=E.keyup((0,f.getDeepActiveElement)(this.topSameDomainDocument),p(t,e)),o=(0,f.getDeepActiveElement)(this.topSameDomainDocument);return!m.isFirefox&&!m.isSafari&&(!m.isChrome||53<=m.version)&&n&&"space"===this.sanitizedKey&&v._isKeyActivatedInputElement(o)&&o.click(),n},o(v,[{key:"key",get:function(){return this.sanitizedKey}}]),v);function v(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,v),this.isLetter=(0,u.default)(e),this.isChar=1===e.length||"space"===e,this.sanitizedKey=(0,c.getSanitizedKey)(e),this.modifierKeyCode=c.KEY_MAPS.modifiers[this.sanitizedKey],this.specialKeyCode=c.KEY_MAPS.specialKeys[this.sanitizedKey],this.keyCode=null,this.keyIdentifierProperty=(0,l.default)(t),this.topSameDomainDocument=c.domUtils.getTopSameDomainWindow(B).document,this.keyProperty=c.KEY_MAPS.keyProperty[t]||t,this.isChar&&"space"!==e?this.keyCode=(0,s.default)(this.sanitizedKey):this.modifierKeyCode?this.keyCode=this.modifierKeyCode:this.specialKeyCode&&(this.keyCode=this.specialKeyCode),this.storedActiveElement=null}e.default=g,t.exports=e.default},"shortcuts.js":function(e,t,n){e.__esModule=!0;var o=l(n("../../deps/hammerhead")),r=l(n("../../deps/testcafe-core")),i=l(n("../../deps/testcafe-ui")),s=n("./utils");function l(e){return e&&e.__esModule?e:{default:e}}var d=o.default.Promise,a=o.default.utils.browser,u=o.default.eventSandbox.eventSimulator,c=o.default.eventSandbox.elementEditingWatcher,h=r.default.textSelection,f=r.default.eventUtils,m=r.default.domUtils,p=i.default.selectElement,E=null,g=null;function v(){g=E=null,f.unbind(this,"blur",v,!0)}function y(e){m.isTextAreaElement(e)&&(E!==e&&(f.bind(e,"blur",v,!0),E=e),g=function(e){var t=h.hasInverseSelection(e),n=m.getTextAreaValue(e),o=t?h.getSelectionStart(e):h.getSelectionEnd(e);return n&&o?m.getTextareaIndentInLine(e,o):0}(e