UNPKG

@restqa/restqa

Version:

An all in one test automation runner

9 lines 17.4 kB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-24caed49"],{2532:function(t,e,n){"use strict";var r=n("23e7"),o=n("5a34"),i=n("1d80"),c=n("ab13");r({target:"String",proto:!0,forced:!c("includes")},{includes:function(t){return!!~String(i(this)).indexOf(o(t),arguments.length>1?arguments[1]:void 0)}})},"28e2":function(t,e,n){"use strict";var r=n("7a23"),o=Object(r["gb"])("data-v-42bf3fdb");Object(r["H"])("data-v-42bf3fdb");var i={key:0,class:"header"},c={key:1},a={class:"body"};Object(r["F"])();var l=o((function(t,e,n,l,u,s){var f=Object(r["N"])("el-tag"),d=Object(r["N"])("el-card"),p=Object(r["O"])("loading");return Object(r["E"])(),Object(r["j"])(d,{class:"card","body-style":"{ width: 100% }"},{default:o((function(){return[n.title?(Object(r["E"])(),Object(r["j"])("div",i,[Object(r["n"])("h5",null,Object(r["R"])(n.title),1),n.tagLabel?(Object(r["E"])(),Object(r["j"])(f,{key:0,type:n.tagType},{default:o((function(){return[Object(r["m"])(Object(r["R"])(n.tagLabel),1)]})),_:1},8,["type"])):Object(r["k"])("",!0),n.emoji?(Object(r["E"])(),Object(r["j"])("span",c,Object(r["R"])(n.emoji),1)):Object(r["k"])("",!0)])):Object(r["k"])("",!0),Object(r["db"])(Object(r["n"])("div",a,[Object(r["M"])(t.$slots,"default",{},void 0,!0)],512),[[p,n.loading]])]})),_:3})}));n("caad");function u(t){return["success","info","warning","danger"].includes(t)}var s={name:"card",components:{},props:{title:{type:String},emoji:{type:String},loading:{type:Boolean,default:!1},tagLabel:{type:String},tagType:{type:String,default:"warning",validator:u}}};n("70f6");s.render=l,s.__scopeId="data-v-42bf3fdb";e["a"]=s},"4de4":function(t,e,n){"use strict";var r=n("23e7"),o=n("b727").filter,i=n("1dde"),c=i("filter");r({target:"Array",proto:!0,forced:!c},{filter:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},"5a34":function(t,e,n){var r=n("44e7");t.exports=function(t){if(r(t))throw TypeError("The method doesn't accept regular expressions");return t}},6676:function(t,e,n){"use strict";(function(t){function r(t){return r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}n.d(e,"a",(function(){return u}));"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof t||"undefined"!==typeof self&&self;function o(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t["default"]:t}function i(t,e){return e={exports:{}},t(e,e.exports),e.exports}var c=i((function(t,e){ /*! * clipboard.js v2.0.6 * https://clipboardjs.com/ * * Licensed MIT © Zeno Rocha */ !function(e,n){t.exports=n()}(0,(function(){return n={},t.m=e=[function(t,e){t.exports=function(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var r=window.getSelection(),o=document.createRange();o.selectNodeContents(t),r.removeAllRanges(),r.addRange(o),e=r.toString()}return e}},function(t,e){function n(){}n.prototype={on:function(t,e,n){var r=this.e||(this.e={});return(r[t]||(r[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var r=this;function o(){r.off(t,o),e.apply(n,arguments)}return o._=e,this.on(t,o,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),r=0,o=n.length;r<o;r++)n[r].fn.apply(n[r].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),r=n[t],o=[];if(r&&e)for(var i=0,c=r.length;i<c;i++)r[i].fn!==e&&r[i].fn._!==e&&o.push(r[i]);return o.length?n[t]=o:delete n[t],this}},t.exports=n,t.exports.TinyEmitter=n},function(t,e,n){var r=n(3),o=n(4);t.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!r.string(e))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(t))return d=e,p=n,(f=t).addEventListener(d,p),{destroy:function(){f.removeEventListener(d,p)}};if(r.nodeList(t))return l=t,u=e,s=n,Array.prototype.forEach.call(l,(function(t){t.addEventListener(u,s)})),{destroy:function(){Array.prototype.forEach.call(l,(function(t){t.removeEventListener(u,s)}))}};if(r.string(t))return i=t,c=e,a=n,o(document.body,i,c,a);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var i,c,a,l,u,s,f,d,p}},function(t,e){e.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},e.nodeList=function(t){var n=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in t&&(0===t.length||e.node(t[0]))},e.string=function(t){return"string"==typeof t||t instanceof String},e.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},function(t,e,n){var r=n(5);function o(t,e,n,o,i){var c=function(t,e,n,o){return function(n){n.delegateTarget=r(n.target,e),n.delegateTarget&&o.call(t,n)}}.apply(this,arguments);return t.addEventListener(n,c,i),{destroy:function(){t.removeEventListener(n,c,i)}}}t.exports=function(t,e,n,r,i){return"function"==typeof t.addEventListener?o.apply(null,arguments):"function"==typeof n?o.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,(function(t){return o(t,e,n,r,i)})))}},function(t,e){if("undefined"!=typeof Element&&!Element.prototype.matches){var n=Element.prototype;n.matches=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}},function(t,e,n){n.r(e);var r=n(0),o=n.n(r),i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function a(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),this.resolveOptions(t),this.initSelection()}var l=(function(t,e,n){e&&c(t.prototype,e),n&&c(t,n)}(a,[{key:"resolveOptions",value:function(t){var e=0<arguments.length&&void 0!==t?t:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=o()(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=o()(this.target),this.copyText()}},{key:"copyText",value:function(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(t){var e=0<arguments.length&&void 0!==t?t:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":i(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),a),u=n(1),s=n.n(u),f=n(2),d=n.n(f),p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b=function(t,e,n){return e&&h(t.prototype,e),n&&h(t,n),t};function h(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var y=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(m,s.a),b(m,[{key:"resolveOptions",value:function(t){var e=0<arguments.length&&void 0!==t?t:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===p(e.container)?e.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=d()(t,"click",(function(t){return e.onClick(t)}))}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new l({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return v("action",t)}},{key:"defaultTarget",value:function(t){var e=v("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return v("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(t){var e=0<arguments.length&&void 0!==t?t:["copy","cut"],n="string"==typeof e?[e]:e,r=!!document.queryCommandSupported;return n.forEach((function(t){r=r&&!!document.queryCommandSupported(t)})),r}}]),m);function m(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,m);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(m.__proto__||Object.getPrototypeOf(m)).call(this));return n.resolveOptions(e),n.listenClick(t),n}function v(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}e.default=y}],t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(t){return e[t]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},t.p="",t(t.s=6).default;function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var e,n}))})),a=o(c),l=(c.ClipboardJS,{autoSetContainer:!1,appendToBody:!0});function u(t,e,n){var o=document.createElement("button"),i=new a(o,{text:function(){return t},action:function(){return"copy"},container:"object"===r(e)?e:document.body});i.on("success",(function(t){i.destroy(),n(void 0,t)})),i.on("error",(function(t){i.destroy(),n(t,void 0)})),l.appendToBody&&document.body.appendChild(o),o.click(),l.appendToBody&&document.body.removeChild(o)}}).call(this,n("c8ba"))},6993:function(t,e,n){},"6baf":function(t,e,n){"use strict";n.r(e);var r=n("7a23"),o={id:"step-definition"},i=Object(r["n"])("br",null,null,-1),c=Object(r["n"])("br",null,null,-1);function a(t,e,n,a,l,u){var s=Object(r["N"])("el-input"),f=Object(r["N"])("RestQAProjectSteps");return Object(r["E"])(),Object(r["j"])("div",o,[Object(r["n"])(s,{placeholder:"Please input",modelValue:l.searchTerm,"onUpdate:modelValue":e[1]||(e[1]=function(t){return l.searchTerm=t}),class:"search",clear:"search",clearable:""},null,8,["modelValue"]),i,c,(Object(r["E"])(!0),Object(r["j"])(r["b"],null,Object(r["L"])(l.keywords,(function(t,e){return Object(r["E"])(),Object(r["j"])(f,{keyword:t,key:e,data:u.steps[t]},null,8,["keyword","data"])})),128))])}n("4de4"),n("caad"),n("2532");var l=Object(r["m"])("Copy"),u=Object(r["n"])("br",null,null,-1);function s(t,e,n,o,i,c){var a=Object(r["N"])("el-descriptions-item"),s=Object(r["N"])("el-descriptions"),f=Object(r["N"])("el-table-column"),d=Object(r["N"])("el-button"),p=Object(r["N"])("el-table"),b=Object(r["N"])("card");return Object(r["E"])(),Object(r["j"])(r["b"],null,[Object(r["n"])(b,{title:c.title,loading:null===n.data},{default:Object(r["cb"])((function(){return[Object(r["n"])(p,{data:n.data,class:"step-definition",style:{width:"100%"}},{default:Object(r["cb"])((function(){return[Object(r["n"])(f,{class:"expand",type:"expand"},{default:Object(r["cb"])((function(t){return[Object(r["n"])(s,{title:"Detail",column:1,border:""},{default:Object(r["cb"])((function(){return[Object(r["n"])(a,{label:"Keyword"},{default:Object(r["cb"])((function(){return[Object(r["m"])(Object(r["R"])(t.row.keyword),1)]})),_:2},1024),Object(r["n"])(a,{label:"Comment"},{default:Object(r["cb"])((function(){return[Object(r["m"])(Object(r["R"])(t.row.comment),1)]})),_:2},1024),Object(r["n"])(a,{label:"Plugin",class:"plugin"},{default:Object(r["cb"])((function(){return[Object(r["m"])(Object(r["R"])(t.row.plugin),1)]})),_:2},1024)]})),_:2},1024)]})),_:1}),Object(r["n"])(f,{class:"step",prop:"step",label:"Step Definition"}),Object(r["n"])(f,{fixed:"right",label:"Operations",width:"120"},{default:Object(r["cb"])((function(t){return[Object(r["n"])(d,{type:"text",onClick:function(e){return c.copy(t.row)},size:"small"},{default:Object(r["cb"])((function(){return[l]})),_:2},1032,["onClick"])]})),_:1})]})),_:1},8,["data"])]})),_:1},8,["title","loading"]),u],64)}n("99af");var f=n("28e2"),d=n("6676"),p={name:"RestQAProjectSteps",components:{Card:f["a"]},props:{keyword:{type:String},data:{type:Array,default:null}},computed:{title:function(){var t=this.data&&" - ".concat(this.data.length," step definitions")||"";return"".concat(this.keyword[0].toUpperCase()+this.keyword.substring(1)).concat(t)}},methods:{copy:function(t){var e=this;Object(d["a"])(t.step,void 0,(function(t){var n=t?"error":"success",r=t?t.message:"Step copied into your clipboard";e.$notify({message:r,type:n})}))}}};p.render=s;var b=p,h=["given","when","then"],y={name:"Steps",components:{RestQAProjectSteps:b},data:function(){return{list:this.$store.getters.steps,searchTerm:"",keywords:h}},computed:{steps:function(){var t=this.$store.getters.steps;return{given:t&&this.filterStep("given",t),when:t&&this.filterStep("when",t),then:t&&this.filterStep("then",t)}}},methods:{filterStep:function(t,e){var n=this;return e.filter((function(e){return e.keyword.toLowerCase()===t&&(e.step.toLowerCase().includes(n.searchTerm.toLowerCase())||e.comment.toLowerCase().includes(n.searchTerm.toLowerCase()))}))}},created:function(){this.$store.dispatch("steps")}};y.render=a;e["default"]=y},"70f6":function(t,e,n){"use strict";n("6993")},ab13:function(t,e,n){var r=n("b622"),o=r("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[o]=!1,"/./"[t](e)}catch(r){}}return!1}},caad:function(t,e,n){"use strict";var r=n("23e7"),o=n("4d64").includes,i=n("44d2");r({target:"Array",proto:!0},{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),i("includes")}}]); //# sourceMappingURL=chunk-24caed49.729220ca.js.map