UNPKG

webdriverio-automation

Version:

WebdriverIO-Automation android ios project

7 lines (6 loc) 4.93 kB
function(){return function(){var b=this,d=Date.now||function(){return+new Date};function k(a,c){this.code=a;this.a=l[a]||n;this.message=c||"";a=this.a.replace(/((?:^|\s+)[a-z])/g,function(a){return a.toUpperCase().replace(/^[\s\xa0]+/g,"")});c=a.length-5;if(0>c||a.indexOf("Error",c)!=c)a+="Error";this.name=a;a=Error(this.message);a.name=this.name;this.stack=a.stack||""} (function(){var a=Error;function c(){}c.prototype=a.prototype;k.c=a.prototype;k.prototype=new c;k.prototype.constructor=k;k.a=function(c,f,h){for(var g=Array(arguments.length-2),e=2;e<arguments.length;e++)g[e-2]=arguments[e];return a.prototype[f].apply(c,g)}})();var n="unknown error",l={15:"element not selectable",11:"element not visible"};l[31]=n;l[30]=n;l[24]="invalid cookie domain";l[29]="invalid element coordinates";l[12]="invalid element state";l[32]="invalid selector";l[51]="invalid selector"; l[52]="invalid selector";l[17]="javascript error";l[405]="unsupported operation";l[34]="move target out of bounds";l[27]="no such alert";l[7]="no such element";l[8]="no such frame";l[23]="no such window";l[28]="script timeout";l[33]="session not created";l[10]="stale element reference";l[21]="timeout";l[25]="unable to set cookie";l[26]="unexpected alert open";l[13]=n;l[9]="unknown command";k.prototype.toString=function(){return this.name+": "+this.message};var p=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")}; function q(a){var c=0;a=p(String(a)).split(".");for(var e=p("3.5").split("."),f=Math.max(a.length,e.length),h=0;!c&&h<f;h++){var g=a[h]||"",m=e[h]||"";do{g=/(\d*)(\D*)(.*)/.exec(g)||["","","",""];m=/(\d*)(\D*)(.*)/.exec(m)||["","","",""];if(0==g[0].length&&0==m[0].length)break;c=r(0==g[1].length?0:parseInt(g[1],10),0==m[1].length?0:parseInt(m[1],10))||r(0==g[2].length,0==m[2].length)||r(g[2],m[2]);g=g[3];m=m[3]}while(!c)}return c}function r(a,c){return a<c?-1:a>c?1:0};var t;a:{var u=b.navigator;if(u){var v=u.userAgent;if(v){t=v;break a}}t=""}function w(a){return-1!=t.indexOf(a)};function x(){return(w("Chrome")||w("CriOS"))&&!w("Edge")};function y(){return w("iPhone")&&!w("iPod")&&!w("iPad")};var z=w("Opera"),A=w("Trident")||w("MSIE"),B=w("Edge"),C=w("Gecko")&&!(-1!=t.toLowerCase().indexOf("webkit")&&!w("Edge"))&&!(w("Trident")||w("MSIE"))&&!w("Edge"),D=-1!=t.toLowerCase().indexOf("webkit")&&!w("Edge");function E(){var a=b.document;return a?a.documentMode:void 0}var F; a:{var G="",H=function(){var a=t;if(C)return/rv\:([^\);]+)(\)|;)/.exec(a);if(B)return/Edge\/([\d\.]+)/.exec(a);if(A)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(D)return/WebKit\/(\S+)/.exec(a);if(z)return/(?:Version)[ \/]?(\S+)/.exec(a)}();H&&(G=H?H[1]:"");if(A){var I=E();if(null!=I&&I>parseFloat(G)){F=String(I);break a}}F=G}var J={},K;var L=b.document;K=L&&A?E()||("CSS1Compat"==L.compatMode?parseInt(F,10):5):void 0;var M=w("Firefox"),aa=y()||w("iPod"),ba=w("iPad"),N=w("Android")&&!(x()||w("Firefox")||w("Opera")||w("Silk")),ca=x(),O=w("Safari")&&!(x()||w("Coast")||w("Opera")||w("Edge")||w("Silk")||w("Android"))&&!(y()||w("iPad")||w("iPod"));function P(a){return(a=a.exec(t))?a[1]:""}(function(){if(M)return P(/Firefox\/([0-9.]+)/);if(A||B||z)return F;if(ca)return y()||w("iPad")||w("iPod")?P(/CriOS\/([0-9.]+)/):P(/Chrome\/([0-9.]+)/);if(O&&!(y()||w("iPad")||w("iPod")))return P(/Version\/([0-9.]+)/);if(aa||ba){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(t);if(a)return a[1]+"."+a[2]}else if(N)return(a=P(/Android\s+([0-9.]+)/))?a:P(/Version\/([0-9.]+)/);return""})();var Q,R,S=function(){if(!C)return!1;var a=b.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(g){return!1}var c=a.classes,a=a.interfaces,e=c["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),c=c["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),f=c.platformVersion,h=c.version;Q=function(a){return 0<=e.compare(f,""+a)};R=function(a){e.compare(h,""+a)};return!0}();N&&S&&R(2.3);N&&S&&R(4);O&&S&&R(6);var T;if(!(T=D)){var U;if(U=C)U=S?Q(3.5):A?0<=q(K):Object.prototype.hasOwnProperty.call(J,3.5)?J[3.5]:J[3.5]=0<=q(F);T=U}T||A&&S&&Q(8);function V(a,c){a=decodeURIComponent(a);c=c||document;var e=c||document;var f=e.$wdc_;f||(f=e.$wdc_={},f.b=d());f.b||(f.b=d());e=f;if(!(null!==e&&a in e))throw new k(10,"Element does not exist in cache");f=e[a];if(null!==f&&"setInterval"in f){if(f.closed)throw delete e[a],new k(23,"Window has been closed.");return f}for(var h=f;h;){if(h==c.documentElement)return f;h=h.parentNode}delete e[a];throw new k(10,"Element is no longer attached to the DOM");}var W=["_"],X=b; 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!==V;Z?X[Y]=V: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);}