UNPKG

webdriverio-automation

Version:

WebdriverIO-Automation android ios project

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