@dscribers/autosurf
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -1,1 +0,1 @@ | ||
function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function n(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){i(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function r(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function u(t,e,n){if(t!==e)throw new TypeError("Private static access of wrong provenance");return n}function l(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}var o=function(){function e(){t(this,e)}return n(e,null,[{key:"init",value:function(t){}},{key:"quit",value:function(t){}},{key:"checkAttrContains",value:function(t,n,i){u(this,e,h).call(this)}},{key:"checkAttrIs",value:function(t,n,i){u(this,e,h).call(this)}},{key:"checkExists",value:function(t){u(this,e,h).call(this)}},{key:"checkElementIs",value:function(t,n){u(this,e,h).call(this)}},{key:"checkIsOn",value:function(t,n){u(this,e,h).call(this)}},{key:"checkTextContains",value:function(t,n){u(this,e,h).call(this)}},{key:"checkTextIs",value:function(t,n){u(this,e,h).call(this)}},{key:"checkValueContains",value:function(t,n){u(this,e,h).call(this)}},{key:"checkValueIs",value:function(t,n){u(this,e,h).call(this)}},{key:"doClick",value:function(t){u(this,e,h).call(this)}},{key:"doGoBack",value:function(){u(this,e,h).call(this)}},{key:"doWait",value:function(t){u(this,e,h).call(this)}},{key:"doWaitTillPageLoads",value:function(){u(this,e,h).call(this)}},{key:"doGoto",value:function(t){u(this,e,h).call(this)}},{key:"doRefresh",value:function(){u(this,e,h).call(this)}},{key:"doSelect",value:function(t,n){u(this,e,h).call(this)}},{key:"doSubmitForm",value:function(t){u(this,e,h).call(this)}},{key:"doType",value:function(t,n){u(this,e,h).call(this)}}]),e}(),h=function(){throw new Error("Not implemented")},d=function(){function e(){t(this,e)}return n(e,[{key:"toJSON",value:function(){return{actionables:e.actionables,config:e.config,schedules:e.schedules,results:e.results,canStart:e.canStart,isDone:e.isDone,isInitialized:e.isInitialized,isLoading:e.isLoading,isPaused:e.isPaused,isReady:e.isReady,isWaiting:e.isWaiting,isWorking:e.isWorking,current:e.current,currentAction:e.currentAction,currentIndex:e.currentIndex,currentSchedule:e.currentSchedule,toResume:e.toResume}}}],[{key:"reset",value:function(){e.actionables=[],e.results=[],e.isPaused=!1,e.isWorking=!1,e.isWaiting=!1,e.current=null,e.currentAction=null,e.currentIndex=null,e.currentSchedule=null,e.toResume=null,e.startLoopCount=0}}]),e}();i(d,"STATUS_SUCCESS",!0),i(d,"STATUS_ERROR",!1),i(d,"Surf",null),i(d,"config",{autoAdvance:!0,defaultFailMessage:"",typingSpeed:500}),i(d,"actionables",[]),i(d,"schedules",[]),i(d,"results",[]),i(d,"events",{}),i(d,"allEvents",["actionError","actionFailed","actionStart","actionSuccess","done","paused","resumed","scheduleFinish","scheduleInit","scheduleStart"]),i(d,"customHandlers",{}),i(d,"canStart",!1),i(d,"isDone",!1),i(d,"isInitialized",!1),i(d,"isLoading",!1),i(d,"isPaused",!1),i(d,"isReady",!1),i(d,"isWorking",!1),i(d,"isWaiting",!1),i(d,"current",null),i(d,"currentAction",null),i(d,"currentIndex",null),i(d,"currentSchedule",null),i(d,"toResume",null),i(d,"startLoopCount",0);var f=new WeakSet,S=new WeakSet,y=new WeakSet,k=new WeakSet,p=new WeakSet,v=new WeakSet,g=new WeakSet,b=new WeakSet,m=new WeakSet,w=new WeakSet,A=new WeakSet,I=new WeakSet,x=new WeakSet,W=new WeakSet,C=new WeakSet,O=new WeakSet,E=new WeakSet,R=new WeakSet,T=new WeakSet,D=new WeakSet,P=new WeakSet,j=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(t(this,e),P.add(this),D.add(this),T.add(this),R.add(this),E.add(this),O.add(this),C.add(this),W.add(this),x.add(this),I.add(this),A.add(this),w.add(this),m.add(this),b.add(this),g.add(this),v.add(this),p.add(this),k.add(this),y.add(this),S.add(this),f.add(this),this.version="1.0.0","function"!=typeof i)throw new Error("Adapter must be a class");if(!(new i instanceof o))throw new Error("Adapter must be a subclass of BaseAdapter");d.Surf=i,d.config=c(c({},d.config),n)}return n(e,[{key:"getBackupData",value:function(){return new d}},{key:"on",value:function(t,e){return"*"===t?d.allEvents.forEach((function(t){return d.events[t]=e})):t.split(",").forEach((function(t){return d.events[t.trim()]=e})),this}},{key:"schedules",value:function(t){if(!Array.isArray(t))throw new Error("Schedules must be an array");return d.schedules=t,l(this,A,G).call(this),this}},{key:"pause",value:function(){return d.isPaused||(d.isReady=!1,d.isPaused=!0,l(this,T,Z).call(this)),this}},{key:"quit",value:function(){return d.Surf.quit(),this}},{key:"ready",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};return l(this,m,H).call(this,t),d.canStart=!0,this}},{key:"reconfigure",value:function(t){return d.config=c(c({},d.config),t),this}},{key:"restart",value:function(){var t=this;return d.isLoading&&setTimeout((function(){return t.restart()}),1e3),d.reset(),d.Surf.quit(),d.Surf.init(this),l(this,A,G).call(this,!0),this.start()}},{key:"resume",value:function(){return d.isPaused?(l(this,R,X).call(this,"resumed",{scheduleIndex:d.currentSchedule,actionIndex:d.currentIndex,action:d.currentAction,on:d.current}),d.isReady=!0,d.isPaused=!1,l(this,W,Y).call(this)?l(this,w,M).call(this):2===d.toResume?l(this,f,L).call(this):l(this,y,_).call(this),this):this}},{key:"start",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!d.canStart)throw new Error("You have to call ready first");return d.isLoading||!d.schedules.length?(d.startLoopCount<10&&(d.startLoopCount++,setTimeout((function(){return t.start(e,!1)}),1e3)),this):(d.currentSchedule=-1,d.isDone=!0,d.config=c(c({},d.config),e),l(this,w,M).call(this),this)}}]),e}(),L=function t(e){var n=this;try{if(d.currentAction="check",d.toResume=2,e?d.currentIndex=0:d.currentIndex++,d.isReady&&!d.isLoading&&d.actionables[d.currentSchedule])if(d.actionables[d.currentSchedule].toCheck.length){if(d.current=d.actionables[d.currentSchedule].toCheck.shift(),d.current){l(this,C,$).call(this);var i=d.current,s=i.action,c=i.params,r=i.selector,a=s;-1!==s.toLowerCase().indexOf("not")&&(a=s.replace(/not/i,"")),d.isReady=!1,l(this,v,z).call(this,a,c,r,(function(t,e){return l(n,D,tt).call(n,s,t,e)}))}}else l(this,p,q).call(this)}catch(e){d.isReady=!0,l(this,k,F).call(this,e.message),d.config.autoAdvance?l(this,f,t).call(this):this.pause()}},U=function(){null!==d.current&&(d.current=null,d.isReady=!1,d.isDone=!0,l(this,O,K).call(this),d.Surf.quit(this),l(this,R,X).call(this,"done",d.results))},_=function t(e){var n=this;try{if(d.currentAction="do",d.toResume=1,e?d.currentIndex=0:d.currentIndex++,d.isReady&&!d.isLoading&&d.actionables[d.currentSchedule])if(d.actionables[d.currentSchedule].toDo.length){if(d.current=d.actionables[d.currentSchedule].toDo.shift(),d.current){var i=d.current,s=i.action,c=i.params,r=void 0===c?[]:c,a=i.selector;d.isReady=!1,"type"===s&&r.length<3&&r.push(d.config.typingSpeed),l(this,v,z).call(this,s,r,a,(function(t,e){return l(n,g,N).call(n,t,e)}))}}else l(this,f,L).call(this,!0)}catch(e){l(this,k,F).call(this,e.message),d.config.autoAdvance?l(this,y,t).call(this):this.pause()}},F=function(t){try{l(this,O,K).call(this),d.results.length<=d.currentSchedule&&d.results.push({title:d.schedules[d.currentSchedule].title,list:[],passed:0,failed:0}),d.results[d.currentSchedule].failed++,d.results[d.currentSchedule].list.push({action:d.currentAction,index:this.currentIndex,description:d.current.description,is_succes:!1}),l(this,R,X).call(this,"actionFailed",{scheduleIndex:d.currentSchedule,actionIndex:d.currentIndex,action:d.currentAction,on:d.current,message:t||d.config.defaultFailMessage}),l(this,T,Z).call(this)}catch(t){}return this},q=function(){l(this,W,Y).call(this)&&(d.isDone||l(this,R,X).call(this,"scheduleFinish",{scheduleIndex:d.currentSchedule}),d.isDone=!0,l(this,b,B).call(this)?d.config.autoAdvance?l(this,w,M).call(this):this.pause():l(this,S,U).call(this))},z=function(t,e,n,i){var s="".concat(d.currentAction).concat(t.replace(/^[a-z]/i,(function(t){return t.toUpperCase()})));if(l(this,C,$).call(this),d.customHandlers[s])d.customHandlers[s].call(this,i,n,e);else{var c=function(){d.Surf.setSuccessCallback((function(){})),d.Surf.setErrorCallback((function(){}))};try{var a;n&&e.unshift(n),d.Surf.setSuccessCallback((function(){c(),i(d.STATUS_SUCCESS)})),d.Surf.setErrorCallback((function(t){c(),i(d.STATUS_ERROR,t)})),(a=d.Surf)[s].apply(a,r(e))}catch(t){c(),i(d.STATUS_ERROR,t.message.replace("Failed to execute 'querySelectorAll' on 'Document': ",""))}}},N=function(t,e){return t===d.STATUS_SUCCESS?l(this,E,Q).call(this):l(this,k,F).call(this,e),d.isPaused||d.isDone||d.isWaiting||(d.isReady=!0,d.isLoading=!1,d.config.autoAdvance?l(this,y,_).call(this):l(this,W,Y).call(this)?l(this,p,q).call(this):this.pause()),this},B=function(){return void 0!==d.actionables[d.currentSchedule+1]},H=function(t){var e=this;d.Surf.init(this,(function(n){if(n){var i=Object.keys((new d).toJSON());for(var s in n){if(!i.includes(s))return;d[s]=n[s]}}d.isWorking&&l(e,g,N).call(e,d.STATUS_SUCCESS),t(!!n)}))},M=function(){return d.isDone?l(this,b,B).call(this)?(d.currentSchedule++,d.isReady=!0,d.isDone=!1,l(this,R,X).call(this,"scheduleStart",{scheduleIndex:d.currentSchedule}),l(this,y,_).call(this,!0),this):(l(this,S,U).call(this),this):this},G=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return d.isLoading=!0,d.schedules.forEach((function(n,i){n.do.forEach((function(e){n.url&&(e.url=n.url),l(t,x,V).call(t,e,i)})),n.check.forEach((function(e){return l(t,I,J).call(t,e,i)})),e||l(t,R,X).call(t,"scheduleInit",{schedule:n,scheduleIndex:i})})),d.isLoading=!1,this},J=function(t,e){d.actionables.length===e&&d.actionables.push({toDo:[],toCheck:[]});var n=c({selector:null,action:t,params:[],description:'Checking "'.concat(t.action,'" on [').concat("isOn"==t.action||"isNotOn"==t.action?t.params[0]:t.selector,"]")},t);return d.actionables[e].toCheck.push(n),this},V=function(t,e){var n=c({selector:null,action:t,params:[],description:null},t);return d.actionables.length===e&&d.actionables.push({toDo:[],toCheck:[]}),d.actionables[e].toDo.push(n),this},Y=function(){return!d.actionables[d.currentSchedule]||!d.actionables[d.currentSchedule].toDo.length&&!d.actionables[d.currentSchedule].toCheck.length},$=function(){return d.isWorking||(l(this,R,X).call(this,"actionStart",{scheduleIndex:d.currentSchedule,actionIndex:d.currentIndex,action:d.currentAction,on:d.current}),d.isWorking=!0),this},K=function(){return d.isWorking=!1,this},Q=function(){try{l(this,O,K).call(this),d.results.length<=d.currentSchedule&&d.results.push({title:d.schedules[d.currentSchedule].title,list:[],passed:0,failed:0}),d.results[d.currentSchedule].passed++,d.results[d.currentSchedule].list.push({action:d.currentAction,index:this.currentIndex,description:d.current.description,is_success:!0}),l(this,R,X).call(this,"actionSuccess",{scheduleIndex:d.currentSchedule,actionIndex:d.currentIndex,action:d.currentAction,on:d.current}),l(this,T,Z).call(this)}catch(t){}return this},X=function(t,e){try{var n;e.schedule?(n=e.schedule,delete e.schedule):e.scheduleIndex?n=d.schedules[e.scheduleIndex]:d.currentSchedule>-1&&(n=d.schedules[d.currentSchedule]),d.events[t]({name:t,schedule:n,detail:e})}catch(t){}return this},Z=function(){d.isPaused&&!d.isWorking&&l(this,R,X).call(this,"paused",{scheduleIndex:d.currentSchedule,actionIndex:d.currentIndex,action:d.currentAction,on:d.current})},tt=function(t,e,n){try{-1!==t.toLowerCase().indexOf("not")?e===d.STATUS_SUCCESS?l(this,k,F).call(this,n):l(this,E,Q).call(this):e===d.STATUS_SUCCESS?l(this,E,Q).call(this):l(this,k,F).call(this,n)}catch(t){l(this,k,F).call(this,t.message)}return d.isReady=!0,d.config.autoAdvance?l(this,f,L).call(this):l(this,W,Y).call(this)?l(this,p,q).call(this):this.pause(),this};export default j; | ||
function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function n(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function u(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}var l=function(){function t(){e(this,t)}return n(t,[{key:"toJSON",value:function(){return{actionables:t.actionables,config:t.config,schedules:t.schedules,results:t.results,canStart:t.canStart,isDone:t.isDone,isInitialized:t.isInitialized,isLoading:t.isLoading,isPaused:t.isPaused,isReady:t.isReady,isWaiting:t.isWaiting,isWorking:t.isWorking,current:t.current,currentAction:t.currentAction,currentIndex:t.currentIndex,currentSchedule:t.currentSchedule,toResume:t.toResume}}}],[{key:"reset",value:function(){t.actionables=[],t.results=[],t.isPaused=!1,t.isWorking=!1,t.isWaiting=!1,t.current=null,t.currentAction=null,t.currentIndex=null,t.currentSchedule=null,t.toResume=null,t.startLoopCount=0}}]),t}();i(l,"STATUS_SUCCESS",!0),i(l,"STATUS_ERROR",!1),i(l,"Surf",null),i(l,"config",{autoAdvance:!0,defaultFailMessage:"",typingSpeed:500}),i(l,"actionables",[]),i(l,"schedules",[]),i(l,"results",[]),i(l,"events",{}),i(l,"allEvents",["actionError","actionFailed","actionStart","actionSuccess","done","paused","resumed","scheduleFinish","scheduleInit","scheduleStart"]),i(l,"customHandlers",{}),i(l,"canStart",!1),i(l,"isDone",!1),i(l,"isInitialized",!1),i(l,"isLoading",!1),i(l,"isPaused",!1),i(l,"isReady",!1),i(l,"isWorking",!1),i(l,"isWaiting",!1),i(l,"current",null),i(l,"currentAction",null),i(l,"currentIndex",null),i(l,"currentSchedule",null),i(l,"toResume",null),i(l,"startLoopCount",0);var o=new WeakSet,h=new WeakSet,d=new WeakSet,f=new WeakSet,S=new WeakSet,g=new WeakSet,p=new WeakSet,y=new WeakSet,v=new WeakSet,b=new WeakSet,k=new WeakSet,m=new WeakSet,w=new WeakSet,A=new WeakSet,I=new WeakSet,x=new WeakSet,W=new WeakSet,C=new WeakSet,O=new WeakSet,R=new WeakSet,E=new WeakSet,T=function(){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e(this,t),E.add(this),R.add(this),O.add(this),C.add(this),W.add(this),x.add(this),I.add(this),A.add(this),w.add(this),m.add(this),k.add(this),b.add(this),v.add(this),y.add(this),p.add(this),g.add(this),S.add(this),f.add(this),d.add(this),h.add(this),o.add(this),l.Surf=n,l.config=s(s({},l.config),i)}return n(t,[{key:"getBackupData",value:function(){return new l}},{key:"on",value:function(e,t){return"*"===e?l.allEvents.forEach((function(e){return l.events[e]=t})):e.split(",").forEach((function(e){return l.events[e.trim()]=t})),this}},{key:"schedules",value:function(e){if(!Array.isArray(e))throw new Error("Schedules must be an array");return l.schedules=e,u(this,k,M).call(this),this}},{key:"pause",value:function(){return l.isPaused||(l.isReady=!1,l.isPaused=!0,u(this,O,Q).call(this)),this}},{key:"quit",value:function(){return l.Surf.quit(),this}},{key:"ready",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};return u(this,v,z).call(this,e),l.canStart=!0,this}},{key:"reconfigure",value:function(e){return l.config=s(s({},l.config),e),this}},{key:"restart",value:function(){var e=this;return l.isLoading&&setTimeout((function(){return e.restart()}),1e3),l.reset(),l.Surf.quit(),l.Surf.init(this),u(this,k,M).call(this,!0),this.start()}},{key:"resume",value:function(){return l.isPaused?(u(this,C,K).call(this,"resumed",{scheduleIndex:l.currentSchedule,actionIndex:l.currentIndex,action:l.currentAction,on:l.current}),l.isReady=!0,l.isPaused=!1,u(this,A,B).call(this)?u(this,b,H).call(this):2===l.toResume?u(this,o,D).call(this):u(this,d,j).call(this),this):this}},{key:"start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!l.canStart)throw new Error("You have to call ready first");return l.isLoading||!l.schedules.length?(l.startLoopCount<10&&(l.startLoopCount++,setTimeout((function(){return e.start(t,!1)}),1e3)),this):(l.currentSchedule=-1,l.isDone=!0,l.config=s(s({},l.config),t),u(this,b,H).call(this),this)}}]),t}(),D=function e(t){var n=this;try{if(l.currentAction="check",l.toResume=2,t?l.currentIndex=0:l.currentIndex++,l.isReady&&!l.isLoading&&l.actionables[l.currentSchedule])if(l.actionables[l.currentSchedule].toCheck.length){if(l.current=l.actionables[l.currentSchedule].toCheck.shift(),l.current){u(this,I,Y).call(this);var i=l.current,r=i.action,s=i.params,c=i.selector,a=r;-1!==r.toLowerCase().indexOf("not")&&(a=r.replace(/not/i,"")),l.isReady=!1,u(this,g,_).call(this,a,s,c,(function(e,t){return u(n,R,V).call(n,r,e,t)}))}}else u(this,S,L).call(this)}catch(t){l.isReady=!0,u(this,f,U).call(this,t.message),l.config.autoAdvance?u(this,o,e).call(this):this.pause()}},P=function(){null!==l.current&&(l.current=null,l.isReady=!1,l.isDone=!0,u(this,x,$).call(this),l.Surf.quit(this),u(this,C,K).call(this,"done",l.results))},j=function e(t){var n=this;try{if(l.currentAction="do",l.toResume=1,t?l.currentIndex=0:l.currentIndex++,l.isReady&&!l.isLoading&&l.actionables[l.currentSchedule])if(l.actionables[l.currentSchedule].toDo.length){if(l.current=l.actionables[l.currentSchedule].toDo.shift(),l.current){var i=l.current,r=i.action,s=i.params,c=void 0===s?[]:s,a=i.selector;l.isReady=!1,"type"===r&&c.length<3&&c.push(l.config.typingSpeed),u(this,g,_).call(this,r,c,a,(function(e,t){return u(n,p,F).call(n,e,t)}))}}else u(this,o,D).call(this,!0)}catch(t){u(this,f,U).call(this,t.message),l.config.autoAdvance?u(this,d,e).call(this):this.pause()}},U=function(e){try{u(this,x,$).call(this),l.results.length<=l.currentSchedule&&l.results.push({title:l.schedules[l.currentSchedule].title,list:[],passed:0,failed:0}),l.results[l.currentSchedule].failed++,l.results[l.currentSchedule].list.push({action:l.currentAction,index:this.currentIndex,description:l.current.description,is_succes:!1}),u(this,C,K).call(this,"actionFailed",{scheduleIndex:l.currentSchedule,actionIndex:l.currentIndex,action:l.currentAction,on:l.current,message:e||l.config.defaultFailMessage}),u(this,O,Q).call(this)}catch(e){}return this},L=function(){u(this,A,B).call(this)&&(l.isDone||u(this,C,K).call(this,"scheduleFinish",{scheduleIndex:l.currentSchedule}),l.isDone=!0,u(this,y,q).call(this)?l.config.autoAdvance?u(this,b,H).call(this):this.pause():u(this,h,P).call(this))},_=function(e,t,n,i){var r="".concat(l.currentAction).concat(e.replace(/^[a-z]/i,(function(e){return e.toUpperCase()})));if(u(this,I,Y).call(this),l.customHandlers[r])l.customHandlers[r].call(this,i,n,t);else{var s=function(){l.Surf.setSuccessCallback((function(){})),l.Surf.setErrorCallback((function(){}))};try{var a;n&&t.unshift(n),l.Surf.setSuccessCallback((function(){s(),i(l.STATUS_SUCCESS)})),l.Surf.setErrorCallback((function(e){s(),i(l.STATUS_ERROR,e)})),(a=l.Surf)[r].apply(a,c(t))}catch(e){s(),i(l.STATUS_ERROR,e.message.replace("Failed to execute 'querySelectorAll' on 'Document': ",""))}}},F=function(e,t){return e===l.STATUS_SUCCESS?u(this,W,G).call(this):u(this,f,U).call(this,t),l.isPaused||l.isDone||l.isWaiting||(l.isReady=!0,l.isLoading=!1,l.config.autoAdvance?u(this,d,j).call(this):u(this,A,B).call(this)?u(this,S,L).call(this):this.pause()),this},q=function(){return void 0!==l.actionables[l.currentSchedule+1]},z=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};l.Surf.init(this,(function(n){if(n){var i=Object.keys((new l).toJSON());for(var r in n){if(!i.includes(r))break;l[r]=n[r]}}l.isWorking&&u(e,p,F).call(e,l.STATUS_SUCCESS),t(!!n)}))},H=function(){return l.isDone?u(this,y,q).call(this)?(l.currentSchedule++,l.isReady=!0,l.isDone=!1,u(this,C,K).call(this,"scheduleStart",{scheduleIndex:l.currentSchedule}),u(this,d,j).call(this,!0),this):(u(this,h,P).call(this),this):this},M=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return l.isLoading=!0,l.schedules.forEach((function(n,i){var r=n.do||[],s=n.check||[];r.forEach((function(t){n.url&&(t.url=n.url),u(e,w,J).call(e,t,i)})),s.forEach((function(t){return u(e,m,N).call(e,t,i)})),t||u(e,C,K).call(e,"scheduleInit",{schedule:n,scheduleIndex:i})})),l.isLoading=!1,this},N=function(e,t){l.actionables.length===t&&l.actionables.push({toDo:[],toCheck:[]});var n=s({selector:null,action:e,params:[],description:'Checking "'.concat(e.action,'" on [').concat("isOn"==e.action||"isNotOn"==e.action?e.params[0]:e.selector,"]")},e);return l.actionables[t].toCheck.push(n),this},J=function(e,t){var n=s({selector:null,action:e,params:[],description:null},e);return l.actionables.length===t&&l.actionables.push({toDo:[],toCheck:[]}),l.actionables[t].toDo.push(n),this},B=function(){return!l.actionables[l.currentSchedule]||!l.actionables[l.currentSchedule].toDo.length&&!l.actionables[l.currentSchedule].toCheck.length},Y=function(){return l.isWorking||(u(this,C,K).call(this,"actionStart",{scheduleIndex:l.currentSchedule,actionIndex:l.currentIndex,action:l.currentAction,on:l.current}),l.isWorking=!0),this},$=function(){return l.isWorking=!1,this},G=function(){try{u(this,x,$).call(this),l.results.length<=l.currentSchedule&&l.results.push({title:l.schedules[l.currentSchedule].title,list:[],passed:0,failed:0}),l.results[l.currentSchedule].passed++,l.results[l.currentSchedule].list.push({action:l.currentAction,index:this.currentIndex,description:l.current.description,is_success:!0}),u(this,C,K).call(this,"actionSuccess",{scheduleIndex:l.currentSchedule,actionIndex:l.currentIndex,action:l.currentAction,on:l.current}),u(this,O,Q).call(this)}catch(e){}return this},K=function(e,t){try{var n;t.schedule?(n=t.schedule,delete t.schedule):t.scheduleIndex?n=l.schedules[t.scheduleIndex]:l.currentSchedule>-1&&(n=l.schedules[l.currentSchedule]),l.events[e]({name:e,schedule:n,detail:t})}catch(e){}return this},Q=function(){l.isPaused&&!l.isWorking&&u(this,C,K).call(this,"paused",{scheduleIndex:l.currentSchedule,actionIndex:l.currentIndex,action:l.currentAction,on:l.current})},V=function(e,t,n){try{-1!==e.toLowerCase().indexOf("not")?t===l.STATUS_SUCCESS?u(this,f,U).call(this,n):u(this,W,G).call(this):t===l.STATUS_SUCCESS?u(this,W,G).call(this):u(this,f,U).call(this,n)}catch(e){u(this,f,U).call(this,e.message)}return l.isReady=!0,l.config.autoAdvance?u(this,o,D).call(this):u(this,A,B).call(this)?u(this,S,L).call(this):this.pause(),this};export default T; |
@@ -1,1 +0,1 @@ | ||
"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function n(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){i(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function r(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function u(t,e,n){if(t!==e)throw new TypeError("Private static access of wrong provenance");return n}function l(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}var o=function(){function e(){t(this,e)}return n(e,null,[{key:"init",value:function(t){}},{key:"quit",value:function(t){}},{key:"checkAttrContains",value:function(t,n,i){u(this,e,h).call(this)}},{key:"checkAttrIs",value:function(t,n,i){u(this,e,h).call(this)}},{key:"checkExists",value:function(t){u(this,e,h).call(this)}},{key:"checkElementIs",value:function(t,n){u(this,e,h).call(this)}},{key:"checkIsOn",value:function(t,n){u(this,e,h).call(this)}},{key:"checkTextContains",value:function(t,n){u(this,e,h).call(this)}},{key:"checkTextIs",value:function(t,n){u(this,e,h).call(this)}},{key:"checkValueContains",value:function(t,n){u(this,e,h).call(this)}},{key:"checkValueIs",value:function(t,n){u(this,e,h).call(this)}},{key:"doClick",value:function(t){u(this,e,h).call(this)}},{key:"doGoBack",value:function(){u(this,e,h).call(this)}},{key:"doWait",value:function(t){u(this,e,h).call(this)}},{key:"doWaitTillPageLoads",value:function(){u(this,e,h).call(this)}},{key:"doGoto",value:function(t){u(this,e,h).call(this)}},{key:"doRefresh",value:function(){u(this,e,h).call(this)}},{key:"doSelect",value:function(t,n){u(this,e,h).call(this)}},{key:"doSubmitForm",value:function(t){u(this,e,h).call(this)}},{key:"doType",value:function(t,n){u(this,e,h).call(this)}}]),e}(),h=function(){throw new Error("Not implemented")},d=function(){function e(){t(this,e)}return n(e,[{key:"toJSON",value:function(){return{actionables:e.actionables,config:e.config,schedules:e.schedules,results:e.results,canStart:e.canStart,isDone:e.isDone,isInitialized:e.isInitialized,isLoading:e.isLoading,isPaused:e.isPaused,isReady:e.isReady,isWaiting:e.isWaiting,isWorking:e.isWorking,current:e.current,currentAction:e.currentAction,currentIndex:e.currentIndex,currentSchedule:e.currentSchedule,toResume:e.toResume}}}],[{key:"reset",value:function(){e.actionables=[],e.results=[],e.isPaused=!1,e.isWorking=!1,e.isWaiting=!1,e.current=null,e.currentAction=null,e.currentIndex=null,e.currentSchedule=null,e.toResume=null,e.startLoopCount=0}}]),e}();i(d,"STATUS_SUCCESS",!0),i(d,"STATUS_ERROR",!1),i(d,"Surf",null),i(d,"config",{autoAdvance:!0,defaultFailMessage:"",typingSpeed:500}),i(d,"actionables",[]),i(d,"schedules",[]),i(d,"results",[]),i(d,"events",{}),i(d,"allEvents",["actionError","actionFailed","actionStart","actionSuccess","done","paused","resumed","scheduleFinish","scheduleInit","scheduleStart"]),i(d,"customHandlers",{}),i(d,"canStart",!1),i(d,"isDone",!1),i(d,"isInitialized",!1),i(d,"isLoading",!1),i(d,"isPaused",!1),i(d,"isReady",!1),i(d,"isWorking",!1),i(d,"isWaiting",!1),i(d,"current",null),i(d,"currentAction",null),i(d,"currentIndex",null),i(d,"currentSchedule",null),i(d,"toResume",null),i(d,"startLoopCount",0);var f=new WeakSet,S=new WeakSet,y=new WeakSet,k=new WeakSet,p=new WeakSet,v=new WeakSet,g=new WeakSet,b=new WeakSet,m=new WeakSet,w=new WeakSet,A=new WeakSet,I=new WeakSet,x=new WeakSet,W=new WeakSet,C=new WeakSet,O=new WeakSet,E=new WeakSet,R=new WeakSet,T=new WeakSet,D=new WeakSet,P=new WeakSet,j=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(t(this,e),P.add(this),D.add(this),T.add(this),R.add(this),E.add(this),O.add(this),C.add(this),W.add(this),x.add(this),I.add(this),A.add(this),w.add(this),m.add(this),b.add(this),g.add(this),v.add(this),p.add(this),k.add(this),y.add(this),S.add(this),f.add(this),this.version="1.0.0","function"!=typeof i)throw new Error("Adapter must be a class");if(!(new i instanceof o))throw new Error("Adapter must be a subclass of BaseAdapter");d.Surf=i,d.config=c(c({},d.config),n)}return n(e,[{key:"getBackupData",value:function(){return new d}},{key:"on",value:function(t,e){return"*"===t?d.allEvents.forEach((function(t){return d.events[t]=e})):t.split(",").forEach((function(t){return d.events[t.trim()]=e})),this}},{key:"schedules",value:function(t){if(!Array.isArray(t))throw new Error("Schedules must be an array");return d.schedules=t,l(this,A,G).call(this),this}},{key:"pause",value:function(){return d.isPaused||(d.isReady=!1,d.isPaused=!0,l(this,T,Z).call(this)),this}},{key:"quit",value:function(){return d.Surf.quit(),this}},{key:"ready",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};return l(this,m,H).call(this,t),d.canStart=!0,this}},{key:"reconfigure",value:function(t){return d.config=c(c({},d.config),t),this}},{key:"restart",value:function(){var t=this;return d.isLoading&&setTimeout((function(){return t.restart()}),1e3),d.reset(),d.Surf.quit(),d.Surf.init(this),l(this,A,G).call(this,!0),this.start()}},{key:"resume",value:function(){return d.isPaused?(l(this,R,X).call(this,"resumed",{scheduleIndex:d.currentSchedule,actionIndex:d.currentIndex,action:d.currentAction,on:d.current}),d.isReady=!0,d.isPaused=!1,l(this,W,Y).call(this)?l(this,w,M).call(this):2===d.toResume?l(this,f,L).call(this):l(this,y,_).call(this),this):this}},{key:"start",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!d.canStart)throw new Error("You have to call ready first");return d.isLoading||!d.schedules.length?(d.startLoopCount<10&&(d.startLoopCount++,setTimeout((function(){return t.start(e,!1)}),1e3)),this):(d.currentSchedule=-1,d.isDone=!0,d.config=c(c({},d.config),e),l(this,w,M).call(this),this)}}]),e}(),L=function t(e){var n=this;try{if(d.currentAction="check",d.toResume=2,e?d.currentIndex=0:d.currentIndex++,d.isReady&&!d.isLoading&&d.actionables[d.currentSchedule])if(d.actionables[d.currentSchedule].toCheck.length){if(d.current=d.actionables[d.currentSchedule].toCheck.shift(),d.current){l(this,C,$).call(this);var i=d.current,s=i.action,c=i.params,r=i.selector,a=s;-1!==s.toLowerCase().indexOf("not")&&(a=s.replace(/not/i,"")),d.isReady=!1,l(this,v,z).call(this,a,c,r,(function(t,e){return l(n,D,tt).call(n,s,t,e)}))}}else l(this,p,q).call(this)}catch(e){d.isReady=!0,l(this,k,F).call(this,e.message),d.config.autoAdvance?l(this,f,t).call(this):this.pause()}},U=function(){null!==d.current&&(d.current=null,d.isReady=!1,d.isDone=!0,l(this,O,K).call(this),d.Surf.quit(this),l(this,R,X).call(this,"done",d.results))},_=function t(e){var n=this;try{if(d.currentAction="do",d.toResume=1,e?d.currentIndex=0:d.currentIndex++,d.isReady&&!d.isLoading&&d.actionables[d.currentSchedule])if(d.actionables[d.currentSchedule].toDo.length){if(d.current=d.actionables[d.currentSchedule].toDo.shift(),d.current){var i=d.current,s=i.action,c=i.params,r=void 0===c?[]:c,a=i.selector;d.isReady=!1,"type"===s&&r.length<3&&r.push(d.config.typingSpeed),l(this,v,z).call(this,s,r,a,(function(t,e){return l(n,g,N).call(n,t,e)}))}}else l(this,f,L).call(this,!0)}catch(e){l(this,k,F).call(this,e.message),d.config.autoAdvance?l(this,y,t).call(this):this.pause()}},F=function(t){try{l(this,O,K).call(this),d.results.length<=d.currentSchedule&&d.results.push({title:d.schedules[d.currentSchedule].title,list:[],passed:0,failed:0}),d.results[d.currentSchedule].failed++,d.results[d.currentSchedule].list.push({action:d.currentAction,index:this.currentIndex,description:d.current.description,is_succes:!1}),l(this,R,X).call(this,"actionFailed",{scheduleIndex:d.currentSchedule,actionIndex:d.currentIndex,action:d.currentAction,on:d.current,message:t||d.config.defaultFailMessage}),l(this,T,Z).call(this)}catch(t){}return this},q=function(){l(this,W,Y).call(this)&&(d.isDone||l(this,R,X).call(this,"scheduleFinish",{scheduleIndex:d.currentSchedule}),d.isDone=!0,l(this,b,B).call(this)?d.config.autoAdvance?l(this,w,M).call(this):this.pause():l(this,S,U).call(this))},z=function(t,e,n,i){var s="".concat(d.currentAction).concat(t.replace(/^[a-z]/i,(function(t){return t.toUpperCase()})));if(l(this,C,$).call(this),d.customHandlers[s])d.customHandlers[s].call(this,i,n,e);else{var c=function(){d.Surf.setSuccessCallback((function(){})),d.Surf.setErrorCallback((function(){}))};try{var a;n&&e.unshift(n),d.Surf.setSuccessCallback((function(){c(),i(d.STATUS_SUCCESS)})),d.Surf.setErrorCallback((function(t){c(),i(d.STATUS_ERROR,t)})),(a=d.Surf)[s].apply(a,r(e))}catch(t){c(),i(d.STATUS_ERROR,t.message.replace("Failed to execute 'querySelectorAll' on 'Document': ",""))}}},N=function(t,e){return t===d.STATUS_SUCCESS?l(this,E,Q).call(this):l(this,k,F).call(this,e),d.isPaused||d.isDone||d.isWaiting||(d.isReady=!0,d.isLoading=!1,d.config.autoAdvance?l(this,y,_).call(this):l(this,W,Y).call(this)?l(this,p,q).call(this):this.pause()),this},B=function(){return void 0!==d.actionables[d.currentSchedule+1]},H=function(t){var e=this;d.Surf.init(this,(function(n){if(n){var i=Object.keys((new d).toJSON());for(var s in n){if(!i.includes(s))return;d[s]=n[s]}}d.isWorking&&l(e,g,N).call(e,d.STATUS_SUCCESS),t(!!n)}))},M=function(){return d.isDone?l(this,b,B).call(this)?(d.currentSchedule++,d.isReady=!0,d.isDone=!1,l(this,R,X).call(this,"scheduleStart",{scheduleIndex:d.currentSchedule}),l(this,y,_).call(this,!0),this):(l(this,S,U).call(this),this):this},G=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return d.isLoading=!0,d.schedules.forEach((function(n,i){n.do.forEach((function(e){n.url&&(e.url=n.url),l(t,x,V).call(t,e,i)})),n.check.forEach((function(e){return l(t,I,J).call(t,e,i)})),e||l(t,R,X).call(t,"scheduleInit",{schedule:n,scheduleIndex:i})})),d.isLoading=!1,this},J=function(t,e){d.actionables.length===e&&d.actionables.push({toDo:[],toCheck:[]});var n=c({selector:null,action:t,params:[],description:'Checking "'.concat(t.action,'" on [').concat("isOn"==t.action||"isNotOn"==t.action?t.params[0]:t.selector,"]")},t);return d.actionables[e].toCheck.push(n),this},V=function(t,e){var n=c({selector:null,action:t,params:[],description:null},t);return d.actionables.length===e&&d.actionables.push({toDo:[],toCheck:[]}),d.actionables[e].toDo.push(n),this},Y=function(){return!d.actionables[d.currentSchedule]||!d.actionables[d.currentSchedule].toDo.length&&!d.actionables[d.currentSchedule].toCheck.length},$=function(){return d.isWorking||(l(this,R,X).call(this,"actionStart",{scheduleIndex:d.currentSchedule,actionIndex:d.currentIndex,action:d.currentAction,on:d.current}),d.isWorking=!0),this},K=function(){return d.isWorking=!1,this},Q=function(){try{l(this,O,K).call(this),d.results.length<=d.currentSchedule&&d.results.push({title:d.schedules[d.currentSchedule].title,list:[],passed:0,failed:0}),d.results[d.currentSchedule].passed++,d.results[d.currentSchedule].list.push({action:d.currentAction,index:this.currentIndex,description:d.current.description,is_success:!0}),l(this,R,X).call(this,"actionSuccess",{scheduleIndex:d.currentSchedule,actionIndex:d.currentIndex,action:d.currentAction,on:d.current}),l(this,T,Z).call(this)}catch(t){}return this},X=function(t,e){try{var n;e.schedule?(n=e.schedule,delete e.schedule):e.scheduleIndex?n=d.schedules[e.scheduleIndex]:d.currentSchedule>-1&&(n=d.schedules[d.currentSchedule]),d.events[t]({name:t,schedule:n,detail:e})}catch(t){}return this},Z=function(){d.isPaused&&!d.isWorking&&l(this,R,X).call(this,"paused",{scheduleIndex:d.currentSchedule,actionIndex:d.currentIndex,action:d.currentAction,on:d.current})},tt=function(t,e,n){try{-1!==t.toLowerCase().indexOf("not")?e===d.STATUS_SUCCESS?l(this,k,F).call(this,n):l(this,E,Q).call(this):e===d.STATUS_SUCCESS?l(this,E,Q).call(this):l(this,k,F).call(this,n)}catch(t){l(this,k,F).call(this,t.message)}return d.isReady=!0,d.config.autoAdvance?l(this,f,L).call(this):l(this,W,Y).call(this)?l(this,p,q).call(this):this.pause(),this};module.exports=j; | ||
"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function n(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function u(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}var l=function(){function t(){e(this,t)}return n(t,[{key:"toJSON",value:function(){return{actionables:t.actionables,config:t.config,schedules:t.schedules,results:t.results,canStart:t.canStart,isDone:t.isDone,isInitialized:t.isInitialized,isLoading:t.isLoading,isPaused:t.isPaused,isReady:t.isReady,isWaiting:t.isWaiting,isWorking:t.isWorking,current:t.current,currentAction:t.currentAction,currentIndex:t.currentIndex,currentSchedule:t.currentSchedule,toResume:t.toResume}}}],[{key:"reset",value:function(){t.actionables=[],t.results=[],t.isPaused=!1,t.isWorking=!1,t.isWaiting=!1,t.current=null,t.currentAction=null,t.currentIndex=null,t.currentSchedule=null,t.toResume=null,t.startLoopCount=0}}]),t}();i(l,"STATUS_SUCCESS",!0),i(l,"STATUS_ERROR",!1),i(l,"Surf",null),i(l,"config",{autoAdvance:!0,defaultFailMessage:"",typingSpeed:500}),i(l,"actionables",[]),i(l,"schedules",[]),i(l,"results",[]),i(l,"events",{}),i(l,"allEvents",["actionError","actionFailed","actionStart","actionSuccess","done","paused","resumed","scheduleFinish","scheduleInit","scheduleStart"]),i(l,"customHandlers",{}),i(l,"canStart",!1),i(l,"isDone",!1),i(l,"isInitialized",!1),i(l,"isLoading",!1),i(l,"isPaused",!1),i(l,"isReady",!1),i(l,"isWorking",!1),i(l,"isWaiting",!1),i(l,"current",null),i(l,"currentAction",null),i(l,"currentIndex",null),i(l,"currentSchedule",null),i(l,"toResume",null),i(l,"startLoopCount",0);var o=new WeakSet,h=new WeakSet,d=new WeakSet,f=new WeakSet,S=new WeakSet,g=new WeakSet,p=new WeakSet,y=new WeakSet,v=new WeakSet,b=new WeakSet,k=new WeakSet,m=new WeakSet,w=new WeakSet,A=new WeakSet,I=new WeakSet,x=new WeakSet,W=new WeakSet,C=new WeakSet,O=new WeakSet,R=new WeakSet,E=new WeakSet,T=function(){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e(this,t),E.add(this),R.add(this),O.add(this),C.add(this),W.add(this),x.add(this),I.add(this),A.add(this),w.add(this),m.add(this),k.add(this),b.add(this),v.add(this),y.add(this),p.add(this),g.add(this),S.add(this),f.add(this),d.add(this),h.add(this),o.add(this),l.Surf=n,l.config=s(s({},l.config),i)}return n(t,[{key:"getBackupData",value:function(){return new l}},{key:"on",value:function(e,t){return"*"===e?l.allEvents.forEach((function(e){return l.events[e]=t})):e.split(",").forEach((function(e){return l.events[e.trim()]=t})),this}},{key:"schedules",value:function(e){if(!Array.isArray(e))throw new Error("Schedules must be an array");return l.schedules=e,u(this,k,M).call(this),this}},{key:"pause",value:function(){return l.isPaused||(l.isReady=!1,l.isPaused=!0,u(this,O,Q).call(this)),this}},{key:"quit",value:function(){return l.Surf.quit(),this}},{key:"ready",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};return u(this,v,z).call(this,e),l.canStart=!0,this}},{key:"reconfigure",value:function(e){return l.config=s(s({},l.config),e),this}},{key:"restart",value:function(){var e=this;return l.isLoading&&setTimeout((function(){return e.restart()}),1e3),l.reset(),l.Surf.quit(),l.Surf.init(this),u(this,k,M).call(this,!0),this.start()}},{key:"resume",value:function(){return l.isPaused?(u(this,C,K).call(this,"resumed",{scheduleIndex:l.currentSchedule,actionIndex:l.currentIndex,action:l.currentAction,on:l.current}),l.isReady=!0,l.isPaused=!1,u(this,A,B).call(this)?u(this,b,H).call(this):2===l.toResume?u(this,o,D).call(this):u(this,d,j).call(this),this):this}},{key:"start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!l.canStart)throw new Error("You have to call ready first");return l.isLoading||!l.schedules.length?(l.startLoopCount<10&&(l.startLoopCount++,setTimeout((function(){return e.start(t,!1)}),1e3)),this):(l.currentSchedule=-1,l.isDone=!0,l.config=s(s({},l.config),t),u(this,b,H).call(this),this)}}]),t}(),D=function e(t){var n=this;try{if(l.currentAction="check",l.toResume=2,t?l.currentIndex=0:l.currentIndex++,l.isReady&&!l.isLoading&&l.actionables[l.currentSchedule])if(l.actionables[l.currentSchedule].toCheck.length){if(l.current=l.actionables[l.currentSchedule].toCheck.shift(),l.current){u(this,I,Y).call(this);var i=l.current,r=i.action,s=i.params,c=i.selector,a=r;-1!==r.toLowerCase().indexOf("not")&&(a=r.replace(/not/i,"")),l.isReady=!1,u(this,g,_).call(this,a,s,c,(function(e,t){return u(n,R,V).call(n,r,e,t)}))}}else u(this,S,L).call(this)}catch(t){l.isReady=!0,u(this,f,U).call(this,t.message),l.config.autoAdvance?u(this,o,e).call(this):this.pause()}},P=function(){null!==l.current&&(l.current=null,l.isReady=!1,l.isDone=!0,u(this,x,$).call(this),l.Surf.quit(this),u(this,C,K).call(this,"done",l.results))},j=function e(t){var n=this;try{if(l.currentAction="do",l.toResume=1,t?l.currentIndex=0:l.currentIndex++,l.isReady&&!l.isLoading&&l.actionables[l.currentSchedule])if(l.actionables[l.currentSchedule].toDo.length){if(l.current=l.actionables[l.currentSchedule].toDo.shift(),l.current){var i=l.current,r=i.action,s=i.params,c=void 0===s?[]:s,a=i.selector;l.isReady=!1,"type"===r&&c.length<3&&c.push(l.config.typingSpeed),u(this,g,_).call(this,r,c,a,(function(e,t){return u(n,p,F).call(n,e,t)}))}}else u(this,o,D).call(this,!0)}catch(t){u(this,f,U).call(this,t.message),l.config.autoAdvance?u(this,d,e).call(this):this.pause()}},U=function(e){try{u(this,x,$).call(this),l.results.length<=l.currentSchedule&&l.results.push({title:l.schedules[l.currentSchedule].title,list:[],passed:0,failed:0}),l.results[l.currentSchedule].failed++,l.results[l.currentSchedule].list.push({action:l.currentAction,index:this.currentIndex,description:l.current.description,is_succes:!1}),u(this,C,K).call(this,"actionFailed",{scheduleIndex:l.currentSchedule,actionIndex:l.currentIndex,action:l.currentAction,on:l.current,message:e||l.config.defaultFailMessage}),u(this,O,Q).call(this)}catch(e){}return this},L=function(){u(this,A,B).call(this)&&(l.isDone||u(this,C,K).call(this,"scheduleFinish",{scheduleIndex:l.currentSchedule}),l.isDone=!0,u(this,y,q).call(this)?l.config.autoAdvance?u(this,b,H).call(this):this.pause():u(this,h,P).call(this))},_=function(e,t,n,i){var r="".concat(l.currentAction).concat(e.replace(/^[a-z]/i,(function(e){return e.toUpperCase()})));if(u(this,I,Y).call(this),l.customHandlers[r])l.customHandlers[r].call(this,i,n,t);else{var s=function(){l.Surf.setSuccessCallback((function(){})),l.Surf.setErrorCallback((function(){}))};try{var a;n&&t.unshift(n),l.Surf.setSuccessCallback((function(){s(),i(l.STATUS_SUCCESS)})),l.Surf.setErrorCallback((function(e){s(),i(l.STATUS_ERROR,e)})),(a=l.Surf)[r].apply(a,c(t))}catch(e){s(),i(l.STATUS_ERROR,e.message.replace("Failed to execute 'querySelectorAll' on 'Document': ",""))}}},F=function(e,t){return e===l.STATUS_SUCCESS?u(this,W,G).call(this):u(this,f,U).call(this,t),l.isPaused||l.isDone||l.isWaiting||(l.isReady=!0,l.isLoading=!1,l.config.autoAdvance?u(this,d,j).call(this):u(this,A,B).call(this)?u(this,S,L).call(this):this.pause()),this},q=function(){return void 0!==l.actionables[l.currentSchedule+1]},z=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};l.Surf.init(this,(function(n){if(n){var i=Object.keys((new l).toJSON());for(var r in n){if(!i.includes(r))break;l[r]=n[r]}}l.isWorking&&u(e,p,F).call(e,l.STATUS_SUCCESS),t(!!n)}))},H=function(){return l.isDone?u(this,y,q).call(this)?(l.currentSchedule++,l.isReady=!0,l.isDone=!1,u(this,C,K).call(this,"scheduleStart",{scheduleIndex:l.currentSchedule}),u(this,d,j).call(this,!0),this):(u(this,h,P).call(this),this):this},M=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return l.isLoading=!0,l.schedules.forEach((function(n,i){var r=n.do||[],s=n.check||[];r.forEach((function(t){n.url&&(t.url=n.url),u(e,w,J).call(e,t,i)})),s.forEach((function(t){return u(e,m,N).call(e,t,i)})),t||u(e,C,K).call(e,"scheduleInit",{schedule:n,scheduleIndex:i})})),l.isLoading=!1,this},N=function(e,t){l.actionables.length===t&&l.actionables.push({toDo:[],toCheck:[]});var n=s({selector:null,action:e,params:[],description:'Checking "'.concat(e.action,'" on [').concat("isOn"==e.action||"isNotOn"==e.action?e.params[0]:e.selector,"]")},e);return l.actionables[t].toCheck.push(n),this},J=function(e,t){var n=s({selector:null,action:e,params:[],description:null},e);return l.actionables.length===t&&l.actionables.push({toDo:[],toCheck:[]}),l.actionables[t].toDo.push(n),this},B=function(){return!l.actionables[l.currentSchedule]||!l.actionables[l.currentSchedule].toDo.length&&!l.actionables[l.currentSchedule].toCheck.length},Y=function(){return l.isWorking||(u(this,C,K).call(this,"actionStart",{scheduleIndex:l.currentSchedule,actionIndex:l.currentIndex,action:l.currentAction,on:l.current}),l.isWorking=!0),this},$=function(){return l.isWorking=!1,this},G=function(){try{u(this,x,$).call(this),l.results.length<=l.currentSchedule&&l.results.push({title:l.schedules[l.currentSchedule].title,list:[],passed:0,failed:0}),l.results[l.currentSchedule].passed++,l.results[l.currentSchedule].list.push({action:l.currentAction,index:this.currentIndex,description:l.current.description,is_success:!0}),u(this,C,K).call(this,"actionSuccess",{scheduleIndex:l.currentSchedule,actionIndex:l.currentIndex,action:l.currentAction,on:l.current}),u(this,O,Q).call(this)}catch(e){}return this},K=function(e,t){try{var n;t.schedule?(n=t.schedule,delete t.schedule):t.scheduleIndex?n=l.schedules[t.scheduleIndex]:l.currentSchedule>-1&&(n=l.schedules[l.currentSchedule]),l.events[e]({name:e,schedule:n,detail:t})}catch(e){}return this},Q=function(){l.isPaused&&!l.isWorking&&u(this,C,K).call(this,"paused",{scheduleIndex:l.currentSchedule,actionIndex:l.currentIndex,action:l.currentAction,on:l.current})},V=function(e,t,n){try{-1!==e.toLowerCase().indexOf("not")?t===l.STATUS_SUCCESS?u(this,f,U).call(this,n):u(this,W,G).call(this):t===l.STATUS_SUCCESS?u(this,W,G).call(this):u(this,f,U).call(this,n)}catch(e){u(this,f,U).call(this,e.message)}return l.isReady=!0,l.config.autoAdvance?u(this,o,D).call(this):u(this,A,B).call(this)?u(this,S,L).call(this):this.pause(),this};module.exports=T; |
@@ -1,1 +0,1 @@ | ||
var AutoSurf=function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function n(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){i(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function r(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function u(t,e,n){if(t!==e)throw new TypeError("Private static access of wrong provenance");return n}function l(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}var o=function(){function e(){t(this,e)}return n(e,null,[{key:"init",value:function(t){}},{key:"quit",value:function(t){}},{key:"checkAttrContains",value:function(t,n,i){u(this,e,h).call(this)}},{key:"checkAttrIs",value:function(t,n,i){u(this,e,h).call(this)}},{key:"checkExists",value:function(t){u(this,e,h).call(this)}},{key:"checkElementIs",value:function(t,n){u(this,e,h).call(this)}},{key:"checkIsOn",value:function(t,n){u(this,e,h).call(this)}},{key:"checkTextContains",value:function(t,n){u(this,e,h).call(this)}},{key:"checkTextIs",value:function(t,n){u(this,e,h).call(this)}},{key:"checkValueContains",value:function(t,n){u(this,e,h).call(this)}},{key:"checkValueIs",value:function(t,n){u(this,e,h).call(this)}},{key:"doClick",value:function(t){u(this,e,h).call(this)}},{key:"doGoBack",value:function(){u(this,e,h).call(this)}},{key:"doWait",value:function(t){u(this,e,h).call(this)}},{key:"doWaitTillPageLoads",value:function(){u(this,e,h).call(this)}},{key:"doGoto",value:function(t){u(this,e,h).call(this)}},{key:"doRefresh",value:function(){u(this,e,h).call(this)}},{key:"doSelect",value:function(t,n){u(this,e,h).call(this)}},{key:"doSubmitForm",value:function(t){u(this,e,h).call(this)}},{key:"doType",value:function(t,n){u(this,e,h).call(this)}}]),e}(),h=function(){throw new Error("Not implemented")},d=function(){function e(){t(this,e)}return n(e,[{key:"toJSON",value:function(){return{actionables:e.actionables,config:e.config,schedules:e.schedules,results:e.results,canStart:e.canStart,isDone:e.isDone,isInitialized:e.isInitialized,isLoading:e.isLoading,isPaused:e.isPaused,isReady:e.isReady,isWaiting:e.isWaiting,isWorking:e.isWorking,current:e.current,currentAction:e.currentAction,currentIndex:e.currentIndex,currentSchedule:e.currentSchedule,toResume:e.toResume}}}],[{key:"reset",value:function(){e.actionables=[],e.results=[],e.isPaused=!1,e.isWorking=!1,e.isWaiting=!1,e.current=null,e.currentAction=null,e.currentIndex=null,e.currentSchedule=null,e.toResume=null,e.startLoopCount=0}}]),e}();i(d,"STATUS_SUCCESS",!0),i(d,"STATUS_ERROR",!1),i(d,"Surf",null),i(d,"config",{autoAdvance:!0,defaultFailMessage:"",typingSpeed:500}),i(d,"actionables",[]),i(d,"schedules",[]),i(d,"results",[]),i(d,"events",{}),i(d,"allEvents",["actionError","actionFailed","actionStart","actionSuccess","done","paused","resumed","scheduleFinish","scheduleInit","scheduleStart"]),i(d,"customHandlers",{}),i(d,"canStart",!1),i(d,"isDone",!1),i(d,"isInitialized",!1),i(d,"isLoading",!1),i(d,"isPaused",!1),i(d,"isReady",!1),i(d,"isWorking",!1),i(d,"isWaiting",!1),i(d,"current",null),i(d,"currentAction",null),i(d,"currentIndex",null),i(d,"currentSchedule",null),i(d,"toResume",null),i(d,"startLoopCount",0);var f=new WeakSet,S=new WeakSet,y=new WeakSet,k=new WeakSet,p=new WeakSet,v=new WeakSet,g=new WeakSet,b=new WeakSet,m=new WeakSet,w=new WeakSet,A=new WeakSet,I=new WeakSet,x=new WeakSet,W=new WeakSet,C=new WeakSet,O=new WeakSet,E=new WeakSet,R=new WeakSet,T=new WeakSet,D=new WeakSet,P=new WeakSet,j=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(t(this,e),P.add(this),D.add(this),T.add(this),R.add(this),E.add(this),O.add(this),C.add(this),W.add(this),x.add(this),I.add(this),A.add(this),w.add(this),m.add(this),b.add(this),g.add(this),v.add(this),p.add(this),k.add(this),y.add(this),S.add(this),f.add(this),this.version="1.0.0","function"!=typeof i)throw new Error("Adapter must be a class");if(!(new i instanceof o))throw new Error("Adapter must be a subclass of BaseAdapter");d.Surf=i,d.config=c(c({},d.config),n)}return n(e,[{key:"getBackupData",value:function(){return new d}},{key:"on",value:function(t,e){return"*"===t?d.allEvents.forEach((function(t){return d.events[t]=e})):t.split(",").forEach((function(t){return d.events[t.trim()]=e})),this}},{key:"schedules",value:function(t){if(!Array.isArray(t))throw new Error("Schedules must be an array");return d.schedules=t,l(this,A,G).call(this),this}},{key:"pause",value:function(){return d.isPaused||(d.isReady=!1,d.isPaused=!0,l(this,T,Z).call(this)),this}},{key:"quit",value:function(){return d.Surf.quit(),this}},{key:"ready",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};return l(this,m,H).call(this,t),d.canStart=!0,this}},{key:"reconfigure",value:function(t){return d.config=c(c({},d.config),t),this}},{key:"restart",value:function(){var t=this;return d.isLoading&&setTimeout((function(){return t.restart()}),1e3),d.reset(),d.Surf.quit(),d.Surf.init(this),l(this,A,G).call(this,!0),this.start()}},{key:"resume",value:function(){return d.isPaused?(l(this,R,X).call(this,"resumed",{scheduleIndex:d.currentSchedule,actionIndex:d.currentIndex,action:d.currentAction,on:d.current}),d.isReady=!0,d.isPaused=!1,l(this,W,Y).call(this)?l(this,w,M).call(this):2===d.toResume?l(this,f,L).call(this):l(this,y,_).call(this),this):this}},{key:"start",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!d.canStart)throw new Error("You have to call ready first");return d.isLoading||!d.schedules.length?(d.startLoopCount<10&&(d.startLoopCount++,setTimeout((function(){return t.start(e,!1)}),1e3)),this):(d.currentSchedule=-1,d.isDone=!0,d.config=c(c({},d.config),e),l(this,w,M).call(this),this)}}]),e}(),L=function t(e){var n=this;try{if(d.currentAction="check",d.toResume=2,e?d.currentIndex=0:d.currentIndex++,d.isReady&&!d.isLoading&&d.actionables[d.currentSchedule])if(d.actionables[d.currentSchedule].toCheck.length){if(d.current=d.actionables[d.currentSchedule].toCheck.shift(),d.current){l(this,C,$).call(this);var i=d.current,s=i.action,c=i.params,r=i.selector,a=s;-1!==s.toLowerCase().indexOf("not")&&(a=s.replace(/not/i,"")),d.isReady=!1,l(this,v,z).call(this,a,c,r,(function(t,e){return l(n,D,tt).call(n,s,t,e)}))}}else l(this,p,q).call(this)}catch(e){d.isReady=!0,l(this,k,F).call(this,e.message),d.config.autoAdvance?l(this,f,t).call(this):this.pause()}},U=function(){null!==d.current&&(d.current=null,d.isReady=!1,d.isDone=!0,l(this,O,K).call(this),d.Surf.quit(this),l(this,R,X).call(this,"done",d.results))},_=function t(e){var n=this;try{if(d.currentAction="do",d.toResume=1,e?d.currentIndex=0:d.currentIndex++,d.isReady&&!d.isLoading&&d.actionables[d.currentSchedule])if(d.actionables[d.currentSchedule].toDo.length){if(d.current=d.actionables[d.currentSchedule].toDo.shift(),d.current){var i=d.current,s=i.action,c=i.params,r=void 0===c?[]:c,a=i.selector;d.isReady=!1,"type"===s&&r.length<3&&r.push(d.config.typingSpeed),l(this,v,z).call(this,s,r,a,(function(t,e){return l(n,g,N).call(n,t,e)}))}}else l(this,f,L).call(this,!0)}catch(e){l(this,k,F).call(this,e.message),d.config.autoAdvance?l(this,y,t).call(this):this.pause()}},F=function(t){try{l(this,O,K).call(this),d.results.length<=d.currentSchedule&&d.results.push({title:d.schedules[d.currentSchedule].title,list:[],passed:0,failed:0}),d.results[d.currentSchedule].failed++,d.results[d.currentSchedule].list.push({action:d.currentAction,index:this.currentIndex,description:d.current.description,is_succes:!1}),l(this,R,X).call(this,"actionFailed",{scheduleIndex:d.currentSchedule,actionIndex:d.currentIndex,action:d.currentAction,on:d.current,message:t||d.config.defaultFailMessage}),l(this,T,Z).call(this)}catch(t){}return this},q=function(){l(this,W,Y).call(this)&&(d.isDone||l(this,R,X).call(this,"scheduleFinish",{scheduleIndex:d.currentSchedule}),d.isDone=!0,l(this,b,B).call(this)?d.config.autoAdvance?l(this,w,M).call(this):this.pause():l(this,S,U).call(this))},z=function(t,e,n,i){var s="".concat(d.currentAction).concat(t.replace(/^[a-z]/i,(function(t){return t.toUpperCase()})));if(l(this,C,$).call(this),d.customHandlers[s])d.customHandlers[s].call(this,i,n,e);else{var c=function(){d.Surf.setSuccessCallback((function(){})),d.Surf.setErrorCallback((function(){}))};try{var a;n&&e.unshift(n),d.Surf.setSuccessCallback((function(){c(),i(d.STATUS_SUCCESS)})),d.Surf.setErrorCallback((function(t){c(),i(d.STATUS_ERROR,t)})),(a=d.Surf)[s].apply(a,r(e))}catch(t){c(),i(d.STATUS_ERROR,t.message.replace("Failed to execute 'querySelectorAll' on 'Document': ",""))}}},N=function(t,e){return t===d.STATUS_SUCCESS?l(this,E,Q).call(this):l(this,k,F).call(this,e),d.isPaused||d.isDone||d.isWaiting||(d.isReady=!0,d.isLoading=!1,d.config.autoAdvance?l(this,y,_).call(this):l(this,W,Y).call(this)?l(this,p,q).call(this):this.pause()),this},B=function(){return void 0!==d.actionables[d.currentSchedule+1]},H=function(t){var e=this;d.Surf.init(this,(function(n){if(n){var i=Object.keys((new d).toJSON());for(var s in n){if(!i.includes(s))return;d[s]=n[s]}}d.isWorking&&l(e,g,N).call(e,d.STATUS_SUCCESS),t(!!n)}))},M=function(){return d.isDone?l(this,b,B).call(this)?(d.currentSchedule++,d.isReady=!0,d.isDone=!1,l(this,R,X).call(this,"scheduleStart",{scheduleIndex:d.currentSchedule}),l(this,y,_).call(this,!0),this):(l(this,S,U).call(this),this):this},G=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return d.isLoading=!0,d.schedules.forEach((function(n,i){n.do.forEach((function(e){n.url&&(e.url=n.url),l(t,x,V).call(t,e,i)})),n.check.forEach((function(e){return l(t,I,J).call(t,e,i)})),e||l(t,R,X).call(t,"scheduleInit",{schedule:n,scheduleIndex:i})})),d.isLoading=!1,this},J=function(t,e){d.actionables.length===e&&d.actionables.push({toDo:[],toCheck:[]});var n=c({selector:null,action:t,params:[],description:'Checking "'.concat(t.action,'" on [').concat("isOn"==t.action||"isNotOn"==t.action?t.params[0]:t.selector,"]")},t);return d.actionables[e].toCheck.push(n),this},V=function(t,e){var n=c({selector:null,action:t,params:[],description:null},t);return d.actionables.length===e&&d.actionables.push({toDo:[],toCheck:[]}),d.actionables[e].toDo.push(n),this},Y=function(){return!d.actionables[d.currentSchedule]||!d.actionables[d.currentSchedule].toDo.length&&!d.actionables[d.currentSchedule].toCheck.length},$=function(){return d.isWorking||(l(this,R,X).call(this,"actionStart",{scheduleIndex:d.currentSchedule,actionIndex:d.currentIndex,action:d.currentAction,on:d.current}),d.isWorking=!0),this},K=function(){return d.isWorking=!1,this},Q=function(){try{l(this,O,K).call(this),d.results.length<=d.currentSchedule&&d.results.push({title:d.schedules[d.currentSchedule].title,list:[],passed:0,failed:0}),d.results[d.currentSchedule].passed++,d.results[d.currentSchedule].list.push({action:d.currentAction,index:this.currentIndex,description:d.current.description,is_success:!0}),l(this,R,X).call(this,"actionSuccess",{scheduleIndex:d.currentSchedule,actionIndex:d.currentIndex,action:d.currentAction,on:d.current}),l(this,T,Z).call(this)}catch(t){}return this},X=function(t,e){try{var n;e.schedule?(n=e.schedule,delete e.schedule):e.scheduleIndex?n=d.schedules[e.scheduleIndex]:d.currentSchedule>-1&&(n=d.schedules[d.currentSchedule]),d.events[t]({name:t,schedule:n,detail:e})}catch(t){}return this},Z=function(){d.isPaused&&!d.isWorking&&l(this,R,X).call(this,"paused",{scheduleIndex:d.currentSchedule,actionIndex:d.currentIndex,action:d.currentAction,on:d.current})},tt=function(t,e,n){try{-1!==t.toLowerCase().indexOf("not")?e===d.STATUS_SUCCESS?l(this,k,F).call(this,n):l(this,E,Q).call(this):e===d.STATUS_SUCCESS?l(this,E,Q).call(this):l(this,k,F).call(this,n)}catch(t){l(this,k,F).call(this,t.message)}return d.isReady=!0,d.config.autoAdvance?l(this,f,L).call(this):l(this,W,Y).call(this)?l(this,p,q).call(this):this.pause(),this};return j}(); | ||
var AutoSurf=function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function n(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function u(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}var l=function(){function t(){e(this,t)}return n(t,[{key:"toJSON",value:function(){return{actionables:t.actionables,config:t.config,schedules:t.schedules,results:t.results,canStart:t.canStart,isDone:t.isDone,isInitialized:t.isInitialized,isLoading:t.isLoading,isPaused:t.isPaused,isReady:t.isReady,isWaiting:t.isWaiting,isWorking:t.isWorking,current:t.current,currentAction:t.currentAction,currentIndex:t.currentIndex,currentSchedule:t.currentSchedule,toResume:t.toResume}}}],[{key:"reset",value:function(){t.actionables=[],t.results=[],t.isPaused=!1,t.isWorking=!1,t.isWaiting=!1,t.current=null,t.currentAction=null,t.currentIndex=null,t.currentSchedule=null,t.toResume=null,t.startLoopCount=0}}]),t}();i(l,"STATUS_SUCCESS",!0),i(l,"STATUS_ERROR",!1),i(l,"Surf",null),i(l,"config",{autoAdvance:!0,defaultFailMessage:"",typingSpeed:500}),i(l,"actionables",[]),i(l,"schedules",[]),i(l,"results",[]),i(l,"events",{}),i(l,"allEvents",["actionError","actionFailed","actionStart","actionSuccess","done","paused","resumed","scheduleFinish","scheduleInit","scheduleStart"]),i(l,"customHandlers",{}),i(l,"canStart",!1),i(l,"isDone",!1),i(l,"isInitialized",!1),i(l,"isLoading",!1),i(l,"isPaused",!1),i(l,"isReady",!1),i(l,"isWorking",!1),i(l,"isWaiting",!1),i(l,"current",null),i(l,"currentAction",null),i(l,"currentIndex",null),i(l,"currentSchedule",null),i(l,"toResume",null),i(l,"startLoopCount",0);var o=new WeakSet,h=new WeakSet,d=new WeakSet,f=new WeakSet,S=new WeakSet,g=new WeakSet,p=new WeakSet,y=new WeakSet,v=new WeakSet,b=new WeakSet,k=new WeakSet,m=new WeakSet,w=new WeakSet,A=new WeakSet,I=new WeakSet,x=new WeakSet,W=new WeakSet,C=new WeakSet,O=new WeakSet,R=new WeakSet,E=new WeakSet,T=function(){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e(this,t),E.add(this),R.add(this),O.add(this),C.add(this),W.add(this),x.add(this),I.add(this),A.add(this),w.add(this),m.add(this),k.add(this),b.add(this),v.add(this),y.add(this),p.add(this),g.add(this),S.add(this),f.add(this),d.add(this),h.add(this),o.add(this),l.Surf=n,l.config=s(s({},l.config),i)}return n(t,[{key:"getBackupData",value:function(){return new l}},{key:"on",value:function(e,t){return"*"===e?l.allEvents.forEach((function(e){return l.events[e]=t})):e.split(",").forEach((function(e){return l.events[e.trim()]=t})),this}},{key:"schedules",value:function(e){if(!Array.isArray(e))throw new Error("Schedules must be an array");return l.schedules=e,u(this,k,M).call(this),this}},{key:"pause",value:function(){return l.isPaused||(l.isReady=!1,l.isPaused=!0,u(this,O,Q).call(this)),this}},{key:"quit",value:function(){return l.Surf.quit(),this}},{key:"ready",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};return u(this,v,z).call(this,e),l.canStart=!0,this}},{key:"reconfigure",value:function(e){return l.config=s(s({},l.config),e),this}},{key:"restart",value:function(){var e=this;return l.isLoading&&setTimeout((function(){return e.restart()}),1e3),l.reset(),l.Surf.quit(),l.Surf.init(this),u(this,k,M).call(this,!0),this.start()}},{key:"resume",value:function(){return l.isPaused?(u(this,C,K).call(this,"resumed",{scheduleIndex:l.currentSchedule,actionIndex:l.currentIndex,action:l.currentAction,on:l.current}),l.isReady=!0,l.isPaused=!1,u(this,A,B).call(this)?u(this,b,H).call(this):2===l.toResume?u(this,o,D).call(this):u(this,d,j).call(this),this):this}},{key:"start",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!l.canStart)throw new Error("You have to call ready first");return l.isLoading||!l.schedules.length?(l.startLoopCount<10&&(l.startLoopCount++,setTimeout((function(){return e.start(t,!1)}),1e3)),this):(l.currentSchedule=-1,l.isDone=!0,l.config=s(s({},l.config),t),u(this,b,H).call(this),this)}}]),t}(),D=function e(t){var n=this;try{if(l.currentAction="check",l.toResume=2,t?l.currentIndex=0:l.currentIndex++,l.isReady&&!l.isLoading&&l.actionables[l.currentSchedule])if(l.actionables[l.currentSchedule].toCheck.length){if(l.current=l.actionables[l.currentSchedule].toCheck.shift(),l.current){u(this,I,Y).call(this);var i=l.current,r=i.action,s=i.params,c=i.selector,a=r;-1!==r.toLowerCase().indexOf("not")&&(a=r.replace(/not/i,"")),l.isReady=!1,u(this,g,_).call(this,a,s,c,(function(e,t){return u(n,R,V).call(n,r,e,t)}))}}else u(this,S,L).call(this)}catch(t){l.isReady=!0,u(this,f,U).call(this,t.message),l.config.autoAdvance?u(this,o,e).call(this):this.pause()}},P=function(){null!==l.current&&(l.current=null,l.isReady=!1,l.isDone=!0,u(this,x,$).call(this),l.Surf.quit(this),u(this,C,K).call(this,"done",l.results))},j=function e(t){var n=this;try{if(l.currentAction="do",l.toResume=1,t?l.currentIndex=0:l.currentIndex++,l.isReady&&!l.isLoading&&l.actionables[l.currentSchedule])if(l.actionables[l.currentSchedule].toDo.length){if(l.current=l.actionables[l.currentSchedule].toDo.shift(),l.current){var i=l.current,r=i.action,s=i.params,c=void 0===s?[]:s,a=i.selector;l.isReady=!1,"type"===r&&c.length<3&&c.push(l.config.typingSpeed),u(this,g,_).call(this,r,c,a,(function(e,t){return u(n,p,F).call(n,e,t)}))}}else u(this,o,D).call(this,!0)}catch(t){u(this,f,U).call(this,t.message),l.config.autoAdvance?u(this,d,e).call(this):this.pause()}},U=function(e){try{u(this,x,$).call(this),l.results.length<=l.currentSchedule&&l.results.push({title:l.schedules[l.currentSchedule].title,list:[],passed:0,failed:0}),l.results[l.currentSchedule].failed++,l.results[l.currentSchedule].list.push({action:l.currentAction,index:this.currentIndex,description:l.current.description,is_succes:!1}),u(this,C,K).call(this,"actionFailed",{scheduleIndex:l.currentSchedule,actionIndex:l.currentIndex,action:l.currentAction,on:l.current,message:e||l.config.defaultFailMessage}),u(this,O,Q).call(this)}catch(e){}return this},L=function(){u(this,A,B).call(this)&&(l.isDone||u(this,C,K).call(this,"scheduleFinish",{scheduleIndex:l.currentSchedule}),l.isDone=!0,u(this,y,q).call(this)?l.config.autoAdvance?u(this,b,H).call(this):this.pause():u(this,h,P).call(this))},_=function(e,t,n,i){var r="".concat(l.currentAction).concat(e.replace(/^[a-z]/i,(function(e){return e.toUpperCase()})));if(u(this,I,Y).call(this),l.customHandlers[r])l.customHandlers[r].call(this,i,n,t);else{var s=function(){l.Surf.setSuccessCallback((function(){})),l.Surf.setErrorCallback((function(){}))};try{var a;n&&t.unshift(n),l.Surf.setSuccessCallback((function(){s(),i(l.STATUS_SUCCESS)})),l.Surf.setErrorCallback((function(e){s(),i(l.STATUS_ERROR,e)})),(a=l.Surf)[r].apply(a,c(t))}catch(e){s(),i(l.STATUS_ERROR,e.message.replace("Failed to execute 'querySelectorAll' on 'Document': ",""))}}},F=function(e,t){return e===l.STATUS_SUCCESS?u(this,W,G).call(this):u(this,f,U).call(this,t),l.isPaused||l.isDone||l.isWaiting||(l.isReady=!0,l.isLoading=!1,l.config.autoAdvance?u(this,d,j).call(this):u(this,A,B).call(this)?u(this,S,L).call(this):this.pause()),this},q=function(){return void 0!==l.actionables[l.currentSchedule+1]},z=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};l.Surf.init(this,(function(n){if(n){var i=Object.keys((new l).toJSON());for(var r in n){if(!i.includes(r))break;l[r]=n[r]}}l.isWorking&&u(e,p,F).call(e,l.STATUS_SUCCESS),t(!!n)}))},H=function(){return l.isDone?u(this,y,q).call(this)?(l.currentSchedule++,l.isReady=!0,l.isDone=!1,u(this,C,K).call(this,"scheduleStart",{scheduleIndex:l.currentSchedule}),u(this,d,j).call(this,!0),this):(u(this,h,P).call(this),this):this},M=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return l.isLoading=!0,l.schedules.forEach((function(n,i){var r=n.do||[],s=n.check||[];r.forEach((function(t){n.url&&(t.url=n.url),u(e,w,J).call(e,t,i)})),s.forEach((function(t){return u(e,m,N).call(e,t,i)})),t||u(e,C,K).call(e,"scheduleInit",{schedule:n,scheduleIndex:i})})),l.isLoading=!1,this},N=function(e,t){l.actionables.length===t&&l.actionables.push({toDo:[],toCheck:[]});var n=s({selector:null,action:e,params:[],description:'Checking "'.concat(e.action,'" on [').concat("isOn"==e.action||"isNotOn"==e.action?e.params[0]:e.selector,"]")},e);return l.actionables[t].toCheck.push(n),this},J=function(e,t){var n=s({selector:null,action:e,params:[],description:null},e);return l.actionables.length===t&&l.actionables.push({toDo:[],toCheck:[]}),l.actionables[t].toDo.push(n),this},B=function(){return!l.actionables[l.currentSchedule]||!l.actionables[l.currentSchedule].toDo.length&&!l.actionables[l.currentSchedule].toCheck.length},Y=function(){return l.isWorking||(u(this,C,K).call(this,"actionStart",{scheduleIndex:l.currentSchedule,actionIndex:l.currentIndex,action:l.currentAction,on:l.current}),l.isWorking=!0),this},$=function(){return l.isWorking=!1,this},G=function(){try{u(this,x,$).call(this),l.results.length<=l.currentSchedule&&l.results.push({title:l.schedules[l.currentSchedule].title,list:[],passed:0,failed:0}),l.results[l.currentSchedule].passed++,l.results[l.currentSchedule].list.push({action:l.currentAction,index:this.currentIndex,description:l.current.description,is_success:!0}),u(this,C,K).call(this,"actionSuccess",{scheduleIndex:l.currentSchedule,actionIndex:l.currentIndex,action:l.currentAction,on:l.current}),u(this,O,Q).call(this)}catch(e){}return this},K=function(e,t){try{var n;t.schedule?(n=t.schedule,delete t.schedule):t.scheduleIndex?n=l.schedules[t.scheduleIndex]:l.currentSchedule>-1&&(n=l.schedules[l.currentSchedule]),l.events[e]({name:e,schedule:n,detail:t})}catch(e){}return this},Q=function(){l.isPaused&&!l.isWorking&&u(this,C,K).call(this,"paused",{scheduleIndex:l.currentSchedule,actionIndex:l.currentIndex,action:l.currentAction,on:l.current})},V=function(e,t,n){try{-1!==e.toLowerCase().indexOf("not")?t===l.STATUS_SUCCESS?u(this,f,U).call(this,n):u(this,W,G).call(this):t===l.STATUS_SUCCESS?u(this,W,G).call(this):u(this,f,U).call(this,n)}catch(e){u(this,f,U).call(this,e.message)}return l.isReady=!0,l.config.autoAdvance?u(this,o,D).call(this):u(this,A,B).call(this)?u(this,S,L).call(this):this.pause(),this};return T}(); |
@@ -1,1 +0,1 @@ | ||
function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function e(t,e,i){if(t!==e)throw new TypeError("Private static access of wrong provenance");return i}var i=function(){function i(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i)}var l,c,a;return l=i,a=[{key:"init",value:function(t){}},{key:"quit",value:function(t){}},{key:"checkAttrContains",value:function(t,l,c){e(this,i,n).call(this)}},{key:"checkAttrIs",value:function(t,l,c){e(this,i,n).call(this)}},{key:"checkExists",value:function(t){e(this,i,n).call(this)}},{key:"checkElementIs",value:function(t,l){e(this,i,n).call(this)}},{key:"checkIsOn",value:function(t,l){e(this,i,n).call(this)}},{key:"checkTextContains",value:function(t,l){e(this,i,n).call(this)}},{key:"checkTextIs",value:function(t,l){e(this,i,n).call(this)}},{key:"checkValueContains",value:function(t,l){e(this,i,n).call(this)}},{key:"checkValueIs",value:function(t,l){e(this,i,n).call(this)}},{key:"doClick",value:function(t){e(this,i,n).call(this)}},{key:"doGoBack",value:function(){e(this,i,n).call(this)}},{key:"doWait",value:function(t){e(this,i,n).call(this)}},{key:"doWaitTillPageLoads",value:function(){e(this,i,n).call(this)}},{key:"doGoto",value:function(t){e(this,i,n).call(this)}},{key:"doRefresh",value:function(){e(this,i,n).call(this)}},{key:"doSelect",value:function(t,l){e(this,i,n).call(this)}},{key:"doSubmitForm",value:function(t){e(this,i,n).call(this)}},{key:"doType",value:function(t,l){e(this,i,n).call(this)}}],(c=null)&&t(l.prototype,c),a&&t(l,a),i}(),n=function(){throw new Error("Not implemented")};export default i; | ||
function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function e(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}var i=new WeakSet,n=function(){function n(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),i.add(this)}var c,a,o;return c=n,(a=[{key:"init",value:function(t){}},{key:"quit",value:function(t){}},{key:"checkAttrContains",value:function(t,n,c){e(this,i,l).call(this)}},{key:"checkAttrIs",value:function(t,n,c){e(this,i,l).call(this)}},{key:"checkExists",value:function(t){e(this,i,l).call(this)}},{key:"checkElementIs",value:function(t,n){e(this,i,l).call(this)}},{key:"checkIsOn",value:function(t,n){e(this,i,l).call(this)}},{key:"checkTextContains",value:function(t,n){e(this,i,l).call(this)}},{key:"checkTextIs",value:function(t,n){e(this,i,l).call(this)}},{key:"checkValueContains",value:function(t,n){e(this,i,l).call(this)}},{key:"checkValueIs",value:function(t,n){e(this,i,l).call(this)}},{key:"doClick",value:function(t){e(this,i,l).call(this)}},{key:"doGoBack",value:function(){e(this,i,l).call(this)}},{key:"doWait",value:function(t){e(this,i,l).call(this)}},{key:"doWaitTillPageLoads",value:function(){e(this,i,l).call(this)}},{key:"doGoto",value:function(t){e(this,i,l).call(this)}},{key:"doRefresh",value:function(){e(this,i,l).call(this)}},{key:"doSelect",value:function(t,n){e(this,i,l).call(this)}},{key:"doSubmitForm",value:function(t){e(this,i,l).call(this)}},{key:"doType",value:function(t,n){e(this,i,l).call(this)}}])&&t(c.prototype,a),o&&t(c,o),n}(),l=function(){throw new Error("Not implemented")};export default n; |
@@ -1,1 +0,1 @@ | ||
"use strict";function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function e(t,e,i){if(t!==e)throw new TypeError("Private static access of wrong provenance");return i}var i=function(){function i(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i)}var c,l,a;return c=i,a=[{key:"init",value:function(t){}},{key:"quit",value:function(t){}},{key:"checkAttrContains",value:function(t,c,l){e(this,i,n).call(this)}},{key:"checkAttrIs",value:function(t,c,l){e(this,i,n).call(this)}},{key:"checkExists",value:function(t){e(this,i,n).call(this)}},{key:"checkElementIs",value:function(t,c){e(this,i,n).call(this)}},{key:"checkIsOn",value:function(t,c){e(this,i,n).call(this)}},{key:"checkTextContains",value:function(t,c){e(this,i,n).call(this)}},{key:"checkTextIs",value:function(t,c){e(this,i,n).call(this)}},{key:"checkValueContains",value:function(t,c){e(this,i,n).call(this)}},{key:"checkValueIs",value:function(t,c){e(this,i,n).call(this)}},{key:"doClick",value:function(t){e(this,i,n).call(this)}},{key:"doGoBack",value:function(){e(this,i,n).call(this)}},{key:"doWait",value:function(t){e(this,i,n).call(this)}},{key:"doWaitTillPageLoads",value:function(){e(this,i,n).call(this)}},{key:"doGoto",value:function(t){e(this,i,n).call(this)}},{key:"doRefresh",value:function(){e(this,i,n).call(this)}},{key:"doSelect",value:function(t,c){e(this,i,n).call(this)}},{key:"doSubmitForm",value:function(t){e(this,i,n).call(this)}},{key:"doType",value:function(t,c){e(this,i,n).call(this)}}],(l=null)&&t(c.prototype,l),a&&t(c,a),i}(),n=function(){throw new Error("Not implemented")};module.exports=i; | ||
"use strict";function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function e(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}var i=new WeakSet,n=function(){function n(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),i.add(this)}var c,a,o;return c=n,(a=[{key:"init",value:function(t){}},{key:"quit",value:function(t){}},{key:"checkAttrContains",value:function(t,n,c){e(this,i,l).call(this)}},{key:"checkAttrIs",value:function(t,n,c){e(this,i,l).call(this)}},{key:"checkExists",value:function(t){e(this,i,l).call(this)}},{key:"checkElementIs",value:function(t,n){e(this,i,l).call(this)}},{key:"checkIsOn",value:function(t,n){e(this,i,l).call(this)}},{key:"checkTextContains",value:function(t,n){e(this,i,l).call(this)}},{key:"checkTextIs",value:function(t,n){e(this,i,l).call(this)}},{key:"checkValueContains",value:function(t,n){e(this,i,l).call(this)}},{key:"checkValueIs",value:function(t,n){e(this,i,l).call(this)}},{key:"doClick",value:function(t){e(this,i,l).call(this)}},{key:"doGoBack",value:function(){e(this,i,l).call(this)}},{key:"doWait",value:function(t){e(this,i,l).call(this)}},{key:"doWaitTillPageLoads",value:function(){e(this,i,l).call(this)}},{key:"doGoto",value:function(t){e(this,i,l).call(this)}},{key:"doRefresh",value:function(){e(this,i,l).call(this)}},{key:"doSelect",value:function(t,n){e(this,i,l).call(this)}},{key:"doSubmitForm",value:function(t){e(this,i,l).call(this)}},{key:"doType",value:function(t,n){e(this,i,l).call(this)}}])&&t(c.prototype,a),o&&t(c,o),n}(),l=function(){throw new Error("Not implemented")};module.exports=n; |
@@ -1,1 +0,1 @@ | ||
var BaseAdapter=function(){"use strict";function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function e(t,e,i){if(t!==e)throw new TypeError("Private static access of wrong provenance");return i}var i=function(){function i(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i)}var c,l,a;return c=i,a=[{key:"init",value:function(t){}},{key:"quit",value:function(t){}},{key:"checkAttrContains",value:function(t,c,l){e(this,i,n).call(this)}},{key:"checkAttrIs",value:function(t,c,l){e(this,i,n).call(this)}},{key:"checkExists",value:function(t){e(this,i,n).call(this)}},{key:"checkElementIs",value:function(t,c){e(this,i,n).call(this)}},{key:"checkIsOn",value:function(t,c){e(this,i,n).call(this)}},{key:"checkTextContains",value:function(t,c){e(this,i,n).call(this)}},{key:"checkTextIs",value:function(t,c){e(this,i,n).call(this)}},{key:"checkValueContains",value:function(t,c){e(this,i,n).call(this)}},{key:"checkValueIs",value:function(t,c){e(this,i,n).call(this)}},{key:"doClick",value:function(t){e(this,i,n).call(this)}},{key:"doGoBack",value:function(){e(this,i,n).call(this)}},{key:"doWait",value:function(t){e(this,i,n).call(this)}},{key:"doWaitTillPageLoads",value:function(){e(this,i,n).call(this)}},{key:"doGoto",value:function(t){e(this,i,n).call(this)}},{key:"doRefresh",value:function(){e(this,i,n).call(this)}},{key:"doSelect",value:function(t,c){e(this,i,n).call(this)}},{key:"doSubmitForm",value:function(t){e(this,i,n).call(this)}},{key:"doType",value:function(t,c){e(this,i,n).call(this)}}],(l=null)&&t(c.prototype,l),a&&t(c,a),i}(),n=function(){throw new Error("Not implemented")};return i}(); | ||
var BaseAdapter=function(){"use strict";function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function e(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}var i=new WeakSet,n=function(){function n(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),i.add(this)}var l,a,o;return l=n,(a=[{key:"init",value:function(t){}},{key:"quit",value:function(t){}},{key:"checkAttrContains",value:function(t,n,l){e(this,i,c).call(this)}},{key:"checkAttrIs",value:function(t,n,l){e(this,i,c).call(this)}},{key:"checkExists",value:function(t){e(this,i,c).call(this)}},{key:"checkElementIs",value:function(t,n){e(this,i,c).call(this)}},{key:"checkIsOn",value:function(t,n){e(this,i,c).call(this)}},{key:"checkTextContains",value:function(t,n){e(this,i,c).call(this)}},{key:"checkTextIs",value:function(t,n){e(this,i,c).call(this)}},{key:"checkValueContains",value:function(t,n){e(this,i,c).call(this)}},{key:"checkValueIs",value:function(t,n){e(this,i,c).call(this)}},{key:"doClick",value:function(t){e(this,i,c).call(this)}},{key:"doGoBack",value:function(){e(this,i,c).call(this)}},{key:"doWait",value:function(t){e(this,i,c).call(this)}},{key:"doWaitTillPageLoads",value:function(){e(this,i,c).call(this)}},{key:"doGoto",value:function(t){e(this,i,c).call(this)}},{key:"doRefresh",value:function(){e(this,i,c).call(this)}},{key:"doSelect",value:function(t,n){e(this,i,c).call(this)}},{key:"doSubmitForm",value:function(t){e(this,i,c).call(this)}},{key:"doType",value:function(t,n){e(this,i,c).call(this)}}])&&t(l.prototype,a),o&&t(l,o),n}(),c=function(){throw new Error("Not implemented")};return n}(); |
{ | ||
"name": "@dscribers/autosurf", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "Automactically surf webpages from Gherkin config files", | ||
@@ -5,0 +5,0 @@ "rollup": { |
@@ -149,3 +149,3 @@ # autosurf | ||
$autosurf = new AutoSurf(config, MobileSurf) | ||
$autosurf = new AutoSurf(new MobileSurf()) | ||
``` | ||
@@ -152,0 +152,0 @@ |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
49678
159
1