Comparing version 0.2.0-alpha to 0.2.1-alpha
@@ -100,3 +100,2 @@ 'use strict'; | ||
// API | ||
BrowserConnection.prototype.addJob = function addJob(job) { | ||
@@ -103,0 +102,0 @@ this.jobQueue.push(job); |
@@ -1,1 +0,818 @@ | ||
!function(t){"use strict";var n,e,i,o,r,s={".js":[],".json":[],".css":[],".html":[]},a="function"==typeof require?require:null;return o=function(t){var n=new Error("Could not find module '"+t+"'");return n.code="MODULE_NOT_FOUND",n},r=function(t,n,e){var i,o;if("function"==typeof t[n+e])return n+e;for(i=0;o=s[e][i];++i)if("function"==typeof t[n+o])return n+o;return null},n=function(t,i,s,a,c,u){var h,l,f,d,p,y;for(s=s.split(/[\\/]/),h=s.pop(),"."!==h&&".."!==h||(s.push(h),h="");null!=(l=s.shift());)if(l&&"."!==l&&(".."===l?(t=i.pop(),u=u.slice(0,u.lastIndexOf("/"))):(i.push(t),t=t[l],u+="/"+l),!t))throw o(a);if(h&&"function"!=typeof t[h]&&(y=r(t,h,".js"),y||(y=r(t,h,".json")),y||(y=r(t,h,".css")),y||(y=r(t,h,".html")),y?h=y:2!==c&&"object"==typeof t[h]&&(i.push(t),t=t[h],u+="/"+h,h="")),!h)return 1!==c&&t[":mainpath:"]?n(t,i,t[":mainpath:"],a,1,u):n(t,i,"index",a,2,u);if(p=t[h],!p)throw o(a);return p.hasOwnProperty("module")?p.module.exports:(f={},p.module=d={exports:f,id:u+"/"+h},p.call(f,f,d,e(t,i,u)),d.exports)},i=function(e,i,r,s){var c,u=r,h=r.charAt(0),l=0;if("/"===h){if(u=u.slice(1),e=t["/"],!e){if(a)return a(r);throw o(r)}s="/",i=[]}else if("."!==h){if(c=u.split("/",1)[0],e=t[c],!e){if(a)return a(r);throw o(r)}s=c,i=[],u=u.slice(c.length+1),u||(u=e[":mainpath:"],u?l=1:(u="index",l=2))}return n(e,i,u,r,l,s)},(e=function(t,n,e){return function(o){return i(t,[].concat(n),o,e)}})(t,[],"")}({pinkie:{"index.js":function(t,n,e){function i(){for(var t=0;t<b.length;t++)b[t][0](b[t][1]);b=[],_=!1}function o(t,n){b.push([t,n]),_||(_=!0,M(i,0))}function r(t,n){function e(t){c(n,t)}function i(t){h(n,t)}try{t(e,i)}catch(o){i(o)}}function s(t){var n=t.owner,e=n._state,i=n._data,o=t[e],r=t.then;if("function"==typeof o){e=v;try{i=o(i)}catch(s){h(r,s)}}a(r,i)||(e===v&&c(r,i),e===C&&h(r,i))}function a(t,n){var e;try{if(t===n)throw new TypeError("A promises callback cannot return that same promise.");if(n&&("function"==typeof n||"object"===("undefined"==typeof n?"undefined":m(n)))){var i=n.then;if("function"==typeof i)return i.call(n,function(i){e||(e=!0,n===i?u(t,i):c(t,i))},function(n){e||(e=!0,h(t,n))}),!0}}catch(o){return e||h(t,o),!0}return!1}function c(t,n){t!==n&&a(t,n)||u(t,n)}function u(t,n){t._state===w&&(t._state=g,t._data=n,o(f,t))}function h(t,n){t._state===w&&(t._state=g,t._data=n,o(d,t))}function l(t){t._then=t._then.forEach(s)}function f(t){t._state=v,l(t)}function d(t){t._state=C,l(t),!t._handled&&S&&global.process.emit("unhandledRejection",t._data,t)}function p(t){global.process.emit("rejectionHandled",t)}function y(t){if("function"!=typeof t)throw new TypeError("Promise resolver "+t+" is not a function");if(this instanceof y==!1)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._then=[],r(t,this)}var _,m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},w="pending",g="settled",v="fulfilled",C="rejected",x=function(){},S="undefined"!=typeof global&&"undefined"!=typeof global.process&&"function"==typeof global.process.emit,M="undefined"==typeof setImmediate?setTimeout:setImmediate,b=[];y.prototype={constructor:y,_state:w,_then:null,_data:void 0,_handled:!1,then:function(t,n){var e={owner:this,then:new this.constructor(x),fulfilled:t,rejected:n};return!n&&!t||this._handled||(this._handled=!0,this._state===C&&S&&o(p,this)),this._state===v||this._state===C?o(s,e):this._then.push(e),e.then},"catch":function(t){return this.then(null,t)}},y.all=function(t){if(!Array.isArray(t))throw new TypeError("You must pass an array to Promise.all().");return new y(function(n,e){function i(t){return s++,function(e){r[t]=e,--s||n(r)}}for(var o,r=[],s=0,a=0;a<t.length;a++)o=t[a],o&&"function"==typeof o.then?o.then(i(a),e):r[a]=o;s||n(r)})},y.race=function(t){if(!Array.isArray(t))throw new TypeError("You must pass an array to Promise.race().");return new y(function(n,e){for(var i,o=0;o<t.length;o++)i=t[o],i&&"function"==typeof i.then?i.then(n,e):n(i)})},y.resolve=function(t){return t&&"object"===("undefined"==typeof t?"undefined":m(t))&&t.constructor===y?t:new y(function(n){n(t)})},y.reject=function(t){return new y(function(n,e){e(t)})},n.exports=y}},testcafe:{src:{"browser-connection":{"command.js":function(t,n,e){t.__esModule=!0,t["default"]={run:"run",idle:"idle"},n.exports=t["default"]}},client:{browser:{"idle-page":{"index.js":function(t,n,e){function i(t){return t&&t.__esModule?t:{"default":t}}function o(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n["default"]=t,n}function r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}var s=e("../"),a=o(s),c=e("./status-indicator"),u=i(c),h=e("../../../browser-connection/command"),l=i(h),f=1e3,d=function(){return new XMLHttpRequest},p=function(){function t(n,e){r(this,t),this.statusUrl=n,this.statusIndicator=new u["default"],a.startHeartbeat(e,d),this._checkStatus(),document.title="["+document.location.toString()+"]"}return t.prototype._checkStatus=function(){var t=this;a.checkStatus(this.statusUrl,d).then(function(n){n===l["default"].idle&&window.setTimeout(function(){return t._checkStatus()},f)})["catch"](function(){return t.statusIndicator.showDisconnection()})},t}();window.IdlePage=p},"status-indicator.js":function(t,n,e){function i(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function o(t){return t*Math.PI/180}function r(t){return t+"px"}function s(t,n){var e=o(n);return{x:Math.round(t.x*Math.cos(e)-t.y*Math.sin(e)),y:Math.round(t.x*Math.sin(e)+t.y*Math.cos(e))}}function a(t,n){return{x:Math.round(t.x-n),y:Math.round(t.y-n)}}t.__esModule=!0;var c=8,u=.8,h=400,l=7,f=.03,d=3.5,p={x:.75,y:.7},y={x:1.025,y:.575},_=6,m="#28687F",w="#882E24",g="#181818",v="CONNECTED",C="DISCONNECTED",x="page-background",S="user-agent",M="status",b="spinner",z="connected",E="disconnected",j=30,A=function(){function t(){i(this,t),this.connected=!0,this.canvas=document.getElementsByClassName(b)[0],this.canvasContext=this.canvas.getContext("2d"),this.spinnerAnimationInterval=null,this.rotationAngle=0,this.size=null,this.spinnerCenter=null,this.gradient=null,this._setSize(),this._setFontSize(),this._setSpinnerGradient(),t._createStatusMessage(this.connected),t._alignContainerVertically(),this._drawSpinner(this.connected,0),this._watchWindowResize()}return t._getContainer=function(){return document.getElementsByClassName("container")[0]},t._getStatusElementSpan=function(){return document.getElementsByClassName(M)[0].children[0]},t._createStatusMessage=function(n){var e=t._getStatusElementSpan();e.className=n?z:E,e.textContent=n?v:C},t._alignContainerVertically=function(){var n=document.getElementsByClassName(x)[0],e=t._getContainer(),i=Math.ceil((n.offsetHeight-e.offsetHeight)/2);i>0&&(e.style.marginTop=r(i))},t.prototype._setSize=function(){var n=window.document.documentElement,e=Math.min(n.clientWidth,n.clientHeight),i=t._getContainer(),o=Math.round(Math.min(h,e*u));o!==this.size&&(this.size=Math.round(Math.min(h,e*u)),this.spinnerCenter=this.size/2,i.style.width=r(this.size),i.style.height=r(this.size),this.canvas.width=this.canvas.height=this.size)},t.prototype._setFontSize=function(){var n=document.getElementsByClassName(S)[0].children[0],e=t._getStatusElementSpan(),i=Math.round(f*this.size+d),o=i+_;n.style.fontSize=r(i),n.style.lineHeight=r(o),n.style.maxHeight=r(2*o),e.style.fontSize=r(i),e.style.lineHeight=r(o-1)},t.prototype._watchWindowResize=function(){var n=this;window.onresize=function(){var e=n.size;n._setSize(),n._setFontSize(),t._alignContainerVertically(),e!==n.size&&(n.connected&&n._setSpinnerGradient(),n._drawSpinner(n.connected,n.rotationAngle))}},t.prototype._drawSpinner=function(t,n){var e=this;this._clearCanvas(),clearInterval(this.spinnerAnimationInterval),t?(this.spinnerAnimationInterval=window.setInterval(function(){e._clearCanvas(),e._rotateSpinner(),e._drawCircle(e.gradient,240,n)},j),this._drawCircle(this.gradient,240,n)):this._drawCircle(w,360,0)},t.prototype._drawCircle=function(t,n,e){var i=this.spinnerCenter-c/2;this.canvasContext.beginPath(),this.canvasContext.lineWidth=c,this.canvasContext.strokeStyle=t,this.canvasContext.arc(this.spinnerCenter,this.spinnerCenter,i,o(e),o(e+n),!1),this.canvasContext.stroke()},t.prototype._rotateSpinner=function(){this.rotationAngle+=l,this.rotationAngle=this.rotationAngle>360?this.rotationAngle%360:this.rotationAngle,this.canvasContext.translate(this.spinnerCenter,this.spinnerCenter),this.canvasContext.rotate(o(l)),this.canvasContext.translate(-this.spinnerCenter,-this.spinnerCenter)},t.prototype._getRotatedGradientPoints=function(t){var n=a(t,this.spinnerCenter);return n=s(n,this.rotationAngle),n=a(n,-this.spinnerCenter)},t.prototype._setSpinnerGradient=function(){var t={x:Math.round(this.size*p.x),y:Math.round(this.size*p.y)},n={x:Math.round(this.size*y.x),y:Math.round(this.size*y.y)};0!==this.rotationAngle&&(t=this._getRotatedGradientPoints(t),n=this._getRotatedGradientPoints(n));var e=this.canvasContext.createLinearGradient(t.x,t.y,n.x,n.y);e.addColorStop(0,m),e.addColorStop(1,g),this.gradient=e},t.prototype._clearCanvas=function(){this.canvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)},t.prototype.showDisconnection=function(){this.connected=!1,t._createStatusMessage(this.connected),this._drawSpinner(this.connected,0)},t}();t["default"]=A,n.exports=t["default"]}},"index.js":function(t,n,e){function i(t){return t&&t.__esModule?t:{"default":t}}function o(t,n){return new u["default"](function(e,i){var o=n();o.open("GET",t,!0),o.onreadystatechange=function(){4===o.readyState&&(200===o.status?e(o.responseText?JSON.parse(o.responseText):""):i("disconnected"))},o.send(null)})}function r(t){return document.location.href.toLowerCase()===t.toLowerCase()}function s(t,n){o(t,n),window.setInterval(function(){return o(t,n)},f)}function a(t,n){return o(t,n).then(function(t){return(t.cmd===l["default"].run||t.cmd===l["default"].idle&&!r(t.url))&&(document.location=t.url),t.cmd})}t.__esModule=!0,t.startHeartbeat=s,t.checkStatus=a;var c=e("pinkie"),u=i(c),h=e("../../browser-connection/command"),l=i(h),f=3e4}}}}}})("testcafe/src/client/browser/idle-page/index"); | ||
// This file was generated by modules-webmake (modules for web) project. | ||
// See: https://github.com/medikoo/modules-webmake | ||
(function (modules) { | ||
'use strict'; | ||
var resolve, getRequire, wmRequire, notFoundError, findFile | ||
, extensions = {".js":[],".json":[],".css":[],".html":[]} | ||
, envRequire = typeof require === 'function' ? require : null; | ||
notFoundError = function (path) { | ||
var error = new Error("Could not find module '" + path + "'"); | ||
error.code = 'MODULE_NOT_FOUND'; | ||
return error; | ||
}; | ||
findFile = function (scope, name, extName) { | ||
var i, ext; | ||
if (typeof scope[name + extName] === 'function') return name + extName; | ||
for (i = 0; (ext = extensions[extName][i]); ++i) { | ||
if (typeof scope[name + ext] === 'function') return name + ext; | ||
} | ||
return null; | ||
}; | ||
resolve = function (scope, tree, path, fullPath, state, id) { | ||
var name, dir, exports, module, fn, found, ext; | ||
path = path.split(/[\\/]/); | ||
name = path.pop(); | ||
if ((name === '.') || (name === '..')) { | ||
path.push(name); | ||
name = ''; | ||
} | ||
while ((dir = path.shift()) != null) { | ||
if (!dir || (dir === '.')) continue; | ||
if (dir === '..') { | ||
scope = tree.pop(); | ||
id = id.slice(0, id.lastIndexOf('/')); | ||
} else { | ||
tree.push(scope); | ||
scope = scope[dir]; | ||
id += '/' + dir; | ||
} | ||
if (!scope) throw notFoundError(fullPath); | ||
} | ||
if (name && (typeof scope[name] !== 'function')) { | ||
found = findFile(scope, name, '.js'); | ||
if (!found) found = findFile(scope, name, '.json'); | ||
if (!found) found = findFile(scope, name, '.css'); | ||
if (!found) found = findFile(scope, name, '.html'); | ||
if (found) { | ||
name = found; | ||
} else if ((state !== 2) && (typeof scope[name] === 'object')) { | ||
tree.push(scope); | ||
scope = scope[name]; | ||
id += '/' + name; | ||
name = ''; | ||
} | ||
} | ||
if (!name) { | ||
if ((state !== 1) && scope[':mainpath:']) { | ||
return resolve(scope, tree, scope[':mainpath:'], fullPath, 1, id); | ||
} | ||
return resolve(scope, tree, 'index', fullPath, 2, id); | ||
} | ||
fn = scope[name]; | ||
if (!fn) throw notFoundError(fullPath); | ||
if (fn.hasOwnProperty('module')) return fn.module.exports; | ||
exports = {}; | ||
fn.module = module = { exports: exports, id: id + '/' + name }; | ||
fn.call(exports, exports, module, getRequire(scope, tree, id)); | ||
return module.exports; | ||
}; | ||
wmRequire = function (scope, tree, fullPath, id) { | ||
var name, path = fullPath, t = fullPath.charAt(0), state = 0; | ||
if (t === '/') { | ||
path = path.slice(1); | ||
scope = modules['/']; | ||
if (!scope) { | ||
if (envRequire) return envRequire(fullPath); | ||
throw notFoundError(fullPath); | ||
} | ||
id = '/'; | ||
tree = []; | ||
} else if (t !== '.') { | ||
name = path.split('/', 1)[0]; | ||
scope = modules[name]; | ||
if (!scope) { | ||
if (envRequire) return envRequire(fullPath); | ||
throw notFoundError(fullPath); | ||
} | ||
id = name; | ||
tree = []; | ||
path = path.slice(name.length + 1); | ||
if (!path) { | ||
path = scope[':mainpath:']; | ||
if (path) { | ||
state = 1; | ||
} else { | ||
path = 'index'; | ||
state = 2; | ||
} | ||
} | ||
} | ||
return resolve(scope, tree, path, fullPath, state, id); | ||
}; | ||
getRequire = function (scope, tree, id) { | ||
return function (path) { | ||
return wmRequire(scope, [].concat(tree), path, id); | ||
}; | ||
}; | ||
return getRequire(modules, [], ''); | ||
})({ | ||
"pinkie": { | ||
"index.js": function (exports, module, require) { | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; | ||
var PENDING = 'pending'; | ||
var SETTLED = 'settled'; | ||
var FULFILLED = 'fulfilled'; | ||
var REJECTED = 'rejected'; | ||
var NOOP = function NOOP() {}; | ||
var isNode = typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function'; | ||
var asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate; | ||
var asyncQueue = []; | ||
var asyncTimer; | ||
function asyncFlush() { | ||
// run promise callbacks | ||
for (var i = 0; i < asyncQueue.length; i++) { | ||
asyncQueue[i][0](asyncQueue[i][1]); | ||
} | ||
// reset async asyncQueue | ||
asyncQueue = []; | ||
asyncTimer = false; | ||
} | ||
function asyncCall(callback, arg) { | ||
asyncQueue.push([callback, arg]); | ||
if (!asyncTimer) { | ||
asyncTimer = true; | ||
asyncSetTimer(asyncFlush, 0); | ||
} | ||
} | ||
function invokeResolver(resolver, promise) { | ||
function resolvePromise(value) { | ||
resolve(promise, value); | ||
} | ||
function rejectPromise(reason) { | ||
reject(promise, reason); | ||
} | ||
try { | ||
resolver(resolvePromise, rejectPromise); | ||
} catch (e) { | ||
rejectPromise(e); | ||
} | ||
} | ||
function invokeCallback(subscriber) { | ||
var owner = subscriber.owner; | ||
var settled = owner._state; | ||
var value = owner._data; | ||
var callback = subscriber[settled]; | ||
var promise = subscriber.then; | ||
if (typeof callback === 'function') { | ||
settled = FULFILLED; | ||
try { | ||
value = callback(value); | ||
} catch (e) { | ||
reject(promise, e); | ||
} | ||
} | ||
if (!handleThenable(promise, value)) { | ||
if (settled === FULFILLED) { | ||
resolve(promise, value); | ||
} | ||
if (settled === REJECTED) { | ||
reject(promise, value); | ||
} | ||
} | ||
} | ||
function handleThenable(promise, value) { | ||
var resolved; | ||
try { | ||
if (promise === value) { | ||
throw new TypeError('A promises callback cannot return that same promise.'); | ||
} | ||
if (value && (typeof value === 'function' || (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object')) { | ||
// then should be retrieved only once | ||
var then = value.then; | ||
if (typeof then === 'function') { | ||
then.call(value, function (val) { | ||
if (!resolved) { | ||
resolved = true; | ||
if (value === val) { | ||
fulfill(promise, val); | ||
} else { | ||
resolve(promise, val); | ||
} | ||
} | ||
}, function (reason) { | ||
if (!resolved) { | ||
resolved = true; | ||
reject(promise, reason); | ||
} | ||
}); | ||
return true; | ||
} | ||
} | ||
} catch (e) { | ||
if (!resolved) { | ||
reject(promise, e); | ||
} | ||
return true; | ||
} | ||
return false; | ||
} | ||
function resolve(promise, value) { | ||
if (promise === value || !handleThenable(promise, value)) { | ||
fulfill(promise, value); | ||
} | ||
} | ||
function fulfill(promise, value) { | ||
if (promise._state === PENDING) { | ||
promise._state = SETTLED; | ||
promise._data = value; | ||
asyncCall(publishFulfillment, promise); | ||
} | ||
} | ||
function reject(promise, reason) { | ||
if (promise._state === PENDING) { | ||
promise._state = SETTLED; | ||
promise._data = reason; | ||
asyncCall(publishRejection, promise); | ||
} | ||
} | ||
function publish(promise) { | ||
promise._then = promise._then.forEach(invokeCallback); | ||
} | ||
function publishFulfillment(promise) { | ||
promise._state = FULFILLED; | ||
publish(promise); | ||
} | ||
function publishRejection(promise) { | ||
promise._state = REJECTED; | ||
publish(promise); | ||
if (!promise._handled && isNode) { | ||
global.process.emit('unhandledRejection', promise._data, promise); | ||
} | ||
} | ||
function notifyRejectionHandled(promise) { | ||
global.process.emit('rejectionHandled', promise); | ||
} | ||
/** | ||
* @class | ||
*/ | ||
function Promise(resolver) { | ||
if (typeof resolver !== 'function') { | ||
throw new TypeError('Promise resolver ' + resolver + ' is not a function'); | ||
} | ||
if (this instanceof Promise === false) { | ||
throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.'); | ||
} | ||
this._then = []; | ||
invokeResolver(resolver, this); | ||
} | ||
Promise.prototype = { | ||
constructor: Promise, | ||
_state: PENDING, | ||
_then: null, | ||
_data: undefined, | ||
_handled: false, | ||
then: function then(onFulfillment, onRejection) { | ||
var subscriber = { | ||
owner: this, | ||
then: new this.constructor(NOOP), | ||
fulfilled: onFulfillment, | ||
rejected: onRejection | ||
}; | ||
if ((onRejection || onFulfillment) && !this._handled) { | ||
this._handled = true; | ||
if (this._state === REJECTED && isNode) { | ||
asyncCall(notifyRejectionHandled, this); | ||
} | ||
} | ||
if (this._state === FULFILLED || this._state === REJECTED) { | ||
// already resolved, call callback async | ||
asyncCall(invokeCallback, subscriber); | ||
} else { | ||
// subscribe | ||
this._then.push(subscriber); | ||
} | ||
return subscriber.then; | ||
}, | ||
catch: function _catch(onRejection) { | ||
return this.then(null, onRejection); | ||
} | ||
}; | ||
Promise.all = function (promises) { | ||
if (!Array.isArray(promises)) { | ||
throw new TypeError('You must pass an array to Promise.all().'); | ||
} | ||
return new Promise(function (resolve, reject) { | ||
var results = []; | ||
var remaining = 0; | ||
function resolver(index) { | ||
remaining++; | ||
return function (value) { | ||
results[index] = value; | ||
if (! --remaining) { | ||
resolve(results); | ||
} | ||
}; | ||
} | ||
for (var i = 0, promise; i < promises.length; i++) { | ||
promise = promises[i]; | ||
if (promise && typeof promise.then === 'function') { | ||
promise.then(resolver(i), reject); | ||
} else { | ||
results[i] = promise; | ||
} | ||
} | ||
if (!remaining) { | ||
resolve(results); | ||
} | ||
}); | ||
}; | ||
Promise.race = function (promises) { | ||
if (!Array.isArray(promises)) { | ||
throw new TypeError('You must pass an array to Promise.race().'); | ||
} | ||
return new Promise(function (resolve, reject) { | ||
for (var i = 0, promise; i < promises.length; i++) { | ||
promise = promises[i]; | ||
if (promise && typeof promise.then === 'function') { | ||
promise.then(resolve, reject); | ||
} else { | ||
resolve(promise); | ||
} | ||
} | ||
}); | ||
}; | ||
Promise.resolve = function (value) { | ||
if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.constructor === Promise) { | ||
return value; | ||
} | ||
return new Promise(function (resolve) { | ||
resolve(value); | ||
}); | ||
}; | ||
Promise.reject = function (reason) { | ||
return new Promise(function (resolve, reject) { | ||
reject(reason); | ||
}); | ||
}; | ||
module.exports = Promise; | ||
} | ||
}, | ||
"testcafe": { | ||
"src": { | ||
"browser-connection": { | ||
"command.js": function (exports, module, require) { | ||
exports.__esModule = true; | ||
// -------------------------------------------------------- | ||
// WARNING: this file is used by both the client and the server. | ||
// Do not use any browser or node-specific API! | ||
// -------------------------------------------------------- | ||
exports.default = { | ||
run: 'run', | ||
idle: 'idle' | ||
}; | ||
module.exports = exports['default']; | ||
} | ||
}, | ||
"client": { | ||
"browser": { | ||
"idle-page": { | ||
"index.js": function (exports, module, require) { | ||
var _ = require('../'); | ||
var browser = _interopRequireWildcard(_); | ||
var _statusIndicator = require('./status-indicator'); | ||
var _statusIndicator2 = _interopRequireDefault(_statusIndicator); | ||
var _command = require('../../../browser-connection/command'); | ||
var _command2 = _interopRequireDefault(_command); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var CHECK_STATUS_DELAY = 1000; | ||
var createXHR = function createXHR() { | ||
return new XMLHttpRequest(); | ||
}; | ||
var IdlePage = function () { | ||
function IdlePage(statusUrl, heartbeatUrl) { | ||
_classCallCheck(this, IdlePage); | ||
this.statusUrl = statusUrl; | ||
this.statusIndicator = new _statusIndicator2.default(); | ||
browser.startHeartbeat(heartbeatUrl, createXHR); | ||
this._checkStatus(); | ||
document.title = '[' + document.location.toString() + ']'; | ||
} | ||
IdlePage.prototype._checkStatus = function _checkStatus() { | ||
var _this = this; | ||
browser.checkStatus(this.statusUrl, createXHR).then(function (cmd) { | ||
if (cmd === _command2.default.idle) window.setTimeout(function () { | ||
return _this._checkStatus(); | ||
}, CHECK_STATUS_DELAY); | ||
}).catch(function () { | ||
return _this.statusIndicator.showDisconnection(); | ||
}); | ||
}; | ||
return IdlePage; | ||
}(); | ||
window.IdlePage = IdlePage; | ||
}, | ||
"status-indicator.js": function (exports, module, require) { | ||
exports.__esModule = true; | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var SPINNER_WIDTH = 8; | ||
var RELATED_SPINNER_SIZE = 0.8; | ||
var MAXIMUM_SPINNER_SIZE = 400; | ||
var ROTATION_ANGLE = 7; | ||
var FONT_SIZE_EQUATION_SLOPE = 0.03; | ||
var FONT_SIZE_EQUATION_Y_INTERCEPT = 3.5; | ||
var START_GRADIENT_POINT_OFFSET = { x: 0.75, y: 0.7 }; | ||
var END_GRADIENT_POINT_OFFSET = { x: 1.025, y: 0.575 }; | ||
var LINE_HEIGHT_INDENT = 6; | ||
var CONNECTED_SPINNER_COLOR = '#28687F'; | ||
var DISCONNECTED_SPINNER_COLOR = '#882E24'; | ||
var SPINNER_GRADIENT_COLOR = '#181818'; | ||
var CONNECTED_TEXT = 'CONNECTED'; | ||
var DISCONNECTED_TEXT = 'DISCONNECTED'; | ||
var PAGE_BACKGROUND_CLASS_NAME = 'page-background'; | ||
var CONTAINER_CLASS_NAME = 'container'; | ||
var STATUS_TEXT_AREA_CLASS_NAME = 'status-text-area'; | ||
var USER_AGENT_ELEMENT_CLASS_NAME = 'user-agent'; | ||
var STATUS_ELEMENT_CLASS_NAME = 'status'; | ||
var CANVAS_CLASS_NAME = 'spinner'; | ||
var CONNECTED_CLASS_NAME = 'connected'; | ||
var DISCONNECTED_CLASS_NAME = 'disconnected'; | ||
var ANIMATION_DELAY = 30; | ||
//Utils | ||
function convertToRadian(angle) { | ||
return angle * Math.PI / 180; | ||
} | ||
function convertToString(value) { | ||
return value + 'px'; | ||
} | ||
function rotateAxes(point, rotationAngle) { | ||
var angle = convertToRadian(rotationAngle); | ||
return { | ||
x: Math.round(point.x * Math.cos(angle) - point.y * Math.sin(angle)), | ||
y: Math.round(point.x * Math.sin(angle) + point.y * Math.cos(angle)) | ||
}; | ||
} | ||
function moveAxes(point, distance) { | ||
return { | ||
x: Math.round(point.x - distance), | ||
y: Math.round(point.y - distance) | ||
}; | ||
} | ||
var StatusIndicator = function () { | ||
function StatusIndicator() { | ||
_classCallCheck(this, StatusIndicator); | ||
this.connected = true; | ||
this.canvas = document.getElementsByClassName(CANVAS_CLASS_NAME)[0]; | ||
this.canvasContext = this.canvas.getContext("2d"); | ||
this.spinnerAnimationInterval = null; | ||
this.rotationAngle = 0; | ||
this.size = null; | ||
this.spinnerCenter = null; | ||
this.gradient = null; | ||
this._setSize(); | ||
this._setFontSize(); | ||
this._setSpinnerGradient(); | ||
StatusIndicator._createStatusMessage(this.connected); | ||
StatusIndicator._alignContainerVertically(); | ||
this._drawSpinner(this.connected, 0); | ||
this._watchWindowResize(); | ||
} | ||
//Markup | ||
StatusIndicator._getContainer = function _getContainer() { | ||
return document.getElementsByClassName('container')[0]; | ||
}; | ||
StatusIndicator._getStatusElementSpan = function _getStatusElementSpan() { | ||
return document.getElementsByClassName(STATUS_ELEMENT_CLASS_NAME)[0].children[0]; | ||
}; | ||
StatusIndicator._createStatusMessage = function _createStatusMessage(connected) { | ||
var statusSpan = StatusIndicator._getStatusElementSpan(); | ||
statusSpan.className = connected ? CONNECTED_CLASS_NAME : DISCONNECTED_CLASS_NAME; | ||
statusSpan.textContent = connected ? CONNECTED_TEXT : DISCONNECTED_TEXT; | ||
}; | ||
StatusIndicator._alignContainerVertically = function _alignContainerVertically() { | ||
var background = document.getElementsByClassName(PAGE_BACKGROUND_CLASS_NAME)[0]; | ||
var container = StatusIndicator._getContainer(); | ||
var topMargin = Math.ceil((background.offsetHeight - container.offsetHeight) / 2); | ||
if (topMargin > 0) container.style.marginTop = convertToString(topMargin); | ||
}; | ||
StatusIndicator.prototype._setSize = function _setSize() { | ||
var documentElement = window.document.documentElement; | ||
var minResolution = Math.min(documentElement.clientWidth, documentElement.clientHeight); | ||
var container = StatusIndicator._getContainer(); | ||
var newSize = Math.round(Math.min(MAXIMUM_SPINNER_SIZE, minResolution * RELATED_SPINNER_SIZE)); | ||
if (newSize === this.size) return; | ||
this.size = Math.round(Math.min(MAXIMUM_SPINNER_SIZE, minResolution * RELATED_SPINNER_SIZE)); | ||
this.spinnerCenter = this.size / 2; | ||
container.style.width = convertToString(this.size); | ||
container.style.height = convertToString(this.size); | ||
this.canvas.width = this.canvas.height = this.size; | ||
}; | ||
StatusIndicator.prototype._setFontSize = function _setFontSize() { | ||
var userAgentSpan = document.getElementsByClassName(USER_AGENT_ELEMENT_CLASS_NAME)[0].children[0]; | ||
var statusSpan = StatusIndicator._getStatusElementSpan(); | ||
// NOTE: We have established proportions for two edge cases: | ||
// the maximum spinner size of 400px corresponds to the 16px font, | ||
// the minimum spinner size of 240px corresponds to the 11px font. | ||
// Actual sizes are calculated from these proportions. | ||
var fontSize = Math.round(FONT_SIZE_EQUATION_SLOPE * this.size + FONT_SIZE_EQUATION_Y_INTERCEPT); | ||
var lineHeight = fontSize + LINE_HEIGHT_INDENT; | ||
userAgentSpan.style.fontSize = convertToString(fontSize); | ||
userAgentSpan.style.lineHeight = convertToString(lineHeight); | ||
userAgentSpan.style.maxHeight = convertToString(2 * lineHeight); | ||
statusSpan.style.fontSize = convertToString(fontSize); | ||
statusSpan.style.lineHeight = convertToString(lineHeight - 1); | ||
}; | ||
StatusIndicator.prototype._watchWindowResize = function _watchWindowResize() { | ||
var _this = this; | ||
window.onresize = function () { | ||
var oldSize = _this.size; | ||
_this._setSize(); | ||
_this._setFontSize(); | ||
StatusIndicator._alignContainerVertically(); | ||
if (oldSize !== _this.size) { | ||
if (_this.connected) _this._setSpinnerGradient(); | ||
_this._drawSpinner(_this.connected, _this.rotationAngle); | ||
} | ||
}; | ||
}; | ||
//Spinner | ||
StatusIndicator.prototype._drawSpinner = function _drawSpinner(connected, startAngle) { | ||
var _this2 = this; | ||
this._clearCanvas(); | ||
clearInterval(this.spinnerAnimationInterval); | ||
if (connected) { | ||
this.spinnerAnimationInterval = window.setInterval(function () { | ||
_this2._clearCanvas(); | ||
_this2._rotateSpinner(); | ||
_this2._drawCircle(_this2.gradient, 240, startAngle); | ||
}, ANIMATION_DELAY); | ||
this._drawCircle(this.gradient, 240, startAngle); | ||
} else this._drawCircle(DISCONNECTED_SPINNER_COLOR, 360, 0); | ||
}; | ||
StatusIndicator.prototype._drawCircle = function _drawCircle(strokeStyle, centralAngle, startAngle) { | ||
var radius = this.spinnerCenter - SPINNER_WIDTH / 2; | ||
this.canvasContext.beginPath(); | ||
this.canvasContext.lineWidth = SPINNER_WIDTH; | ||
this.canvasContext.strokeStyle = strokeStyle; | ||
this.canvasContext.arc(this.spinnerCenter, this.spinnerCenter, radius, convertToRadian(startAngle), convertToRadian(startAngle + centralAngle), false); | ||
this.canvasContext.stroke(); | ||
}; | ||
StatusIndicator.prototype._rotateSpinner = function _rotateSpinner() { | ||
this.rotationAngle += ROTATION_ANGLE; | ||
this.rotationAngle = this.rotationAngle > 360 ? this.rotationAngle % 360 : this.rotationAngle; | ||
this.canvasContext.translate(this.spinnerCenter, this.spinnerCenter); | ||
this.canvasContext.rotate(convertToRadian(ROTATION_ANGLE)); | ||
this.canvasContext.translate(-this.spinnerCenter, -this.spinnerCenter); | ||
}; | ||
StatusIndicator.prototype._getRotatedGradientPoints = function _getRotatedGradientPoints(point) { | ||
var changedPoint = moveAxes(point, this.spinnerCenter); | ||
changedPoint = rotateAxes(changedPoint, this.rotationAngle); | ||
changedPoint = moveAxes(changedPoint, -this.spinnerCenter); | ||
return changedPoint; | ||
}; | ||
StatusIndicator.prototype._setSpinnerGradient = function _setSpinnerGradient() { | ||
var startGradientPoint = { | ||
x: Math.round(this.size * START_GRADIENT_POINT_OFFSET.x), | ||
y: Math.round(this.size * START_GRADIENT_POINT_OFFSET.y) | ||
}; | ||
var endGradientPoint = { | ||
x: Math.round(this.size * END_GRADIENT_POINT_OFFSET.x), | ||
y: Math.round(this.size * END_GRADIENT_POINT_OFFSET.y) | ||
}; | ||
if (this.rotationAngle !== 0) { | ||
startGradientPoint = this._getRotatedGradientPoints(startGradientPoint); | ||
endGradientPoint = this._getRotatedGradientPoints(endGradientPoint); | ||
} | ||
var gradient = this.canvasContext.createLinearGradient(startGradientPoint.x, startGradientPoint.y, endGradientPoint.x, endGradientPoint.y); | ||
gradient.addColorStop(0, CONNECTED_SPINNER_COLOR); | ||
gradient.addColorStop(1, SPINNER_GRADIENT_COLOR); | ||
this.gradient = gradient; | ||
}; | ||
StatusIndicator.prototype._clearCanvas = function _clearCanvas() { | ||
this.canvasContext.clearRect(0, 0, this.canvas.width, this.canvas.height); | ||
}; | ||
//API | ||
StatusIndicator.prototype.showDisconnection = function showDisconnection() { | ||
this.connected = false; | ||
StatusIndicator._createStatusMessage(this.connected); | ||
this._drawSpinner(this.connected, 0); | ||
}; | ||
return StatusIndicator; | ||
}(); | ||
exports.default = StatusIndicator; | ||
module.exports = exports['default']; | ||
} | ||
}, | ||
"index.js": function (exports, module, require) { | ||
exports.__esModule = true; | ||
exports.startHeartbeat = startHeartbeat; | ||
exports.checkStatus = checkStatus; | ||
var _pinkie = require('pinkie'); | ||
var _pinkie2 = _interopRequireDefault(_pinkie); | ||
var _command = require('../../browser-connection/command'); | ||
var _command2 = _interopRequireDefault(_command); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
// TODO: once we'll have client commons load it from there instead of node modules (currently it's leads to two copies of this packages on client) | ||
var HEARTBEAT_INTERVAL = 30 * 1000; | ||
//Utils | ||
// NOTE: the window.XMLHttpRequest may have been wrapped by Hammerhead, while we should send a request to | ||
// the original URL. That's why we need the XMLHttpRequest argument to send the request via native methods. | ||
function sendXHR(url, createXHR) { | ||
return new _pinkie2.default(function (resolve, reject) { | ||
var xhr = createXHR(); | ||
xhr.open('GET', url, true); | ||
xhr.onreadystatechange = function () { | ||
if (xhr.readyState === 4) { | ||
if (xhr.status === 200) resolve(xhr.responseText ? JSON.parse(xhr.responseText) : '');else reject('disconnected'); | ||
} | ||
}; | ||
xhr.send(null); | ||
}); | ||
} | ||
function isCurrentLocation(url) { | ||
return document.location.href.toLowerCase() === url.toLowerCase(); | ||
} | ||
//API | ||
function startHeartbeat(heartbeatUrl, createXHR) { | ||
sendXHR(heartbeatUrl, createXHR); | ||
window.setInterval(function () { | ||
return sendXHR(heartbeatUrl, createXHR); | ||
}, HEARTBEAT_INTERVAL); | ||
} | ||
function checkStatus(statusUrl, createXHR) { | ||
return sendXHR(statusUrl, createXHR).then(function (res) { | ||
if (res.cmd === _command2.default.run || res.cmd === _command2.default.idle && !isCurrentLocation(res.url)) document.location = res.url; | ||
return res.cmd; | ||
}); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
})("testcafe/src/client/browser/idle-page/index"); |
@@ -1,2 +0,2 @@ | ||
!function(){function initTestCafeClientDrivers(window,isIFrameWithoutSrc){var document=window.document;!function(t){"use strict";var e,n,r,o,i,a={".js":[],".json":[],".css":[],".html":[]},s="function"==typeof require?require:null;return o=function(t){var e=new Error("Could not find module '"+t+"'");return e.code="MODULE_NOT_FOUND",e},i=function(t,e,n){var r,o;if("function"==typeof t[e+n])return e+n;for(r=0;o=a[n][r];++r)if("function"==typeof t[e+o])return e+o;return null},e=function(t,r,a,s,u,c){var l,f,d,h,m,p;for(a=a.split(/[\\/]/),l=a.pop(),"."!==l&&".."!==l||(a.push(l),l="");null!=(f=a.shift());)if(f&&"."!==f&&(".."===f?(t=r.pop(),c=c.slice(0,c.lastIndexOf("/"))):(r.push(t),t=t[f],c+="/"+f),!t))throw o(s);if(l&&"function"!=typeof t[l]&&(p=i(t,l,".js"),p||(p=i(t,l,".json")),p||(p=i(t,l,".css")),p||(p=i(t,l,".html")),p?l=p:2!==u&&"object"==typeof t[l]&&(r.push(t),t=t[l],c+="/"+l,l="")),!l)return 1!==u&&t[":mainpath:"]?e(t,r,t[":mainpath:"],s,1,c):e(t,r,"index",s,2,c);if(m=t[l],!m)throw o(s);return m.hasOwnProperty("module")?m.module.exports:(d={},m.module=h={exports:d,id:c+"/"+l},m.call(d,d,h,n(t,r,c)),h.exports)},r=function(n,r,i,a){var u,c=i,l=i.charAt(0),f=0;if("/"===l){if(c=c.slice(1),n=t["/"],!n){if(s)return s(i);throw o(i)}a="/",r=[]}else if("."!==l){if(u=c.split("/",1)[0],n=t[u],!n){if(s)return s(i);throw o(i)}a=u,r=[],c=c.slice(u.length+1),c||(c=n[":mainpath:"],c?f=1:(c="index",f=2))}return e(n,r,c,i,f,a)},(n=function(t,e,n){return function(o){return r(t,[].concat(e),o,n)}})(t,[],"")}({pinkie:{"index.js":function(t,e,n){function r(){for(var t=0;t<x.length;t++)x[t][0](x[t][1]);x=[],E=!1}function o(t,e){x.push([t,e]),E||(E=!0,b(r,0))}function i(t,e){function n(t){u(e,t)}function r(t){l(e,t)}try{t(n,r)}catch(o){r(o)}}function a(t){var e=t.owner,n=e._state,r=e._data,o=t[n],i=t.then;if("function"==typeof o){n=w;try{r=o(r)}catch(a){l(i,a)}}s(i,r)||(n===w&&u(i,r),n===_&&l(i,r))}function s(t,e){var n;try{if(t===e)throw new TypeError("A promises callback cannot return that same promise.");if(e&&("function"==typeof e||"object"===("undefined"==typeof e?"undefined":g(e)))){var r=e.then;if("function"==typeof r)return r.call(e,function(r){n||(n=!0,e===r?c(t,r):u(t,r))},function(e){n||(n=!0,l(t,e))}),!0}}catch(o){return n||l(t,o),!0}return!1}function u(t,e){t!==e&&s(t,e)||c(t,e)}function c(t,e){t._state===v&&(t._state=y,t._data=e,o(d,t))}function l(t,e){t._state===v&&(t._state=y,t._data=e,o(h,t))}function f(t){t._then=t._then.forEach(a)}function d(t){t._state=w,f(t)}function h(t){t._state=_,f(t),!t._handled&&C&&global.process.emit("unhandledRejection",t._data,t)}function m(t){global.process.emit("rejectionHandled",t)}function p(t){if("function"!=typeof t)throw new TypeError("Promise resolver "+t+" is not a function");if(this instanceof p==!1)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._then=[],i(t,this)}var E,g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},v="pending",y="settled",w="fulfilled",_="rejected",I=function(){},C="undefined"!=typeof global&&"undefined"!=typeof global.process&&"function"==typeof global.process.emit,b="undefined"==typeof setImmediate?setTimeout:setImmediate,x=[];p.prototype={constructor:p,_state:v,_then:null,_data:void 0,_handled:!1,then:function(t,e){var n={owner:this,then:new this.constructor(I),fulfilled:t,rejected:e};return!e&&!t||this._handled||(this._handled=!0,this._state===_&&C&&o(m,this)),this._state===w||this._state===_?o(a,n):this._then.push(n),n.then},"catch":function(t){return this.then(null,t)}},p.all=function(t){if(!Array.isArray(t))throw new TypeError("You must pass an array to Promise.all().");return new p(function(e,n){function r(t){return a++,function(n){i[t]=n,--a||e(i)}}for(var o,i=[],a=0,s=0;s<t.length;s++)o=t[s],o&&"function"==typeof o.then?o.then(r(s),n):i[s]=o;a||e(i)})},p.race=function(t){if(!Array.isArray(t))throw new TypeError("You must pass an array to Promise.race().");return new p(function(e,n){for(var r,o=0;o<t.length;o++)r=t[o],r&&"function"==typeof r.then?r.then(e,n):e(r)})},p.resolve=function(t){return t&&"object"===("undefined"==typeof t?"undefined":g(t))&&t.constructor===p?t:new p(function(e){e(t)})},p.reject=function(t){return new p(function(e,n){n(t)})},e.exports=p}},replicator:{":mainpath:":"index.js","index.js":function(t,e,n){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},o="@t",i="@r",a=/^#*@(t|r)$/,s=function(){var t=eval;return t("this")}(),u="function"==typeof ArrayBuffer,c="function"==typeof Map,l="function"==typeof Set,f=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"],d=Array.prototype.slice,h={serialize:function(t){return JSON.stringify(t)},deserialize:function(t){return JSON.parse(t)}},m=function(t,e){this.references=t,this.transforms=e,this.circularCandidates=[],this.circularCandidatesDescrs=[],this.circularRefCount=0};m._createRefMark=function(t){var e=Object.create(null);return e[i]=t,e},m.prototype._createCircularCandidate=function(t,e,n){this.circularCandidates.push(t),this.circularCandidatesDescrs.push({parent:e,key:n,refIdx:-1})},m.prototype._applyTransform=function(t,e,n,i){var a=Object.create(null),s=i.toSerializable(t);return"object"===("undefined"==typeof s?"undefined":r(s))&&this._createCircularCandidate(t,e,n),a[o]=i.type,a.data=this._handleValue(s,e,n),a},m.prototype._handleArray=function(t){for(var e=[],n=0;n<t.length;n++)e[n]=this._handleValue(t[n],e,n);return e},m.prototype._handlePlainObject=function(t){var e=Object.create(null);for(var n in t)if(t.hasOwnProperty(n)){var r=a.test(n)?"#"+n:n;e[r]=this._handleValue(t[n],e,r)}return e},m.prototype._handleObject=function(t,e,n){return this._createCircularCandidate(t,e,n),Array.isArray(t)?this._handleArray(t):this._handlePlainObject(t)},m.prototype._ensureCircularReference=function(t){var e=this.circularCandidates.indexOf(t);if(e>-1){var n=this.circularCandidatesDescrs[e];return n.refIdx===-1&&(n.refIdx=n.parent?++this.circularRefCount:0),m._createRefMark(n.refIdx)}return null},m.prototype._handleValue=function(t,e,n){var o="undefined"==typeof t?"undefined":r(t),i="object"===o&&null!==t;if(i){var a=this._ensureCircularReference(t);if(a)return a}for(var s=0;s<this.transforms.length;s++){var u=this.transforms[s];if(u.shouldTransform(o,t))return this._applyTransform(t,e,n,u)}return i?this._handleObject(t,e,n):t},m.prototype.transform=function(){for(var t=[this._handleValue(this.references,null,null)],e=0;e<this.circularCandidatesDescrs.length;e++){var n=this.circularCandidatesDescrs[e];n.refIdx>0&&(t[n.refIdx]=n.parent[n.key],n.parent[n.key]=m._createRefMark(n.refIdx))}return t};var p=function(t,e){this.references=t,this.transformMap=e,this.activeTransformsStack=[],this.visitedRefs=Object.create(null)};p.prototype._handlePlainObject=function(t){var e=Object.create(null);for(var n in t)t.hasOwnProperty(n)&&(this._handleValue(t[n],t,n),a.test(n)&&(e[n.substring(1)]=t[n],delete t[n]));for(var r in e)t[r]=e[r]},p.prototype._handleTransformedObject=function(t,e,n){var r=t[o],i=this.transformMap[r];if(!i)throw new Error("Can't find transform for \""+r+'" type.');this.activeTransformsStack.push(t),this._handleValue(t.data,t,"data"),this.activeTransformsStack.pop(),e[n]=i.fromSerializable(t.data)},p.prototype._handleCircularSelfRefDuringTransform=function(t,e,n){var r=this.references;Object.defineProperty(e,n,{val:void 0,configurable:!0,enumerable:!0,get:function(){return void 0===this.val&&(this.val=r[t]),this.val},set:function(t){this.val=t}})},p.prototype._handleCircularRef=function(t,e,n){this.activeTransformsStack.indexOf(this.references[t])>-1?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])},p.prototype._handleValue=function(t,e,n){if("object"===("undefined"==typeof t?"undefined":r(t))&&null!==t){var a=t[i];if(void 0!==a)this._handleCircularRef(a,e,n);else if(t[o])this._handleTransformedObject(t,e,n);else if(Array.isArray(t))for(var s=0;s<t.length;s++)this._handleValue(t[s],t,s);else this._handlePlainObject(t)}},p.prototype.transform=function(){return this.visitedRefs[0]=!0,this._handleValue(this.references[0],this.references,0),this.references[0]};var E=[{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=s[t.name]||Error,n=new e(t.message);return n.stack=t.stack,n}},{type:"[[ArrayBuffer]]",shouldTransform:function(t,e){return u&&e instanceof ArrayBuffer},toSerializable:function(t){var e=new Int8Array(t);return d.call(e)},fromSerializable:function(t){if(u){var e=new ArrayBuffer(t.length),n=new Int8Array(e);return n.set(t),e}return t}},{type:"[[TypedArray]]",shouldTransform:function(t,e){for(var n=0;n<f.length;n++){var r=f[n];if("function"==typeof s[r]&&e instanceof s[r])return!0}return!1},toSerializable:function(t){return{ctorName:t.constructor.name,arr:d.call(t)}},fromSerializable:function(t){return"function"==typeof s[t.ctorName]?new s[t.ctorName](t.arr):t.arr}},{type:"[[Map]]",shouldTransform:function(t,e){return c&&e instanceof Map},toSerializable:function(t){var e=[];return t.forEach(function(t,n){e.push(n),e.push(t)}),e},fromSerializable:function(t){if(c){for(var e=new Map,n=0;n<t.length;n+=2)e.set(t[n],t[n+1]);return e}for(var r=[],o=0;o<t.length;o+=2)r.push([t[n],t[n+1]]);return r}},{type:"[[Set]]",shouldTransform:function(t,e){return l&&e instanceof Set},toSerializable:function(t){var e=[];return t.forEach(function(t){e.push(t)}),e},fromSerializable:function(t){if(l){for(var e=new Set,n=0;n<t.length;n++)e.add(t[n]);return e}return t}}],g=e.exports=function(t){this.transforms=[],this.transformsMap=Object.create(null),this.serializer=t||h,this.addTransforms(E)};g.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},g.prototype.removeTransforms=function(t){t=Array.isArray(t)?t:[t];for(var e=0;e<t.length;e++){var n=t[e],r=this.transforms.indexOf(n);r>-1&&this.transforms.splice(r,1),delete this.transformsMap[n.type]}return this},g.prototype.encode=function(t){var e=new m(t,this.transforms),n=e.transform();return this.serializer.serialize(n)},g.prototype.decode=function(t){var e=this.serializer.deserialize(t),n=new p(e,this.transformsMap);return n.transform()}}},testcafe:{src:{"browser-connection":{"command.js":function(t,e,n){t.__esModule=!0,t["default"]={run:"run",idle:"idle"},e.exports=t["default"]}},client:{browser:{"index.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){return new c["default"](function(n,r){var o=e();o.open("GET",t,!0),o.onreadystatechange=function(){4===o.readyState&&(200===o.status?n(o.responseText?JSON.parse(o.responseText):""):r("disconnected"))},o.send(null)})}function i(t){return document.location.href.toLowerCase()===t.toLowerCase()}function a(t,e){o(t,e),window.setInterval(function(){return o(t,e)},d)}function s(t,e){return o(t,e).then(function(t){return(t.cmd===f["default"].run||t.cmd===f["default"].idle&&!i(t.url))&&(document.location=t.url),t.cmd})}t.__esModule=!0,t.startHeartbeat=a,t.checkStatus=s;var u=n("pinkie"),c=r(u),l=n("../../browser-connection/command"),f=r(l),d=3e4}},driver:{"command-executors":{"client-functions":{"client-function-executor.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=n("../../deps/hammerhead"),a=n("../../status"),s=r(a),u=n("./replicator"),c=n("./eval-function"),l=r(c),f=n("../../../../errors/test-run"),d=function(){function t(e){o(this,t),this.command=e,this.replicator=this._createReplicator()}return t.prototype.getResult=function(){var t=this;return i.Promise.resolve().then(function(){var e=t.replicator.decode(t.command.dependencies);return(0,l["default"])(t.command.fnCode,e)}).then(function(e){var n=t.replicator.decode(t.command.args);return t._executeFn(e,n)})["catch"](function(e){throw e.isTestCafeError||(e=new f.UncaughtErrorInClientFunctionCode(t.command.instantiationCallsiteName,e)),e})},t.prototype.getResultDriverStatus=function(){var t=this;return this.getResult().then(function(e){return new s["default"]({isCommandResult:!0,result:t.replicator.encode(e)})})["catch"](function(t){return new s["default"]({isCommandResult:!0,executionError:t})})},t.prototype._createReplicator=function(){return(0,u.createReplicator)([new u.ClientFunctionNodeTransform(this.command.instantiationCallsiteName),new u.FunctionTransform])},t.prototype._executeFn=function(t,e){return t.apply(window,e)},t}();t["default"]=d,e.exports=t["default"]},"eval-function.js":function(exports,module,require){function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}function evalFunction(fnCode,__dependencies$){"use strict";return eval(fnCode)}exports.__esModule=!0,exports["default"]=evalFunction;var _hammerhead=require("../../deps/hammerhead"),_hammerhead2=_interopRequireDefault(_hammerhead),Promise=_hammerhead2["default"].Promise;module.exports=exports["default"]},"replicator.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t){var e=new s["default"]({serialize:h,deserialize:h});return e.addTransforms(t)}t.__esModule=!0,t.ClientFunctionNodeTransform=t.SelectorNodeTransform=t.FunctionTransform=void 0,t.createReplicator=i;var a=n("replicator"),s=r(a),u=n("./eval-function"),c=r(u),l=n("./selector-executor/node-snapshots"),f=n("../../../../errors/test-run"),d=window.Node,h=function(t){return t};t.FunctionTransform=function(){function t(){o(this,t),this.type="Function"}return t.prototype.shouldTransform=function(t){return"function"===t},t.prototype.toSerializable=function(){return""},t.prototype.fromSerializable=function(t){var e=t.fnCode,n=t.dependencies;return(0,c["default"])(e,n)},t}(),t.SelectorNodeTransform=function(){function t(){o(this,t),this.type="Node"}return t.prototype.shouldTransform=function(t,e){return e instanceof d},t.prototype.toSerializable=function(t){return 1===t.nodeType?new l.ElementSnapshot(t):new l.NodeSnapshot(t)},t}(),t.ClientFunctionNodeTransform=function(){function t(e){o(this,t),this.type="Node",this.instantiationCallsiteName=e}return t.prototype.shouldTransform=function(t,e){if(e instanceof d)throw new f.DomNodeClientFunctionResultError(this.instantiationCallsiteName)},t}()},"selector-executor":{"index.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t){if(!x(t))return!1;for(var e=0;e<t.length;e++)if(!(t[e]instanceof I))return!1;return!0}function u(t){return!!t}function c(t){return h.domUtils.isOptionElement(t)||"optgroup"===h.domUtils.getTagName(t)?m.selectElement.isOptionElementVisible(t):h.positionUtils.isElementVisible(t)}function l(t,e){return 1===t.nodeType?e.test((0,y.getInnerText)(t)):9===t.nodeType||11===t.nodeType?!!f(t.childNodes,e).length:e.test((0,y.getTextContent)(t))}function f(t,e){for(var n=[],r=0;r<t.length;r++)l(t[r],e)&&n.push(t[r]);return n}t.__esModule=!0;var d=n("../../../deps/hammerhead"),h=n("../../../deps/testcafe-core"),m=n("../../../deps/testcafe-ui"),p=n("../client-function-executor"),E=r(p),g=n("../replicator"),v=n("../../../../../errors/test-run"),y=n("./sandboxed-node-properties"),w=200,_="Waiting for an element to appear",I=window.Node,C=window.HTMLCollection,b=window.NodeList,x=Array.isArray;Object.defineProperty(window,"%testCafeSelectorFilter%",{value:function(t,e){if(null===t||void 0===t)return t;if(t instanceof I)return e.textFilter?l(t,e.textFilter)?t:null:t;if(t instanceof C||t instanceof b||s(t))return e.textFilter&&(t=f(t,e.textFilter)),t[e.index];throw new v.InvalidSelectorResultError}});var S=function(t){function e(n,r,a,s,u){o(this,e);var c=i(this,t.call(this,n));if(c.createNotFoundError=s,c.createIsInvisibleError=u,c.timeout="number"==typeof n.timeout?n.timeout:r,a){var l=new Date-a;c.timeout=Math.max(c.timeout-l,0)}return c}return a(e,t),e.prototype._createReplicator=function(){return(0,g.createReplicator)([new g.SelectorNodeTransform,new g.FunctionTransform])},e.prototype._checkElement=function(t,e,n,r,o){if(n(t))return t;var i=new Date-e>=this.timeout;if(i){if(r)throw r();return null}return(0,h.delay)(w).then(o)},e.prototype._ensureExists=function(t,e,n){var r=this,o=function(){return r._ensureExists(t,e,n)};return d.Promise.resolve().then(function(){return t.apply(window,e)}).then(function(t){return r._checkElement(t,n,u,r.createNotFoundError,o)})},e.prototype._ensureVisible=function(t,e){var n=this,r=function(){return n._ensureVisible(t,e)};return this._checkElement(t,e,c,this.createIsInvisibleError,r)},e.prototype._executeFn=function(t,e){var n=this,r=new Date,o=new m.ProgressPanel;return o.show(_,this.timeout),this._ensureExists(t,e,r).then(function(t){return t&&n.command.visibilityCheck?n._ensureVisible(t,r):t})["catch"](function(t){throw o.close(!1),t}).then(function(t){return o.close(!!t),t})},e}(E["default"]);t["default"]=S,e.exports=t["default"]},"node-snapshots.js":function(t,e,n){function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0,t.ElementSnapshot=t.NodeSnapshot=void 0;var a=n("../../../deps/testcafe-core"),s=n("./sandboxed-node-properties"),u=t.NodeSnapshot=function(){function t(e){i(this,t),this.nodeType=e.nodeType,this.textContent=(0,s.getTextContent)(e),this.childNodeCount=(0,s.getChildNodes)(e).length,this.hasChildNodes=!!this.childNodeCount,this.childElementCount=t._getChildElementCount(e),this.hasChildElements=!!this.childElementCount}return t._getChildElementCount=function(t){var e=(0,s.getChildren)(t);if(e)return e.length;for(var n=0,r=t.childNodes.length,o=0;o<r;o++)1===t.childNodes[o].nodeType&&n++;return n},t}();t.ElementSnapshot=function(t){function e(n){i(this,e);var o=r(this,t.call(this,n));return o.tagName=n.tagName.toLowerCase(),o.visible=a.positionUtils.isElementVisible(n),o.focused=document.activeElement===n,o.attributes=e._getAttrsDictionary(n),o.boundingClientRect=e._getBoundingClientRect(n),o.classNames=e._getClassNames(n),o.style=e._getStyle(n),o.innerText=(0,s.getInnerText)(n),["namespaceURI","id","value","checked","scrollWidth","scrollHeight","scrollLeft","scrollTop","offsetWidth","offsetHeight","offsetLeft","offsetTop","clientWidth","clientHeight","clientLeft","clientTop"].forEach(function(t){o[t]=n[t]}),o}return o(e,t),e._getBoundingClientRect=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}},e._getClassNames=function(t){var e=(0,s.getClassName)(t);return e="string"==typeof e.animVal?e.animVal:e,e.replace(/^\s+|\s+$/g,"").split(/\s+/g)},e._getAttrsDictionary=function(t){for(var e=(0,s.getAttrs)(t),n={},r=e.length-1;r>=0;r--)n[e[r].name]=e[r].value;return n},e._getStyle=function(t){for(var e={},n=window.getComputedStyle(t),r=0;r<n.length;r++){var o=n[r];e[o]=n[o]}return e},e}(u)},"sandboxed-node-properties.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t){return t.replace(/[\\^$*+?.()|[\]{}]/g,"\\$&")}function i(t){var e="("+t.toString()+")";return e=(0,s.processScript)(e,!1),(0,c["default"])(e,null)}function a(t){var e=d(t);return e&&e.replace(l,"").replace(f,"").replace(/\r\n/g,"\n")}t.__esModule=!0,t.getClassName=t.getTextContent=t.getChildren=t.getChildNodes=t.getAttrs=void 0,t.getInnerText=a;var s=n("../../../deps/hammerhead"),u=n("../eval-function"),c=r(u),l=new RegExp(o(s.PROCESSING_COMMENTS.scriptStart)+".*?"+o(s.PROCESSING_COMMENTS.scriptEnd),"g"),f=new RegExp(o(s.PROCESSING_COMMENTS.stylesheetStart)+".*?"+o(s.PROCESSING_COMMENTS.stylesheetEnd),"g"),d=(t.getAttrs=i(function(t){return t.attributes}),t.getChildNodes=i(function(t){return t.childNodes}),t.getChildren=i(function(t){return t.children}),t.getTextContent=i(function(t){return t.textContent}),t.getClassName=i(function(t){return t.className}),i(function(t){return t.innerText}))}}},"execute-action.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t){if(!E.domUtils.isEditableElement(t))throw new S.ActionElementNonEditableError}function i(t){if(!E.domUtils.isTextAreaElement(t))throw new S.ActionElementNotTextAreaError}function a(t,e){if(!E.domUtils.isContentEditableElement(t))throw new S.ActionElementNonContentEditableError(e)}function s(t){if(!E.contentEditable.getNearestCommonAncestor(t[0],t[1]))throw new S.ActionRootContainerNotFoundError;return t}function u(t){if(!E.domUtils.isFileInput(t))throw new S.ActionElementIsNotFileInputError}function c(t,e){t.type===b["default"].selectText?o(e[0]):t.type===b["default"].selectTextAreaContent?i(e[0]):t.type===b["default"].selectEditableContent?(a(e[0],"startSelector"),a(e[1],"endSelector"),s(e)):t.type!==b["default"].setFilesToUpload&&t.type!==b["default"].clearUpload||u(e[0])}function l(t,e){var n=[],r=p.Promise.resolve(),o=new Date,i=function(t,i,a){r=r.then(function(){var n=new I["default"](t,e,o,i,a);return n.getResult()}).then(function(t){return n.push(t)})};return t.selector&&i(t.selector,function(){return new S.ActionElementNotFoundError},function(){return new S.ActionElementIsInvisibleError}),t.type===b["default"].dragToElement?i(t.destinationSelector,function(){return new S.ActionAdditionalElementNotFoundError("destinationSelector")},function(){return new S.ActionAdditionalElementIsInvisibleError("destinationSelector")}):t.type===b["default"].selectEditableContent&&(i(t.startSelector,function(){return new S.ActionAdditionalElementNotFoundError("startSelector")},function(){return new S.ActionAdditionalElementIsInvisibleError("startSelector")}),i(t.endSelector||t.startSelector,function(){return new S.ActionAdditionalElementNotFoundError("endSelector")},function(){return new S.ActionAdditionalElementIsInvisibleError("endSelector")})),r.then(function(){return c(t,n),n})}function f(t){if(t.type===b["default"].pressKey){var e=U(t.keys);if(e.error)throw new S.ActionIncorrectKeysError("keys")}}function d(t,e){var n=(0,x.getOffsetOptions)(t,e.offsetX,e.offsetY),r=n.offsetX,o=n.offsetY;e.offsetX=r,e.offsetY=o}function h(t,e){var n=null;switch(e.options&&"offsetX"in e.options&&"offsetY"in e.options&&d(t[0],e.options),e.type){case b["default"].click:return new A(t[0],e.options);case b["default"].rightClick:return new T(t[0],e.options);case b["default"].doubleClick:return new N(t[0],e.options);case b["default"].hover:return new F(t[0],e.options);case b["default"].drag:return new M(t[0],e.dragOffsetX,e.dragOffsetY,e.options);case b["default"].dragToElement:return new R(t[0],t[1],e.options);case b["default"].typeText:return new O(t[0],e.text,e.options);case b["default"].selectText:case b["default"].selectTextAreaContent:return n=D(t[0],e),new P(t[0],n.startPos,n.endPos);case b["default"].selectEditableContent:return new j(t[0],t[1]);case b["default"].pressKey:return new k(U(e.keys).combinations);case b["default"].setFilesToUpload:return new L(t[0],e.filePath,function(t){return new S.ActionCanNotFindFileToUploadError(t)});case b["default"].clearUpload:return new L(t[0])}return null}function m(t,e){var n=null,r=new p.Promise(function(t){n=t}),o=new p.Promise(function(r){var o=null;l(t,e).then(function(e){return n(),o=new E.RequestBarrier,f(t),h(e,t).run()}).then(function(){return p.Promise.all([o.wait(),E.pageUnloadBarrier.wait()])}).then(function(){return r(new w["default"]({isCommandResult:!0}))})["catch"](function(t){var e=t.message===V.elementIsInvisibleError?new S.ActionElementIsInvisibleError:t;return r(new w["default"]({isCommandResult:!0,executionError:e}))})});return{startPromise:r,completionPromise:o}}t.__esModule=!0,t["default"]=m;var p=n("../deps/hammerhead"),E=n("../deps/testcafe-core"),g=n("../deps/testcafe-runner"),v=r(g),y=n("../status"),w=r(y),_=n("./client-functions/selector-executor"),I=r(_),C=n("../../../test-run/commands/type"),b=r(C),x=n("../../runner/utils/mouse"),S=n("../../../errors/test-run"),A=v["default"].get("./automation/playback/click"),T=v["default"].get("./automation/playback/rclick"),N=v["default"].get("./automation/playback/dblclick"),M=v["default"].get("./automation/playback/drag/to-offset"),R=v["default"].get("./automation/playback/drag/to-element"),F=v["default"].get("./automation/playback/hover"),O=v["default"].get("./automation/playback/type"),P=v["default"].get("./automation/playback/select/select-text"),j=v["default"].get("./automation/playback/select/select-editable-content"),k=v["default"].get("./automation/playback/press"),U=v["default"].get("./automation/playback/press/parse-key-sequence"),D=v["default"].get("./automation/playback/select/get-select-position-arguments"),L=v["default"].get("./automation/playback/upload"),V=v["default"].get("./automation/errors");e.exports=t["default"]},"execute-navigate-to.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t){var e=new d;return a["default"].navigateTo(t.url),f.all([e.wait(),h.wait()]).then(function(){return new l["default"]({isCommandResult:!0})})["catch"](function(t){return new l["default"]({isCommandResult:!0,executionError:t})})}t.__esModule=!0,t["default"]=o;var i=n("../deps/hammerhead"),a=r(i),s=n("../deps/testcafe-core"),u=r(s),c=n("../status"),l=r(c),f=a["default"].Promise,d=u["default"].RequestBarrier,h=u["default"].pageUnloadBarrier;e.exports=t["default"]},"prepare-browser-manipulation.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t){var e=document.title,n="[ "+t+" ]",r=null,o=null;return r=h.setInterval.call(window,function(){document.title!==n&&(e=document.title,document.title=n)},E),document.title=n,p(g).then(function(){var t={cmd:l["default"].readyForBrowserManipulation,currentWidth:window.innerWidth,currentHeight:window.innerHeight};return m.queuedAsyncServiceMsg(t)}).then(function(t){return o=t,h.clearInterval.call(window,r),document.title=e,p(v)}).then(function(){return new d["default"]({isCommandResult:!0,result:o})})}t.__esModule=!0,t["default"]=o;var i=n("../deps/hammerhead"),a=r(i),s=n("../deps/testcafe-core"),u=r(s),c=n("../../../test-run/client-messages"),l=r(c),f=n("../status"),d=r(f),h=a["default"].nativeMethods,m=a["default"].transport,p=u["default"].delay,E=50,g=500,v=100;e.exports=t["default"]}},deps:{"hammerhead.js":function(t,e,n){t.__esModule=!0,t["default"]=window["%hammerhead%"],e.exports=t["default"]},"testcafe-core.js":function(t,e,n){t.__esModule=!0,t["default"]=window["%testCafeCore%"],e.exports=t["default"]},"testcafe-runner.js":function(t,e,n){t.__esModule=!0,t["default"]=window["%testCafeRunner%"],e.exports=t["default"]},"testcafe-ui.js":function(t,e,n){t.__esModule=!0,t["default"]=window["%testCafeUI%"],e.exports=t["default"]}},"driver-link":{"child.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=n("../deps/hammerhead"),a=n("../deps/testcafe-core"),s=n("../../../errors/test-run"),u=n("./send-message-to-driver"),c=r(u),l=n("./messages"),f=n("../status"),d=r(f),h=1e3,m=200,p=500,E=function(){function t(e,n,r){o(this,t),this.driverWindow=e,this.driverIframe=a.domUtils.findIframeByWindow(e),this.driverId=n,this.iframeAvailabilityTimeout=r}return t.prototype._ensureIframe=function(){var t=this;return a.domUtils.isElementInDocument(this.driverIframe)?(0,a.waitFor)(function(){return a.positionUtils.isElementVisible(t.driverIframe)?t.driverIframe:null},m,this.iframeAvailabilityTimeout)["catch"](function(){throw new s.CurrentIframeIsInvisibleError}):i.Promise.reject(new s.CurrentIframeNotFoundError)},t.prototype._waitForIframeRemovedOrHidden=function(){var t=this;return new i.Promise(function(e){t.checkIframeInterval=i.nativeMethods.setInterval.call(window,function(){t._ensureIframe()["catch"](function(){return(0,a.delay)(p).then(function(){return e(new d["default"]({isCommandResult:!0}))})})},h)})},t.prototype._waitForCommandResult=function(){var t=this,e=null,n=function(){return new i.Promise(function(t){e=function(e){e.message.type===l.TYPE.commandExecuted&&t(e.message.driverStatus)},i.eventSandbox.message.on(i.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,e)})};return i.Promise.race([this._waitForIframeRemovedOrHidden(),n()]).then(function(n){return i.eventSandbox.message.off(i.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,e),i.nativeMethods.clearInterval.call(window,t.checkIframeInterval),n})},t.prototype.confirmConnectionEstablished=function(t){var e=new l.ConfirmationMessage(t,{id:this.driverId});i.eventSandbox.message.sendServiceMsg(e,this.driverWindow)},t.prototype.executeCommand=function(t){var e=this;return this._ensureIframe().then(function(){var n=new l.ExecuteCommandMessage(t);return i.Promise.all([(0,c["default"])(n,e.driverWindow,e.timeout,s.CurrentIframeIsNotLoadedError),e._waitForCommandResult()])}).then(function(t){return t[1]})},t}();t["default"]=E,e.exports=t["default"]},"messages.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e); | ||
}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0,t.ConfirmationMessage=t.ExecuteCommandMessage=t.CommandExecutedMessage=t.EstablishConnectionMessage=t.TYPE=void 0;var s=n("../generate-id"),u=r(s),c=t.TYPE={establishConnection:"driver|establish-connection",commandExecuted:"driver|command-executed",executeCommand:"driver|execute-command",confirmation:"driver|confirmation"},l=function f(t){a(this,f),this.type=t,this.id=(0,u["default"])()};t.EstablishConnectionMessage=function(t){function e(){return a(this,e),o(this,t.call(this,c.establishConnection))}return i(e,t),e}(l),t.CommandExecutedMessage=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c.commandExecuted));return r.driverStatus=n,r}return i(e,t),e}(l),t.ExecuteCommandMessage=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c.executeCommand));return r.command=n,r}return i(e,t),e}(l),t.ConfirmationMessage=function(t){function e(n,r){a(this,e);var i=o(this,t.call(this,c.confirmation));return i.requestMessageId=n,i.result=r,i}return i(e,t),e}(l)},"parent.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=n("../deps/hammerhead"),a=n("./messages"),s=n("../../../errors/test-run"),u=n("./send-message-to-driver"),c=r(u),l=5e3,f=function(){function t(e){o(this,t),this.driverWindow=e}return t.prototype.establishConnection=function(){var t=new a.EstablishConnectionMessage;return(0,c["default"])(t,this.driverWindow,l,s.CurrentIframeIsNotLoadedError).then(function(t){return t.result.id})},t.prototype.confirmMessageReceived=function(t){var e=new a.ConfirmationMessage(t);i.eventSandbox.message.sendServiceMsg(e,this.driverWindow)},t.prototype.onCommandExecuted=function(t){var e=new a.CommandExecutedMessage(t);i.eventSandbox.message.sendServiceMsg(e,this.driverWindow)},t}();t["default"]=f,e.exports=t["default"]},"send-message-to-driver.js":function(t,e,n){function r(t,e,n,r){var c=null,l=null,f=null;n=Math.max(n||0,s);var d=function(){return new o.Promise(function(n){f=function(e){e.message.type===a.TYPE.confirmation&&e.message.requestMessageId===t.id&&n(e.message)},o.eventSandbox.message.on(o.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,f),c=o.nativeMethods.setInterval.call(window,function(){return o.eventSandbox.message.sendServiceMsg(t,e)},u),o.eventSandbox.message.sendServiceMsg(t,e)})};return o.Promise.race([(0,i.delay)(n),d()]).then(function(t){if(o.nativeMethods.clearInterval.call(window,c),o.nativeMethods.clearTimeout.call(window,l),o.eventSandbox.message.off(o.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,f),!t)throw new r;return t})}t.__esModule=!0,t["default"]=r;var o=n("../deps/hammerhead"),i=n("../deps/testcafe-core"),a=n("./messages"),s=2500,u=1e3;e.exports=t["default"]}},"driver.js":function(t,e,n){function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function o(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var a=n("./deps/hammerhead"),s=o(a),u=n("./deps/testcafe-core"),c=n("./deps/testcafe-ui"),l=n("../../test-run/client-messages"),f=o(l),d=n("../../test-run/commands/type"),h=o(d),m=n("../../errors/test-run"),p=n("../browser"),E=r(p),g=n("./driver-link/messages"),v=n("./storage"),y=o(v),w=n("./status"),_=o(w),I=n("./generate-id"),C=o(I),b=n("./driver-link/child"),x=o(b),S=n("./command-executors/prepare-browser-manipulation"),A=o(S),T=n("./command-executors/execute-action"),N=o(T),M=n("./command-executors/execute-navigate-to"),R=o(M),F=n("./command-executors/client-functions/client-function-executor"),O=o(F),P=n("./command-executors/client-functions/selector-executor"),j=o(P),k=s["default"].transport,U=s["default"].Promise,D=s["default"].eventSandbox.message,L="testcafe|driver|test-done-sent-flag",V="testcafe|driver|pending-status",G="testcafe|driver|executing-client-function-descriptor",z="testcafe|driver|selector-execution-start-time",B="testcafe|driver|pending-page-error",W="testcafe|driver|active-iframe-selector",X=500,Y={NotLoadedError:m.ActionIframeIsNotLoadedError,NotFoundError:m.ActionElementNotFoundError,IsInvisibleError:m.ActionElementIsInvisibleError},q={NotLoadedError:m.CurrentIframeIsNotLoadedError,NotFoundError:m.CurrentIframeNotFoundError,IsInvisibleError:m.CurrentIframeIsInvisibleError},H=new U(u.noop),K=function(){function t(e,n,r){var o=this;i(this,t),this.COMMAND_EXECUTING_FLAG="testcafe|driver|command-executing-flag",this.EXECUTING_IN_IFRAME_FLAG="testcafe|driver|executing-in-iframe-flag",this.testRunId=e,this.heartbeatUrl=n.heartbeat,this.browserStatusUrl=n.status,this.selectorTimeout=r.selectorTimeout,this.skipJsErrors=r.skipJsErrors,this.contextStorage=null,this.childDriverLinks=[],this.activeChildDriverLink=null,this.beforeUnloadRaised=!1,this.pageInitialRequestBarrier=new u.RequestBarrier,this.readyPromise=u.eventUtils.documentReady().then(function(){return o.pageInitialRequestBarrier.wait(!0)}),this._initChildDriverListening(),u.pageUnloadBarrier.init(),(0,u.preventRealEvents)(),s["default"].on(s["default"].EVENTS.uncaughtJsError,function(t){return o._onJsError(t)}),s["default"].on(s["default"].EVENTS.beforeUnload,function(){o.beforeUnloadRaised=!0})}return t.prototype._onJsError=function(t){if(this.skipJsErrors||this.contextStorage.getItem(L))return U.resolve();var e=new m.UncaughtErrorOnPage(t.msg||t.message,t.pageUrl);return this.contextStorage.getItem(B)||this.contextStorage.setItem(B,e),null},t.prototype._failIfClientCodeExecutionIsInterrupted=function(){var t=this.contextStorage.getItem(G);return!!t&&(this._onReady(new _["default"]({isCommandResult:!0,executionError:new m.ClientFunctionExecutionInterruptionError(t.instantiationCallsiteName)})),!0)},t.prototype._addPendingErrorToStatus=function(t){var e=this.contextStorage.getItem(B);e&&(this.contextStorage.setItem(B,null),t.pageError=e)},t.prototype._sendStatus=function(t){var e=this;return this._addPendingErrorToStatus(t),this.contextStorage.setItem(V,t),this.beforeUnloadRaised?H:k.queuedAsyncServiceMsg({cmd:f["default"].ready,status:t}).then(function(t){return e.beforeUnloadRaised?H:(e.contextStorage.setItem(V,null),t)})},t.prototype._initChildDriverListening=function(){var t=this;D.on(D.SERVICE_MSG_RECEIVED_EVENT,function(e){var n=e.message,r=e.source;if(n.type===g.TYPE.establishConnection){var o=t._getChildDriverLinkByWindow(r);if(!o){var i=t.testRunId+"-"+(0,C["default"])();o=new x["default"](r,i),t.childDriverLinks.push(o)}o.confirmConnectionEstablished(n.id)}})},t.prototype._getChildDriverLinkByWindow=function(t){return this.childDriverLinks.filter(function(e){return e.driverWindow===t})[0]},t.prototype._runInActiveIframe=function(t){var e=this,n=U.resolve(),r=this.contextStorage.getItem(W);!this.activeChildDriverLink&&r&&(n=this._switchToIframe(r,q)),n.then(function(){return e.contextStorage.setItem(e.EXECUTING_IN_IFRAME_FLAG,!0),e.activeChildDriverLink.executeCommand(t)}).then(function(t){return e._onCommandExecutedInIframe(t)})["catch"](function(t){return e._onCommandExecutedInIframe(new _["default"]({isCommandResult:!0,executionError:t}))})},t.prototype._onCommandExecutedInIframe=function(t){this.contextStorage.setItem(this.EXECUTING_IN_IFRAME_FLAG,!1),this._onReady(t)},t.prototype._ensureChildDriverLink=function(t,e){var n=this;return(0,u.waitFor)(function(){return n._getChildDriverLinkByWindow(t)},X,this.selectorTimeout)["catch"](function(){throw new e})},t.prototype._switchToIframe=function(t,e){var n=this,r=new j["default"](t,this.selectorTimeout,null,function(){return new e.NotFoundError},function(){return e.IsInvisibleError()});return r.getResult().then(function(t){if(!u.domUtils.isIframeElement(t))throw new m.ActionElementNotIframe;return n._ensureChildDriverLink(t.contentWindow,e.NotLoadedError)}).then(function(e){n.activeChildDriverLink=e,n.contextStorage.setItem(W,t)})},t.prototype._switchToMainWindow=function(t){this.activeChildDriverLink&&this.activeChildDriverLink.executeCommand(t),this.contextStorage.setItem(W,null),this.activeChildDriverLink=null},t.prototype._onActionCommand=function(t){var e=this,n=(0,N["default"])(t,this.selectorTimeout),r=n.startPromise,o=n.completionPromise;r.then(function(){return e.contextStorage.setItem(e.COMMAND_EXECUTING_FLAG,!0)}),o.then(function(t){return e.contextStorage.setItem(e.COMMAND_EXECUTING_FLAG,!1),e._onReady(t)})},t.prototype._onNavigateToCommand=function(t){var e=this;this.contextStorage.setItem(this.COMMAND_EXECUTING_FLAG,!0),(0,R["default"])(t).then(function(t){return e.contextStorage.setItem(e.COMMAND_EXECUTING_FLAG,!1),e._onReady(t)})},t.prototype._onExecuteClientFunctionCommand=function(t){var e=this;this.contextStorage.setItem(G,{instantiationCallsiteName:t.instantiationCallsiteName});var n=new O["default"](t);n.getResultDriverStatus().then(function(t){e.contextStorage.setItem(G,null),e._onReady(t)})},t.prototype._onExecuteSelectorCommand=function(t){var e=this,n=this.contextStorage.getItem(z)||new Date,r=new j["default"](t,this.selectorTimeout,n);r.getResultDriverStatus().then(function(t){e.contextStorage.setItem(z,null),e._onReady(t)})},t.prototype._onSwitchToMainWindowCommand=function(t){this._switchToMainWindow(t),this._onReady(new _["default"]({isCommandResult:!0}))},t.prototype._onSwitchToIframeCommand=function(t){var e=this;this._switchToIframe(t.selector,Y).then(function(){return e._onReady(new _["default"]({isCommandResult:!0}))})["catch"](function(t){return e._onReady(new _["default"]({isCommandResult:!0,executionError:t}))})},t.prototype._onPrepareBrowserManipulationCommand=function(){var t=this;this.contextStorage.setItem(this.COMMAND_EXECUTING_FLAG,!0),(0,A["default"])(this.testRunId).then(function(e){return t.contextStorage.setItem(t.COMMAND_EXECUTING_FLAG,!1),t._onReady(e)})},t.prototype._onTestDone=function(){var t=this;this.contextStorage.setItem(L,!0),this._sendStatus(new _["default"]({isCommandResult:!0})).then(function(){return E.checkStatus(t.browserStatusUrl,s["default"].createNativeXHR)})},t.prototype._onReady=function(t){var e=this;this._sendStatus(t).then(function(t){t?e._onCommand(t):e._onReady(new _["default"])})},t.prototype._onCommand=function(t){var e=this;this.readyPromise.then(function(){t.type===h["default"].testDone?e._onTestDone():t.type===h["default"].prepareBrowserManipulation?e._onPrepareBrowserManipulationCommand():t.type===h["default"].switchToMainWindow?e._onSwitchToMainWindowCommand(t):e.activeChildDriverLink||e.contextStorage.getItem(W)?e._runInActiveIframe(t):t.type===h["default"].switchToIframe?e._onSwitchToIframeCommand(t):t.type===h["default"].executeClientFunction?e._onExecuteClientFunctionCommand(t):t.type===h["default"].executeSelector?e._onExecuteSelectorCommand(t):e.contextStorage.getItem(B)?e._onReady(new _["default"]({isCommandResult:!0})):t.type===h["default"].navigateTo?e._onNavigateToCommand(t):e._onActionCommand(t)})},t.prototype.start=function(){this.contextStorage=new y["default"](window,this.testRunId),E.startHeartbeat(this.heartbeatUrl,s["default"].createNativeXHR),c.modalBackground.initAndShowLoadingText(),this.readyPromise.then(function(){return c.modalBackground.hide()});var t=this.contextStorage.getItem(V);if(this.contextStorage.getItem(L))return void(t?this._onTestDone():E.checkStatus(this.browserStatusUrl,s["default"].createNativeXHR));if(!this._failIfClientCodeExecutionIsInterrupted()){var e=this.contextStorage.getItem(this.COMMAND_EXECUTING_FLAG)||this.contextStorage.getItem(this.EXECUTING_IN_IFRAME_FLAG),n=t||new _["default"]({isCommandResult:e});this._onReady(n)}},t}();t["default"]=K,e.exports=t["default"]},"generate-id.js":function(t,e,n){t.__esModule=!0,t["default"]=function(){return"function"==typeof r.nativeMethods.performanceNow?r.nativeMethods.performanceNow().toString():(r.nativeMethods.dateNow()+Math.random()).toString()};var r=n("./deps/hammerhead");e.exports=t["default"]},"iframe-driver.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}t.__esModule=!0;var s=n("./deps/hammerhead"),u=n("./driver"),c=r(u),l=n("./storage"),f=r(l),d=n("./status"),h=r(d),m=n("./driver-link/parent"),p=r(m),E=n("./driver-link/messages"),g=function(t){function e(n,r){o(this,e);var a=i(this,t.call(this,n,{},r));return a.lastParentDriverMessageId=null,a.parentDriverLink=new p["default"](window.parent),a._initParentDriverListening(),a}return a(e,t),e.prototype._onJsError=function(){},e.prototype._initParentDriverListening=function(){var t=this;s.eventSandbox.message.on(s.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,function(e){var n=e.message;if(!t.beforeUnloadRaised&&n.type===E.TYPE.executeCommand){if(t.lastParentDriverMessageId===n.id)return;t.lastParentDriverMessageId=n.id,t.parentDriverLink.confirmMessageReceived(n.id),t._onCommand(n.command)}})},e.prototype._onSwitchToMainWindowCommand=function(t){this._switchToMainWindow(t)},e.prototype._onReady=function(t){this.parentDriverLink.onCommandExecuted(t)},e.prototype.start=function(){var t=this;this.parentDriverLink.establishConnection().then(function(e){if(t.contextStorage=new f["default"](window,e),!t._failIfClientCodeExecutionIsInterrupted()){var n=t.contextStorage.getItem(t.COMMAND_EXECUTING_FLAG)||t.contextStorage.getItem(t.EXECUTING_IN_IFRAME_FLAG);n&&t._onReady(new h["default"]({isCommandResult:!0}))}})},e}(c["default"]);t["default"]=g,e.exports=t["default"]},"index.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}var o=n("./deps/hammerhead"),i=r(o),a=n("./driver"),s=r(a),u=n("./iframe-driver"),c=r(u);Object.defineProperty(window,"%testCafeDriver%",{enumerable:!1,configurable:!1,writable:!1,value:s["default"]}),Object.defineProperty(window,"%testCafeIframeDriver%",{enumerable:!1,configurable:!1,writable:!1,value:c["default"]}),i["default"].on(i["default"].EVENTS.evalIframeScript,function(t){return initTestCafeClientDrivers(t.iframe.contentWindow,!0)})},"status.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}t.__esModule=!0;var s=n("../../utils/assignable"),u=r(s),c=n("./generate-id"),l=r(c),f=function(t){function e(n){o(this,e);var r=i(this,t.call(this,n));return r.id=(0,l["default"])(),r.isCommandResult=!1,r.executionError=null,r.pageError=null,r.result=null,r._assignFrom(n,!0),r}return a(e,t),e.prototype._getAssignableProperties=function(){return[{name:"isCommandResult"},{name:"executionError"},{name:"pageError"},{name:"result"}]},e}(u["default"]);t["default"]=f,e.exports=t["default"]},"storage.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=n("./deps/hammerhead"),a=r(i),s=a["default"].json,u="testcafe|driver|",c=function(){function t(e,n){o(this,t),this.storage=e.sessionStorage,this.storageKey=u+n,this.data={},this._loadFromStorage()}return t.prototype._loadFromStorage=function(){var t=this.storage.getItem(this.storageKey);t&&(this.data=s.parse(t),this.storage.removeItem(this.storageKey))},t.prototype._saveToStorage=function(){this.storage.setItem(this.storageKey,s.stringify(this.data))},t.prototype.setItem=function(t,e){this.data[t]=e,this._saveToStorage()},t.prototype.getItem=function(t){return this.data[t]},t.prototype.dispose=function(){this.storage.removeItem(this.storageKey)},t}();t["default"]=c,e.exports=t["default"]}},runner:{deps:{"testcafe-core.js":function(t,e,n){t.__esModule=!0,t["default"]=window["%testCafeCore%"],e.exports=t["default"]}},utils:{"mouse.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t){var e=f.getElementRectangle(t);return{offsetX:Math.round(e.width/2),offsetY:Math.round(e.height/2)}}function i(t,e,n){var r=f.containsOffset(t,e,n);if(r)return{offsetX:e,offsetY:n};var o=a(t,e,n);return{offsetX:o.x,offsetY:o.y}}function a(t,e,n){var r=f.getOffsetPosition(t),o=t===document.documentElement?0:r.left,i=t===document.documentElement?0:r.top;return{x:o+e,y:i+n}}function s(t,e){var n=d.getElementScroll(t);return!/html/i.test(t.tagName)&&d.hasScroll(t)&&(e.x-=n.left,e.y-=n.top),f.offsetToClientCoords(e)}function u(t,e,n){var r=o(t);return{offsetX:"number"==typeof e?Math.round(e):r.offsetX,offsetY:"number"==typeof n?Math.round(n):r.offsetY}}t.__esModule=!0,t.getDefaultAutomationOffsets=o,t.getMoveAutomationOffsets=i,t.getAutomationPoint=a,t.convertToClient=s,t.getOffsetOptions=u;var c=n("../deps/testcafe-core"),l=r(c),f=l["default"].positionUtils,d=l["default"].styleUtils}}}},errors:{"test-run":{"index.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0,t.CurrentIframeIsInvisibleError=t.CurrentIframeNotFoundError=t.CurrentIframeIsNotLoadedError=t.ActionIframeIsNotLoadedError=t.ActionElementNotIframe=t.ActionElementIsNotFileInputError=t.ActionCanNotFindFileToUploadError=t.ActionIncorrectKeysError=t.ActionRootContainerNotFoundError=t.ActionElementNonContentEditableError=t.ActionElementNotTextAreaError=t.ActionElementNonEditableError=t.ActionAdditionalElementIsInvisibleError=t.ActionAdditionalElementNotFoundError=t.ActionElementIsInvisibleError=t.ActionElementNotFoundError=t.ActionSelectorError=t.ActionUnsupportedDeviceTypeError=t.ActionUnsupportedUrlProtocolError=t.ActionStringArrayElementError=t.ActionStringOrStringArrayArgumentError=t.ActionPositiveIntegerArgumentError=t.ActionIntegerArgumentError=t.ActionStringArgumentError=t.ActionOptionsTypeError=t.ActionBooleanOptionError=t.ActionPositiveIntegerOptionError=t.ExternalAssertionLibraryError=t.UncaughtErrorInClientFunctionCode=t.UncaughtNonErrorObjectInTestCode=t.UncaughtErrorInTestCode=t.UncaughtErrorOnPage=t.PageLoadError=t.InvalidSelectorResultError=t.DomNodeClientFunctionResultError=t.ClientFunctionExecutionInterruptionError=t.MissingAwaitError=void 0;var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},u=n("./type"),c=r(u),l=function h(t){a(this,h),this.type=t,this.isTestCafeError=!0,this.callsite=null},f=function(t){function e(n,r,i){a(this,e);var s=o(this,t.call(this,n));return s.optionName=r,s.actualValue=i,s}return i(e,t),e}(l),d=function(t){function e(n,r,i){a(this,e);var s=o(this,t.call(this,n));return s.argumentName=r,s.actualValue=i,s}return i(e,t),e}(l);t.MissingAwaitError=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c["default"].missingAwaitError));return r.callsite=n,r}return i(e,t),e}(l),t.ClientFunctionExecutionInterruptionError=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c["default"].clientFunctionExecutionInterruptionError));return r.instantiationCallsiteName=n,r}return i(e,t),e}(l),t.DomNodeClientFunctionResultError=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c["default"].domNodeClientFunctionResultError));return r.instantiationCallsiteName=n,r}return i(e,t),e}(l),t.InvalidSelectorResultError=function(t){function e(){return a(this,e),o(this,t.call(this,c["default"].invalidSelectorResultError))}return i(e,t),e}(l),t.PageLoadError=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c["default"].pageLoadError));return r.errMsg=n,r}return i(e,t),e}(l),t.UncaughtErrorOnPage=function(t){function e(n,r){a(this,e);var i=o(this,t.call(this,c["default"].uncaughtErrorOnPage));return i.errMsg=n,i.pageDestUrl=r,i}return i(e,t),e}(l),t.UncaughtErrorInTestCode=function(t){function e(n,r){a(this,e);var i=o(this,t.call(this,c["default"].uncaughtErrorInTestCode));return i.errMsg=String(n),i.callsite=r,i}return i(e,t),e}(l),t.UncaughtNonErrorObjectInTestCode=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c["default"].uncaughtNonErrorObjectInTestCode));return r.objType="undefined"==typeof n?"undefined":s(n),r.objStr=String(n),r}return i(e,t),e}(l),t.UncaughtErrorInClientFunctionCode=function(t){function e(n,r){a(this,e);var i=o(this,t.call(this,c["default"].uncaughtErrorInClientFunctionCode));return i.errMsg=String(r),i.instantiationCallsiteName=n,i}return i(e,t),e}(l),t.ExternalAssertionLibraryError=function(t){function e(n,r){a(this,e);var i=o(this,t.call(this,c["default"].externalAssertionLibraryError));return i.errMsg=String(n),i.callsite=r,i}return i(e,t),e}(l),t.ActionPositiveIntegerOptionError=function(t){function e(n,r){return a(this,e),o(this,t.call(this,c["default"].actionPositiveIntegerOptionError,n,r))}return i(e,t),e}(f),t.ActionBooleanOptionError=function(t){function e(n,r){return a(this,e),o(this,t.call(this,c["default"].actionBooleanOptionError,n,r))}return i(e,t),e}(f),t.ActionOptionsTypeError=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c["default"].actionOptionsTypeError));return r.actualType=n,r}return i(e,t),e}(l),t.ActionStringArgumentError=function(t){function e(n,r){return a(this,e),o(this,t.call(this,c["default"].actionStringArgumentError,n,r))}return i(e,t),e}(d),t.ActionIntegerArgumentError=function(t){function e(n,r){return a(this,e),o(this,t.call(this,c["default"].actionIntegerArgumentError,n,r))}return i(e,t),e}(d),t.ActionPositiveIntegerArgumentError=function(t){function e(n,r){return a(this,e),o(this,t.call(this,c["default"].actionPositiveIntegerArgumentError,n,r))}return i(e,t),e}(d),t.ActionStringOrStringArrayArgumentError=function(t){function e(n,r){return a(this,e),o(this,t.call(this,c["default"].actionStringOrStringArrayArgumentError,n,r))}return i(e,t),e}(d),t.ActionStringArrayElementError=function(t){function e(n,r,i){a(this,e);var s=o(this,t.call(this,c["default"].actionStringArrayElementError,n,r));return s.elementIndex=i,s}return i(e,t),e}(d),t.ActionUnsupportedUrlProtocolError=function(t){function e(n,r){a(this,e);var i=o(this,t.call(this,c["default"].actionUnsupportedUrlProtocolError));return i.argumentName=n,i.protocol=r,i}return i(e,t),e}(l),t.ActionUnsupportedDeviceTypeError=function(t){function e(n,r){return a(this,e),o(this,t.call(this,c["default"].actionUnsupportedDeviceTypeError,n,r))}return i(e,t),e}(d),t.ActionSelectorError=function(t){function e(n,r){a(this,e);var i=o(this,t.call(this,c["default"].actionSelectorError));return i.selectorName=n,i.errMsg=r,i}return i(e,t),e}(l),t.ActionElementNotFoundError=function(t){function e(){return a(this,e),o(this,t.call(this,c["default"].actionElementNotFoundError))}return i(e,t),e}(l),t.ActionElementIsInvisibleError=function(t){function e(){return a(this,e),o(this,t.call(this,c["default"].actionElementIsInvisibleError))}return i(e,t),e}(l),t.ActionAdditionalElementNotFoundError=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c["default"].actionAdditionalElementNotFoundError));return r.argumentName=n,r}return i(e,t),e}(l),t.ActionAdditionalElementIsInvisibleError=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c["default"].actionAdditionalElementIsInvisibleError));return r.argumentName=n,r}return i(e,t),e}(l),t.ActionElementNonEditableError=function(t){function e(){return a(this,e),o(this,t.call(this,c["default"].actionElementNonEditableError))}return i(e,t),e}(l),t.ActionElementNotTextAreaError=function(t){function e(){return a(this,e),o(this,t.call(this,c["default"].actionElementNotTextAreaError))}return i(e,t),e}(l),t.ActionElementNonContentEditableError=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c["default"].actionElementNonContentEditableError));return r.argumentName=n,r}return i(e,t),e}(l),t.ActionRootContainerNotFoundError=function(t){function e(){return a(this,e),o(this,t.call(this,c["default"].actionRootContainerNotFoundError))}return i(e,t),e}(l),t.ActionIncorrectKeysError=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c["default"].actionIncorrectKeysError));return r.argumentName=n,r}return i(e,t),e}(l),t.ActionCanNotFindFileToUploadError=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c["default"].actionCanNotFindFileToUploadError));return r.filePaths=n,r}return i(e,t),e}(l),t.ActionElementIsNotFileInputError=function(t){function e(){return a(this,e),o(this,t.call(this,c["default"].actionElementIsNotFileInputError))}return i(e,t),e}(l),t.ActionElementNotIframe=function(t){function e(){return a(this,e),o(this,t.call(this,c["default"].actionElementNotIframeError))}return i(e,t),e}(l),t.ActionIframeIsNotLoadedError=function(t){function e(){return a(this,e),o(this,t.call(this,c["default"].actionIframeIsNotLoadedError))}return i(e,t),e}(l),t.CurrentIframeIsNotLoadedError=function(t){function e(){return a(this,e),o(this,t.call(this,c["default"].currentIframeIsNotLoadedError))}return i(e,t),e}(l),t.CurrentIframeNotFoundError=function(t){function e(){return a(this,e),o(this,t.call(this,c["default"].currentIframeNotFoundError))}return i(e,t),e}(l),t.CurrentIframeIsInvisibleError=function(t){function e(){return a(this,e),o(this,t.call(this,c["default"].currentIframeIsInvisibleError))}return i(e,t),e}(l)},"type.js":function(t,e,n){t.__esModule=!0,t["default"]={uncaughtErrorOnPage:"uncaughtErrorOnPage",uncaughtErrorInTestCode:"uncaughtErrorInTestCode",uncaughtNonErrorObjectInTestCode:"uncaughtNonErrorObjectInTestCode",uncaughtErrorInClientFunctionCode:"uncaughtErrorInClientFunctionCode",missingAwaitError:"missingAwaitError",actionPositiveIntegerOptionError:"actionPositiveIntegerOptionError",actionBooleanOptionError:"actionBooleanOptionError",actionOptionsTypeError:"actionOptionsTypeError",actionStringArgumentError:"actionStringArgumentError",actionStringOrStringArrayArgumentError:"actionStringOrStringArrayArgumentError",actionStringArrayElementError:"actionStringArrayElementError",actionIntegerArgumentError:"actionIntegerArgumentError",actionPositiveIntegerArgumentError:"actionPositiveIntegerArgumentError",actionSelectorError:"actionSelectorError",actionUnsupportedUrlProtocolError:"actionUnsupportedUrlProtocolError",actionElementNotFoundError:"actionElementNotFoundError",actionElementIsInvisibleError:"actionElementIsInvisibleError",actionAdditionalElementNotFoundError:"actionAdditionalElementNotFoundError",actionAdditionalElementIsInvisibleError:"actionAdditionalElementIsInvisibleError",actionElementNonEditableError:"actionElementNonEditableError",actionElementNotTextAreaError:"actionElementNotTextAreaError",actionElementNonContentEditableError:"actionElementNonContentEditableError",actionElementIsNotFileInputError:"actionElementIsNotFileInputError",actionRootContainerNotFoundError:"actionRootContainerNotFoundError",actionIncorrectKeysError:"actionIncorrectKeysError",actionCanNotFindFileToUploadError:"actionCanNotFindFileToUploadError",actionUnsupportedDeviceTypeError:"actionUnsupportedDeviceTypeError",actionIframeIsNotLoadedError:"actionIframeIsNotLoadedError",currentIframeIsNotLoadedError:"currentIframeIsNotLoadedError",currentIframeNotFoundError:"currentIframeNotFoundError",currentIframeIsInvisibleError:"currentIframeIsInvisibleError",clientFunctionExecutionInterruptionError:"clientFunctionExecutionInterruptionError",domNodeClientFunctionResultError:"domNodeClientFunctionResultError",invalidSelectorResultError:"invalidSelectorResultError",externalAssertionLibraryError:"externalAssertionLibraryError",pageLoadError:"pageLoadError"},e.exports=t["default"]}}},"test-run":{"client-messages.js":function(t,e,n){t.__esModule=!0,t["default"]={ready:"ready",readyForBrowserManipulation:"ready-for-browser-manipulation"},e.exports=t["default"]},commands:{"type.js":function(t,e,n){t.__esModule=!0,t["default"]={click:"click",rightClick:"right-click",doubleClick:"double-click",drag:"drag",dragToElement:"drag-to-element",hover:"hover",typeText:"type-text",selectText:"select-text",selectTextAreaContent:"select-text-area-content",selectEditableContent:"select-editable-content",pressKey:"press-key",wait:"wait",navigateTo:"navigate-to",setFilesToUpload:"set-files-to-upload",clearUpload:"clear-upload",executeClientFunction:"execute-client-function",executeSelector:"execute-selector",takeScreenshot:"take-screenshot",takeScreenshotOnFail:"take-screenshot-on-fail",prepareBrowserManipulation:"prepare-browser-manipulation",resizeWindow:"resize-window",resizeWindowToFitDevice:"resize-window-to-fit-device",switchToIframe:"switch-to-iframe",switchToMainWindow:"switch-to-main-window",testDone:"test-done"},e.exports=t["default"]}}},utils:{"assignable.js":function(t,e,n){function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=function(){function t(){r(this,t)}return t.prototype._getAssignableProperties=function(){throw new Error("Not implemented")},t.prototype._assignFrom=function(t,e){if(t)for(var n=this._getAssignableProperties(),r=0;r<n.length;r++){for(var o=n[r],i=o.name,a=o.type,s=o.required,u=o.init,c=i.split("."),l=c.length-1,f=c[l],d=t,h=this,m=0;m<l&&d&&h;m++)d=d[c[m]],h=h[c[m]];if(d&&h){var p=d[f];(void 0!==p||s)&&(e&&a&&a(i,p),h[f]=u?u(i,p):p)}}},t}();t["default"]=o,e.exports=t["default"]}}}}})("testcafe/src/client/driver/index")}initTestCafeClientDrivers(window)}(); | ||
!function(){function initTestCafeClientDrivers(window,isIFrameWithoutSrc){var document=window.document;!function(t){"use strict";var e,n,r,o,i,a={".js":[],".json":[],".css":[],".html":[]},s="function"==typeof require?require:null;return o=function(t){var e=new Error("Could not find module '"+t+"'");return e.code="MODULE_NOT_FOUND",e},i=function(t,e,n){var r,o;if("function"==typeof t[e+n])return e+n;for(r=0;o=a[n][r];++r)if("function"==typeof t[e+o])return e+o;return null},e=function(t,r,a,s,u,c){var l,f,d,h,m,p;for(a=a.split(/[\\/]/),l=a.pop(),"."!==l&&".."!==l||(a.push(l),l="");null!=(f=a.shift());)if(f&&"."!==f&&(".."===f?(t=r.pop(),c=c.slice(0,c.lastIndexOf("/"))):(r.push(t),t=t[f],c+="/"+f),!t))throw o(s);if(l&&"function"!=typeof t[l]&&(p=i(t,l,".js"),p||(p=i(t,l,".json")),p||(p=i(t,l,".css")),p||(p=i(t,l,".html")),p?l=p:2!==u&&"object"==typeof t[l]&&(r.push(t),t=t[l],c+="/"+l,l="")),!l)return 1!==u&&t[":mainpath:"]?e(t,r,t[":mainpath:"],s,1,c):e(t,r,"index",s,2,c);if(m=t[l],!m)throw o(s);return m.hasOwnProperty("module")?m.module.exports:(d={},m.module=h={exports:d,id:c+"/"+l},m.call(d,d,h,n(t,r,c)),h.exports)},r=function(n,r,i,a){var u,c=i,l=i.charAt(0),f=0;if("/"===l){if(c=c.slice(1),n=t["/"],!n){if(s)return s(i);throw o(i)}a="/",r=[]}else if("."!==l){if(u=c.split("/",1)[0],n=t[u],!n){if(s)return s(i);throw o(i)}a=u,r=[],c=c.slice(u.length+1),c||(c=n[":mainpath:"],c?f=1:(c="index",f=2))}return e(n,r,c,i,f,a)},(n=function(t,e,n){return function(o){return r(t,[].concat(e),o,n)}})(t,[],"")}({pinkie:{"index.js":function(t,e,n){function r(){for(var t=0;t<S.length;t++)S[t][0](S[t][1]);S=[],E=!1}function o(t,e){S.push([t,e]),E||(E=!0,b(r,0))}function i(t,e){function n(t){u(e,t)}function r(t){l(e,t)}try{t(n,r)}catch(o){r(o)}}function a(t){var e=t.owner,n=e._state,r=e._data,o=t[n],i=t.then;if("function"==typeof o){n=w;try{r=o(r)}catch(a){l(i,a)}}s(i,r)||(n===w&&u(i,r),n===_&&l(i,r))}function s(t,e){var n;try{if(t===e)throw new TypeError("A promises callback cannot return that same promise.");if(e&&("function"==typeof e||"object"===("undefined"==typeof e?"undefined":v(e)))){var r=e.then;if("function"==typeof r)return r.call(e,function(r){n||(n=!0,e===r?c(t,r):u(t,r))},function(e){n||(n=!0,l(t,e))}),!0}}catch(o){return n||l(t,o),!0}return!1}function u(t,e){t!==e&&s(t,e)||c(t,e)}function c(t,e){t._state===g&&(t._state=y,t._data=e,o(d,t))}function l(t,e){t._state===g&&(t._state=y,t._data=e,o(h,t))}function f(t){t._then=t._then.forEach(a)}function d(t){t._state=w,f(t)}function h(t){t._state=_,f(t),!t._handled&&C&&global.process.emit("unhandledRejection",t._data,t)}function m(t){global.process.emit("rejectionHandled",t)}function p(t){if("function"!=typeof t)throw new TypeError("Promise resolver "+t+" is not a function");if(this instanceof p==!1)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._then=[],i(t,this)}var E,v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},g="pending",y="settled",w="fulfilled",_="rejected",I=function(){},C="undefined"!=typeof global&&"undefined"!=typeof global.process&&"function"==typeof global.process.emit,b="undefined"==typeof setImmediate?setTimeout:setImmediate,S=[];p.prototype={constructor:p,_state:g,_then:null,_data:void 0,_handled:!1,then:function(t,e){var n={owner:this,then:new this.constructor(I),fulfilled:t,rejected:e};return!e&&!t||this._handled||(this._handled=!0,this._state===_&&C&&o(m,this)),this._state===w||this._state===_?o(a,n):this._then.push(n),n.then},"catch":function(t){return this.then(null,t)}},p.all=function(t){if(!Array.isArray(t))throw new TypeError("You must pass an array to Promise.all().");return new p(function(e,n){function r(t){return a++,function(n){i[t]=n,--a||e(i)}}for(var o,i=[],a=0,s=0;s<t.length;s++)o=t[s],o&&"function"==typeof o.then?o.then(r(s),n):i[s]=o;a||e(i)})},p.race=function(t){if(!Array.isArray(t))throw new TypeError("You must pass an array to Promise.race().");return new p(function(e,n){for(var r,o=0;o<t.length;o++)r=t[o],r&&"function"==typeof r.then?r.then(e,n):e(r)})},p.resolve=function(t){return t&&"object"===("undefined"==typeof t?"undefined":v(t))&&t.constructor===p?t:new p(function(e){e(t)})},p.reject=function(t){return new p(function(e,n){n(t)})},e.exports=p}},replicator:{":mainpath:":"index.js","index.js":function(t,e,n){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},o="@t",i="@r",a=/^#*@(t|r)$/,s=function(){var t=eval;return t("this")}(),u="function"==typeof ArrayBuffer,c="function"==typeof Map,l="function"==typeof Set,f=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"],d=Array.prototype.slice,h={serialize:function(t){return JSON.stringify(t)},deserialize:function(t){return JSON.parse(t)}},m=function(t,e){this.references=t,this.transforms=e,this.circularCandidates=[],this.circularCandidatesDescrs=[],this.circularRefCount=0};m._createRefMark=function(t){var e=Object.create(null);return e[i]=t,e},m.prototype._createCircularCandidate=function(t,e,n){this.circularCandidates.push(t),this.circularCandidatesDescrs.push({parent:e,key:n,refIdx:-1})},m.prototype._applyTransform=function(t,e,n,i){var a=Object.create(null),s=i.toSerializable(t);return"object"===("undefined"==typeof s?"undefined":r(s))&&this._createCircularCandidate(t,e,n),a[o]=i.type,a.data=this._handleValue(s,e,n),a},m.prototype._handleArray=function(t){for(var e=[],n=0;n<t.length;n++)e[n]=this._handleValue(t[n],e,n);return e},m.prototype._handlePlainObject=function(t){var e=Object.create(null);for(var n in t)if(t.hasOwnProperty(n)){var r=a.test(n)?"#"+n:n;e[r]=this._handleValue(t[n],e,r)}return e},m.prototype._handleObject=function(t,e,n){return this._createCircularCandidate(t,e,n),Array.isArray(t)?this._handleArray(t):this._handlePlainObject(t)},m.prototype._ensureCircularReference=function(t){var e=this.circularCandidates.indexOf(t);if(e>-1){var n=this.circularCandidatesDescrs[e];return n.refIdx===-1&&(n.refIdx=n.parent?++this.circularRefCount:0),m._createRefMark(n.refIdx)}return null},m.prototype._handleValue=function(t,e,n){var o="undefined"==typeof t?"undefined":r(t),i="object"===o&&null!==t;if(i){var a=this._ensureCircularReference(t);if(a)return a}for(var s=0;s<this.transforms.length;s++){var u=this.transforms[s];if(u.shouldTransform(o,t))return this._applyTransform(t,e,n,u)}return i?this._handleObject(t,e,n):t},m.prototype.transform=function(){for(var t=[this._handleValue(this.references,null,null)],e=0;e<this.circularCandidatesDescrs.length;e++){var n=this.circularCandidatesDescrs[e];n.refIdx>0&&(t[n.refIdx]=n.parent[n.key],n.parent[n.key]=m._createRefMark(n.refIdx))}return t};var p=function(t,e){this.references=t,this.transformMap=e,this.activeTransformsStack=[],this.visitedRefs=Object.create(null)};p.prototype._handlePlainObject=function(t){var e=Object.create(null);for(var n in t)t.hasOwnProperty(n)&&(this._handleValue(t[n],t,n),a.test(n)&&(e[n.substring(1)]=t[n],delete t[n]));for(var r in e)t[r]=e[r]},p.prototype._handleTransformedObject=function(t,e,n){var r=t[o],i=this.transformMap[r];if(!i)throw new Error("Can't find transform for \""+r+'" type.');this.activeTransformsStack.push(t),this._handleValue(t.data,t,"data"),this.activeTransformsStack.pop(),e[n]=i.fromSerializable(t.data)},p.prototype._handleCircularSelfRefDuringTransform=function(t,e,n){var r=this.references;Object.defineProperty(e,n,{val:void 0,configurable:!0,enumerable:!0,get:function(){return void 0===this.val&&(this.val=r[t]),this.val},set:function(t){this.val=t}})},p.prototype._handleCircularRef=function(t,e,n){this.activeTransformsStack.indexOf(this.references[t])>-1?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])},p.prototype._handleValue=function(t,e,n){if("object"===("undefined"==typeof t?"undefined":r(t))&&null!==t){var a=t[i];if(void 0!==a)this._handleCircularRef(a,e,n);else if(t[o])this._handleTransformedObject(t,e,n);else if(Array.isArray(t))for(var s=0;s<t.length;s++)this._handleValue(t[s],t,s);else this._handlePlainObject(t)}},p.prototype.transform=function(){return this.visitedRefs[0]=!0,this._handleValue(this.references[0],this.references,0),this.references[0]};var E=[{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=s[t.name]||Error,n=new e(t.message);return n.stack=t.stack,n}},{type:"[[ArrayBuffer]]",shouldTransform:function(t,e){return u&&e instanceof ArrayBuffer},toSerializable:function(t){var e=new Int8Array(t);return d.call(e)},fromSerializable:function(t){if(u){var e=new ArrayBuffer(t.length),n=new Int8Array(e);return n.set(t),e}return t}},{type:"[[TypedArray]]",shouldTransform:function(t,e){for(var n=0;n<f.length;n++){var r=f[n];if("function"==typeof s[r]&&e instanceof s[r])return!0}return!1},toSerializable:function(t){return{ctorName:t.constructor.name,arr:d.call(t)}},fromSerializable:function(t){return"function"==typeof s[t.ctorName]?new s[t.ctorName](t.arr):t.arr}},{type:"[[Map]]",shouldTransform:function(t,e){return c&&e instanceof Map},toSerializable:function(t){var e=[];return t.forEach(function(t,n){e.push(n),e.push(t)}),e},fromSerializable:function(t){if(c){for(var e=new Map,n=0;n<t.length;n+=2)e.set(t[n],t[n+1]);return e}for(var r=[],o=0;o<t.length;o+=2)r.push([t[n],t[n+1]]);return r}},{type:"[[Set]]",shouldTransform:function(t,e){return l&&e instanceof Set},toSerializable:function(t){var e=[];return t.forEach(function(t){e.push(t)}),e},fromSerializable:function(t){if(l){for(var e=new Set,n=0;n<t.length;n++)e.add(t[n]);return e}return t}}],v=e.exports=function(t){this.transforms=[],this.transformsMap=Object.create(null),this.serializer=t||h,this.addTransforms(E)};v.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},v.prototype.removeTransforms=function(t){t=Array.isArray(t)?t:[t];for(var e=0;e<t.length;e++){var n=t[e],r=this.transforms.indexOf(n);r>-1&&this.transforms.splice(r,1),delete this.transformsMap[n.type]}return this},v.prototype.encode=function(t){var e=new m(t,this.transforms),n=e.transform();return this.serializer.serialize(n)},v.prototype.decode=function(t){var e=this.serializer.deserialize(t),n=new p(e,this.transformsMap);return n.transform()}}},testcafe:{src:{"browser-connection":{"command.js":function(t,e,n){t.__esModule=!0,t["default"]={run:"run",idle:"idle"},e.exports=t["default"]}},client:{browser:{"index.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){return new c["default"](function(n,r){var o=e();o.open("GET",t,!0),o.onreadystatechange=function(){4===o.readyState&&(200===o.status?n(o.responseText?JSON.parse(o.responseText):""):r("disconnected"))},o.send(null)})}function i(t){return document.location.href.toLowerCase()===t.toLowerCase()}function a(t,e){o(t,e),window.setInterval(function(){return o(t,e)},d)}function s(t,e){return o(t,e).then(function(t){return(t.cmd===f["default"].run||t.cmd===f["default"].idle&&!i(t.url))&&(document.location=t.url),t.cmd})}t.__esModule=!0,t.startHeartbeat=a,t.checkStatus=s;var u=n("pinkie"),c=r(u),l=n("../../browser-connection/command"),f=r(l),d=3e4}},driver:{"command-executors":{"client-functions":{"client-function-executor.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=n("../../deps/hammerhead"),a=n("../../status"),s=r(a),u=n("./replicator"),c=n("./eval-function"),l=r(c),f=n("../../../../errors/test-run"),d=function(){function t(e){o(this,t),this.command=e,this.replicator=this._createReplicator()}return t.prototype.getResult=function(){var t=this;return i.Promise.resolve().then(function(){var e=t.replicator.decode(t.command.dependencies);return(0,l["default"])(t.command.fnCode,e)}).then(function(e){var n=t.replicator.decode(t.command.args);return t._executeFn(e,n)})["catch"](function(e){throw e.isTestCafeError||(e=new f.UncaughtErrorInClientFunctionCode(t.command.instantiationCallsiteName,e)),e})},t.prototype.getResultDriverStatus=function(){var t=this;return this.getResult().then(function(e){return new s["default"]({isCommandResult:!0,result:t.replicator.encode(e)})})["catch"](function(t){return new s["default"]({isCommandResult:!0,executionError:t})})},t.prototype._createReplicator=function(){return(0,u.createReplicator)([new u.ClientFunctionNodeTransform(this.command.instantiationCallsiteName),new u.FunctionTransform])},t.prototype._executeFn=function(t,e){return t.apply(window,e)},t}();t["default"]=d,e.exports=t["default"]},"eval-function.js":function(exports,module,require){function _interopRequireDefault(t){return t&&t.__esModule?t:{"default":t}}function evalFunction(fnCode,__dependencies$){"use strict";return eval(fnCode)}exports.__esModule=!0,exports["default"]=evalFunction;var _hammerhead=require("../../deps/hammerhead"),_hammerhead2=_interopRequireDefault(_hammerhead),Promise=_hammerhead2["default"].Promise;module.exports=exports["default"]},"replicator.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t){var e=new s["default"]({serialize:h,deserialize:h});return e.addTransforms(t)}t.__esModule=!0,t.ClientFunctionNodeTransform=t.SelectorNodeTransform=t.FunctionTransform=void 0,t.createReplicator=i;var a=n("replicator"),s=r(a),u=n("./eval-function"),c=r(u),l=n("./selector-executor/node-snapshots"),f=n("../../../../errors/test-run"),d=window.Node,h=function(t){return t};t.FunctionTransform=function(){function t(){o(this,t),this.type="Function"}return t.prototype.shouldTransform=function(t){return"function"===t},t.prototype.toSerializable=function(){return""},t.prototype.fromSerializable=function(t){var e=t.fnCode,n=t.dependencies;return(0,c["default"])(e,n)},t}(),t.SelectorNodeTransform=function(){function t(){o(this,t),this.type="Node"}return t.prototype.shouldTransform=function(t,e){return e instanceof d},t.prototype.toSerializable=function(t){return 1===t.nodeType?new l.ElementSnapshot(t):new l.NodeSnapshot(t)},t}(),t.ClientFunctionNodeTransform=function(){function t(e){o(this,t),this.type="Node",this.instantiationCallsiteName=e}return t.prototype.shouldTransform=function(t,e){if(e instanceof d)throw new f.DomNodeClientFunctionResultError(this.instantiationCallsiteName)},t}()},"selector-executor":{"index.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t){if(!S(t))return!1;for(var e=0;e<t.length;e++)if(!(t[e]instanceof I))return!1;return!0}function u(t){return!!t}function c(t){return h.domUtils.isOptionElement(t)||"optgroup"===h.domUtils.getTagName(t)?m.selectElement.isOptionElementVisible(t):h.positionUtils.isElementVisible(t)}function l(t,e){return 1===t.nodeType?e.test((0,y.getInnerText)(t)):9===t.nodeType||11===t.nodeType?!!f(t.childNodes,e).length:e.test((0,y.getTextContent)(t))}function f(t,e){for(var n=[],r=0;r<t.length;r++)l(t[r],e)&&n.push(t[r]);return n}t.__esModule=!0;var d=n("../../../deps/hammerhead"),h=n("../../../deps/testcafe-core"),m=n("../../../deps/testcafe-ui"),p=n("../client-function-executor"),E=r(p),v=n("../replicator"),g=n("../../../../../errors/test-run"),y=n("./sandboxed-node-properties"),w=200,_="Waiting for an element to appear",I=window.Node,C=window.HTMLCollection,b=window.NodeList,S=Array.isArray;Object.defineProperty(window,"%testCafeSelectorFilter%",{value:function(t,e){if(null===t||void 0===t)return t;if(t instanceof I)return e.textFilter?l(t,e.textFilter)?t:null:t;if(t instanceof C||t instanceof b||s(t))return e.textFilter&&(t=f(t,e.textFilter)),t[e.index];throw new g.InvalidSelectorResultError}});var x=function(t){function e(n,r,a,s,u){o(this,e);var c=i(this,t.call(this,n));if(c.createNotFoundError=s,c.createIsInvisibleError=u,c.timeout="number"==typeof n.timeout?n.timeout:r,a){var l=new Date-a;c.timeout=Math.max(c.timeout-l,0)}return c}return a(e,t),e.prototype._createReplicator=function(){return(0,v.createReplicator)([new v.SelectorNodeTransform,new v.FunctionTransform])},e.prototype._checkElement=function(t,e,n,r,o){if(n(t))return t;var i=new Date-e>=this.timeout;if(i){if(r)throw r();return null}return(0,h.delay)(w).then(o)},e.prototype._ensureExists=function(t,e,n){var r=this,o=function(){return r._ensureExists(t,e,n)};return d.Promise.resolve().then(function(){return t.apply(window,e)}).then(function(t){return r._checkElement(t,n,u,r.createNotFoundError,o)})},e.prototype._ensureVisible=function(t,e){var n=this,r=function(){return n._ensureVisible(t,e)};return this._checkElement(t,e,c,this.createIsInvisibleError,r)},e.prototype._executeFn=function(t,e){var n=this,r=new Date,o=new m.ProgressPanel;return o.show(_,this.timeout),this._ensureExists(t,e,r).then(function(t){return t&&n.command.visibilityCheck?n._ensureVisible(t,r):t})["catch"](function(t){throw o.close(!1),t}).then(function(t){return o.close(!!t),t})},e}(E["default"]);t["default"]=x,e.exports=t["default"]},"node-snapshots.js":function(t,e,n){function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0,t.ElementSnapshot=t.NodeSnapshot=void 0;var a=n("../../../deps/testcafe-core"),s=n("./sandboxed-node-properties"),u=t.NodeSnapshot=function(){function t(e){i(this,t),this.nodeType=e.nodeType,this.textContent=(0,s.getTextContent)(e),this.childNodeCount=(0,s.getChildNodes)(e).length,this.hasChildNodes=!!this.childNodeCount,this.childElementCount=t._getChildElementCount(e),this.hasChildElements=!!this.childElementCount}return t._getChildElementCount=function(t){var e=(0,s.getChildren)(t);if(e)return e.length;for(var n=0,r=t.childNodes.length,o=0;o<r;o++)1===t.childNodes[o].nodeType&&n++;return n},t}();t.ElementSnapshot=function(t){function e(n){i(this,e);var o=r(this,t.call(this,n));return o.tagName=n.tagName.toLowerCase(),o.visible=a.positionUtils.isElementVisible(n),o.focused=document.activeElement===n,o.attributes=e._getAttrsDictionary(n),o.boundingClientRect=e._getBoundingClientRect(n),o.classNames=e._getClassNames(n),o.style=e._getStyle(n),o.innerText=(0,s.getInnerText)(n),["namespaceURI","id","value","checked","scrollWidth","scrollHeight","scrollLeft","scrollTop","offsetWidth","offsetHeight","offsetLeft","offsetTop","clientWidth","clientHeight","clientLeft","clientTop"].forEach(function(t){o[t]=n[t]}),o}return o(e,t),e._getBoundingClientRect=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}},e._getClassNames=function(t){var e=(0,s.getClassName)(t);return e="string"==typeof e.animVal?e.animVal:e,e.replace(/^\s+|\s+$/g,"").split(/\s+/g)},e._getAttrsDictionary=function(t){for(var e=(0,s.getAttrs)(t),n={},r=e.length-1;r>=0;r--)n[e[r].name]=e[r].value;return n},e._getStyle=function(t){for(var e={},n=window.getComputedStyle(t),r=0;r<n.length;r++){var o=n[r];e[o]=n[o]}return e},e}(u)},"sandboxed-node-properties.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t){return t.replace(/[\\^$*+?.()|[\]{}]/g,"\\$&")}function i(t){var e="("+t.toString()+")";return e=(0,s.processScript)(e,!1),(0,c["default"])(e,null)}function a(t){var e=d(t);return e&&e.replace(l,"").replace(f,"").replace(/\r\n/g,"\n")}t.__esModule=!0,t.getClassName=t.getTextContent=t.getChildren=t.getChildNodes=t.getAttrs=void 0,t.getInnerText=a;var s=n("../../../deps/hammerhead"),u=n("../eval-function"),c=r(u),l=new RegExp(o(s.PROCESSING_COMMENTS.scriptStart)+".*?"+o(s.PROCESSING_COMMENTS.scriptEnd),"g"),f=new RegExp(o(s.PROCESSING_COMMENTS.stylesheetStart)+".*?"+o(s.PROCESSING_COMMENTS.stylesheetEnd),"g"),d=(t.getAttrs=i(function(t){return t.attributes}),t.getChildNodes=i(function(t){return t.childNodes}),t.getChildren=i(function(t){return t.children}),t.getTextContent=i(function(t){return t.textContent}),t.getClassName=i(function(t){return t.className}),i(function(t){return t.innerText}))}}},"execute-action.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t){if(!E.domUtils.isEditableElement(t))throw new b.ActionElementNonEditableError}function i(t){if(!E.domUtils.isTextAreaElement(t))throw new b.ActionElementNotTextAreaError}function a(t,e){if(!E.domUtils.isContentEditableElement(t))throw new b.ActionElementNonContentEditableError(e)}function s(t){if(!E.contentEditable.getNearestCommonAncestor(t[0],t[1]))throw new b.ActionRootContainerNotFoundError;return t}function u(t){if(!E.domUtils.isFileInput(t))throw new b.ActionElementIsNotFileInputError}function c(t,e){t.type===C["default"].selectText?o(e[0]):t.type===C["default"].selectTextAreaContent?i(e[0]):t.type===C["default"].selectEditableContent?(a(e[0],"startSelector"),a(e[1],"endSelector"),s(e)):t.type!==C["default"].setFilesToUpload&&t.type!==C["default"].clearUpload||u(e[0])}function l(t,e){var n=[],r=p.Promise.resolve(),o=new Date,i=function(t,i,a){r=r.then(function(){var n=new _["default"](t,e,o,i,a);return n.getResult()}).then(function(t){return n.push(t)})};return t.selector&&i(t.selector,function(){return new b.ActionElementNotFoundError},function(){return new b.ActionElementIsInvisibleError}),t.type===C["default"].dragToElement?i(t.destinationSelector,function(){return new b.ActionAdditionalElementNotFoundError("destinationSelector")},function(){return new b.ActionAdditionalElementIsInvisibleError("destinationSelector")}):t.type===C["default"].selectEditableContent&&(i(t.startSelector,function(){return new b.ActionAdditionalElementNotFoundError("startSelector")},function(){return new b.ActionAdditionalElementIsInvisibleError("startSelector")}),i(t.endSelector||t.startSelector,function(){return new b.ActionAdditionalElementNotFoundError("endSelector")},function(){return new b.ActionAdditionalElementIsInvisibleError("endSelector")})),r.then(function(){return c(t,n),n})}function f(t){if(t.type===C["default"].pressKey){var e=(0,E.parseKeySequence)(t.keys);if(e.error)throw new b.ActionIncorrectKeysError("keys")}}function d(t,e){var n=(0,v.getOffsetOptions)(t,e.offsetX,e.offsetY),r=n.offsetX,o=n.offsetY;e.offsetX=r,e.offsetY=o}function h(t,e){var n=null;switch(e.options&&"offsetX"in e.options&&"offsetY"in e.options&&d(t[0],e.options),e.type){case C["default"].click:return new v.Click(t[0],e.options);case C["default"].rightClick:return new v.RClick(t[0],e.options);case C["default"].doubleClick:return new v.DblClick(t[0],e.options);case C["default"].hover:return new v.Hover(t[0],e.options);case C["default"].drag:return new v.DragToOffset(t[0],e.dragOffsetX,e.dragOffsetY,e.options);case C["default"].dragToElement:return new v.DragToElement(t[0],t[1],e.options);case C["default"].typeText:return new v.Type(t[0],e.text,e.options);case C["default"].selectText:case C["default"].selectTextAreaContent:return n=(0,v.calculateSelectTextArguments)(t[0],e),new v.SelectText(t[0],n.startPos,n.endPos);case C["default"].selectEditableContent:return new v.SelectEditableContent(t[0],t[1]);case C["default"].pressKey:return new v.Press((0,E.parseKeySequence)(e.keys).combinations);case C["default"].setFilesToUpload:return new v.Upload(t[0],e.filePath,function(t){return new b.ActionCanNotFindFileToUploadError(t)});case C["default"].clearUpload:return new v.Upload(t[0])}return null}function m(t,e){var n=null,r=new p.Promise(function(t){n=t}),o=new p.Promise(function(r){var o=null;l(t,e).then(function(e){return n(),o=new E.RequestBarrier,f(t),h(e,t).run()}).then(function(){return p.Promise.all([o.wait(),E.pageUnloadBarrier.wait()])}).then(function(){return r(new y["default"]({isCommandResult:!0}))})["catch"](function(t){var e=t.message===v.ERROR_TYPES.elementIsInvisibleError?new b.ActionElementIsInvisibleError:t;return r(new y["default"]({isCommandResult:!0,executionError:e}))})});return{startPromise:r,completionPromise:o}}t.__esModule=!0,t["default"]=m;var p=n("../deps/hammerhead"),E=n("../deps/testcafe-core"),v=n("../deps/testcafe-automation"),g=n("../status"),y=r(g),w=n("./client-functions/selector-executor"),_=r(w),I=n("../../../test-run/commands/type"),C=r(I),b=n("../../../errors/test-run");e.exports=t["default"]},"execute-navigate-to.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t){var e=new d;return a["default"].navigateTo(t.url),f.all([e.wait(),h.wait()]).then(function(){return new l["default"]({isCommandResult:!0})})["catch"](function(t){return new l["default"]({isCommandResult:!0,executionError:t})})}t.__esModule=!0,t["default"]=o;var i=n("../deps/hammerhead"),a=r(i),s=n("../deps/testcafe-core"),u=r(s),c=n("../status"),l=r(c),f=a["default"].Promise,d=u["default"].RequestBarrier,h=u["default"].pageUnloadBarrier;e.exports=t["default"]},"prepare-browser-manipulation.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t){var e=document.title,n="[ "+t+" ]",r=null,o=null;return r=h.setInterval.call(window,function(){document.title!==n&&(e=document.title,document.title=n)},E),document.title=n,p(v).then(function(){var t={cmd:l["default"].readyForBrowserManipulation,currentWidth:window.innerWidth,currentHeight:window.innerHeight};return m.queuedAsyncServiceMsg(t)}).then(function(t){return o=t,h.clearInterval.call(window,r),document.title=e,p(g)}).then(function(){return new d["default"]({isCommandResult:!0,result:o})})}t.__esModule=!0,t["default"]=o;var i=n("../deps/hammerhead"),a=r(i),s=n("../deps/testcafe-core"),u=r(s),c=n("../../../test-run/client-messages"),l=r(c),f=n("../status"),d=r(f),h=a["default"].nativeMethods,m=a["default"].transport,p=u["default"].delay,E=50,v=500,g=100;e.exports=t["default"]}},deps:{"hammerhead.js":function(t,e,n){t.__esModule=!0,t["default"]=window["%hammerhead%"],e.exports=t["default"]},"testcafe-automation.js":function(t,e,n){t.__esModule=!0,t["default"]=window["%testCafeAutomation%"],e.exports=t["default"]},"testcafe-core.js":function(t,e,n){t.__esModule=!0,t["default"]=window["%testCafeCore%"],e.exports=t["default"]},"testcafe-ui.js":function(t,e,n){t.__esModule=!0,t["default"]=window["%testCafeUI%"],e.exports=t["default"]}},"driver-link":{"child.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=n("../deps/hammerhead"),a=n("../deps/testcafe-core"),s=n("../../../errors/test-run"),u=n("./send-message-to-driver"),c=r(u),l=n("./messages"),f=n("../status"),d=r(f),h=1e3,m=200,p=500,E=function(){function t(e,n,r){o(this,t),this.driverWindow=e,this.driverIframe=a.domUtils.findIframeByWindow(e),this.driverId=n,this.iframeAvailabilityTimeout=r}return t.prototype._ensureIframe=function(){var t=this;return a.domUtils.isElementInDocument(this.driverIframe)?(0,a.waitFor)(function(){return a.positionUtils.isElementVisible(t.driverIframe)?t.driverIframe:null},m,this.iframeAvailabilityTimeout)["catch"](function(){throw new s.CurrentIframeIsInvisibleError}):i.Promise.reject(new s.CurrentIframeNotFoundError)},t.prototype._waitForIframeRemovedOrHidden=function(){var t=this;return new i.Promise(function(e){t.checkIframeInterval=i.nativeMethods.setInterval.call(window,function(){t._ensureIframe()["catch"](function(){return(0,a.delay)(p).then(function(){return e(new d["default"]({isCommandResult:!0}))})})},h)})},t.prototype._waitForCommandResult=function(){var t=this,e=null,n=function(){return new i.Promise(function(t){e=function(e){e.message.type===l.TYPE.commandExecuted&&t(e.message.driverStatus)},i.eventSandbox.message.on(i.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,e)})};return i.Promise.race([this._waitForIframeRemovedOrHidden(),n()]).then(function(n){return i.eventSandbox.message.off(i.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,e),i.nativeMethods.clearInterval.call(window,t.checkIframeInterval),n})},t.prototype.confirmConnectionEstablished=function(t){var e=new l.ConfirmationMessage(t,{id:this.driverId});i.eventSandbox.message.sendServiceMsg(e,this.driverWindow)},t.prototype.executeCommand=function(t){var e=this;return this._ensureIframe().then(function(){var n=new l.ExecuteCommandMessage(t);return i.Promise.all([(0,c["default"])(n,e.driverWindow,e.timeout,s.CurrentIframeIsNotLoadedError),e._waitForCommandResult()])}).then(function(t){return t[1]})},t}();t["default"]=E,e.exports=t["default"]},"messages.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0,t.ConfirmationMessage=t.ExecuteCommandMessage=t.CommandExecutedMessage=t.EstablishConnectionMessage=t.TYPE=void 0;var s=n("../generate-id"),u=r(s),c=t.TYPE={establishConnection:"driver|establish-connection",commandExecuted:"driver|command-executed",executeCommand:"driver|execute-command",confirmation:"driver|confirmation"},l=function f(t){a(this,f),this.type=t,this.id=(0,u["default"])()};t.EstablishConnectionMessage=function(t){function e(){return a(this,e),o(this,t.call(this,c.establishConnection)); | ||
}return i(e,t),e}(l),t.CommandExecutedMessage=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c.commandExecuted));return r.driverStatus=n,r}return i(e,t),e}(l),t.ExecuteCommandMessage=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c.executeCommand));return r.command=n,r}return i(e,t),e}(l),t.ConfirmationMessage=function(t){function e(n,r){a(this,e);var i=o(this,t.call(this,c.confirmation));return i.requestMessageId=n,i.result=r,i}return i(e,t),e}(l)},"parent.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=n("../deps/hammerhead"),a=n("./messages"),s=n("../../../errors/test-run"),u=n("./send-message-to-driver"),c=r(u),l=5e3,f=function(){function t(e){o(this,t),this.driverWindow=e}return t.prototype.establishConnection=function(){var t=new a.EstablishConnectionMessage;return(0,c["default"])(t,this.driverWindow,l,s.CurrentIframeIsNotLoadedError).then(function(t){return t.result.id})},t.prototype.confirmMessageReceived=function(t){var e=new a.ConfirmationMessage(t);i.eventSandbox.message.sendServiceMsg(e,this.driverWindow)},t.prototype.onCommandExecuted=function(t){var e=new a.CommandExecutedMessage(t);i.eventSandbox.message.sendServiceMsg(e,this.driverWindow)},t}();t["default"]=f,e.exports=t["default"]},"send-message-to-driver.js":function(t,e,n){function r(t,e,n,r){var c=null,l=null,f=null;n=Math.max(n||0,s);var d=function(){return new o.Promise(function(n){f=function(e){e.message.type===a.TYPE.confirmation&&e.message.requestMessageId===t.id&&n(e.message)},o.eventSandbox.message.on(o.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,f),c=o.nativeMethods.setInterval.call(window,function(){return o.eventSandbox.message.sendServiceMsg(t,e)},u),o.eventSandbox.message.sendServiceMsg(t,e)})};return o.Promise.race([(0,i.delay)(n),d()]).then(function(t){if(o.nativeMethods.clearInterval.call(window,c),o.nativeMethods.clearTimeout.call(window,l),o.eventSandbox.message.off(o.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,f),!t)throw new r;return t})}t.__esModule=!0,t["default"]=r;var o=n("../deps/hammerhead"),i=n("../deps/testcafe-core"),a=n("./messages"),s=2500,u=1e3;e.exports=t["default"]}},"driver.js":function(t,e,n){function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function o(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var a=n("./deps/hammerhead"),s=o(a),u=n("./deps/testcafe-core"),c=n("./deps/testcafe-ui"),l=n("../../test-run/client-messages"),f=o(l),d=n("../../test-run/commands/type"),h=o(d),m=n("../../errors/test-run"),p=n("../browser"),E=r(p),v=n("./driver-link/messages"),g=n("./storage"),y=o(g),w=n("./status"),_=o(w),I=n("./generate-id"),C=o(I),b=n("./driver-link/child"),S=o(b),x=n("./command-executors/prepare-browser-manipulation"),T=o(x),A=n("./command-executors/execute-action"),N=o(A),M=n("./command-executors/execute-navigate-to"),R=o(M),F=n("./command-executors/client-functions/client-function-executor"),O=o(F),P=n("./command-executors/client-functions/selector-executor"),j=o(P),D=s["default"].transport,U=s["default"].Promise,k=s["default"].eventSandbox.message,L="testcafe|driver|test-done-sent-flag",V="testcafe|driver|pending-status",G="testcafe|driver|executing-client-function-descriptor",z="testcafe|driver|selector-execution-start-time",B="testcafe|driver|pending-page-error",W="testcafe|driver|active-iframe-selector",X=500,q={NotLoadedError:m.ActionIframeIsNotLoadedError,NotFoundError:m.ActionElementNotFoundError,IsInvisibleError:m.ActionElementIsInvisibleError},K={NotLoadedError:m.CurrentIframeIsNotLoadedError,NotFoundError:m.CurrentIframeNotFoundError,IsInvisibleError:m.CurrentIframeIsInvisibleError},H=new U(u.noop),Y=function(){function t(e,n,r){var o=this;i(this,t),this.COMMAND_EXECUTING_FLAG="testcafe|driver|command-executing-flag",this.EXECUTING_IN_IFRAME_FLAG="testcafe|driver|executing-in-iframe-flag",this.testRunId=e,this.heartbeatUrl=n.heartbeat,this.browserStatusUrl=n.status,this.selectorTimeout=r.selectorTimeout,this.skipJsErrors=r.skipJsErrors,this.contextStorage=null,this.childDriverLinks=[],this.activeChildDriverLink=null,this.beforeUnloadRaised=!1,this.pageInitialRequestBarrier=new u.RequestBarrier,this.readyPromise=u.eventUtils.documentReady().then(function(){return o.pageInitialRequestBarrier.wait(!0)}),this._initChildDriverListening(),u.pageUnloadBarrier.init(),(0,u.preventRealEvents)(),s["default"].on(s["default"].EVENTS.uncaughtJsError,function(t){return o._onJsError(t)}),s["default"].on(s["default"].EVENTS.beforeUnload,function(){o.beforeUnloadRaised=!0})}return t.prototype._onJsError=function(t){if(this.skipJsErrors||this.contextStorage.getItem(L))return U.resolve();var e=new m.UncaughtErrorOnPage(t.msg||t.message,t.pageUrl);return this.contextStorage.getItem(B)||this.contextStorage.setItem(B,e),null},t.prototype._failIfClientCodeExecutionIsInterrupted=function(){var t=this.contextStorage.getItem(G);return!!t&&(this._onReady(new _["default"]({isCommandResult:!0,executionError:new m.ClientFunctionExecutionInterruptionError(t.instantiationCallsiteName)})),!0)},t.prototype._addPendingErrorToStatus=function(t){var e=this.contextStorage.getItem(B);e&&(this.contextStorage.setItem(B,null),t.pageError=e)},t.prototype._sendStatus=function(t){var e=this;return this._addPendingErrorToStatus(t),this.contextStorage.setItem(V,t),this.beforeUnloadRaised?H:D.queuedAsyncServiceMsg({cmd:f["default"].ready,status:t}).then(function(t){return e.beforeUnloadRaised?H:(e.contextStorage.setItem(V,null),t)})},t.prototype._initChildDriverListening=function(){var t=this;k.on(k.SERVICE_MSG_RECEIVED_EVENT,function(e){var n=e.message,r=e.source;if(n.type===v.TYPE.establishConnection){var o=t._getChildDriverLinkByWindow(r);if(!o){var i=t.testRunId+"-"+(0,C["default"])();o=new S["default"](r,i),t.childDriverLinks.push(o)}o.confirmConnectionEstablished(n.id)}})},t.prototype._getChildDriverLinkByWindow=function(t){return this.childDriverLinks.filter(function(e){return e.driverWindow===t})[0]},t.prototype._runInActiveIframe=function(t){var e=this,n=U.resolve(),r=this.contextStorage.getItem(W);!this.activeChildDriverLink&&r&&(n=this._switchToIframe(r,K)),n.then(function(){return e.contextStorage.setItem(e.EXECUTING_IN_IFRAME_FLAG,!0),e.activeChildDriverLink.executeCommand(t)}).then(function(t){return e._onCommandExecutedInIframe(t)})["catch"](function(t){return e._onCommandExecutedInIframe(new _["default"]({isCommandResult:!0,executionError:t}))})},t.prototype._onCommandExecutedInIframe=function(t){this.contextStorage.setItem(this.EXECUTING_IN_IFRAME_FLAG,!1),this._onReady(t)},t.prototype._ensureChildDriverLink=function(t,e){var n=this;return(0,u.waitFor)(function(){return n._getChildDriverLinkByWindow(t)},X,this.selectorTimeout)["catch"](function(){throw new e})},t.prototype._switchToIframe=function(t,e){var n=this,r=new j["default"](t,this.selectorTimeout,null,function(){return new e.NotFoundError},function(){return e.IsInvisibleError()});return r.getResult().then(function(t){if(!u.domUtils.isIframeElement(t))throw new m.ActionElementNotIframe;return n._ensureChildDriverLink(t.contentWindow,e.NotLoadedError)}).then(function(e){n.activeChildDriverLink=e,n.contextStorage.setItem(W,t)})},t.prototype._switchToMainWindow=function(t){this.activeChildDriverLink&&this.activeChildDriverLink.executeCommand(t),this.contextStorage.setItem(W,null),this.activeChildDriverLink=null},t.prototype._onActionCommand=function(t){var e=this,n=(0,N["default"])(t,this.selectorTimeout),r=n.startPromise,o=n.completionPromise;r.then(function(){return e.contextStorage.setItem(e.COMMAND_EXECUTING_FLAG,!0)}),o.then(function(t){return e.contextStorage.setItem(e.COMMAND_EXECUTING_FLAG,!1),e._onReady(t)})},t.prototype._onNavigateToCommand=function(t){var e=this;this.contextStorage.setItem(this.COMMAND_EXECUTING_FLAG,!0),(0,R["default"])(t).then(function(t){return e.contextStorage.setItem(e.COMMAND_EXECUTING_FLAG,!1),e._onReady(t)})},t.prototype._onExecuteClientFunctionCommand=function(t){var e=this;this.contextStorage.setItem(G,{instantiationCallsiteName:t.instantiationCallsiteName});var n=new O["default"](t);n.getResultDriverStatus().then(function(t){e.contextStorage.setItem(G,null),e._onReady(t)})},t.prototype._onExecuteSelectorCommand=function(t){var e=this,n=this.contextStorage.getItem(z)||new Date,r=new j["default"](t,this.selectorTimeout,n);r.getResultDriverStatus().then(function(t){e.contextStorage.setItem(z,null),e._onReady(t)})},t.prototype._onSwitchToMainWindowCommand=function(t){this._switchToMainWindow(t),this._onReady(new _["default"]({isCommandResult:!0}))},t.prototype._onSwitchToIframeCommand=function(t){var e=this;this._switchToIframe(t.selector,q).then(function(){return e._onReady(new _["default"]({isCommandResult:!0}))})["catch"](function(t){return e._onReady(new _["default"]({isCommandResult:!0,executionError:t}))})},t.prototype._onPrepareBrowserManipulationCommand=function(){var t=this;this.contextStorage.setItem(this.COMMAND_EXECUTING_FLAG,!0),(0,T["default"])(this.testRunId).then(function(e){return t.contextStorage.setItem(t.COMMAND_EXECUTING_FLAG,!1),t._onReady(e)})},t.prototype._onTestDone=function(){var t=this;this.contextStorage.setItem(L,!0),this._sendStatus(new _["default"]({isCommandResult:!0})).then(function(){return E.checkStatus(t.browserStatusUrl,s["default"].createNativeXHR)})},t.prototype._onReady=function(t){var e=this;this._sendStatus(t).then(function(t){t?e._onCommand(t):e._onReady(new _["default"])})},t.prototype._onCommand=function(t){var e=this;this.readyPromise.then(function(){t.type===h["default"].testDone?e._onTestDone():t.type===h["default"].prepareBrowserManipulation?e._onPrepareBrowserManipulationCommand():t.type===h["default"].switchToMainWindow?e._onSwitchToMainWindowCommand(t):e.activeChildDriverLink||e.contextStorage.getItem(W)?e._runInActiveIframe(t):t.type===h["default"].switchToIframe?e._onSwitchToIframeCommand(t):t.type===h["default"].executeClientFunction?e._onExecuteClientFunctionCommand(t):t.type===h["default"].executeSelector?e._onExecuteSelectorCommand(t):e.contextStorage.getItem(B)?e._onReady(new _["default"]({isCommandResult:!0})):t.type===h["default"].navigateTo?e._onNavigateToCommand(t):e._onActionCommand(t)})},t.prototype.start=function(){this.contextStorage=new y["default"](window,this.testRunId),E.startHeartbeat(this.heartbeatUrl,s["default"].createNativeXHR),c.modalBackground.initAndShowLoadingText(),this.readyPromise.then(function(){return c.modalBackground.hide()});var t=this.contextStorage.getItem(V);if(this.contextStorage.getItem(L))return void(t?this._onTestDone():E.checkStatus(this.browserStatusUrl,s["default"].createNativeXHR));if(!this._failIfClientCodeExecutionIsInterrupted()){var e=this.contextStorage.getItem(this.COMMAND_EXECUTING_FLAG)||this.contextStorage.getItem(this.EXECUTING_IN_IFRAME_FLAG),n=t||new _["default"]({isCommandResult:e});this._onReady(n)}},t}();t["default"]=Y,e.exports=t["default"]},"generate-id.js":function(t,e,n){t.__esModule=!0,t["default"]=function(){return"function"==typeof r.nativeMethods.performanceNow?r.nativeMethods.performanceNow().toString():(r.nativeMethods.dateNow()+Math.random()).toString()};var r=n("./deps/hammerhead");e.exports=t["default"]},"iframe-driver.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}t.__esModule=!0;var s=n("./deps/hammerhead"),u=n("./driver"),c=r(u),l=n("./storage"),f=r(l),d=n("./status"),h=r(d),m=n("./driver-link/parent"),p=r(m),E=n("./driver-link/messages"),v=function(t){function e(n,r){o(this,e);var a=i(this,t.call(this,n,{},r));return a.lastParentDriverMessageId=null,a.parentDriverLink=new p["default"](window.parent),a._initParentDriverListening(),a}return a(e,t),e.prototype._onJsError=function(){},e.prototype._initParentDriverListening=function(){var t=this;s.eventSandbox.message.on(s.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,function(e){var n=e.message;if(!t.beforeUnloadRaised&&n.type===E.TYPE.executeCommand){if(t.lastParentDriverMessageId===n.id)return;t.lastParentDriverMessageId=n.id,t.parentDriverLink.confirmMessageReceived(n.id),t._onCommand(n.command)}})},e.prototype._onSwitchToMainWindowCommand=function(t){this._switchToMainWindow(t)},e.prototype._onReady=function(t){this.parentDriverLink.onCommandExecuted(t)},e.prototype.start=function(){var t=this;this.parentDriverLink.establishConnection().then(function(e){if(t.contextStorage=new f["default"](window,e),!t._failIfClientCodeExecutionIsInterrupted()){var n=t.contextStorage.getItem(t.COMMAND_EXECUTING_FLAG)||t.contextStorage.getItem(t.EXECUTING_IN_IFRAME_FLAG);n&&t._onReady(new h["default"]({isCommandResult:!0}))}})},e}(c["default"]);t["default"]=v,e.exports=t["default"]},"index.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}var o=n("./deps/hammerhead"),i=r(o),a=n("./driver"),s=r(a),u=n("./iframe-driver"),c=r(u);Object.defineProperty(window,"%testCafeDriver%",{enumerable:!1,configurable:!1,writable:!1,value:s["default"]}),Object.defineProperty(window,"%testCafeIframeDriver%",{enumerable:!1,configurable:!1,writable:!1,value:c["default"]}),i["default"].on(i["default"].EVENTS.evalIframeScript,function(t){return initTestCafeClientDrivers(t.iframe.contentWindow,!0)})},"status.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}t.__esModule=!0;var s=n("../../utils/assignable"),u=r(s),c=n("./generate-id"),l=r(c),f=function(t){function e(n){o(this,e);var r=i(this,t.call(this,n));return r.id=(0,l["default"])(),r.isCommandResult=!1,r.executionError=null,r.pageError=null,r.result=null,r._assignFrom(n,!0),r}return a(e,t),e.prototype._getAssignableProperties=function(){return[{name:"isCommandResult"},{name:"executionError"},{name:"pageError"},{name:"result"}]},e}(u["default"]);t["default"]=f,e.exports=t["default"]},"storage.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var i=n("./deps/hammerhead"),a=r(i),s=a["default"].json,u="testcafe|driver|",c=function(){function t(e,n){o(this,t),this.storage=e.sessionStorage,this.storageKey=u+n,this.data={},this._loadFromStorage()}return t.prototype._loadFromStorage=function(){var t=this.storage.getItem(this.storageKey);t&&(this.data=s.parse(t),this.storage.removeItem(this.storageKey))},t.prototype._saveToStorage=function(){this.storage.setItem(this.storageKey,s.stringify(this.data))},t.prototype.setItem=function(t,e){this.data[t]=e,this._saveToStorage()},t.prototype.getItem=function(t){return this.data[t]},t.prototype.dispose=function(){this.storage.removeItem(this.storageKey)},t}();t["default"]=c,e.exports=t["default"]}}},errors:{"test-run":{"index.js":function(t,e,n){function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0,t.CurrentIframeIsInvisibleError=t.CurrentIframeNotFoundError=t.CurrentIframeIsNotLoadedError=t.ActionIframeIsNotLoadedError=t.ActionElementNotIframe=t.ActionElementIsNotFileInputError=t.ActionCanNotFindFileToUploadError=t.ActionIncorrectKeysError=t.ActionRootContainerNotFoundError=t.ActionElementNonContentEditableError=t.ActionElementNotTextAreaError=t.ActionElementNonEditableError=t.ActionAdditionalElementIsInvisibleError=t.ActionAdditionalElementNotFoundError=t.ActionElementIsInvisibleError=t.ActionElementNotFoundError=t.ActionSelectorError=t.ActionUnsupportedDeviceTypeError=t.ActionUnsupportedUrlProtocolError=t.ActionStringArrayElementError=t.ActionStringOrStringArrayArgumentError=t.ActionPositiveIntegerArgumentError=t.ActionIntegerArgumentError=t.ActionStringArgumentError=t.ActionOptionsTypeError=t.ActionBooleanOptionError=t.ActionPositiveIntegerOptionError=t.ExternalAssertionLibraryError=t.UncaughtErrorInClientFunctionCode=t.UncaughtNonErrorObjectInTestCode=t.UncaughtErrorInTestCode=t.UncaughtErrorOnPage=t.PageLoadError=t.InvalidSelectorResultError=t.DomNodeClientFunctionResultError=t.ClientFunctionExecutionInterruptionError=t.MissingAwaitError=void 0;var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},u=n("./type"),c=r(u),l=function h(t){a(this,h),this.type=t,this.isTestCafeError=!0,this.callsite=null},f=function(t){function e(n,r,i){a(this,e);var s=o(this,t.call(this,n));return s.optionName=r,s.actualValue=i,s}return i(e,t),e}(l),d=function(t){function e(n,r,i){a(this,e);var s=o(this,t.call(this,n));return s.argumentName=r,s.actualValue=i,s}return i(e,t),e}(l);t.MissingAwaitError=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c["default"].missingAwaitError));return r.callsite=n,r}return i(e,t),e}(l),t.ClientFunctionExecutionInterruptionError=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c["default"].clientFunctionExecutionInterruptionError));return r.instantiationCallsiteName=n,r}return i(e,t),e}(l),t.DomNodeClientFunctionResultError=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c["default"].domNodeClientFunctionResultError));return r.instantiationCallsiteName=n,r}return i(e,t),e}(l),t.InvalidSelectorResultError=function(t){function e(){return a(this,e),o(this,t.call(this,c["default"].invalidSelectorResultError))}return i(e,t),e}(l),t.PageLoadError=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c["default"].pageLoadError));return r.errMsg=n,r}return i(e,t),e}(l),t.UncaughtErrorOnPage=function(t){function e(n,r){a(this,e);var i=o(this,t.call(this,c["default"].uncaughtErrorOnPage));return i.errMsg=n,i.pageDestUrl=r,i}return i(e,t),e}(l),t.UncaughtErrorInTestCode=function(t){function e(n,r){a(this,e);var i=o(this,t.call(this,c["default"].uncaughtErrorInTestCode));return i.errMsg=String(n),i.callsite=r,i}return i(e,t),e}(l),t.UncaughtNonErrorObjectInTestCode=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c["default"].uncaughtNonErrorObjectInTestCode));return r.objType="undefined"==typeof n?"undefined":s(n),r.objStr=String(n),r}return i(e,t),e}(l),t.UncaughtErrorInClientFunctionCode=function(t){function e(n,r){a(this,e);var i=o(this,t.call(this,c["default"].uncaughtErrorInClientFunctionCode));return i.errMsg=String(r),i.instantiationCallsiteName=n,i}return i(e,t),e}(l),t.ExternalAssertionLibraryError=function(t){function e(n,r){a(this,e);var i=o(this,t.call(this,c["default"].externalAssertionLibraryError));return i.errMsg=String(n),i.callsite=r,i}return i(e,t),e}(l),t.ActionPositiveIntegerOptionError=function(t){function e(n,r){return a(this,e),o(this,t.call(this,c["default"].actionPositiveIntegerOptionError,n,r))}return i(e,t),e}(f),t.ActionBooleanOptionError=function(t){function e(n,r){return a(this,e),o(this,t.call(this,c["default"].actionBooleanOptionError,n,r))}return i(e,t),e}(f),t.ActionOptionsTypeError=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c["default"].actionOptionsTypeError));return r.actualType=n,r}return i(e,t),e}(l),t.ActionStringArgumentError=function(t){function e(n,r){return a(this,e),o(this,t.call(this,c["default"].actionStringArgumentError,n,r))}return i(e,t),e}(d),t.ActionIntegerArgumentError=function(t){function e(n,r){return a(this,e),o(this,t.call(this,c["default"].actionIntegerArgumentError,n,r))}return i(e,t),e}(d),t.ActionPositiveIntegerArgumentError=function(t){function e(n,r){return a(this,e),o(this,t.call(this,c["default"].actionPositiveIntegerArgumentError,n,r))}return i(e,t),e}(d),t.ActionStringOrStringArrayArgumentError=function(t){function e(n,r){return a(this,e),o(this,t.call(this,c["default"].actionStringOrStringArrayArgumentError,n,r))}return i(e,t),e}(d),t.ActionStringArrayElementError=function(t){function e(n,r,i){a(this,e);var s=o(this,t.call(this,c["default"].actionStringArrayElementError,n,r));return s.elementIndex=i,s}return i(e,t),e}(d),t.ActionUnsupportedUrlProtocolError=function(t){function e(n,r){a(this,e);var i=o(this,t.call(this,c["default"].actionUnsupportedUrlProtocolError));return i.argumentName=n,i.protocol=r,i}return i(e,t),e}(l),t.ActionUnsupportedDeviceTypeError=function(t){function e(n,r){return a(this,e),o(this,t.call(this,c["default"].actionUnsupportedDeviceTypeError,n,r))}return i(e,t),e}(d),t.ActionSelectorError=function(t){function e(n,r){a(this,e);var i=o(this,t.call(this,c["default"].actionSelectorError));return i.selectorName=n,i.errMsg=r,i}return i(e,t),e}(l),t.ActionElementNotFoundError=function(t){function e(){return a(this,e),o(this,t.call(this,c["default"].actionElementNotFoundError))}return i(e,t),e}(l),t.ActionElementIsInvisibleError=function(t){function e(){return a(this,e),o(this,t.call(this,c["default"].actionElementIsInvisibleError))}return i(e,t),e}(l),t.ActionAdditionalElementNotFoundError=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c["default"].actionAdditionalElementNotFoundError));return r.argumentName=n,r}return i(e,t),e}(l),t.ActionAdditionalElementIsInvisibleError=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c["default"].actionAdditionalElementIsInvisibleError));return r.argumentName=n,r}return i(e,t),e}(l),t.ActionElementNonEditableError=function(t){function e(){return a(this,e),o(this,t.call(this,c["default"].actionElementNonEditableError))}return i(e,t),e}(l),t.ActionElementNotTextAreaError=function(t){function e(){return a(this,e),o(this,t.call(this,c["default"].actionElementNotTextAreaError))}return i(e,t),e}(l),t.ActionElementNonContentEditableError=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c["default"].actionElementNonContentEditableError));return r.argumentName=n,r}return i(e,t),e}(l),t.ActionRootContainerNotFoundError=function(t){function e(){return a(this,e),o(this,t.call(this,c["default"].actionRootContainerNotFoundError))}return i(e,t),e}(l),t.ActionIncorrectKeysError=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c["default"].actionIncorrectKeysError));return r.argumentName=n,r}return i(e,t),e}(l),t.ActionCanNotFindFileToUploadError=function(t){function e(n){a(this,e);var r=o(this,t.call(this,c["default"].actionCanNotFindFileToUploadError));return r.filePaths=n,r}return i(e,t),e}(l),t.ActionElementIsNotFileInputError=function(t){function e(){return a(this,e),o(this,t.call(this,c["default"].actionElementIsNotFileInputError))}return i(e,t),e}(l),t.ActionElementNotIframe=function(t){function e(){return a(this,e),o(this,t.call(this,c["default"].actionElementNotIframeError))}return i(e,t),e}(l),t.ActionIframeIsNotLoadedError=function(t){function e(){return a(this,e),o(this,t.call(this,c["default"].actionIframeIsNotLoadedError))}return i(e,t),e}(l),t.CurrentIframeIsNotLoadedError=function(t){function e(){return a(this,e),o(this,t.call(this,c["default"].currentIframeIsNotLoadedError))}return i(e,t),e}(l),t.CurrentIframeNotFoundError=function(t){function e(){return a(this,e),o(this,t.call(this,c["default"].currentIframeNotFoundError))}return i(e,t),e}(l),t.CurrentIframeIsInvisibleError=function(t){function e(){return a(this,e),o(this,t.call(this,c["default"].currentIframeIsInvisibleError))}return i(e,t),e}(l)},"type.js":function(t,e,n){t.__esModule=!0,t["default"]={uncaughtErrorOnPage:"uncaughtErrorOnPage",uncaughtErrorInTestCode:"uncaughtErrorInTestCode",uncaughtNonErrorObjectInTestCode:"uncaughtNonErrorObjectInTestCode",uncaughtErrorInClientFunctionCode:"uncaughtErrorInClientFunctionCode",missingAwaitError:"missingAwaitError",actionPositiveIntegerOptionError:"actionPositiveIntegerOptionError",actionBooleanOptionError:"actionBooleanOptionError",actionOptionsTypeError:"actionOptionsTypeError",actionStringArgumentError:"actionStringArgumentError",actionStringOrStringArrayArgumentError:"actionStringOrStringArrayArgumentError",actionStringArrayElementError:"actionStringArrayElementError",actionIntegerArgumentError:"actionIntegerArgumentError",actionPositiveIntegerArgumentError:"actionPositiveIntegerArgumentError",actionSelectorError:"actionSelectorError",actionUnsupportedUrlProtocolError:"actionUnsupportedUrlProtocolError",actionElementNotFoundError:"actionElementNotFoundError",actionElementIsInvisibleError:"actionElementIsInvisibleError",actionAdditionalElementNotFoundError:"actionAdditionalElementNotFoundError",actionAdditionalElementIsInvisibleError:"actionAdditionalElementIsInvisibleError",actionElementNonEditableError:"actionElementNonEditableError",actionElementNotTextAreaError:"actionElementNotTextAreaError",actionElementNonContentEditableError:"actionElementNonContentEditableError",actionElementIsNotFileInputError:"actionElementIsNotFileInputError",actionRootContainerNotFoundError:"actionRootContainerNotFoundError",actionIncorrectKeysError:"actionIncorrectKeysError",actionCanNotFindFileToUploadError:"actionCanNotFindFileToUploadError",actionUnsupportedDeviceTypeError:"actionUnsupportedDeviceTypeError",actionIframeIsNotLoadedError:"actionIframeIsNotLoadedError",currentIframeIsNotLoadedError:"currentIframeIsNotLoadedError",currentIframeNotFoundError:"currentIframeNotFoundError",currentIframeIsInvisibleError:"currentIframeIsInvisibleError",clientFunctionExecutionInterruptionError:"clientFunctionExecutionInterruptionError",domNodeClientFunctionResultError:"domNodeClientFunctionResultError",invalidSelectorResultError:"invalidSelectorResultError",externalAssertionLibraryError:"externalAssertionLibraryError",pageLoadError:"pageLoadError"},e.exports=t["default"]}}},"test-run":{"client-messages.js":function(t,e,n){t.__esModule=!0,t["default"]={ready:"ready",readyForBrowserManipulation:"ready-for-browser-manipulation"},e.exports=t["default"]},commands:{"type.js":function(t,e,n){t.__esModule=!0,t["default"]={click:"click",rightClick:"right-click",doubleClick:"double-click",drag:"drag",dragToElement:"drag-to-element",hover:"hover",typeText:"type-text",selectText:"select-text",selectTextAreaContent:"select-text-area-content",selectEditableContent:"select-editable-content",pressKey:"press-key",wait:"wait",navigateTo:"navigate-to",setFilesToUpload:"set-files-to-upload",clearUpload:"clear-upload",executeClientFunction:"execute-client-function",executeSelector:"execute-selector",takeScreenshot:"take-screenshot",takeScreenshotOnFail:"take-screenshot-on-fail",prepareBrowserManipulation:"prepare-browser-manipulation",resizeWindow:"resize-window",resizeWindowToFitDevice:"resize-window-to-fit-device",switchToIframe:"switch-to-iframe",switchToMainWindow:"switch-to-main-window",testDone:"test-done"},e.exports=t["default"]}}},utils:{"assignable.js":function(t,e,n){function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var o=function(){function t(){r(this,t)}return t.prototype._getAssignableProperties=function(){throw new Error("Not implemented")},t.prototype._assignFrom=function(t,e){if(t)for(var n=this._getAssignableProperties(),r=0;r<n.length;r++){for(var o=n[r],i=o.name,a=o.type,s=o.required,u=o.init,c=i.split("."),l=c.length-1,f=c[l],d=t,h=this,m=0;m<l&&d&&h;m++)d=d[c[m]],h=h[c[m]];if(d&&h){var p=d[f];(void 0!==p||s)&&(e&&a&&a(i,p),h[f]=u?u(i,p):p)}}},t}();t["default"]=o,e.exports=t["default"]}}}}})("testcafe/src/client/driver/index")}initTestCafeClientDrivers(window)}(); |
@@ -1,1 +0,1 @@ | ||
!function(){function e(t){var n=t.document;!function(e){"use strict";var t,n,i,s,o,r={".js":[],".json":[],".css":[],".html":[]},a="function"==typeof require?require:null;return s=function(e){var t=new Error("Could not find module '"+e+"'");return t.code="MODULE_NOT_FOUND",t},o=function(e,t,n){var i,s;if("function"==typeof e[t+n])return t+n;for(i=0;s=r[n][i];++i)if("function"==typeof e[t+s])return t+s;return null},t=function(e,i,r,a,l,u){var d,c,f,h,p,m;for(r=r.split(/[\\/]/),d=r.pop(),"."!==d&&".."!==d||(r.push(d),d="");null!=(c=r.shift());)if(c&&"."!==c&&(".."===c?(e=i.pop(),u=u.slice(0,u.lastIndexOf("/"))):(i.push(e),e=e[c],u+="/"+c),!e))throw s(a);if(d&&"function"!=typeof e[d]&&(m=o(e,d,".js"),m||(m=o(e,d,".json")),m||(m=o(e,d,".css")),m||(m=o(e,d,".html")),m?d=m:2!==l&&"object"==typeof e[d]&&(i.push(e),e=e[d],u+="/"+d,d="")),!d)return 1!==l&&e[":mainpath:"]?t(e,i,e[":mainpath:"],a,1,u):t(e,i,"index",a,2,u);if(p=e[d],!p)throw s(a);return p.hasOwnProperty("module")?p.module.exports:(f={},p.module=h={exports:f,id:u+"/"+d},p.call(f,f,h,n(e,i,u)),h.exports)},i=function(n,i,o,r){var l,u=o,d=o.charAt(0),c=0;if("/"===d){if(u=u.slice(1),n=e["/"],!n){if(a)return a(o);throw s(o)}r="/",i=[]}else if("."!==d){if(l=u.split("/",1)[0],n=e[l],!n){if(a)return a(o);throw s(o)}r=l,i=[],u=u.slice(l.length+1),u||(u=n[":mainpath:"],u?c=1:(u="index",c=2))}return t(n,i,u,o,c,r)},(n=function(e,t,n){return function(s){return i(e,[].concat(t),s,n)}})(e,[],"")}({testcafe:{src:{client:{runner:{deps:{"hammerhead.js":function(e,n,i){e.__esModule=!0,e["default"]=t["%hammerhead%"],n.exports=e["default"]}},utils:{"iframe.js":function(e,t,n){function i(e){return e&&e.__esModule?e:{"default":e}}e.__esModule=!0,e.sendRequestToFrame=void 0;var s=n("../deps/hammerhead"),o=i(s),r=o["default"].Promise,a=o["default"].eventSandbox.message;e.sendRequestToFrame=function(e,t,n){return new r(function(i){function s(e){e.message.cmd===t&&(a.off(a.SERVICE_MSG_RECEIVED_EVENT,s),i(e.message))}a.on(a.SERVICE_MSG_RECEIVED_EVENT,s),a.sendServiceMsg(e,n)})}}}},ui:{cursor:{"iframe-cursor.js":function(e,n,i){function s(e){return e&&e.__esModule?e:{"default":e}}e.__esModule=!0;var o=i("./../deps/hammerhead"),r=s(o),a=i("./messages"),l=s(a),u=i("../../runner/utils/iframe"),d=r["default"].utils.browser,c=d.isIE?1:0;e["default"]={move:function(e,n){var i={cmd:l["default"].moveRequest,x:e+c,y:n+c};return(0,u.sendRequestToFrame)(i,l["default"].moveResponse,t.parent)},leftButtonDown:function(){return(0,u.sendRequestToFrame)({cmd:l["default"].leftButtonDownRequest},l["default"].leftButtonDownResponse,t.parent)},rightButtonDown:function(){return(0,u.sendRequestToFrame)({cmd:l["default"].rightButtonDownRequest},l["default"].rightButtonDownResponse,t.parent)},buttonUp:function(){return(0,u.sendRequestToFrame)({cmd:l["default"].buttonUpRequest},l["default"].buttonUpResponse,t.parent)}},n.exports=e["default"]},"index.js":function(e,i,s){function o(e){return e&&e.__esModule?e:{"default":e}}e.__esModule=!0;var r=s("./../deps/hammerhead"),a=o(r),l=s("./../deps/testcafe-core"),u=o(l),d=s("./messages"),c=o(d),f=a["default"].Promise,h=a["default"].shadowUI,p=a["default"].utils.browser,m=a["default"].eventSandbox.message,g=u["default"].styleUtils,v=u["default"].positionUtils,E=u["default"].eventUtils,_="cursor",w="touch",b="l-mouse-down",x="r-mouse-down",y=[b,x].join(" ");m.on(m.SERVICE_MSG_RECEIVED_EVENT,function(e){var t=e.message;switch(t.cmd){case c["default"].moveRequest:var n=v.getIframePointRelativeToParentFrame({x:t.x,y:t.y},e.source);C.move(n.x,n.y).then(function(){return m.sendServiceMsg({cmd:c["default"].moveResponse},e.source)});break;case c["default"].leftButtonDownRequest:C.leftButtonDown().then(function(){return m.sendServiceMsg({cmd:c["default"].leftButtonDownResponse},e.source)});break;case c["default"].rightButtonDownRequest:C.rightButtonDown().then(function(){return m.sendServiceMsg({cmd:c["default"].rightButtonDownResponse},e.source)});break;case c["default"].buttonUpRequest:C.buttonUp().then(function(){return m.sendServiceMsg({cmd:c["default"].buttonUpResponse},e.source)})}});var C={cursorElement:null,x:50,y:50,pointerOffsetX:0,pointerOffsetY:0,_createElement:function(){var e=this;this.cursorElement=n.createElement("div"),h.addClass(this.cursorElement,_),p.isTouchDevice&&!p.isIE&&(h.addClass(this.cursorElement,w),this.pointerOffsetX=Math.ceil(g.getWidth(this.cursorElement)/2),this.pointerOffsetY=Math.ceil(g.getHeight(this.cursorElement)/2)),h.getRoot().appendChild(this.cursorElement),E.bind(t,"scroll",function(){return e.move(e.x,e.y)})},isVisible:function(){return this.cursorElement&&"hidden"!==g.get(this.cursorElement,"visibility")},hide:function(){this.cursorElement||this._createElement(),g.set(this.cursorElement,"visibility","hidden")},show:function(){this.cursorElement||this._createElement(),g.set(this.cursorElement,"visibility","")},move:function(e,t){return this.x=e,this.y=t,this.cursorElement||this._createElement(),g.set(this.cursorElement,{left:this.x+g.getScrollLeft(n)-this.pointerOffsetX+"px",top:this.y+g.getScrollTop(n)-this.pointerOffsetY+"px"}),f.resolve()},leftButtonDown:function(){return this.cursorElement||this._createElement(),h.removeClass(this.cursorElement,y),h.addClass(this.cursorElement,b),f.resolve()},rightButtonDown:function(){return this.cursorElement||this._createElement(),h.removeClass(this.cursorElement,y),h.addClass(this.cursorElement,x),f.resolve()},buttonUp:function(){return this.cursorElement||this._createElement(),h.removeClass(this.cursorElement,y),f.resolve()}};e["default"]=C,i.exports=e["default"]},"messages.js":function(e,t,n){e.__esModule=!0,e["default"]={moveRequest:"ui|cursor|move|request",leftButtonDownRequest:"ui|cursor|leftbuttondown|request",rightButtonDownRequest:"ui|cursor|rightbuttondown|request",buttonUpRequest:"ui|cursor|buttonup|request",moveResponse:"ui|cursor|move|response",leftButtonDownResponse:"ui|cursor|leftbuttondown|response",rightButtonDownResponse:"ui|cursor|rightbuttondown|response",buttonUpResponse:"ui|cursor|buttonup|response"},t.exports=e["default"]}},deps:{"hammerhead.js":function(e,n,i){e.__esModule=!0,e["default"]=t["%hammerhead%"],n.exports=e["default"]},"testcafe-core.js":function(e,n,i){e.__esModule=!0,e["default"]=t["%testCafeCore%"],n.exports=e["default"]}},"index.js":function(n,i,s){function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function r(e){return e&&e.__esModule?e:{"default":e}}var a=s("./deps/hammerhead"),l=r(a),u=s("./select-element"),d=o(u),c=s("./modal-background"),f=o(c),h=s("./progress-panel"),p=r(h),m=s("./cursor"),g=r(m),v=s("./cursor/iframe-cursor"),E=o(v);n.cursorUI=g["default"],n.iframeCursorUI=E,n.selectElement=d,n.modalBackground=f,n.ProgressPanel=p["default"],n.get=s,n.hide=function(){l["default"].shadowUI.getRoot().style.visibility="hidden"},n.show=function(){l["default"].shadowUI.getRoot().style.visibility=""},Object.defineProperty(t,"%testCafeUI%",{enumerable:!1,configurable:!1,writable:!1,value:n}),l["default"].on(l["default"].EVENTS.evalIframeScript,function(t){return e(t.iframe.contentWindow,!0)})},"modal-background.js":function(e,i,s){function o(e){return e&&e.__esModule?e:{"default":e}}function r(){var e=_.getRoot();M=n.createElement("div"),e.appendChild(M),_.addClass(M,y),S=n.createElement("div"),S.textContent=x,e.appendChild(S),_.addClass(S,C),R=n.createElement("div"),b.set(R,"visibility","hidden"),e.appendChild(R),_.addClass(R,D)}function a(){var e=b.getHeight(t),n=b.getWidth(t),i=!b.hasDimensions(S);i&&(b.set(S,"visibility","hidden"),b.set(S,"display","block")),b.set(S,{left:Math.max((n-b.getWidth(S))/2,0)+"px",top:Math.max((e-b.getHeight(S))/2,0)+"px"}),i&&(b.set(S,"display","none"),b.set(S,"visibility",""))}function l(){var e=function(){var e=b.getHeight(t),n=b.getWidth(t);b.set(M,"width",n+"px"),b.set(M,"height",e+"px"),b.set(R,{left:Math.round((n-b.getWidth(R))/2)+"px",top:Math.round((e-b.getHeight(R))/2)+"px"})};e(),w.bind(t,"resize",e)}function u(){r(),l(),a(),O=!0}function d(){var e=!1,i=function(){u(),b.set(M,"opacity",T),b.set(M,"display","block"),b.set(S,"display","block"),e=!0},s=function o(){e||(n.body?i():t.setTimeout(o,0))};s(),w.documentReady().then(function(){e||i()})}function c(e){O||u(),b.set(M,"opacity",e?0:I),b.set(M,"display","block")}function f(){O&&(b.set(S,"display","none"),b.set(M,"display","none"))}function h(){b.set(R,"visibility","visible")}function p(){b.set(R,"visibility","hidden")}e.__esModule=!0,e.initAndShowLoadingText=d,e.show=c,e.hide=f,e.showLoadingIcon=h,e.hideLoadingIcon=p;var m=s("./deps/hammerhead"),g=o(m),v=s("./deps/testcafe-core"),E=o(v),_=g["default"].shadowUI,w=E["default"].eventUtils,b=E["default"].styleUtils,x="Loading page...",y="modal-background",C="loading-text",I=.7,T=.8,D="loading-icon",M=null,S=null,R=null,O=!1},"progress-panel":{"index.js":function(e,i,s){function o(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var a=s("../deps/hammerhead"),l=o(a),u=s("../deps/testcafe-core"),d=o(u),c=s("./progress-bar"),f=o(c),h=l["default"].shadowUI,p=d["default"].eventUtils,m=d["default"].styleUtils,g="progress-panel",v="title",E="content",_=100,w=10,b=300,x=200,y=600,C=1e3,I=function(){function e(){var t=this;r(this,e),this.startTime=null,this.openingTimeout=null,this.updateInterval=null,this.animationInterval=null,this.panelDiv=n.createElement("div"),h.getRoot().appendChild(this.panelDiv),this.titleDiv=n.createElement("div"),this.panelDiv.appendChild(this.titleDiv),this.contentDiv=n.createElement("div"),this.panelDiv.appendChild(this.contentDiv),h.addClass(this.panelDiv,g),h.addClass(this.titleDiv,v),h.addClass(this.contentDiv,E),e._showAtWindowCenter(this.panelDiv),this.progressBar=new f["default"](this.contentDiv),this.disposePanel=function(){return e._showAtWindowCenter(t.panelDiv)}}return e._getInvisibleElementProperty=function(e,t){var n="none"===m.get(e,"display");n&&m.set(e,"display","block");var i=e[t];return n&&m.set(e,"display","none"),i},e._showAtWindowCenter=function(n){var i=e._getInvisibleElementProperty(n,"offsetHeight"),s=e._getInvisibleElementProperty(n,"offsetWidth"),o=Math.round(m.getHeight(t)/2-i/2),r=Math.round(m.getWidth(t)/2-s/2);m.set(n,{left:r+"px",top:o+"px"})},e.prototype._setCurrentProgress=function(){var e=Math.round((Date.now()-this.startTime)/this.maxTimeout*100);this.progressBar.setValue(e)},e.prototype._setSuccess=function(e){this.progressBar.setSuccess(e)},e.prototype._stopAnimation=function(){t.clearInterval(this.animationInterval)},e.prototype._animate=function(e,n,i,s){var o=this,r=Date.now(),a=i?0:1,l=0,u=0,d=0;i&&(m.set(e,"opacity",a),m.set(e,"display","block")),this._stopAnimation(),this.animationInterval=t.setInterval(function(){l=Date.now()-r,u=Math.min(l/n,1),d=.5-Math.cos(u*Math.PI)/2,m.set(e,"opacity",a+(i?d:-d)),1===u&&(o._stopAnimation(),s&&s())},w)},e.prototype._showPanel=function(){p.bind(t,"resize",this.disposePanel),this._animate(this.panelDiv,x,!0)},e.prototype._hidePanel=function(e){var n=this;this.startTime=null,p.unbind(t,"resize",this.disposePanel),this._animate(this.panelDiv,e?0:y,!1,function(){return m.set(n.panelDiv,"display","none")})},e.prototype.show=function(e,n){var i=this;this.startTime=Date.now(),this.maxTimeout=n,this.titleDiv.textContent=e,this._setSuccess(!1),this.openingTimeout=t.setTimeout(function(){i.openingTimeout=null,i._setCurrentProgress(),i._showPanel(),i.updateInterval=t.setInterval(function(){return i._setCurrentProgress()},_)},b)},e.prototype.close=function(e){var n=this;e&&this._setSuccess(!0),this.openingTimeout&&(t.clearTimeout(this.openingTimeout),this.openingTimeout=null),this.updateInterval&&(t.clearInterval(this.updateInterval),this.updateInterval=null),e?this.startTime&&Date.now()-this.startTime<C?t.setTimeout(function(){t.setTimeout(function(){return n._hidePanel(!1)},x)},_):t.setTimeout(function(){return n._hidePanel(!1)},x):this._hidePanel(!0)},e}();e["default"]=I,i.exports=e["default"]},"progress-bar.js":function(e,t,i){function s(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var r=i("../deps/hammerhead"),a=s(r),l=i("../deps/testcafe-core"),u=s(l),d=a["default"].shadowUI,c=u["default"].styleUtils,f="progress-bar",h="value",p="success",m=function(){function e(t){o(this,e),this.containerElement=n.createElement("div"),this.valueElement=n.createElement("div"),t.appendChild(this.containerElement),this.containerElement.appendChild(this.valueElement),d.addClass(this.containerElement,f),d.addClass(this.valueElement,h)}return e.prototype.setValue=function(e){e="number"!=typeof e?0:Math.min(Math.max(e,0),100),c.set(this.valueElement,"width",e+"%")},e.prototype.setSuccess=function(e){e?d.addClass(this.containerElement,p):d.removeClass(this.containerElement,p)},e}();e["default"]=m,t.exports=e["default"]}},"select-element.js":function(e,i,s){function o(e){return e&&e.__esModule?e:{"default":e}}function r(e){(e.target||e.srcElement)===B||T.containsElement(B,e.target)||T.containsElement(j,e.target)||c()}function a(e,t){var i=n.createElement("div"),s=e.disabled||"optgroup"===T.getTagName(e.parentElement)&&e.parentElement.disabled;i.textContent=e.text,t.appendChild(i),x.addClass(i,U),s&&(x.addClass(i,P),D.set(i,"color",D.get(e,"color"))),s&&y.isWebKit?M.bind(i,"click",function(){return!1}):M.bind(i,"click",function(){var e=B.selectedIndex,t=S.indexOf(k,this),n=B.getElementsByTagName("option")[t],i=!s&&t!==e,o=y.isSafari&&y.hasTouchEvents||y.isAndroid;i&&!y.isIE&&(B.selectedIndex=t),y.isFirefox||y.isIE||!i||C.change(B),(y.isFirefox||y.isIE)&&C.mousedown(y.isFirefox?n:B),o||C.mouseup(y.isFirefox?n:B),(y.isFirefox||y.isIE)&&i&&(y.isIE&&(B.selectedIndex=t),C.change(B)),o||C.click(y.isFirefox||y.isIE?n:B),s||c()}),k.push(i)}function l(e,t){var i=n.createElement("div");i.textContent=e.label||" ",t.appendChild(i),x.addClass(i,O),i.disabled&&(x.addClass(i,P),D.set(i,"color",D.get(e,"color"))),u(e.children,i),F.push(i)}function u(e,t){for(var n=0;n<e.length;n++)T.isOptionElement(e[n])?a(e[n],t):"optgroup"===T.getTagName(e[n])&&l(e[n],t)}function d(e){var i=e.children;if(i.length){if(B){var s=e===B;if(c(),s)return}B=e,j=n.createElement("div"),x.getRoot().appendChild(j),x.addClass(j,R),u(i,j),t.setTimeout(function(){M.bind(n,"mousedown",r)},0),D.set(j,{position:"absolute",fontSize:D.get(B,"fontSize"),fontFamily:D.get(B,"fontFamily"),minWidth:D.getWidth(B)+"px",left:I.getOffsetPosition(B).left+"px",height:T.getSelectVisibleChildren(e).length>q?D.getOptionHeight(e)*q:""});var o=I.getOffsetPosition(B).top,a=D.getHeight(j),l=o+D.getHeight(B)+2;if(l+a>D.getScrollTop(t)+D.getHeight(t)){var d=o-3-a;d>=D.getScrollTop(t)&&(l=d)}D.set(j,"top",l+"px")}}function c(){T.remove(j),M.unbind(n,"mousedown",r),j=null,B=null,k=[],F=[]}function f(e){return e?e===B:!!B}function h(e){var t="optgroup"===T.getTagName(e),n=t?T.getOptionGroupIndex(B,e):T.getOptionIndex(B,e);return t?F[n]:k[n]}function p(e){var t=T.getSelectParent(e);if(t){var n=D.getSelectElementSize(t),i=D.getOptionHeight(t),s=0,o=Math.max(D.getScrollTop(t)/i,0),r=o+n-1,a=T.getChildVisibleIndex(t,e);a<o?(s=i*(o-a),D.setScrollTop(t,Math.max(D.getScrollTop(t)-s,0))):a>r&&(s=i*(a-r),D.setScrollTop(t,D.getScrollTop(t)+s))}}function m(e){var t=T.getSelectParent(e);if(!t)return{x:0,y:0};var n=D.getOptionHeight(t),i=I.getElementRectangle(e);return{x:Math.round(i.left+i.width/2),y:Math.round(i.top+n/2)}}function g(e,t){var n=D.getSelectElementSize(e),i=!D.hasDimensions(x.select("."+R)[0]);if(/down|up/.test(t)||!y.isIE&&(n<=1||y.isFirefox)&&(i||y.isFirefox)&&/left|right/.test(t)){for(var s=e.querySelectorAll("option"),o=[],r=0;r<s.length;r++){var a=s[r].parentElement;s[r].disabled||"optgroup"===T.getTagName(a)&&a.disabled||o.push(s[r])}var l=S.indexOf(o,s[e.selectedIndex]),u=l+(/down|right/.test(t)?1:-1);u>=0&&u<o.length&&(e.selectedIndex=S.indexOf(s,o[u]),C.change(e))}}function v(e){var t=T.getSelectParent(e);if(!t)return!0;var n=f(t),i=D.getSelectElementSize(t);return n||i>1}e.__esModule=!0,e.expandOptionList=d,e.collapseOptionList=c,e.isOptionListExpanded=f,e.getEmulatedChildElement=h,e.scrollOptionListByChild=p,e.getSelectChildCenter=m,e.switchOptionsByKeys=g,e.isOptionElementVisible=v;var E=s("./deps/hammerhead"),_=o(E),w=s("./deps/testcafe-core"),b=o(w),x=_["default"].shadowUI,y=_["default"].utils.browser,C=_["default"].eventSandbox.eventSimulator,I=b["default"].positionUtils,T=b["default"].domUtils,D=b["default"].styleUtils,M=b["default"].eventUtils,S=b["default"].arrayUtils,R="tcOptionList",O="tcOptionGroup",U="tcOption",P="disabled",q=y.isIE?30:20,B=null,j=null,F=[],k=[]}}}}}})("testcafe/src/client/ui/index")}e(window)}(); | ||
!function(){function e(t){var n=t.document;!function(e){"use strict";var t,n,i,s,o,r={".js":[],".json":[],".css":[],".html":[]},a="function"==typeof require?require:null;return s=function(e){var t=new Error("Could not find module '"+e+"'");return t.code="MODULE_NOT_FOUND",t},o=function(e,t,n){var i,s;if("function"==typeof e[t+n])return t+n;for(i=0;s=r[n][i];++i)if("function"==typeof e[t+s])return t+s;return null},t=function(e,i,r,a,l,u){var d,c,f,h,p,m;for(r=r.split(/[\\/]/),d=r.pop(),"."!==d&&".."!==d||(r.push(d),d="");null!=(c=r.shift());)if(c&&"."!==c&&(".."===c?(e=i.pop(),u=u.slice(0,u.lastIndexOf("/"))):(i.push(e),e=e[c],u+="/"+c),!e))throw s(a);if(d&&"function"!=typeof e[d]&&(m=o(e,d,".js"),m||(m=o(e,d,".json")),m||(m=o(e,d,".css")),m||(m=o(e,d,".html")),m?d=m:2!==l&&"object"==typeof e[d]&&(i.push(e),e=e[d],u+="/"+d,d="")),!d)return 1!==l&&e[":mainpath:"]?t(e,i,e[":mainpath:"],a,1,u):t(e,i,"index",a,2,u);if(p=e[d],!p)throw s(a);return p.hasOwnProperty("module")?p.module.exports:(f={},p.module=h={exports:f,id:u+"/"+d},p.call(f,f,h,n(e,i,u)),h.exports)},i=function(n,i,o,r){var l,u=o,d=o.charAt(0),c=0;if("/"===d){if(u=u.slice(1),n=e["/"],!n){if(a)return a(o);throw s(o)}r="/",i=[]}else if("."!==d){if(l=u.split("/",1)[0],n=e[l],!n){if(a)return a(o);throw s(o)}r=l,i=[],u=u.slice(l.length+1),u||(u=n[":mainpath:"],u?c=1:(u="index",c=2))}return t(n,i,u,o,c,r)},(n=function(e,t,n){return function(s){return i(e,[].concat(t),s,n)}})(e,[],"")}({testcafe:{src:{client:{ui:{cursor:{"iframe-cursor.js":function(e,n,i){function s(e){return e&&e.__esModule?e:{"default":e}}e.__esModule=!0;var o=i("../deps/hammerhead"),r=s(o),a=i("../deps/testcafe-core"),l=i("./messages"),u=s(l),d=r["default"].utils.browser,c=d.isIE?1:0;e["default"]={move:function(e,n){var i={cmd:u["default"].moveRequest,x:e+c,y:n+c};return(0,a.sendRequestToFrame)(i,u["default"].moveResponse,t.parent)},leftButtonDown:function(){return(0,a.sendRequestToFrame)({cmd:u["default"].leftButtonDownRequest},u["default"].leftButtonDownResponse,t.parent)},rightButtonDown:function(){return(0,a.sendRequestToFrame)({cmd:u["default"].rightButtonDownRequest},u["default"].rightButtonDownResponse,t.parent)},buttonUp:function(){return(0,a.sendRequestToFrame)({cmd:u["default"].buttonUpRequest},u["default"].buttonUpResponse,t.parent)}},n.exports=e["default"]},"index.js":function(e,i,s){function o(e){return e&&e.__esModule?e:{"default":e}}e.__esModule=!0;var r=s("./../deps/hammerhead"),a=o(r),l=s("./../deps/testcafe-core"),u=o(l),d=s("./messages"),c=o(d),f=a["default"].Promise,h=a["default"].shadowUI,p=a["default"].utils.browser,m=a["default"].eventSandbox.message,g=u["default"].styleUtils,v=u["default"].positionUtils,E=u["default"].eventUtils,w="cursor",b="touch",y="l-mouse-down",x="r-mouse-down",_=[y,x].join(" ");m.on(m.SERVICE_MSG_RECEIVED_EVENT,function(e){var t=e.message;switch(t.cmd){case c["default"].moveRequest:var n=v.getIframePointRelativeToParentFrame({x:t.x,y:t.y},e.source);C.move(n.x,n.y).then(function(){return m.sendServiceMsg({cmd:c["default"].moveResponse},e.source)});break;case c["default"].leftButtonDownRequest:C.leftButtonDown().then(function(){return m.sendServiceMsg({cmd:c["default"].leftButtonDownResponse},e.source)});break;case c["default"].rightButtonDownRequest:C.rightButtonDown().then(function(){return m.sendServiceMsg({cmd:c["default"].rightButtonDownResponse},e.source)});break;case c["default"].buttonUpRequest:C.buttonUp().then(function(){return m.sendServiceMsg({cmd:c["default"].buttonUpResponse},e.source)})}});var C={cursorElement:null,x:50,y:50,pointerOffsetX:0,pointerOffsetY:0,_createElement:function(){var e=this;this.cursorElement=n.createElement("div"),h.addClass(this.cursorElement,w),p.isTouchDevice&&!p.isIE&&(h.addClass(this.cursorElement,b),this.pointerOffsetX=Math.ceil(g.getWidth(this.cursorElement)/2),this.pointerOffsetY=Math.ceil(g.getHeight(this.cursorElement)/2)),h.getRoot().appendChild(this.cursorElement),E.bind(t,"scroll",function(){return e.move(e.x,e.y)})},isVisible:function(){return this.cursorElement&&"hidden"!==g.get(this.cursorElement,"visibility")},hide:function(){this.cursorElement||this._createElement(),g.set(this.cursorElement,"visibility","hidden")},show:function(){this.cursorElement||this._createElement(),g.set(this.cursorElement,"visibility","")},move:function(e,t){return this.x=e,this.y=t,this.cursorElement||this._createElement(),g.set(this.cursorElement,{left:this.x+g.getScrollLeft(n)-this.pointerOffsetX+"px",top:this.y+g.getScrollTop(n)-this.pointerOffsetY+"px"}),f.resolve()},leftButtonDown:function(){return this.cursorElement||this._createElement(),h.removeClass(this.cursorElement,_),h.addClass(this.cursorElement,y),f.resolve()},rightButtonDown:function(){return this.cursorElement||this._createElement(),h.removeClass(this.cursorElement,_),h.addClass(this.cursorElement,x),f.resolve()},buttonUp:function(){return this.cursorElement||this._createElement(),h.removeClass(this.cursorElement,_),f.resolve()}};e["default"]=C,i.exports=e["default"]},"messages.js":function(e,t,n){e.__esModule=!0,e["default"]={moveRequest:"ui|cursor|move|request",leftButtonDownRequest:"ui|cursor|leftbuttondown|request",rightButtonDownRequest:"ui|cursor|rightbuttondown|request",buttonUpRequest:"ui|cursor|buttonup|request",moveResponse:"ui|cursor|move|response",leftButtonDownResponse:"ui|cursor|leftbuttondown|response",rightButtonDownResponse:"ui|cursor|rightbuttondown|response",buttonUpResponse:"ui|cursor|buttonup|response"},t.exports=e["default"]}},deps:{"hammerhead.js":function(e,n,i){e.__esModule=!0,e["default"]=t["%hammerhead%"],n.exports=e["default"]},"testcafe-core.js":function(e,n,i){e.__esModule=!0,e["default"]=t["%testCafeCore%"],n.exports=e["default"]}},"index.js":function(n,i,s){function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function r(e){return e&&e.__esModule?e:{"default":e}}var a=s("./deps/hammerhead"),l=r(a),u=s("./select-element"),d=o(u),c=s("./modal-background"),f=o(c),h=s("./progress-panel"),p=r(h),m=s("./cursor"),g=r(m),v=s("./cursor/iframe-cursor"),E=o(v);n.cursorUI=g["default"],n.iframeCursorUI=E,n.selectElement=d,n.modalBackground=f,n.ProgressPanel=p["default"],n.get=s,n.hide=function(){l["default"].shadowUI.getRoot().style.visibility="hidden"},n.show=function(){l["default"].shadowUI.getRoot().style.visibility=""},Object.defineProperty(t,"%testCafeUI%",{enumerable:!1,configurable:!1,writable:!1,value:n}),l["default"].on(l["default"].EVENTS.evalIframeScript,function(t){return e(t.iframe.contentWindow,!0)})},"modal-background.js":function(e,i,s){function o(e){return e&&e.__esModule?e:{"default":e}}function r(){var e=w.getRoot();M=n.createElement("div"),e.appendChild(M),w.addClass(M,_),S=n.createElement("div"),S.textContent=x,e.appendChild(S),w.addClass(S,C),R=n.createElement("div"),y.set(R,"visibility","hidden"),e.appendChild(R),w.addClass(R,T)}function a(){var e=y.getHeight(t),n=y.getWidth(t),i=!y.hasDimensions(S);i&&(y.set(S,"visibility","hidden"),y.set(S,"display","block")),y.set(S,{left:Math.max((n-y.getWidth(S))/2,0)+"px",top:Math.max((e-y.getHeight(S))/2,0)+"px"}),i&&(y.set(S,"display","none"),y.set(S,"visibility",""))}function l(){var e=function(){var e=y.getHeight(t),n=y.getWidth(t);y.set(M,"width",n+"px"),y.set(M,"height",e+"px"),y.set(R,{left:Math.round((n-y.getWidth(R))/2)+"px",top:Math.round((e-y.getHeight(R))/2)+"px"})};e(),b.bind(t,"resize",e)}function u(){r(),l(),a(),O=!0}function d(){var e=!1,i=function(){u(),y.set(M,"opacity",D),y.set(M,"display","block"),y.set(S,"display","block"),e=!0},s=function o(){e||(n.body?i():t.setTimeout(o,0))};s(),b.documentReady().then(function(){e||i()})}function c(e){O||u(),y.set(M,"opacity",e?0:I),y.set(M,"display","block")}function f(){O&&(y.set(S,"display","none"),y.set(M,"display","none"))}function h(){y.set(R,"visibility","visible")}function p(){y.set(R,"visibility","hidden")}e.__esModule=!0,e.initAndShowLoadingText=d,e.show=c,e.hide=f,e.showLoadingIcon=h,e.hideLoadingIcon=p;var m=s("./deps/hammerhead"),g=o(m),v=s("./deps/testcafe-core"),E=o(v),w=g["default"].shadowUI,b=E["default"].eventUtils,y=E["default"].styleUtils,x="Loading page...",_="modal-background",C="loading-text",I=.7,D=.8,T="loading-icon",M=null,S=null,R=null,O=!1},"progress-panel":{"index.js":function(e,i,s){function o(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var a=s("../deps/hammerhead"),l=o(a),u=s("../deps/testcafe-core"),d=o(u),c=s("./progress-bar"),f=o(c),h=l["default"].shadowUI,p=d["default"].eventUtils,m=d["default"].styleUtils,g="progress-panel",v="title",E="content",w=100,b=10,y=300,x=200,_=600,C=1e3,I=function(){function e(){var t=this;r(this,e),this.startTime=null,this.openingTimeout=null,this.updateInterval=null,this.animationInterval=null,this.panelDiv=n.createElement("div"),h.getRoot().appendChild(this.panelDiv),this.titleDiv=n.createElement("div"),this.panelDiv.appendChild(this.titleDiv),this.contentDiv=n.createElement("div"),this.panelDiv.appendChild(this.contentDiv),h.addClass(this.panelDiv,g),h.addClass(this.titleDiv,v),h.addClass(this.contentDiv,E),e._showAtWindowCenter(this.panelDiv),this.progressBar=new f["default"](this.contentDiv),this.disposePanel=function(){return e._showAtWindowCenter(t.panelDiv)}}return e._getInvisibleElementProperty=function(e,t){var n="none"===m.get(e,"display");n&&m.set(e,"display","block");var i=e[t];return n&&m.set(e,"display","none"),i},e._showAtWindowCenter=function(n){var i=e._getInvisibleElementProperty(n,"offsetHeight"),s=e._getInvisibleElementProperty(n,"offsetWidth"),o=Math.round(m.getHeight(t)/2-i/2),r=Math.round(m.getWidth(t)/2-s/2);m.set(n,{left:r+"px",top:o+"px"})},e.prototype._setCurrentProgress=function(){var e=Math.round((Date.now()-this.startTime)/this.maxTimeout*100);this.progressBar.setValue(e)},e.prototype._setSuccess=function(e){this.progressBar.setSuccess(e)},e.prototype._stopAnimation=function(){t.clearInterval(this.animationInterval)},e.prototype._animate=function(e,n,i,s){var o=this,r=Date.now(),a=i?0:1,l=0,u=0,d=0;i&&(m.set(e,"opacity",a),m.set(e,"display","block")),this._stopAnimation(),this.animationInterval=t.setInterval(function(){l=Date.now()-r,u=Math.min(l/n,1),d=.5-Math.cos(u*Math.PI)/2,m.set(e,"opacity",a+(i?d:-d)),1===u&&(o._stopAnimation(),s&&s())},b)},e.prototype._showPanel=function(){p.bind(t,"resize",this.disposePanel),this._animate(this.panelDiv,x,!0)},e.prototype._hidePanel=function(e){var n=this;this.startTime=null,p.unbind(t,"resize",this.disposePanel),this._animate(this.panelDiv,e?0:_,!1,function(){return m.set(n.panelDiv,"display","none")})},e.prototype.show=function(e,n){var i=this;this.startTime=Date.now(),this.maxTimeout=n,this.titleDiv.textContent=e,this._setSuccess(!1),this.openingTimeout=t.setTimeout(function(){i.openingTimeout=null,i._setCurrentProgress(),i._showPanel(),i.updateInterval=t.setInterval(function(){return i._setCurrentProgress()},w)},y)},e.prototype.close=function(e){var n=this;e&&this._setSuccess(!0),this.openingTimeout&&(t.clearTimeout(this.openingTimeout),this.openingTimeout=null),this.updateInterval&&(t.clearInterval(this.updateInterval),this.updateInterval=null),e?this.startTime&&Date.now()-this.startTime<C?t.setTimeout(function(){t.setTimeout(function(){return n._hidePanel(!1)},x)},w):t.setTimeout(function(){return n._hidePanel(!1)},x):this._hidePanel(!0)},e}();e["default"]=I,i.exports=e["default"]},"progress-bar.js":function(e,t,i){function s(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var r=i("../deps/hammerhead"),a=s(r),l=i("../deps/testcafe-core"),u=s(l),d=a["default"].shadowUI,c=u["default"].styleUtils,f="progress-bar",h="value",p="success",m=function(){function e(t){o(this,e),this.containerElement=n.createElement("div"),this.valueElement=n.createElement("div"),t.appendChild(this.containerElement),this.containerElement.appendChild(this.valueElement),d.addClass(this.containerElement,f),d.addClass(this.valueElement,h)}return e.prototype.setValue=function(e){e="number"!=typeof e?0:Math.min(Math.max(e,0),100),c.set(this.valueElement,"width",e+"%")},e.prototype.setSuccess=function(e){e?d.addClass(this.containerElement,p):d.removeClass(this.containerElement,p)},e}();e["default"]=m,t.exports=e["default"]}},"select-element.js":function(e,i,s){function o(e){return e&&e.__esModule?e:{"default":e}}function r(e){(e.target||e.srcElement)===q||D.containsElement(q,e.target)||D.containsElement(j,e.target)||c()}function a(e,t){var i=n.createElement("div"),s=e.disabled||"optgroup"===D.getTagName(e.parentElement)&&e.parentElement.disabled;i.textContent=e.text,t.appendChild(i),x.addClass(i,U),s&&(x.addClass(i,P),T.set(i,"color",T.get(e,"color"))),s&&_.isWebKit?M.bind(i,"click",function(){return!1}):M.bind(i,"click",function(){var e=q.selectedIndex,t=S.indexOf(F,this),n=q.getElementsByTagName("option")[t],i=!s&&t!==e,o=_.isSafari&&_.hasTouchEvents||_.isAndroid;i&&!_.isIE&&(q.selectedIndex=t),_.isFirefox||_.isIE||!i||C.change(q),(_.isFirefox||_.isIE)&&C.mousedown(_.isFirefox?n:q),o||C.mouseup(_.isFirefox?n:q),(_.isFirefox||_.isIE)&&i&&(_.isIE&&(q.selectedIndex=t),C.change(q)),o||C.click(_.isFirefox||_.isIE?n:q),s||c()}),F.push(i)}function l(e,t){var i=n.createElement("div");i.textContent=e.label||" ",t.appendChild(i),x.addClass(i,O),i.disabled&&(x.addClass(i,P),T.set(i,"color",T.get(e,"color"))),u(e.children,i),k.push(i)}function u(e,t){for(var n=0;n<e.length;n++)D.isOptionElement(e[n])?a(e[n],t):"optgroup"===D.getTagName(e[n])&&l(e[n],t)}function d(e){var i=e.children;if(i.length){if(q){var s=e===q;if(c(),s)return}q=e,j=n.createElement("div"),x.getRoot().appendChild(j),x.addClass(j,R),u(i,j),t.setTimeout(function(){M.bind(n,"mousedown",r)},0),T.set(j,{position:"absolute",fontSize:T.get(q,"fontSize"),fontFamily:T.get(q,"fontFamily"),minWidth:T.getWidth(q)+"px",left:I.getOffsetPosition(q).left+"px",height:D.getSelectVisibleChildren(e).length>B?T.getOptionHeight(e)*B:""});var o=I.getOffsetPosition(q).top,a=T.getHeight(j),l=o+T.getHeight(q)+2;if(l+a>T.getScrollTop(t)+T.getHeight(t)){var d=o-3-a;d>=T.getScrollTop(t)&&(l=d)}T.set(j,"top",l+"px")}}function c(){D.remove(j),M.unbind(n,"mousedown",r),j=null,q=null,F=[],k=[]}function f(e){return e?e===q:!!q}function h(e){var t="optgroup"===D.getTagName(e),n=t?D.getOptionGroupIndex(q,e):D.getOptionIndex(q,e);return t?k[n]:F[n]}function p(e){var t=D.getSelectParent(e);if(t){var n=T.getSelectElementSize(t),i=T.getOptionHeight(t),s=0,o=Math.max(T.getScrollTop(t)/i,0),r=o+n-1,a=D.getChildVisibleIndex(t,e);a<o?(s=i*(o-a),T.setScrollTop(t,Math.max(T.getScrollTop(t)-s,0))):a>r&&(s=i*(a-r),T.setScrollTop(t,T.getScrollTop(t)+s))}}function m(e){var t=D.getSelectParent(e);if(!t)return{x:0,y:0};var n=T.getOptionHeight(t),i=I.getElementRectangle(e);return{x:Math.round(i.left+i.width/2),y:Math.round(i.top+n/2)}}function g(e,t){var n=T.getSelectElementSize(e),i=!T.hasDimensions(x.select("."+R)[0]);if(/down|up/.test(t)||!_.isIE&&(n<=1||_.isFirefox)&&(i||_.isFirefox)&&/left|right/.test(t)){for(var s=e.querySelectorAll("option"),o=[],r=0;r<s.length;r++){var a=s[r].parentElement;s[r].disabled||"optgroup"===D.getTagName(a)&&a.disabled||o.push(s[r])}var l=S.indexOf(o,s[e.selectedIndex]),u=l+(/down|right/.test(t)?1:-1);u>=0&&u<o.length&&(e.selectedIndex=S.indexOf(s,o[u]),C.change(e))}}function v(e){var t=D.getSelectParent(e);if(!t)return!0;var n=f(t),i=T.getSelectElementSize(t);return n||i>1}e.__esModule=!0,e.expandOptionList=d,e.collapseOptionList=c,e.isOptionListExpanded=f,e.getEmulatedChildElement=h,e.scrollOptionListByChild=p,e.getSelectChildCenter=m,e.switchOptionsByKeys=g,e.isOptionElementVisible=v;var E=s("./deps/hammerhead"),w=o(E),b=s("./deps/testcafe-core"),y=o(b),x=w["default"].shadowUI,_=w["default"].utils.browser,C=w["default"].eventSandbox.eventSimulator,I=y["default"].positionUtils,D=y["default"].domUtils,T=y["default"].styleUtils,M=y["default"].eventUtils,S=y["default"].arrayUtils,R="tcOptionList",O="tcOptionGroup",U="tcOption",P="disabled",B=_.isIE?30:20,q=null,j=null,k=[],F=[]}}}}}})("testcafe/src/client/ui/index")}e(window)}(); |
@@ -39,3 +39,2 @@ 'use strict'; | ||
// Errors | ||
var GeneralError = exports.GeneralError = function (_Error) { | ||
@@ -66,5 +65,3 @@ (0, _inherits3.default)(GeneralError, _Error); | ||
// NOTE: stack includes message as well. | ||
var _this2 = (0, _possibleConstructorReturn3.default)(this, _Error2.call(this, (0, _renderTemplate2.default)(_message2.default.cannotPrepareTestsDueToError, originalError.toString()))); | ||
@@ -93,3 +90,2 @@ | ||
// NOTE: `rawMessage` is used in error substitution if it occurs in test run. | ||
var _this3 = (0, _possibleConstructorReturn3.default)(this, _Error3.call(this, (0, _renderTemplate2.default)(_message2.default.cannotPrepareTestsDueToError, rawMessage))); | ||
@@ -96,0 +92,0 @@ |
@@ -30,3 +30,2 @@ 'use strict'; | ||
//-------------------------------------------------------------------- | ||
var TestRunErrorBase = function TestRunErrorBase(type) { | ||
@@ -33,0 +32,0 @@ (0, _classCallCheck3.default)(this, TestRunErrorBase); |
@@ -18,3 +18,2 @@ 'use strict'; | ||
// Validations | ||
var getValidHostname = function () { | ||
@@ -21,0 +20,0 @@ var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(hostname) { |
@@ -56,2 +56,4 @@ 'use strict'; | ||
LegacyTestRunErrorFormattableAdapter.prototype.getCallsiteMarkup = function getCallsiteMarkup() { | ||
if (!this.callsite) return null; | ||
var code = (0, _highlightEs2.default)(this.callsite, renderer); | ||
@@ -58,0 +60,0 @@ var lines = code.split(NEWLINE); |
@@ -27,10 +27,4 @@ 'use strict'; | ||
function getMsgPrefix(err) { | ||
return '<span class="user-agent">' + err.userAgent + '</span>\n'; | ||
} | ||
function getAssertionMsgPrefix(err) { | ||
var assertionPrefix = err.message ? '"' + (0, _lodash.escape)(err.message) + '" assertion' : 'Assertion'; | ||
return getMsgPrefix(err) + assertionPrefix; | ||
return err.message ? '"' + (0, _lodash.escape)(err.message) + '" assertion' : 'Assertion'; | ||
} | ||
@@ -48,12 +42,22 @@ | ||
function getScreenshotInfoStr(err) { | ||
if (err.screenshotPath) return '<div class="screenshot-info"><strong>Screenshot:</strong> <a class="screenshot-path">' + (0, _lodash.escape)(err.screenshotPath) + '</a></div>'; | ||
function markup(err, msgMarkup) { | ||
var opts = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; | ||
return ''; | ||
msgMarkup = (0, _dedent2.default)('\n <div class="message">' + (0, _dedent2.default)(msgMarkup) + '</div>\n\n <strong>Browser:</strong> <span class="user-agent">' + err.userAgent + '</span>\n '); | ||
if (err.screenshotPath) msgMarkup += '\n<div class="screenshot-info"><strong>Screenshot:</strong> <a class="screenshot-path">' + (0, _lodash.escape)(err.screenshotPath) + '</a></div>'; | ||
if (!opts.withoutCallsite) { | ||
var callsiteMarkup = err.getCallsiteMarkup(); | ||
if (callsiteMarkup) msgMarkup += '\n\n<strong>Code:</strong>\n' + callsiteMarkup; | ||
} | ||
return msgMarkup; | ||
} | ||
exports.default = (_TYPE$okAssertion$TYP = {}, _TYPE$okAssertion$TYP[_type2.default.okAssertion] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getAssertionMsgPrefix(err) + ' failed at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n\n ' + err.getCallsiteMarkup() + '\n\n <strong>Expected: </strong>not <code>null</code>, not <code>undefined</code>, not <code>false</code>, not <code>NaN</code> and not <code>\'\'</code>\n <strong>Actual: </strong><code>' + escapeNewLines(err.actual) + '</code>\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n ' + getAssertionMsgPrefix(err) + ' failed at step "' + (0, _lodash.escape)(err.stepName) + '":\n\n <strong>Expected: </strong>not <code>null</code>, not <code>undefined</code>, not <code>false</code>, not <code>NaN</code> and not <code>\'\'</code>\n <strong>Actual: </strong><code>' + escapeNewLines(err.actual) + '</code>\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.notOkAssertion] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getAssertionMsgPrefix(err) + ' failed at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n\n ' + err.getCallsiteMarkup() + '\n\n <strong>Expected: </strong><code>null</code>, <code>undefined</code>, <code>false</code>, <code>NaN</code> or <code>\'\'</code>\n <strong>Actual: </strong><code>' + escapeNewLines(err.actual) + '</code>\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n ' + getAssertionMsgPrefix(err) + ' failed at step "' + (0, _lodash.escape)(err.stepName) + '":\n\n <strong>Expected: </strong><code>null</code>, <code>undefined</code>, <code>false</code>, <code>NaN</code> or <code>\'\'</code>\n <strong>Actual: </strong><code>' + escapeNewLines(err.actual) + '</code>\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.eqAssertion] = function (err, maxStringLength) { | ||
@@ -63,70 +67,68 @@ var diff = (0, _assertionDiffs2.default)(err, maxStringLength); | ||
return (0, _dedent2.default)('\n ' + getAssertionMsgPrefix(err) + ' failed at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n\n ' + err.getCallsiteMarkup() + '\n\n ' + getDiffHeader(err) + '\n\n <strong>Expected: </strong><code>' + escapeNewLines(diff.expected) + '</code>\n <strong>Actual: </strong><code>' + escapeNewLines(diff.actual) + '</code>\n <code>' + diffMarkerStr + '</code>\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n ' + getAssertionMsgPrefix(err) + ' failed at step "' + (0, _lodash.escape)(err.stepName) + '":\n\n ' + getDiffHeader(err) + '\n\n <strong>Expected: </strong><code>' + escapeNewLines(diff.expected) + '</code>\n <strong>Actual: </strong><code>' + escapeNewLines(diff.actual) + '</code>\n <code>' + diffMarkerStr + '</code>\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.notEqAssertion] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getAssertionMsgPrefix(err) + ' failed at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n\n ' + err.getCallsiteMarkup() + '\n\n <strong>Expected: </strong>not <code>' + escapeNewLines(err.actual) + '</code>\n <strong>Actual: </strong><code>' + escapeNewLines(err.actual) + '</code>\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n ' + getAssertionMsgPrefix(err) + ' failed at step "' + (0, _lodash.escape)(err.stepName) + '":\n\n <strong>Expected: </strong>not <code>' + escapeNewLines(err.actual) + '</code>\n <strong>Actual: </strong><code>' + escapeNewLines(err.actual) + '</code>\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.iframeLoadingTimeout] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'IFrame loading timed out.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n IFrame loading timed out.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.inIFrameTargetLoadingTimeout] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n IFrame target loading timed out.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n IFrame target loading timed out.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.uncaughtJSError] = function (err) { | ||
if (err.pageDestUrl) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Uncaught JavaScript error <code>' + (0, _lodash.escape)(err.scriptErr) + '</code> on page <a href="' + err.pageDestUrl + '">' + err.pageDestUrl + '</a>\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Uncaught JavaScript error <code>' + (0, _lodash.escape)(err.scriptErr) + '</code> on page <a href="' + err.pageDestUrl + '">' + err.pageDestUrl + '</a>\n '); | ||
} | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Uncaught JavaScript error <code>' + (0, _lodash.escape)(err.scriptErr) + '</code> on page.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Uncaught JavaScript error <code>' + (0, _lodash.escape)(err.scriptErr) + '</code> on page.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.uncaughtJSErrorInTestCodeStep] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n Uncaught JavaScript error in test code - <code>' + (0, _lodash.escape)(err.scriptErr) + '</code>.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n Uncaught JavaScript error in test code - <code>' + (0, _lodash.escape)(err.scriptErr) + '</code>.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.storeDomNodeOrJqueryObject] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n It is not allowed to share the DOM element, jQuery object or a function between test steps via "this" object.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n It is not allowed to share the DOM element, jQuery object or a function between test steps via "this" object.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.emptyFirstArgument] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n\n ' + err.getCallsiteMarkup() + '\n\n A target element of the <code class="api">' + err.action + '</code> action has not been found in the DOM tree.\n If this element should be created after animation or a time-consuming operation is finished, use the <code class="api">waitFor</code> action (available for use in code) to pause test execution until this element appears.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n A target element of the <code>' + err.action + '</code> action has not been found in the DOM tree.\n If this element should be created after animation or a time-consuming operation is finished, use the <code>waitFor</code> action (available for use in code) to pause test execution until this element appears.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.invisibleActionElement] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n\n ' + err.getCallsiteMarkup() + '\n\n A target element <code>' + (0, _lodash.escape)(err.element) + '</code> of the <code class="api">' + err.action + '</code> action is not visible.\n If this element should appear when you are hovering over another element, make sure that you properly recorded the <code class="api">hover</code> action.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n A target element <code>' + (0, _lodash.escape)(err.element) + '</code> of the <code>' + err.action + '</code> action is not visible.\n If this element should appear when you are hovering over another element, make sure that you properly recorded the <code>hover</code> action.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.incorrectDraggingSecondArgument] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n\n ' + err.getCallsiteMarkup() + '\n\n <code class="api">drag</code> action drop target is incorrect.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n <code>drag</code> action drop target is incorrect.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.incorrectPressActionArgument] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n\n ' + err.getCallsiteMarkup() + '\n\n <code class="api">press</code> action parameter contains incorrect key code.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n <code>press</code> action parameter contains incorrect key code.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.emptyTypeActionArgument] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n\n ' + err.getCallsiteMarkup() + '\n\n The <code class="api">type<code> action\'s parameter text is empty.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n The <code>type<code> action\'s parameter text is empty.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.unexpectedDialog] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n Unexpected system <code>' + err.dialog + '</code> dialog <code>' + (0, _lodash.escape)(err.message) + '</code> appeared.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n Unexpected system <code>' + err.dialog + '</code> dialog <code>' + (0, _lodash.escape)(err.message) + '</code> appeared.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.expectedDialogDoesntAppear] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n The expected system <code>' + err.dialog + '</code> dialog did not appear.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n The expected system <code>' + err.dialog + '</code> dialog did not appear.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.incorrectSelectActionArguments] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n\n ' + err.getCallsiteMarkup() + '\n\n <code class="api">select</code> action\'s parameters contain an incorrect value.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n <code>select</code> action\'s parameters contain an incorrect value.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.incorrectWaitActionMillisecondsArgument] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n\n ' + err.getCallsiteMarkup() + '\n\n <code class="api">wait</code> action\'s "milliseconds" parameter should be a positive number.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n <code>wait</code> action\'s "milliseconds" parameter should be a positive number.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.incorrectWaitForActionEventArgument] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n\n ' + err.getCallsiteMarkup() + '\n\n <code class="api">waitFor</code> action\'s first parameter should be a function, a CSS selector or an array of CSS selectors.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n <code>waitFor</code> action\'s first parameter should be a function, a CSS selector or an array of CSS selectors.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.incorrectWaitForActionTimeoutArgument] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n\n ' + err.getCallsiteMarkup() + '\n\n <code class="api">waitFor</code> action\'s "timeout" parameter should be a positive number.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n <code>waitFor</code> action\'s "timeout" parameter should be a positive number.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.waitForActionTimeoutExceeded] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n\n ' + err.getCallsiteMarkup() + '\n\n <code class="api">waitFor</code> action\'s timeout exceeded.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n <code>waitFor</code> action\'s timeout exceeded.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.incorrectGlobalWaitForActionEventArgument] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n\n <code class="api">__waitFor</code> action\'s first parameter should be a function.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n <code>__waitFor</code> action\'s first parameter should be a function.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.incorrectGlobalWaitForActionTimeoutArgument] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n\n <code class="api">__waitFor</code> action\'s "timeout" parameter should be a positive number.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n <code>__waitFor</code> action\'s "timeout" parameter should be a positive number.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.globalWaitForActionTimeoutExceeded] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n\n <code class="api">__waitFor</code> action\'s timeout exceeded.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n <code>__waitFor</code> action\'s timeout exceeded.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.emptyIFrameArgument] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n The selector within the <code class="api">inIFrame</code> function returns an empty value.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n The selector within the <code>inIFrame</code> function returns an empty value.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.iframeArgumentIsNotIFrame] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n The selector within the <code class="api">inIFrame</code> function doesn’t return an iframe element.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n The selector within the <code>inIFrame</code> function doesn’t return an iframe element.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.multipleIFrameArgument] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n The selector within the <code class="api">inIFrame</code> function returns more than one iframe element.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n The selector within the <code>inIFrame</code> function returns more than one iframe element.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.incorrectIFrameArgument] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n The <code class="api">inIFrame</code> function contains an invalid argument.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n The <code>inIFrame</code> function contains an invalid argument.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.uploadCanNotFindFileToUpload] = function (err) { | ||
var msg = (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n\n ' + err.getCallsiteMarkup() + '\n\n Cannot find the following file(s) to upload:\n '); | ||
return msg + err.filePaths.map(function (path) { | ||
return '\n <code>' + (0, _lodash.escape)(path) + '</code>'; | ||
}).join(',') + (err.screenshotPath ? '\n\n' + getScreenshotInfoStr(err) : ''); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n Cannot find the following file(s) to upload:\n\n ' + err.filePaths.map(function (path) { | ||
return '<code>' + (0, _lodash.escape)(path) + '</code>'; | ||
}).join(',\n') + '\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.uploadElementIsNotFileInput] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n\n ' + err.getCallsiteMarkup() + '\n\n <code class="api">upload</code> action argument does not contain a file input element.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n <code>upload</code> action argument does not contain a file input element.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.uploadInvalidFilePathArgument] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + 'Error at step <span class="step-name">' + (0, _lodash.escape)(err.stepName) + '</span>:\n\n ' + err.getCallsiteMarkup() + '\n\n <code class="api">upload</code> action\'s "path" parameter should be a string or an array of strings.\n\n ' + getScreenshotInfoStr(err) + '\n '); | ||
return markup(err, '\n Error at step "' + (0, _lodash.escape)(err.stepName) + '":\n <code>upload</code> action\'s "path" parameter should be a string or an array of strings.\n '); | ||
}, _TYPE$okAssertion$TYP[_type2.default.pageNotLoaded] = function (err) { | ||
return (0, _dedent2.default)('\n ' + getMsgPrefix(err) + err.message + '\n '); | ||
return markup(err, '\n ' + err.message + '\n '); | ||
}, _TYPE$okAssertion$TYP); | ||
module.exports = exports['default']; |
@@ -56,4 +56,4 @@ 'use strict'; | ||
// Const | ||
var TEST_RUN_TEMPLATE = (0, _readFileRelative.readSync)('../../client/legacy/test-run/index.js.mustache'); | ||
var IFRAME_TEST_RUN_TEMPLATE = (0, _readFileRelative.readSync)('../../client/legacy/test-run/iframe.js.mustache'); | ||
var TEST_RUN_TEMPLATE = (0, _readFileRelative.readSync)('../client/test-run/index.js.mustache'); | ||
var IFRAME_TEST_RUN_TEMPLATE = (0, _readFileRelative.readSync)('../client/test-run/iframe.js.mustache'); | ||
@@ -87,3 +87,4 @@ var LegacyTestRun = function (_Session) { | ||
_this.injectable.scripts.push('/testcafe-ui.js'); | ||
_this.injectable.scripts.push('/testcafe-runner.js'); | ||
_this.injectable.scripts.push('/testcafe-automation.js'); | ||
_this.injectable.scripts.push('/testcafe-legacy-runner.js'); | ||
_this.injectable.styles.push('/testcafe-ui-styles.css'); | ||
@@ -90,0 +91,0 @@ return _this; |
@@ -79,5 +79,2 @@ 'use strict'; | ||
return { | ||
'span step-name': function spanStepName(str) { | ||
return '"' + str + '"'; | ||
}, | ||
'span user-agent': function spanUserAgent(str) { | ||
@@ -88,3 +85,3 @@ return _this.chalk.grey(str); | ||
'span subtitle': function spanSubtitle(str) { | ||
return '- ' + _this.chalk.bold(str) + ' -'; | ||
return '- ' + _this.chalk.bold.red(str) + ' -'; | ||
}, | ||
@@ -100,8 +97,3 @@ 'div message': function divMessage(str) { | ||
'code': function code(str) { | ||
return _this.chalk.yellow(str); | ||
}, | ||
'code api': function codeApi(str) { | ||
return _this.chalk.yellow(str); | ||
}, | ||
'code': _lodash.identity, | ||
@@ -108,0 +100,0 @@ 'span syntax-string': function spanSyntaxString(str) { |
@@ -25,3 +25,3 @@ 'use strict'; | ||
var _screenshots = require('./screenshots'); | ||
var _screenshots = require('../screenshots'); | ||
@@ -28,0 +28,0 @@ var _screenshots2 = _interopRequireDefault(_screenshots); |
@@ -31,3 +31,2 @@ 'use strict'; | ||
// Commands | ||
var WaitCommand = exports.WaitCommand = function (_Assignable) { | ||
@@ -34,0 +33,0 @@ (0, _inherits3.default)(WaitCommand, _Assignable); |
@@ -17,3 +17,2 @@ 'use strict'; | ||
// Commands | ||
var PrepareBrowserManipulationCommand = exports.PrepareBrowserManipulationCommand = function PrepareBrowserManipulationCommand(manipulationCommandType) { | ||
@@ -20,0 +19,0 @@ (0, _classCallCheck3.default)(this, PrepareBrowserManipulationCommand); |
@@ -119,3 +119,4 @@ 'use strict'; | ||
_this.injectable.scripts.push('/testcafe-ui.js'); | ||
_this.injectable.scripts.push('/testcafe-runner.js'); | ||
_this.injectable.scripts.push('/testcafe-automation.js'); | ||
_this.injectable.scripts.push('/testcafe-legacy-runner.js'); | ||
_this.injectable.scripts.push('/testcafe-driver.js'); | ||
@@ -122,0 +123,0 @@ _this.injectable.styles.push('/testcafe-ui-styles.css'); |
@@ -42,4 +42,5 @@ 'use strict'; | ||
var DRIVER_SCRIPT = (0, _readFileRelative.readSync)('./client/driver/index.js'); | ||
var RUNNER_SCRIPT = (0, _readFileRelative.readSync)('./client/runner/index.js'); | ||
var LEGACY_RUNNER_SCRIPT = (0, _readFileRelative.readSync)('./legacy/client/index.js'); | ||
var UI_SCRIPT = (0, _readFileRelative.readSync)('./client/ui/index.js'); | ||
var AUTOMATION_SCRIPT = (0, _readFileRelative.readSync)('./client/automation/index.js'); | ||
var UI_STYLE = (0, _readFileRelative.readSync)('./client/ui/styles.css'); | ||
@@ -63,3 +64,7 @@ var UI_SPRITE = (0, _readFileRelative.readSync)('./client/ui/sprite.png', true); | ||
this.proxy.GET('/testcafe-driver.js', { content: DRIVER_SCRIPT, contentType: 'application/x-javascript' }); | ||
this.proxy.GET('/testcafe-runner.js', { content: RUNNER_SCRIPT, contentType: 'application/x-javascript' }); | ||
this.proxy.GET('/testcafe-legacy-runner.js', { | ||
content: LEGACY_RUNNER_SCRIPT, | ||
contentType: 'application/x-javascript' | ||
}); | ||
this.proxy.GET('/testcafe-automation.js', { content: AUTOMATION_SCRIPT, contentType: 'application/x-javascript' }); | ||
this.proxy.GET('/testcafe-ui.js', { content: UI_SCRIPT, contentType: 'application/x-javascript' }); | ||
@@ -66,0 +71,0 @@ this.proxy.GET('/testcafe-ui-sprite.png', { content: UI_SPRITE, contentType: 'image/png' }); |
@@ -5,3 +5,3 @@ 'use strict'; | ||
exports.default = { | ||
screenshotsPathNotSpecified: 'Cannot take screenshots because the screenshot directory is not specified. To specify it, use the "-s" or "--screenshots" command line option or the "screenshots" method of the test runner in case you are using API.', | ||
screenshotsPathNotSpecified: 'Was unable to take screenshots because the screenshot directory is not specified. To specify it, use the "-s" or "--screenshots" command line option or the "screenshots" method of the test runner in case you are using API.', | ||
screenshotError: 'Was unable to take a screenshot due to an error.\n\n{errMessage}', | ||
@@ -8,0 +8,0 @@ browserManipulationsNotSupportedOnLinux: 'The screenshot and window resize functionality are not yet supported on Linux. Subscribe to the following issue to keep track: https://github.com/DevExpress/testcafe-browser-natives/issues/12' |
{ | ||
"name": "testcafe", | ||
"license": "MIT", | ||
"version": "0.2.0-alpha", | ||
"version": "0.2.1-alpha", | ||
"main": "lib/index", | ||
@@ -53,7 +53,7 @@ "bin": { | ||
"testcafe-legacy-api": "^0.4.0", | ||
"testcafe-reporter-json": "^1.0.0", | ||
"testcafe-reporter-list": "^1.0.0", | ||
"testcafe-reporter-minimal": "^1.0.0", | ||
"testcafe-reporter-spec": "^1.0.0", | ||
"testcafe-reporter-xunit": "^1.0.0", | ||
"testcafe-reporter-json": "^2.0.0", | ||
"testcafe-reporter-list": "^2.0.0", | ||
"testcafe-reporter-minimal": "^2.0.0", | ||
"testcafe-reporter-spec": "^2.0.0", | ||
"testcafe-reporter-xunit": "^2.0.0", | ||
"time-limit-promise": "^1.0.2", | ||
@@ -60,0 +60,0 @@ "useragent": "^2.1.7" |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
857965
103
8961
14
+ Addedtestcafe-reporter-json@2.2.0(transitive)
+ Addedtestcafe-reporter-list@2.2.0(transitive)
+ Addedtestcafe-reporter-minimal@2.2.0(transitive)
+ Addedtestcafe-reporter-spec@2.2.0(transitive)
+ Addedtestcafe-reporter-xunit@2.2.3(transitive)
- Removedtestcafe-reporter-json@1.0.0(transitive)
- Removedtestcafe-reporter-list@1.0.2(transitive)
- Removedtestcafe-reporter-minimal@1.0.2(transitive)
- Removedtestcafe-reporter-spec@1.0.5(transitive)
- Removedtestcafe-reporter-xunit@1.0.0(transitive)