webdriverio-automation
Version:
WebdriverIO-Automation android ios project
16 lines (15 loc) • 9.37 kB
JavaScript
function(){return function(){var e=this;
function g(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==
b&&"undefined"==typeof a.call)return"object";return b}function aa(a){var b=g(a);return"array"==b||"object"==b&&"number"==typeof a.length}function ba(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function m(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var n=Date.now||function(){return+new Date};function p(a,b){this.code=a;this.b=q[a]||r;this.message=b||"";a=this.b.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")});b=a.length-5;if(0>b||a.indexOf("Error",b)!=b)a+="Error";this.name=a;a=Error(this.message);a.name=this.name;this.stack=a.stack||""}
(function(){var a=Error;function b(){}b.prototype=a.prototype;p.c=a.prototype;p.prototype=new b;p.prototype.constructor=p;p.b=function(b,d,h){for(var c=Array(arguments.length-2),k=2;k<arguments.length;k++)c[k-2]=arguments[k];return a.prototype[d].apply(b,c)}})();var r="unknown error",q={15:"element not selectable",11:"element not visible"};q[31]=r;q[30]=r;q[24]="invalid cookie domain";q[29]="invalid element coordinates";q[12]="invalid element state";q[32]="invalid selector";q[51]="invalid selector";
q[52]="invalid selector";q[17]="javascript error";q[405]="unsupported operation";q[34]="move target out of bounds";q[27]="no such alert";q[7]="no such element";q[8]="no such frame";q[23]="no such window";q[28]="script timeout";q[33]="session not created";q[10]="stale element reference";q[21]="timeout";q[25]="unable to set cookie";q[26]="unexpected alert open";q[13]=r;q[9]="unknown command";p.prototype.toString=function(){return this.name+": "+this.message};var t=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};
function u(a){var b=0;a=t(String(a)).split(".");for(var c=t("3.5").split("."),d=Math.max(a.length,c.length),h=0;!b&&h<d;h++){var f=a[h]||"",k=c[h]||"";do{f=/(\d*)(\D*)(.*)/.exec(f)||["","","",""];k=/(\d*)(\D*)(.*)/.exec(k)||["","","",""];if(0==f[0].length&&0==k[0].length)break;b=v(0==f[1].length?0:parseInt(f[1],10),0==k[1].length?0:parseInt(k[1],10))||v(0==f[2].length,0==k[2].length)||v(f[2],k[2]);f=f[3];k=k[3]}while(!b)}return b}function v(a,b){return a<b?-1:a>b?1:0};function w(a,b){for(var c=a.length,d=Array(c),h="string"==typeof a?a.split(""):a,f=0;f<c;f++)f in h&&(d[f]=b.call(void 0,h[f],f,a));return d};var x;a:{var y=e.navigator;if(y){var z=y.userAgent;if(z){x=z;break a}}x=""}function A(a){return-1!=x.indexOf(a)};function ca(a,b){var c={},d;for(d in a)b.call(void 0,a[d],d,a)&&(c[d]=a[d]);return c}function B(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}function C(a,b){return null!==a&&b in a}function da(a,b){for(var c in a)if(b.call(void 0,a[c],c,a))return c};function D(){return(A("Chrome")||A("CriOS"))&&!A("Edge")};function F(){return A("iPhone")&&!A("iPod")&&!A("iPad")};var ea=A("Opera"),G=A("Trident")||A("MSIE"),fa=A("Edge"),H=A("Gecko")&&!(-1!=x.toLowerCase().indexOf("webkit")&&!A("Edge"))&&!(A("Trident")||A("MSIE"))&&!A("Edge"),ga=-1!=x.toLowerCase().indexOf("webkit")&&!A("Edge");function ha(){var a=e.document;return a?a.documentMode:void 0}var I;
a:{var J="",K=function(){var a=x;if(H)return/rv\:([^\);]+)(\)|;)/.exec(a);if(fa)return/Edge\/([\d\.]+)/.exec(a);if(G)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(ga)return/WebKit\/(\S+)/.exec(a);if(ea)return/(?:Version)[ \/]?(\S+)/.exec(a)}();K&&(J=K?K[1]:"");if(G){var L=ha();if(null!=L&&L>parseFloat(J)){I=String(L);break a}}I=J}var M={},ia;var ja=e.document;ia=ja&&G?ha()||("CSS1Compat"==ja.compatMode?parseInt(I,10):5):void 0;var ka=A("Firefox"),la=F()||A("iPod"),ma=A("iPad"),N=A("Android")&&!(D()||A("Firefox")||A("Opera")||A("Silk")),pa=D(),qa=A("Safari")&&!(D()||A("Coast")||A("Opera")||A("Edge")||A("Silk")||A("Android"))&&!(F()||A("iPad")||A("iPod"));function O(a){return(a=a.exec(x))?a[1]:""}(function(){if(ka)return O(/Firefox\/([0-9.]+)/);if(G||fa||ea)return I;if(pa)return F()||A("iPad")||A("iPod")?O(/CriOS\/([0-9.]+)/):O(/Chrome\/([0-9.]+)/);if(qa&&!(F()||A("iPad")||A("iPod")))return O(/Version\/([0-9.]+)/);if(la||ma){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(x);if(a)return a[1]+"."+a[2]}else if(N)return(a=O(/Android\s+([0-9.]+)/))?a:O(/Version\/([0-9.]+)/);return""})();var P,Q,R=function(){if(!H)return!1;var a=e.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,h=b.version;P=function(a){return 0<=c.compare(d,""+a)};Q=function(a){c.compare(h,""+a)};return!0}();N&&R&&Q(2.3);N&&R&&Q(4);qa&&R&&Q(6);function ra(){}
function S(a,b,c){if(null==b)c.push("null");else{if("object"==typeof b){if("array"==g(b)){var d=b;b=d.length;c.push("[");for(var h="",f=0;f<b;f++)c.push(h),S(a,d[f],c),h=",";c.push("]");return}if(b instanceof String||b instanceof Number||b instanceof Boolean)b=b.valueOf();else{c.push("{");h="";for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&(f=b[d],"function"!=typeof f&&(c.push(h),sa(d,c),c.push(":"),S(a,f,c),h=","));c.push("}");return}}switch(typeof b){case "string":sa(b,c);break;case "number":c.push(isFinite(b)&&
!isNaN(b)?String(b):"null");break;case "boolean":c.push(String(b));break;case "function":c.push("null");break;default:throw Error("Unknown type: "+typeof b);}}}var ta={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},ua=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g;
function sa(a,b){b.push('"',a.replace(ua,function(a){var b=ta[a];b||(b="\\u"+(a.charCodeAt(0)|65536).toString(16).substr(1),ta[a]=b);return b}),'"')};var T;if(!(T=ga)){var U;if(U=H)U=R?P(3.5):G?0<=u(ia):Object.prototype.hasOwnProperty.call(M,3.5)?M[3.5]:M[3.5]=0<=u(I);T=U}T||G&&R&&P(8);function va(a){function b(a,d){switch(g(a)){case "string":case "number":case "boolean":return a;case "function":return a.toString();case "array":return w(a,function(a){return b(a,d)});case "object":if(0<=d.indexOf(a))throw new p(17,"Recursive object cannot be transferred");if(C(a,"nodeType")&&(1==a.nodeType||9==a.nodeType)){var c={};c.ELEMENT=wa(a);return c}if(C(a,"document"))return c={},c.WINDOW=wa(a),c;d.push(a);if(aa(a))return w(a,function(a){return b(a,d)});a=ca(a,function(a,b){return"number"==
typeof b||"string"==typeof b});return B(a,function(a){return b(a,d)});default:return null}}return b(a,[])}function V(a,b){return"array"==g(a)?w(a,function(a){return V(a,b)}):ba(a)?"function"==typeof a?a:C(a,"ELEMENT")?xa(a.ELEMENT,b):C(a,"WINDOW")?xa(a.WINDOW,b):B(a,function(a){return V(a,b)}):a}
function ya(a,b){if("string"==typeof a)try{return new b.Function(a)}catch(c){if(G&&b.execScript)return b.execScript(";"),new b.Function(a);throw c;}return b==window?a:new b.Function("return ("+a+").apply(null,arguments);")}function za(a){a=a||document;var b=a.$wdc_;b||(b=a.$wdc_={},b.a=n());b.a||(b.a=n());return b}function wa(a){var b=za(a.ownerDocument),c=da(b,function(b){return b==a});c||(c=":wdc:"+b.a++,b[c]=a);return c}
function xa(a,b){a=decodeURIComponent(a);b=b||document;var c=za(b);if(!C(c,a))throw new p(10,"Element does not exist in cache");var d=c[a];if(C(d,"setInterval")){if(d.closed)throw delete c[a],new p(23,"Window has been closed.");return d}for(var h=d;h;){if(h==b.documentElement)return d;h=h.parentNode}delete c[a];throw new p(10,"Element is no longer attached to the DOM");};function Aa(a,b,c,d,h,f){function k(a,b){oa||(l.removeEventListener?l.removeEventListener("unload",E,!0):l.detachEvent("onunload",E),l.clearTimeout(Ba),0!=a?(a=new p(a,b.message||b+""),a.stack=b.stack,b={status:C(a,"code")?a.code:13,value:{message:a.message}}):b={status:0,value:va(b)},h&&(a=[],S(new ra,b,a),b=a.join("")),d(b),oa=!0)}function E(){k(13,Error("Detected a page unload event; asynchronous script execution does not work across page loads."))}var l=f||window,oa=!1;f=m(k,13);if(l.closed)f("Unable to execute script; the target window is closed.");
else{a=ya(a,l);b=V(b,l.document);b.push(m(k,0));l.addEventListener?l.addEventListener("unload",E,!0):l.attachEvent("onunload",E);var Ca=n();try{a.apply(l,b);var Ba=l.setTimeout(function(){k(28,Error("Timed out waiting for asyncrhonous script result after "+(n()-Ca)+" ms"))},Math.max(0,c))}catch(na){k(na.code||13,na)}}}var W=["_"],X=e;W[0]in X||!X.execScript||X.execScript("var "+W[0]);
for(var Y;W.length&&(Y=W.shift());){var Z;if(Z=!W.length)Z=void 0!==Aa;Z?X[Y]=Aa:X[Y]&&X[Y]!==Object.prototype[Y]?X=X[Y]:X=X[Y]={}};; return this._.apply(null,arguments);}.apply({navigator:typeof window!='undefined'?window.navigator:null,document:typeof window!='undefined'?window.document:null}, arguments);}