@dscribers/autosurf
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -1,1 +0,1 @@ | ||
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; | ||
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}();function D(e){var t=this;try{if(l.currentAction="check",l.toResume=2,e?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 n=l.current,i=n.action,r=n.params,s=n.selector,c=i;-1!==i.toLowerCase().indexOf("not")&&(c=i.replace(/not/i,"")),l.isReady=!1,u(this,g,_).call(this,c,r,s,(function(e,n){return u(t,R,V).call(t,i,e,n)}))}}else u(this,S,L).call(this)}catch(e){l.isReady=!0,u(this,f,U).call(this,e.message),l.config.autoAdvance?u(this,o,D).call(this):this.pause()}}function P(){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))}function j(e){var t=this;try{if(l.currentAction="do",l.toResume=1,e?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 n=l.current,i=n.action,r=n.params,s=void 0===r?[]:r,c=n.selector;l.isReady=!1,"type"===i&&s.length<3&&s.push(l.config.typingSpeed),u(this,g,_).call(this,i,s,c,(function(e,n){return u(t,p,F).call(t,e,n)}))}}else u(this,o,D).call(this,!0)}catch(e){u(this,f,U).call(this,e.message),l.config.autoAdvance?u(this,d,j).call(this):this.pause()}}function U(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}function L(){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': ",""))}}}function F(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}function q(){return void 0!==l.actionables[l.currentSchedule+1]}function z(){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)}))}function H(){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}function M(){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}function N(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}function J(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}function B(){return!l.actionables[l.currentSchedule]||!l.actionables[l.currentSchedule].toDo.length&&!l.actionables[l.currentSchedule].toCheck.length}function Y(){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}function G(){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}function K(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}function Q(){l.isPaused&&!l.isWorking&&u(this,C,K).call(this,"paused",{scheduleIndex:l.currentSchedule,actionIndex:l.currentIndex,action:l.currentAction,on:l.current})}function V(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 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; | ||
"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}();function D(e){var t=this;try{if(l.currentAction="check",l.toResume=2,e?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 n=l.current,i=n.action,r=n.params,s=n.selector,c=i;-1!==i.toLowerCase().indexOf("not")&&(c=i.replace(/not/i,"")),l.isReady=!1,u(this,g,_).call(this,c,r,s,(function(e,n){return u(t,R,V).call(t,i,e,n)}))}}else u(this,S,L).call(this)}catch(e){l.isReady=!0,u(this,f,U).call(this,e.message),l.config.autoAdvance?u(this,o,D).call(this):this.pause()}}function P(){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))}function j(e){var t=this;try{if(l.currentAction="do",l.toResume=1,e?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 n=l.current,i=n.action,r=n.params,s=void 0===r?[]:r,c=n.selector;l.isReady=!1,"type"===i&&s.length<3&&s.push(l.config.typingSpeed),u(this,g,_).call(this,i,s,c,(function(e,n){return u(t,p,F).call(t,e,n)}))}}else u(this,o,D).call(this,!0)}catch(e){u(this,f,U).call(this,e.message),l.config.autoAdvance?u(this,d,j).call(this):this.pause()}}function U(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}function L(){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': ",""))}}}function F(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}function q(){return void 0!==l.actionables[l.currentSchedule+1]}function z(){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)}))}function H(){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}function M(){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}function N(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}function J(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}function B(){return!l.actionables[l.currentSchedule]||!l.actionables[l.currentSchedule].toDo.length&&!l.actionables[l.currentSchedule].toCheck.length}function Y(){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}function G(){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}function K(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}function Q(){l.isPaused&&!l.isWorking&&u(this,C,K).call(this,"paused",{scheduleIndex:l.currentSchedule,actionIndex:l.currentIndex,action:l.currentAction,on:l.current})}function V(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 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}(); | ||
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;function T(e){var t=this;try{if(l.currentAction="check",l.toResume=2,e?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,B).call(this);var n=l.current,i=n.action,r=n.params,s=n.selector,c=i;-1!==i.toLowerCase().indexOf("not")&&(c=i.replace(/not/i,"")),l.isReady=!1,u(this,g,L).call(this,c,r,s,(function(e,n){return u(t,R,Q).call(t,i,e,n)}))}}else u(this,S,U).call(this)}catch(e){l.isReady=!0,u(this,f,j).call(this,e.message),l.config.autoAdvance?u(this,o,T).call(this):this.pause()}}function D(){null!==l.current&&(l.current=null,l.isReady=!1,l.isDone=!0,u(this,x,Y).call(this),l.Surf.quit(this),u(this,C,G).call(this,"done",l.results))}function P(e){var t=this;try{if(l.currentAction="do",l.toResume=1,e?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 n=l.current,i=n.action,r=n.params,s=void 0===r?[]:r,c=n.selector;l.isReady=!1,"type"===i&&s.length<3&&s.push(l.config.typingSpeed),u(this,g,L).call(this,i,s,c,(function(e,n){return u(t,p,_).call(t,e,n)}))}}else u(this,o,T).call(this,!0)}catch(e){u(this,f,j).call(this,e.message),l.config.autoAdvance?u(this,d,P).call(this):this.pause()}}function j(e){try{u(this,x,Y).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,G).call(this,"actionFailed",{scheduleIndex:l.currentSchedule,actionIndex:l.currentIndex,action:l.currentAction,on:l.current,message:e||l.config.defaultFailMessage}),u(this,O,K).call(this)}catch(e){}return this}function U(){u(this,A,J).call(this)&&(l.isDone||u(this,C,G).call(this,"scheduleFinish",{scheduleIndex:l.currentSchedule}),l.isDone=!0,u(this,y,F).call(this)?l.config.autoAdvance?u(this,b,z).call(this):this.pause():u(this,h,D).call(this))}function L(e,t,n,i){var r="".concat(l.currentAction).concat(e.replace(/^[a-z]/i,(function(e){return e.toUpperCase()})));if(u(this,I,B).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': ",""))}}}function _(e,t){return e===l.STATUS_SUCCESS?u(this,W,$).call(this):u(this,f,j).call(this,t),l.isPaused||l.isDone||l.isWaiting||(l.isReady=!0,l.isLoading=!1,l.config.autoAdvance?u(this,d,P).call(this):u(this,A,J).call(this)?u(this,S,U).call(this):this.pause()),this}function F(){return void 0!==l.actionables[l.currentSchedule+1]}function q(){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,_).call(e,l.STATUS_SUCCESS),t(!!n)}))}function z(){return l.isDone?u(this,y,F).call(this)?(l.currentSchedule++,l.isReady=!0,l.isDone=!1,u(this,C,G).call(this,"scheduleStart",{scheduleIndex:l.currentSchedule}),u(this,d,P).call(this,!0),this):(u(this,h,D).call(this),this):this}function H(){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,N).call(e,t,i)})),s.forEach((function(t){return u(e,m,M).call(e,t,i)})),t||u(e,C,G).call(e,"scheduleInit",{schedule:n,scheduleIndex:i})})),l.isLoading=!1,this}function M(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}function N(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}function J(){return!l.actionables[l.currentSchedule]||!l.actionables[l.currentSchedule].toDo.length&&!l.actionables[l.currentSchedule].toCheck.length}function B(){return l.isWorking||(u(this,C,G).call(this,"actionStart",{scheduleIndex:l.currentSchedule,actionIndex:l.currentIndex,action:l.currentAction,on:l.current}),l.isWorking=!0),this}function Y(){return l.isWorking=!1,this}function $(){try{u(this,x,Y).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,G).call(this,"actionSuccess",{scheduleIndex:l.currentSchedule,actionIndex:l.currentIndex,action:l.currentAction,on:l.current}),u(this,O,K).call(this)}catch(e){}return this}function G(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}function K(){l.isPaused&&!l.isWorking&&u(this,C,G).call(this,"paused",{scheduleIndex:l.currentSchedule,actionIndex:l.currentIndex,action:l.currentAction,on:l.current})}function Q(e,t,n){try{-1!==e.toLowerCase().indexOf("not")?t===l.STATUS_SUCCESS?u(this,f,j).call(this,n):u(this,W,$).call(this):t===l.STATUS_SUCCESS?u(this,W,$).call(this):u(this,f,j).call(this,n)}catch(e){u(this,f,j).call(this,e.message)}return l.isReady=!0,l.config.autoAdvance?u(this,o,T).call(this):u(this,A,J).call(this)?u(this,S,U).call(this):this.pause(),this}return 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,H).call(this),this}},{key:"pause",value:function(){return l.isPaused||(l.isReady=!1,l.isPaused=!0,u(this,O,K).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,q).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,H).call(this,!0),this.start()}},{key:"resume",value:function(){return l.isPaused?(u(this,C,G).call(this,"resumed",{scheduleIndex:l.currentSchedule,actionIndex:l.currentIndex,action:l.currentAction,on:l.current}),l.isReady=!0,l.isPaused=!1,u(this,A,J).call(this)?u(this,b,z).call(this):2===l.toResume?u(this,o,T).call(this):u(this,d,P).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,z).call(this),this)}}]),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(!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; | ||
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}();function l(){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(!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; | ||
"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}();function l(){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(!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}(); | ||
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;function n(){throw new Error("Not implemented")}return function(){function c(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),i.add(this)}var l,a,o;return l=c,(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)}}])&&t(l.prototype,a),o&&t(l,o),c}()}(); |
{ | ||
"name": "@dscribers/autosurf", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Automactically surf webpages from Gherkin config files", | ||
@@ -5,0 +5,0 @@ "rollup": { |
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
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
49595