allure-cypress 3.1.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var B=Object.defineProperty;var sr=Object.getOwnPropertyDescriptor;var nr=Object.getOwnPropertyNames;var or=Object.prototype.hasOwnProperty;var ar=(t,e)=>{for(var r in e)B(t,r,{get:e[r],enumerable:!0})},ir=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of nr(e))!or.call(t,n)&&n!==r&&B(t,n,{get:()=>e[n],enumerable:!(s=sr(e,n))||s.enumerable});return t};var pr=t=>ir(B({},"__esModule",{value:!0}),t);var Ss={};ar(Ss,{ContentType:()=>k,LabelName:()=>c,LinkType:()=>C,Severity:()=>Tt,Stage:()=>xt,Status:()=>u,StatusByPriority:()=>vt,allureId:()=>Ut,attachment:()=>It,attachmentPath:()=>Lt,description:()=>_t,descriptionHtml:()=>Mt,displayName:()=>kt,epic:()=>Gt,feature:()=>zt,historyId:()=>wt,issue:()=>Ht,label:()=>h,labels:()=>Dt,layer:()=>Yt,link:()=>F,links:()=>Pt,logStep:()=>Ot,owner:()=>Vt,parameter:()=>Rt,parentSuite:()=>Wt,severity:()=>qt,step:()=>jt,story:()=>Bt,subSuite:()=>$t,suite:()=>Kt,tag:()=>Jt,tags:()=>Zt,testCaseId:()=>Ft,tms:()=>Nt});module.exports=pr(Ss);var u=function(t){return t.FAILED="failed",t.BROKEN="broken",t.PASSED="passed",t.SKIPPED="skipped",t}({}),vt=[u.FAILED,u.BROKEN,u.PASSED,u.SKIPPED],xt=function(t){return t.SCHEDULED="scheduled",t.RUNNING="running",t.FINISHED="finished",t.PENDING="pending",t.INTERRUPTED="interrupted",t}({}),c=function(t){return t.ALLURE_ID="ALLURE_ID",t.AS_ID="ALLURE_ID",t.SUITE="suite",t.PARENT_SUITE="parentSuite",t.SUB_SUITE="subSuite",t.EPIC="epic",t.FEATURE="feature",t.STORY="story",t.SEVERITY="severity",t.TAG="tag",t.OWNER="owner",t.LEAD="lead",t.HOST="host",t.THREAD="thread",t.TEST_METHOD="testMethod",t.TEST_CLASS="testClass",t.PACKAGE="package",t.FRAMEWORK="framework",t.LANGUAGE="language",t.LAYER="layer",t}({}),Tt=function(t){return t.BLOCKER="blocker",t.CRITICAL="critical",t.NORMAL="normal",t.MINOR="minor",t.TRIVIAL="trivial",t}({}),k=function(t){return t.TEXT="text/plain",t.XML="application/xml",t.HTML="text/html",t.CSV="text/csv",t.TSV="text/tab-separated-values",t.CSS="text/css",t.URI="text/uri-list",t.SVG="image/svg+xml",t.PNG="image/png",t.JSON="application/json",t.ZIP="application/zip",t.WEBM="video/webm",t.JPEG="image/jpeg",t.MP4="video/mp4",t.IMAGEDIFF="application/vnd.allure.image.diff",t}({}),C=function(t){return t.DEFAULT="link",t.ISSUE="issue",t.TMS="tms",t}({});function K(){K=function(o,a){return new r(o,void 0,a)};var t=RegExp.prototype,e=new WeakMap;function r(n,o,a){var p=RegExp(n,o);return e.set(p,a||e.get(n)),w(p,r.prototype)}function s(n,o){var a=e.get(o);return Object.keys(a).reduce(function(p,i){var g=a[i];if(typeof g=="number")p[i]=n[g];else{for(var y=0;n[g[y]]===void 0&&y+1<g.length;)y++;p[i]=n[g[y]]}return p},Object.create(null))}return ur(r,RegExp),r.prototype.exec=function(n){var o=t.exec.call(this,n);if(o){o.groups=s(o,this);var a=o.indices;a&&(a.groups=s(a,this))}return o},r.prototype[Symbol.replace]=function(n,o){if(typeof o=="string"){var a=e.get(this);return t[Symbol.replace].call(this,n,o.replace(/\$<([^>]+)>/g,function(i,g){var y=a[g];return"$"+(Array.isArray(y)?y.join("$"):y)}))}if(typeof o=="function"){var p=this;return t[Symbol.replace].call(this,n,function(){var i=arguments;return typeof i[i.length-1]!="object"&&(i=[].slice.call(i)).push(s(i,p)),o.apply(this,i)})}return t[Symbol.replace].call(this,n,o)},K.apply(this,arguments)}function ur(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&w(t,e)}function w(t,e){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},w(t,e)}function At(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,s)}return r}function W(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?At(Object(r),!0).forEach(function(s){cr(t,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):At(Object(r)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(r,s))})}return t}function cr(t,e,r){return(e=lr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lr(t){var e=mr(t,"string");return typeof e=="symbol"?e:e+""}function mr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var s=r.call(t,e||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var v=t=>{switch(!0){case/assert/gi.test(t.constructor.name):case/expectation/gi.test(t.constructor.name):case(t.name&&/assert/gi.test(t.name)):case(t.message&&/assert/gi.test(t.message)):case(t.stack&&/@vitest\/expect/gi.test(t.stack)):case(t.stack&&/playwright\/lib\/matchers\/expect\.js/gi.test(t.stack)):case"matcherResult"in t:case("inspect"in t&&typeof t.inspect=="function"):return u.FAILED;default:return u.BROKEN}},dr=function(){var{onlyFirst:e=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,e?void 0:"g")},$=t=>{var e=dr();return t.replace(e,"")},fr=t=>{if(!t||typeof t!="object")return{};if("matcherResult"in t&&t.matcherResult!==void 0&&typeof t.matcherResult=="object")return{actual:T(t.matcherResult.actual),expected:T(t.matcherResult.expected)};var e="actual"in t&&t.actual!==void 0?{actual:T(t.actual)}:{},r="expected"in t&&t.expected!==void 0?{expected:T(t.expected)}:{};return W(W({},e),r)},S=t=>{var{message:e,stack:r}=t;return W({message:e?$(e):void 0,trace:r?$(r):void 0},fr(t))};var gr=K(/(?:^|\s)@?allure\.([^:=\s]+)[:=]("[^"]+"|'[^']+'|`[^`]+`|\S+)/,{type:1}),Et=new RegExp(gr,"g");var yr=t=>t?.[1],hr=t=>{var e,r=/['"`]/,s=new RegExp("^".concat(r.source)),n=new RegExp("".concat(r.source,"$")),o=(e=t?.[2])!==null&&e!==void 0?e:"";return s.test(o)&&n.test(o)?o.slice(1,-1):o};var V=t=>{var e=[],r=[],s=t.matchAll(Et),n=t.replaceAll(Et,"").split(" ").filter(Boolean).reduce((M,z)=>/^[\n\r]/.test(z)?M+z:"".concat(M," ").concat(z),"").trim();for(var o of s){var a=o,p=yr(a),i=hr(a);if(!(!p||!i)){var[g,y]=p.split(".");switch(g){case"id":e.push({name:c.ALLURE_ID,value:i});break;case"label":e.push({name:y,value:i});break;case"link":r.push({type:y,url:i});break}}}return{labels:e,links:r,cleanTitle:n}};var D=t=>!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function",T=function(e){var{maxDepth:r=0,maxLength:s=0,replacer:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Ar(typeof e=="object"?JSON.stringify(e,Sr(r,n)):String(e),s)},Sr=(t,e)=>{var r=[],s=function(o,a){if(typeof a!="object"||a===null)return a;for(;r.length>0&&!Object.is(r.at(-1),this);)r.pop();if(!(t&&r.length>=t||r.includes(a)))return r.push(a),a instanceof Map?xr(r,a):a instanceof Set?Tr(r,a):a};return e?vr(e,s):s},vr=(t,e)=>function(r,s){return e.call(this,r,t.call(this,r,s))},xr=(t,e)=>Array.from(e).filter(r=>{var[s]=r;return!t.includes(s)}).map(r=>{var[s,n]=r;return[s,t.includes(n)?void 0:n]}),Tr=(t,e)=>Array.from(e).map(r=>t.includes(r)?void 0:r),Ar=(t,e)=>e&&t.length>e?"".concat(t.substring(0,e),"..."):t;function bt(t,e,r,s,n,o,a){try{var p=t[o](a),i=p.value}catch(g){return void r(g)}p.done?e(i):Promise.resolve(i).then(s,n)}function f(t){return function(){var e=this,r=arguments;return new Promise(function(s,n){var o=t.apply(e,r);function a(i){bt(o,s,n,a,p,"next",i)}function p(i){bt(o,s,n,a,p,"throw",i)}a(void 0)})}}var q=class{attachment(){var e=this;return f(function*(){yield e.warning()})()}attachmentFromPath(){var e=this;return f(function*(){yield e.warning()})()}description(){var e=this;return f(function*(){yield e.warning()})()}descriptionHtml(){var e=this;return f(function*(){yield e.warning()})()}displayName(){var e=this;return f(function*(){yield e.warning()})()}historyId(){var e=this;return f(function*(){yield e.warning()})()}labels(){var e=this;return f(function*(){yield e.warning()})()}links(){var e=this;return f(function*(){yield e.warning()})()}parameter(){var e=this;return f(function*(){yield e.warning()})()}logStep(){var e=this;return f(function*(){yield e.warning()})()}step(e,r){var s=this;return f(function*(){return yield s.warning(),r()})()}stepDisplayName(){var e=this;return f(function*(){yield e.warning()})()}stepParameter(){var e=this;return f(function*(){yield e.warning()})()}testCaseId(){var e=this;return f(function*(){yield e.warning()})()}warning(){return f(function*(){console.log("no test runtime is found. Please check test framework configuration")})()}},A=new q;var Ct="allureTestRuntime",J=t=>{globalThis[Ct]=()=>t},Y=()=>globalThis?.[Ct],Z=()=>{var t=Y();if(t){var e;return(e=t())!==null&&e!==void 0?e:A}return A},X=()=>{var t=Y();if(t){var e;return(e=t())!==null&&e!==void 0?e:A}if("_playwrightInstance"in globalThis)try{return(0,eval)("(() => import('allure-playwright/autoconfig'))()").then(()=>{var r,s;return(r=(s=Y())===null||s===void 0?void 0:s())!==null&&r!==void 0?r:A})}catch(r){return console.log("can't execute allure-playwright/autoconfig",r),A}return A};var m=function(e){for(var r=arguments.length,s=new Array(r>1?r-1:0),n=1;n<r;n++)s[n-1]=arguments[n];var o=X();return D(o)?o.then(a=>a[e](...s)):o[e](...s)},h=(t,e)=>m("labels",{name:t,value:e}),Dt=function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return m("labels",...r)},F=(t,e,r)=>m("links",{url:t,type:r,name:e}),Pt=function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return m("links",...r)},Rt=(t,e,r)=>m("parameter",t,e,r),_t=t=>m("description",t),Mt=t=>m("descriptionHtml",t),kt=t=>m("displayName",t),wt=t=>m("historyId",t),Ft=t=>m("testCaseId",t),It=(t,e,r)=>{var s=typeof r=="string"?{contentType:r}:r;return m("attachment",t,e,s)},Lt=(t,e,r)=>{var s=typeof r=="string"?{contentType:r}:r;return m("attachmentFromPath",t,e,s)},Er=()=>({displayName:t=>m("stepDisplayName",t),parameter:(t,e,r)=>m("stepParameter",t,e,r)}),Ot=(t,e,r)=>m("logStep",t,e,r),jt=(t,e)=>m("step",t,()=>e(Er())),Ht=(t,e)=>F(t,e,C.ISSUE),Nt=(t,e)=>F(t,e,C.TMS),Ut=t=>h(c.ALLURE_ID,t),Gt=t=>h(c.EPIC,t),zt=t=>h(c.FEATURE,t),Bt=t=>h(c.STORY,t),Kt=t=>h(c.SUITE,t),Wt=t=>h(c.PARENT_SUITE,t),$t=t=>h(c.SUB_SUITE,t),Vt=t=>h(c.OWNER,t),qt=t=>h(c.SEVERITY,t),Yt=t=>h(c.LAYER,t),Jt=t=>h(c.TAG,t),Zt=function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return m("labels",...r.map(n=>({name:c.TAG,value:n})))};var Xt={stepsFromCommands:{maxArgumentLength:128,maxArgumentDepth:3}},Qt=(t,e)=>{let r=t.findIndex(e);return r!==-1?Q(t.splice(r)):[]},Q=t=>{let e=t.length,r=new Array(e);for(let s=0;s<e;s++)r[e-s-1]=t[s];return r},te=t=>t[t.length-1],ee=t=>typeof t<"u";var d=()=>{let t=Cypress.env("allure");return t||(t={config:Xt,initialized:!1,messages:[],testPlan:void 0,currentTest:void 0,projectDir:void 0,stepStack:[],stepsToFinalize:[],nextApiStepId:0},Cypress.env("allure",t)),t},re=()=>d().initialized,se=()=>{d().initialized=!0},tt=()=>d().messages,ne=t=>{d().messages=t},l=t=>{tt().push(t)},oe=()=>d().testPlan,ae=()=>d().projectDir,ie=()=>d().currentTest,pe=t=>{d().currentTest=t},ue=()=>{d().currentTest=void 0},ce=()=>d().config,x=()=>d().stepStack,le=()=>te(x()),I=t=>x().push(t);var Cr=t=>Q(x().splice(t)),me=()=>Cr(0);var L=(t,e)=>d().stepsToFinalize.push([t,e]),de=()=>d().stepsToFinalize,fe=()=>{let t=d();t.stepsToFinalize=[]};var ge=(t,e)=>{let r=oe();if(r){let s=ye(t);for(let n of Dr(e)){let o=Pr(r,t,s,n.tests);Rr(n.tests,o)}}},Dr=function*(t){let e=[];for(let r=t;r;r=e.pop()){yield r;for(let s=r.suites.length-1;s>=0;s--)e.push(r.suites[s])}},Pr=(t,e,r,s)=>{let n=[];return s.forEach((o,a)=>{let{fullNameSuffix:p,labels:i}=et(o),g=`${r}#${p}`,y=i.find(({name:M})=>M===c.ALLURE_ID)?.value;_r(t,g,y)||n.push(a)}),n},Rr=(t,e)=>{for(let r=e.length-1;r>=0;r--)t.splice(e[r],1)},_r=(t,e,r)=>t.tests.some(s=>r&&s.id?.toString()===r||s.selector===e);var O="__allure_report_system_hook__",he=()=>{Cypress.mocha.getRunner().on("start",Mr).on("suite",kr).on("suite end",Ee).on("hook",wr).on("hook end",Fr).on("test",Ir).on("pass",be).on("fail",Lr).on("pending",Ce).on("test end",at)},Se=()=>{afterEach(O,it),after(O,Or)},Mr=()=>{xe(),Te()},kr=t=>{t.root&&ge(Cypress.spec,t),Ae(t)},wr=t=>{E(t)||rt(t)},Fr=t=>{E(t)||j(t)},Ir=t=>{P(t)||st(t)},Lr=(t,e)=>{let r="hookName"in t;if(r&&ve(t))return;r&&E(t)&&rt(t,Date.now()-(t.duration??0)),nt(e),r&&ot(t,e)},Or=function(){it(),b(this)};var De=Cypress.platform==="win32",Pe=t=>t.substring(t.lastIndexOf(De?"\\":"/")+1),ye=t=>{let e=ae(),r=e?t.absolute.substring(e.length+1):t.relative;return De?r.replaceAll("\\","/"):r},Re=t=>Array.isArray(t)||t.buffer?btoa(String.fromCharCode.apply(null,t)):t,pt=t=>({...et(t),start:typeof t.wallClockStartedAt=="string"?Date.parse(t.wallClockStartedAt):t.wallClockStartedAt?.getTime?.()||Date.now()}),_e=t=>({duration:t.duration??0,retries:t._retries??0}),ut=()=>({statusDetails:{message:"This is a pending test"}}),Me=(t,e,r)=>{let s={id:t.id,stop:Date.now(),status:e??je(t)};return r&&(s.statusDetails=r),s},ke=Symbol("The test has been reported to Allure"),ct=t=>{t[ke]=!0},P=t=>t[ke]===!0,jr=function*(t){let e=[];for(let r=t;r;r=e.pop()){yield r;for(let s=r.suites.length-1;s>=0;s--)e.push(r.suites[s])}},we=function*(t){for(let e of jr(t))yield*e.tests},Fe=t=>{let e=[];for(let r=t.parent;r;r=r.parent)e.push(r);return e.reverse(),e};var Ie=()=>(d().nextApiStepId++).toString(),et=t=>{let e=t.title,{cleanTitle:r,labels:s,links:n}=V(e),a=`${[...t.titlePath().slice(0,-1),r].join(" ")}`;return{name:r,labels:s,links:n,fullNameSuffix:a}},E=t=>t.title.includes(O),ve=t=>t.parent.root&&t.hookName==="after all",Le=t=>{let e=t.test;return t.test.parent.hooks.findLast(o=>o.hookName==="after all")?.hookId===e.hookId},Oe=(t,e,r,s)=>{let n=e?u.SKIPPED:v(r),{message:o,trace:a}=S(r);return{status:n,statusDetails:{message:e?Hr(t,s):o,trace:a}}},Hr=(t,e)=>{let r=e.title?`'${e.title}'`:"root";return`'${t}' defined in the ${r} suite has failed`};var R={},He=t=>t.type==="api",_=t=>t.type==="log",lt=t=>U(Nr(),t),Nr=()=>{let t=Ie();return I({id:t,type:"api"}),t},Ne=t=>{let e=v(t),r=S(t);Gr(e,r),Ge(t)},mt=(t,e)=>H(r=>He(r),t,e),H=(t,e,r)=>Ue(Qt(x(),t),e,r),N=(t,e)=>Ue(me(),t,e),dt=()=>{N(),de().forEach(Ur),fe()},je=t=>t.error?v(t.error):u.PASSED,Ur=([t,e])=>{let{id:r,error:s}=t,n={id:r};s&&(n.statusDetails=S(s)),e?.(n),l({type:"cypress_step_finalize",data:n})},Gr=(t,e)=>{let r=x(),s=r.at(r.findLastIndex(_)+1);s&&H(n=>Object.is(n,s),t,e)},zr=(t,e)=>{if(_(t)){let r=t.log.attributes.error;if(r)return t.error=r}return e&&(t.error=e),t.error},Ue=(t,e,r)=>{let s;for(let n of t)s=zr(n,s),Br(n,e,r);s&&Ge(s)},Ge=t=>x().forEach(e=>e.error=t),Br=(t,e,r)=>{ze(t,e,r),He(t)&&t.error&&L(t)};var xe=()=>J(new ft),gt=()=>Z(),ft=class{constructor(){this.#e()}labels(...e){return this.#t({type:"metadata",data:{labels:e}})}links(...e){return this.#t({type:"metadata",data:{links:e}})}parameter(e,r,s){return this.#t({type:"metadata",data:{parameters:[{name:e,value:r,...s}]}})}description(e){return this.#t({type:"metadata",data:{description:e}})}descriptionHtml(e){return this.#t({type:"metadata",data:{descriptionHtml:e}})}displayName(e){return this.#t({type:"metadata",data:{displayName:e}})}historyId(e){return this.#t({type:"metadata",data:{historyId:e}})}testCaseId(e){return this.#t({type:"metadata",data:{testCaseId:e}})}attachment(e,r,s){let n=r?.type==="Buffer"?r.data:r,o=typeof n=="string"?"utf8":"base64",a=Re(n);return this.#t({type:"attachment_content",data:{name:e,content:a,encoding:o,contentType:s.contentType,fileExtension:s.fileExtension}})}attachmentFromPath(e,r,s){return this.#t({type:"attachment_path",data:{name:e,path:r,contentType:s.contentType,fileExtension:s.fileExtension}})}logStep(e,r=u.PASSED,s){return cy.wrap(R,{log:!1}).then(()=>(lt(e),Cypress.Promise.resolve())).then(()=>(mt(r,s?S(s):void 0),Cypress.Promise.resolve()))}step(e,r){return cy.wrap(R,{log:!1}).then(()=>(lt(e),Cypress.Promise.resolve(r()))).then(s=>(mt(),s))}stepDisplayName(e){return this.#t({type:"step_metadata",data:{name:e}})}stepParameter(e,r,s){return this.#t({type:"step_metadata",data:{parameters:[{name:e,value:r,mode:s}]}})}flushAllureMessagesToTask(e){let r=this.#r();r.length&&cy.task(e,{absolutePath:Cypress.spec.absolute,messages:r},{log:!1})}flushAllureMessagesToTaskAsync(e){let r=this.#r();if(r.length){let s={absolutePath:Cypress.spec.absolute,messages:r,isInteractive:Cypress.config("isInteractive")};return cy.task(e,s,{log:!1})}}#e(){ne([])}#t(e){return l(e),Cypress.Promise.resolve()}#r(){let e=tt();return this.#e(),e}};var Te=()=>{l({type:"cypress_run_start",data:{}})},Ae=t=>{l({type:"cypress_suite_start",data:{id:t.id,name:t.title,root:t.root,start:Date.now()}})},Ee=t=>{l({type:"cypress_suite_end",data:{root:t.root,stop:Date.now()}})},rt=(t,e)=>{l({type:"cypress_hook_start",data:{name:t.title,scopeType:t.hookName.includes("each")?"each":"all",position:t.hookName.includes("before")?"before":"after",start:e??Date.now()}})},j=t=>{dt(),l({type:"cypress_hook_end",data:{duration:t.duration??0}})},st=t=>{pe(t),l({type:"cypress_test_start",data:pt(t)}),ct(t)},U=(t,e)=>{l({type:"cypress_step_start",data:{id:t,name:e,start:Date.now()}})},ze=(t,e,r)=>{l({type:"cypress_step_stop",data:Me(t,e,r)})},be=()=>{l({type:"cypress_test_pass",data:{}})},nt=t=>{let e=v(t),r=S(t);N(e,r),l({type:"cypress_fail",data:{status:e,statusDetails:r}})},ot=(t,e)=>{let r=t.hookName.includes("each"),s=t.parent,n=Oe(t.title,r,e,s);j(t),Kr(),Wr(s,n)},Ce=t=>{P(t)?N(u.SKIPPED,{message:"The test was skipped before the command was completed"}):st(t),l({type:"cypress_test_skip",data:ut()})},at=t=>{dt(),l({type:"cypress_test_end",data:{duration:t.duration??0,retries:t._retries??0}}),ue()},Be=(t,e)=>{l({type:"attachment_path",data:{path:t,name:e,contentType:k.PNG}})},b=t=>{if(Le(t)){let e=t.test;return E(e)||j(e),Ke()}},yt=(t,e)=>{try{return nt(e),ot(t.test,e),Ke()}catch(r){Vr(t,r)}},ht=(t,e)=>{if(!yt(t,e)?.then(()=>{throw e}))throw e},it=()=>gt().flushAllureMessagesToTask("reportAllureCypressSpecMessages"),Ke=()=>gt().flushAllureMessagesToTaskAsync("reportFinalAllureCypressSpecMessages"),Kr=()=>{let t=ie();t&&at(t)},Wr=(t,e)=>{for(let r of we(t))P(r)||$r(r,r.pending?{...ut(),status:u.SKIPPED}:e)},$r=(t,e)=>{l({type:"cypress_skipped_test",data:{...pt(t),...e,..._e(t),suites:Fe(t).map(r=>r.id)}}),ct(t)},Vr=(t,e)=>{try{console.error(`Unexpected error when reporting the failure of ${t.test?.title??"'after all'"}`),console.error(e)}catch{}};var $e=()=>{let t=qr();Yr(t),Jr(t)},qr=()=>{let t=0;return{getSuiteDepth:()=>t,incrementSuiteDepth:()=>{t++},decrementSuiteDepth:()=>{t--}}},Yr=({incrementSuiteDepth:t,decrementSuiteDepth:e})=>{let r=o=>(a,p,i)=>{t();try{return Zr(o,a,p,i)}finally{e()}},s=globalThis.describe,n=r(s);n.only=r(s.only),n.skip=r(s.skip),globalThis.describe=n},Jr=({getSuiteDepth:t})=>{let e=globalThis.after,r=(s,n)=>typeof s=="string"?e(s,We(t,n)):e(We(t,s));globalThis.after=r},Zr=(t,...e)=>{let[r,s,n]=e;return typeof n>"u"&&typeof s>"u"?t(r):typeof s=="function"?t(r,s):t(r,s,n)},We=(t,e)=>{if(t()===0&&e){let r=e.length?Xr(e):Qr(e);return Object.defineProperty(r,"name",{value:e.name}),r}return e},Xr=t=>function(e){let r=s=>{if(s){yt(this,s)?.then(()=>e(s))||e(s);return}try{if(b(this)?.then(()=>e()))return}catch(n){e(n);return}e()};return t.bind(this)(r)},Qr=t=>function(){let e,r;try{e=t.bind(this)()}catch(s){r=s}if(r)ht(this,r);else return D(e)?e.then(()=>b(this),s=>ht(this,s)):(b(this),e)};var Ve=t=>es(t)?qe(t):T(t,ts()),ts=()=>{let{stepsFromCommands:{maxArgumentDepth:t,maxArgumentLength:e}}=ce();return{maxDepth:t,maxLength:e,nonNullReplacerWithDomSupport:rs}},es=t=>typeof t=="object"&&t!==null&&Cypress.dom.isDom(t),qe=t=>Cypress.dom.stringify(t,"long"),rs=(t,e)=>{if(typeof e=="object"){if(e===null)return;if(Cypress.dom.isDom(e))return qe(e)}return e};var Ye=t=>{let{event:e,instrument:r}=t.attributes;return!(r!=="command"||e||os(t))},Je=(t,e)=>{let r=le();if(r&&_(r)){let{name:s,props:{name:n}}=r.log.attributes.consoleProps();s==="screenshot"&&n===t&&(r.attachmentName=e)}},Ze=t=>{let e=ms();typeof e<"u"&&ds(e.log,t)&&G(e.log.attributes.id),ss(t),U(t.attributes.id,as(t)),ns(t)},G=t=>H(({id:e})=>e===t),ss=t=>{let r={id:t.attributes.id,type:"log",log:t};I(r),L(r,s=>{s.parameters=is(t),r.attachmentName&&(s.name=r.attachmentName)})},ns=t=>{let{groupStart:e,end:r,id:s}=t.attributes;if(r)G(s);else if(e){let n=t.endGroup;t.endGroup=function(){return G(s),n.call(this)}}else{let n=t.end;t.end=function(){return G(s),n.call(this)}}},os=({attributes:{name:t,consoleProps:e}})=>t==="then"&&Object.is(e().props["Applied To"],R),as=t=>{let{name:e,message:r,displayName:s}=t.attributes,n=(s??e).trim(),o=(Xe(t)??us(t)??t.attributes.renderProps().message??r).trim();return[n,o].filter(Boolean).join(" ")},is=t=>cs(t).map(([e,r])=>({name:e.toString(),value:Ve(r)})).filter(fs(t)),ps=["Given","When","Then","And"],us=t=>{let{attributes:{name:e,message:r}}=t;if(ps.includes(e.trim())&&r.startsWith("**")&&r.endsWith("**"))return r.substring(2,r.length-2)},cs=t=>{let{attributes:{consoleProps:e}}=t,r=!!Xe(t),{props:s,name:n}=e();return["clearLocalStorage"].includes(n)?[]:Object.entries(s).filter(([o,a])=>ee(a)&&!(r&&o==="Message"))},Xe=t=>{if(ls(t)){let e=t.attributes.consoleProps().props.Message;if(e&&typeof e=="string")return e}},ls=({attributes:{name:t}})=>t==="assert",ms=()=>x().findLast(_),ds=(t,e)=>{let{groupStart:r,type:s}=t.attributes,{type:n}=e.attributes;return!r&&(s==="child"||n!=="child")},fs=t=>t.attributes.name==="wrap"?()=>!0:({name:e,value:r})=>e!=="Yielded"||r!=="{}";var Qe=()=>Cypress.on("fail",tr).on("log:added",ys),St=()=>Cypress.Screenshot.defaults({onAfterScreenshot:gs}),gs=(...[,{name:t,path:e}])=>{let r=t??Pe(e);Be(e,r),Je(t,r)},ys=(t,e)=>{Ye(e)&&Ze(e)},tr=t=>{if(Ne(t),hs())throw t},hs=()=>Object.is(Cypress.listeners("fail").at(-1),tr);var er=()=>{he(),Qe(),Se(),$e()};var rr=()=>{re()||(se(),er(),St())};rr();
1
+ "use strict";var B=Object.defineProperty;var nr=Object.getOwnPropertyDescriptor;var or=Object.getOwnPropertyNames;var ar=Object.prototype.hasOwnProperty;var ir=(t,e)=>{for(var r in e)B(t,r,{get:e[r],enumerable:!0})},pr=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of or(e))!ar.call(t,n)&&n!==r&&B(t,n,{get:()=>e[n],enumerable:!(s=nr(e,n))||s.enumerable});return t};var ur=t=>pr(B({},"__esModule",{value:!0}),t);var vs={};ir(vs,{ContentType:()=>w,LabelName:()=>c,LinkType:()=>C,Severity:()=>Tt,Stage:()=>xt,Status:()=>u,StatusByPriority:()=>vt,allureId:()=>Gt,attachTrace:()=>Lt,attachment:()=>It,attachmentPath:()=>Ot,description:()=>_t,descriptionHtml:()=>Mt,displayName:()=>wt,epic:()=>zt,feature:()=>Bt,historyId:()=>kt,issue:()=>Nt,label:()=>h,labels:()=>Dt,layer:()=>Jt,link:()=>F,links:()=>Pt,logStep:()=>jt,owner:()=>qt,parameter:()=>Rt,parentSuite:()=>$t,severity:()=>Yt,step:()=>Ht,story:()=>Kt,subSuite:()=>Vt,suite:()=>Wt,tag:()=>Zt,tags:()=>Xt,testCaseId:()=>Ft,tms:()=>Ut});module.exports=ur(vs);var u=function(t){return t.FAILED="failed",t.BROKEN="broken",t.PASSED="passed",t.SKIPPED="skipped",t}({}),vt=[u.FAILED,u.BROKEN,u.PASSED,u.SKIPPED],xt=function(t){return t.SCHEDULED="scheduled",t.RUNNING="running",t.FINISHED="finished",t.PENDING="pending",t.INTERRUPTED="interrupted",t}({}),c=function(t){return t.ALLURE_ID="ALLURE_ID",t.AS_ID="ALLURE_ID",t.SUITE="suite",t.PARENT_SUITE="parentSuite",t.SUB_SUITE="subSuite",t.EPIC="epic",t.FEATURE="feature",t.STORY="story",t.SEVERITY="severity",t.TAG="tag",t.OWNER="owner",t.LEAD="lead",t.HOST="host",t.THREAD="thread",t.TEST_METHOD="testMethod",t.TEST_CLASS="testClass",t.PACKAGE="package",t.FRAMEWORK="framework",t.LANGUAGE="language",t.LAYER="layer",t}({}),Tt=function(t){return t.BLOCKER="blocker",t.CRITICAL="critical",t.NORMAL="normal",t.MINOR="minor",t.TRIVIAL="trivial",t}({}),w=function(t){return t.TEXT="text/plain",t.XML="application/xml",t.HTML="text/html",t.CSV="text/csv",t.TSV="text/tab-separated-values",t.CSS="text/css",t.URI="text/uri-list",t.SVG="image/svg+xml",t.PNG="image/png",t.JSON="application/json",t.ZIP="application/zip",t.WEBM="video/webm",t.JPEG="image/jpeg",t.MP4="video/mp4",t.IMAGEDIFF="application/vnd.allure.image.diff",t}({}),C=function(t){return t.DEFAULT="link",t.ISSUE="issue",t.TMS="tms",t}({});function K(){K=function(o,a){return new r(o,void 0,a)};var t=RegExp.prototype,e=new WeakMap;function r(n,o,a){var p=RegExp(n,o);return e.set(p,a||e.get(n)),k(p,r.prototype)}function s(n,o){var a=e.get(o);return Object.keys(a).reduce(function(p,i){var g=a[i];if(typeof g=="number")p[i]=n[g];else{for(var y=0;n[g[y]]===void 0&&y+1<g.length;)y++;p[i]=n[g[y]]}return p},Object.create(null))}return cr(r,RegExp),r.prototype.exec=function(n){var o=t.exec.call(this,n);if(o){o.groups=s(o,this);var a=o.indices;a&&(a.groups=s(a,this))}return o},r.prototype[Symbol.replace]=function(n,o){if(typeof o=="string"){var a=e.get(this);return t[Symbol.replace].call(this,n,o.replace(/\$<([^>]+)>/g,function(i,g){var y=a[g];return"$"+(Array.isArray(y)?y.join("$"):y)}))}if(typeof o=="function"){var p=this;return t[Symbol.replace].call(this,n,function(){var i=arguments;return typeof i[i.length-1]!="object"&&(i=[].slice.call(i)).push(s(i,p)),o.apply(this,i)})}return t[Symbol.replace].call(this,n,o)},K.apply(this,arguments)}function cr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&k(t,e)}function k(t,e){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},k(t,e)}function At(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,s)}return r}function W(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?At(Object(r),!0).forEach(function(s){lr(t,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):At(Object(r)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(r,s))})}return t}function lr(t,e,r){return(e=mr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mr(t){var e=dr(t,"string");return typeof e=="symbol"?e:e+""}function dr(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var s=r.call(t,e||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var v=t=>{switch(!0){case/assert/gi.test(t.constructor.name):case/expectation/gi.test(t.constructor.name):case(t.name&&/assert/gi.test(t.name)):case(t.message&&/assert/gi.test(t.message)):case(t.stack&&/@vitest\/expect/gi.test(t.stack)):case(t.stack&&/playwright\/lib\/matchers\/expect\.js/gi.test(t.stack)):case"matcherResult"in t:case("inspect"in t&&typeof t.inspect=="function"):return u.FAILED;default:return u.BROKEN}},fr=function(){var{onlyFirst:e=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,e?void 0:"g")},$=t=>{var e=fr();return t.replace(e,"")},gr=t=>{if(!t||typeof t!="object")return{};if("matcherResult"in t&&t.matcherResult!==void 0&&typeof t.matcherResult=="object")return{actual:T(t.matcherResult.actual),expected:T(t.matcherResult.expected)};var e="actual"in t&&t.actual!==void 0?{actual:T(t.actual)}:{},r="expected"in t&&t.expected!==void 0?{expected:T(t.expected)}:{};return W(W({},e),r)},S=t=>{var{message:e,stack:r}=t;return W({message:e?$(e):void 0,trace:r?$(r):void 0},gr(t))};var yr=K(/(?:^|\s)@?allure\.([^:=\s]+)[:=]("[^"]+"|'[^']+'|`[^`]+`|\S+)/,{type:1}),Et=new RegExp(yr,"g");var hr=t=>t?.[1],Sr=t=>{var e,r=/['"`]/,s=new RegExp("^".concat(r.source)),n=new RegExp("".concat(r.source,"$")),o=(e=t?.[2])!==null&&e!==void 0?e:"";return s.test(o)&&n.test(o)?o.slice(1,-1):o};var V=t=>{var e=[],r=[],s=t.matchAll(Et),n=t.replaceAll(Et,"").split(" ").filter(Boolean).reduce((M,z)=>/^[\n\r]/.test(z)?M+z:"".concat(M," ").concat(z),"").trim();for(var o of s){var a=o,p=hr(a),i=Sr(a);if(!(!p||!i)){var[g,y]=p.split(".");switch(g){case"id":e.push({name:c.ALLURE_ID,value:i});break;case"label":e.push({name:y,value:i});break;case"link":r.push({type:y,url:i});break}}}return{labels:e,links:r,cleanTitle:n}};var D=t=>!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function",T=function(e){var{maxDepth:r=0,maxLength:s=0,replacer:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Er(typeof e=="object"?JSON.stringify(e,vr(r,n)):String(e),s)},vr=(t,e)=>{var r=[],s=function(o,a){if(typeof a!="object"||a===null)return a;for(;r.length>0&&!Object.is(r.at(-1),this);)r.pop();if(!(t&&r.length>=t||r.includes(a)))return r.push(a),a instanceof Map?Tr(r,a):a instanceof Set?Ar(r,a):a};return e?xr(e,s):s},xr=(t,e)=>function(r,s){return e.call(this,r,t.call(this,r,s))},Tr=(t,e)=>Array.from(e).filter(r=>{var[s]=r;return!t.includes(s)}).map(r=>{var[s,n]=r;return[s,t.includes(n)?void 0:n]}),Ar=(t,e)=>Array.from(e).map(r=>t.includes(r)?void 0:r),Er=(t,e)=>e&&t.length>e?"".concat(t.substring(0,e),"..."):t;function bt(t,e,r,s,n,o,a){try{var p=t[o](a),i=p.value}catch(g){return void r(g)}p.done?e(i):Promise.resolve(i).then(s,n)}function f(t){return function(){var e=this,r=arguments;return new Promise(function(s,n){var o=t.apply(e,r);function a(i){bt(o,s,n,a,p,"next",i)}function p(i){bt(o,s,n,a,p,"throw",i)}a(void 0)})}}var q=class{attachment(){var e=this;return f(function*(){yield e.warning()})()}attachmentFromPath(){var e=this;return f(function*(){yield e.warning()})()}description(){var e=this;return f(function*(){yield e.warning()})()}descriptionHtml(){var e=this;return f(function*(){yield e.warning()})()}displayName(){var e=this;return f(function*(){yield e.warning()})()}historyId(){var e=this;return f(function*(){yield e.warning()})()}labels(){var e=this;return f(function*(){yield e.warning()})()}links(){var e=this;return f(function*(){yield e.warning()})()}parameter(){var e=this;return f(function*(){yield e.warning()})()}logStep(){var e=this;return f(function*(){yield e.warning()})()}step(e,r){var s=this;return f(function*(){return yield s.warning(),r()})()}stepDisplayName(){var e=this;return f(function*(){yield e.warning()})()}stepParameter(){var e=this;return f(function*(){yield e.warning()})()}testCaseId(){var e=this;return f(function*(){yield e.warning()})()}warning(){return f(function*(){console.log("no test runtime is found. Please check test framework configuration")})()}},A=new q;var Ct="allureTestRuntime",J=t=>{globalThis[Ct]=()=>t},Y=()=>globalThis?.[Ct],Z=()=>{var t=Y();if(t){var e;return(e=t())!==null&&e!==void 0?e:A}return A},X=()=>{var t=Y();if(t){var e;return(e=t())!==null&&e!==void 0?e:A}if("_playwrightInstance"in globalThis)try{return(0,eval)("(() => import('allure-playwright/autoconfig'))()").then(()=>{var r,s;return(r=(s=Y())===null||s===void 0?void 0:s())!==null&&r!==void 0?r:A})}catch(r){return console.log("can't execute allure-playwright/autoconfig",r),A}return A};var m=function(e){for(var r=arguments.length,s=new Array(r>1?r-1:0),n=1;n<r;n++)s[n-1]=arguments[n];var o=X();return D(o)?o.then(a=>a[e](...s)):o[e](...s)},h=(t,e)=>m("labels",{name:t,value:e}),Dt=function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return m("labels",...r)},F=(t,e,r)=>m("links",{url:t,type:r,name:e}),Pt=function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return m("links",...r)},Rt=(t,e,r)=>m("parameter",t,e,r),_t=t=>m("description",t),Mt=t=>m("descriptionHtml",t),wt=t=>m("displayName",t),kt=t=>m("historyId",t),Ft=t=>m("testCaseId",t),It=(t,e,r)=>{var s=typeof r=="string"?{contentType:r}:r;return m("attachment",t,e,s)},Lt=(t,e)=>m("attachmentFromPath",t,e,{contentType:"application/vnd.allure.playwright-trace"}),Ot=(t,e,r)=>{var s=typeof r=="string"?{contentType:r}:r;return m("attachmentFromPath",t,e,s)},br=()=>({displayName:t=>m("stepDisplayName",t),parameter:(t,e,r)=>m("stepParameter",t,e,r)}),jt=(t,e,r)=>m("logStep",t,e,r),Ht=(t,e)=>m("step",t,()=>e(br())),Nt=(t,e)=>F(t,e,C.ISSUE),Ut=(t,e)=>F(t,e,C.TMS),Gt=t=>h(c.ALLURE_ID,t),zt=t=>h(c.EPIC,t),Bt=t=>h(c.FEATURE,t),Kt=t=>h(c.STORY,t),Wt=t=>h(c.SUITE,t),$t=t=>h(c.PARENT_SUITE,t),Vt=t=>h(c.SUB_SUITE,t),qt=t=>h(c.OWNER,t),Yt=t=>h(c.SEVERITY,t),Jt=t=>h(c.LAYER,t),Zt=t=>h(c.TAG,t),Xt=function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return m("labels",...r.map(n=>({name:c.TAG,value:n})))};var Qt={stepsFromCommands:{maxArgumentLength:128,maxArgumentDepth:3}},te=(t,e)=>{let r=t.findIndex(e);return r!==-1?Q(t.splice(r)):[]},Q=t=>{let e=t.length,r=new Array(e);for(let s=0;s<e;s++)r[e-s-1]=t[s];return r},ee=t=>t[t.length-1],re=t=>typeof t<"u";var d=()=>{let t=Cypress.env("allure");return t||(t={config:Qt,initialized:!1,messages:[],testPlan:void 0,currentTest:void 0,projectDir:void 0,stepStack:[],stepsToFinalize:[],nextApiStepId:0},Cypress.env("allure",t)),t},se=()=>d().initialized,ne=()=>{d().initialized=!0},tt=()=>d().messages,oe=t=>{d().messages=t},l=t=>{tt().push(t)},ae=()=>d().testPlan,ie=()=>d().projectDir,pe=()=>d().currentTest,ue=t=>{d().currentTest=t},ce=()=>{d().currentTest=void 0},le=()=>d().config,x=()=>d().stepStack,me=()=>ee(x()),I=t=>x().push(t);var Dr=t=>Q(x().splice(t)),de=()=>Dr(0);var L=(t,e)=>d().stepsToFinalize.push([t,e]),fe=()=>d().stepsToFinalize,ge=()=>{let t=d();t.stepsToFinalize=[]};var ye=(t,e)=>{let r=ae();if(r){let s=he(t);for(let n of Pr(e)){let o=Rr(r,t,s,n.tests);_r(n.tests,o)}}},Pr=function*(t){let e=[];for(let r=t;r;r=e.pop()){yield r;for(let s=r.suites.length-1;s>=0;s--)e.push(r.suites[s])}},Rr=(t,e,r,s)=>{let n=[];return s.forEach((o,a)=>{let{fullNameSuffix:p,labels:i}=et(o),g=`${r}#${p}`,y=i.find(({name:M})=>M===c.ALLURE_ID)?.value;Mr(t,g,y)||n.push(a)}),n},_r=(t,e)=>{for(let r=e.length-1;r>=0;r--)t.splice(e[r],1)},Mr=(t,e,r)=>t.tests.some(s=>r&&s.id?.toString()===r||s.selector===e);var O="__allure_report_system_hook__",Se=()=>{Cypress.mocha.getRunner().on("start",wr).on("suite",kr).on("suite end",be).on("hook",Fr).on("hook end",Ir).on("test",Lr).on("pass",Ce).on("fail",Or).on("pending",De).on("test end",at)},ve=()=>{afterEach(O,it),after(O,jr)},wr=()=>{Te(),Ae()},kr=t=>{t.root&&ye(Cypress.spec,t),Ee(t)},Fr=t=>{E(t)||rt(t)},Ir=t=>{E(t)||j(t)},Lr=t=>{P(t)||st(t)},Or=(t,e)=>{let r="hookName"in t;if(r&&xe(t))return;r&&E(t)&&rt(t,Date.now()-(t.duration??0)),nt(e),r&&ot(t,e)},jr=function(){it(),b(this)};var Pe=Cypress.platform==="win32",Re=t=>t.substring(t.lastIndexOf(Pe?"\\":"/")+1),he=t=>{let e=ie(),r=e?t.absolute.substring(e.length+1):t.relative;return Pe?r.replaceAll("\\","/"):r},_e=t=>Array.isArray(t)||t.buffer?btoa(String.fromCharCode.apply(null,t)):t,pt=t=>({...et(t),start:typeof t.wallClockStartedAt=="string"?Date.parse(t.wallClockStartedAt):t.wallClockStartedAt?.getTime?.()||Date.now()}),Me=t=>({duration:t.duration??0,retries:t._retries??0}),ut=()=>({statusDetails:{message:"This is a pending test"}}),we=(t,e,r)=>{let s={id:t.id,stop:Date.now(),status:e??He(t)};return r&&(s.statusDetails=r),s},ke=Symbol("The test has been reported to Allure"),ct=t=>{t[ke]=!0},P=t=>t[ke]===!0,Hr=function*(t){let e=[];for(let r=t;r;r=e.pop()){yield r;for(let s=r.suites.length-1;s>=0;s--)e.push(r.suites[s])}},Fe=function*(t){for(let e of Hr(t))yield*e.tests},Ie=t=>{let e=[];for(let r=t.parent;r;r=r.parent)e.push(r);return e.reverse(),e};var Le=()=>(d().nextApiStepId++).toString(),et=t=>{let e=t.title,{cleanTitle:r,labels:s,links:n}=V(e),a=`${[...t.titlePath().slice(0,-1),r].join(" ")}`;return{name:r,labels:s,links:n,fullNameSuffix:a}},E=t=>t.title.includes(O),xe=t=>t.parent.root&&t.hookName==="after all",Oe=t=>{let e=t.test;return t.test.parent.hooks.findLast(o=>o.hookName==="after all")?.hookId===e.hookId},je=(t,e,r,s)=>{let n=e?u.SKIPPED:v(r),{message:o,trace:a}=S(r);return{status:n,statusDetails:{message:e?Nr(t,s):o,trace:a}}},Nr=(t,e)=>{let r=e.title?`'${e.title}'`:"root";return`'${t}' defined in the ${r} suite has failed`};var R={},Ne=t=>t.type==="api",_=t=>t.type==="log",lt=t=>U(Ur(),t),Ur=()=>{let t=Le();return I({id:t,type:"api"}),t},Ue=t=>{let e=v(t),r=S(t);zr(e,r),ze(t)},mt=(t,e)=>H(r=>Ne(r),t,e),H=(t,e,r)=>Ge(te(x(),t),e,r),N=(t,e)=>Ge(de(),t,e),dt=()=>{N(),fe().forEach(Gr),ge()},He=t=>t.error?v(t.error):u.PASSED,Gr=([t,e])=>{let{id:r,error:s}=t,n={id:r};s&&(n.statusDetails=S(s)),e?.(n),l({type:"cypress_step_finalize",data:n})},zr=(t,e)=>{let r=x(),s=r.at(r.findLastIndex(_)+1);s&&H(n=>Object.is(n,s),t,e)},Br=(t,e)=>{if(_(t)){let r=t.log.attributes.error;if(r)return t.error=r}return e&&(t.error=e),t.error},Ge=(t,e,r)=>{let s;for(let n of t)s=Br(n,s),Kr(n,e,r);s&&ze(s)},ze=t=>x().forEach(e=>e.error=t),Kr=(t,e,r)=>{Be(t,e,r),Ne(t)&&t.error&&L(t)};var Te=()=>J(new ft),gt=()=>Z(),ft=class{constructor(){this.#e()}labels(...e){return this.#t({type:"metadata",data:{labels:e}})}links(...e){return this.#t({type:"metadata",data:{links:e}})}parameter(e,r,s){return this.#t({type:"metadata",data:{parameters:[{name:e,value:r,...s}]}})}description(e){return this.#t({type:"metadata",data:{description:e}})}descriptionHtml(e){return this.#t({type:"metadata",data:{descriptionHtml:e}})}displayName(e){return this.#t({type:"metadata",data:{displayName:e}})}historyId(e){return this.#t({type:"metadata",data:{historyId:e}})}testCaseId(e){return this.#t({type:"metadata",data:{testCaseId:e}})}attachment(e,r,s){let n=r?.type==="Buffer"?r.data:r,o=typeof n=="string"?"utf8":"base64",a=_e(n);return this.#t({type:"attachment_content",data:{name:e,content:a,encoding:o,contentType:s.contentType,fileExtension:s.fileExtension}})}attachmentFromPath(e,r,s){return this.#t({type:"attachment_path",data:{name:e,path:r,contentType:s.contentType,fileExtension:s.fileExtension}})}logStep(e,r=u.PASSED,s){return cy.wrap(R,{log:!1}).then(()=>(lt(e),Cypress.Promise.resolve())).then(()=>(mt(r,s?S(s):void 0),Cypress.Promise.resolve()))}step(e,r){return cy.wrap(R,{log:!1}).then(()=>(lt(e),Cypress.Promise.resolve(r()))).then(s=>(mt(),s))}stepDisplayName(e){return this.#t({type:"step_metadata",data:{name:e}})}stepParameter(e,r,s){return this.#t({type:"step_metadata",data:{parameters:[{name:e,value:r,mode:s}]}})}flushAllureMessagesToTask(e){let r=this.#r();r.length&&cy.task(e,{absolutePath:Cypress.spec.absolute,messages:r},{log:!1})}flushAllureMessagesToTaskAsync(e){let r=this.#r();if(r.length){let s={absolutePath:Cypress.spec.absolute,messages:r,isInteractive:Cypress.config("isInteractive")};return cy.task(e,s,{log:!1})}}#e(){oe([])}#t(e){return l(e),Cypress.Promise.resolve()}#r(){let e=tt();return this.#e(),e}};var Ae=()=>{l({type:"cypress_run_start",data:{}})},Ee=t=>{l({type:"cypress_suite_start",data:{id:t.id,name:t.title,root:t.root,start:Date.now()}})},be=t=>{l({type:"cypress_suite_end",data:{root:t.root,stop:Date.now()}})},rt=(t,e)=>{l({type:"cypress_hook_start",data:{name:t.title,scopeType:t.hookName.includes("each")?"each":"all",position:t.hookName.includes("before")?"before":"after",start:e??Date.now()}})},j=t=>{dt(),l({type:"cypress_hook_end",data:{duration:t.duration??0}})},st=t=>{ue(t),l({type:"cypress_test_start",data:pt(t)}),ct(t)},U=(t,e)=>{l({type:"cypress_step_start",data:{id:t,name:e,start:Date.now()}})},Be=(t,e,r)=>{l({type:"cypress_step_stop",data:we(t,e,r)})},Ce=()=>{l({type:"cypress_test_pass",data:{}})},nt=t=>{let e=v(t),r=S(t);N(e,r),l({type:"cypress_fail",data:{status:e,statusDetails:r}})},ot=(t,e)=>{let r=t.hookName.includes("each"),s=t.parent,n=je(t.title,r,e,s);j(t),Wr(),$r(s,n)},De=t=>{P(t)?N(u.SKIPPED,{message:"The test was skipped before the command was completed"}):st(t),l({type:"cypress_test_skip",data:ut()})},at=t=>{dt(),l({type:"cypress_test_end",data:{duration:t.duration??0,retries:t._retries??0}}),ce()},Ke=(t,e)=>{l({type:"attachment_path",data:{path:t,name:e,contentType:w.PNG}})},b=t=>{if(Oe(t)){let e=t.test;return E(e)||j(e),We()}},yt=(t,e)=>{try{return nt(e),ot(t.test,e),We()}catch(r){qr(t,r)}},ht=(t,e)=>{if(!yt(t,e)?.then(()=>{throw e}))throw e},it=()=>gt().flushAllureMessagesToTask("reportAllureCypressSpecMessages"),We=()=>gt().flushAllureMessagesToTaskAsync("reportFinalAllureCypressSpecMessages"),Wr=()=>{let t=pe();t&&at(t)},$r=(t,e)=>{for(let r of Fe(t))P(r)||Vr(r,r.pending?{...ut(),status:u.SKIPPED}:e)},Vr=(t,e)=>{l({type:"cypress_skipped_test",data:{...pt(t),...e,...Me(t),suites:Ie(t).map(r=>r.id)}}),ct(t)},qr=(t,e)=>{try{console.error(`Unexpected error when reporting the failure of ${t.test?.title??"'after all'"}`),console.error(e)}catch{}};var Ve=()=>{let t=Yr();Jr(t),Zr(t)},Yr=()=>{let t=0;return{getSuiteDepth:()=>t,incrementSuiteDepth:()=>{t++},decrementSuiteDepth:()=>{t--}}},Jr=({incrementSuiteDepth:t,decrementSuiteDepth:e})=>{let r=o=>(a,p,i)=>{t();try{return Xr(o,a,p,i)}finally{e()}},s=globalThis.describe,n=r(s);n.only=r(s.only),n.skip=r(s.skip),globalThis.describe=n},Zr=({getSuiteDepth:t})=>{let e=globalThis.after,r=(s,n)=>typeof s=="string"?e(s,$e(t,n)):e($e(t,s));globalThis.after=r},Xr=(t,...e)=>{let[r,s,n]=e;return typeof n>"u"&&typeof s>"u"?t(r):typeof s=="function"?t(r,s):t(r,s,n)},$e=(t,e)=>{if(t()===0&&e){let r=e.length?Qr(e):ts(e);return Object.defineProperty(r,"name",{value:e.name}),r}return e},Qr=t=>function(e){let r=s=>{if(s){yt(this,s)?.then(()=>e(s))||e(s);return}try{if(b(this)?.then(()=>e()))return}catch(n){e(n);return}e()};return t.bind(this)(r)},ts=t=>function(){let e,r;try{e=t.bind(this)()}catch(s){r=s}if(r)ht(this,r);else return D(e)?e.then(()=>b(this),s=>ht(this,s)):(b(this),e)};var qe=t=>rs(t)?Ye(t):T(t,es()),es=()=>{let{stepsFromCommands:{maxArgumentDepth:t,maxArgumentLength:e}}=le();return{maxDepth:t,maxLength:e,nonNullReplacerWithDomSupport:ss}},rs=t=>typeof t=="object"&&t!==null&&Cypress.dom.isDom(t),Ye=t=>Cypress.dom.stringify(t,"long"),ss=(t,e)=>{if(typeof e=="object"){if(e===null)return;if(Cypress.dom.isDom(e))return Ye(e)}return e};var Je=t=>{let{event:e,instrument:r}=t.attributes;return!(r!=="command"||e||as(t))},Ze=(t,e)=>{let r=me();if(r&&_(r)){let{name:s,props:{name:n}}=r.log.attributes.consoleProps();s==="screenshot"&&n===t&&(r.attachmentName=e)}},Xe=t=>{let e=ds();typeof e<"u"&&fs(e.log,t)&&G(e.log.attributes.id),ns(t),U(t.attributes.id,is(t)),os(t)},G=t=>H(({id:e})=>e===t),ns=t=>{let r={id:t.attributes.id,type:"log",log:t};I(r),L(r,s=>{s.parameters=ps(t),r.attachmentName&&(s.name=r.attachmentName)})},os=t=>{let{groupStart:e,end:r,id:s}=t.attributes;if(r)G(s);else if(e){let n=t.endGroup;t.endGroup=function(){return G(s),n.call(this)}}else{let n=t.end;t.end=function(){return G(s),n.call(this)}}},as=({attributes:{name:t,consoleProps:e}})=>t==="then"&&Object.is(e().props["Applied To"],R),is=t=>{let{name:e,message:r,displayName:s}=t.attributes,n=(s??e).trim(),o=(Qe(t)??cs(t)??t.attributes.renderProps().message??r).trim();return[n,o].filter(Boolean).join(" ")},ps=t=>ls(t).map(([e,r])=>({name:e.toString(),value:qe(r)})).filter(gs(t)),us=["Given","When","Then","And"],cs=t=>{let{attributes:{name:e,message:r}}=t;if(us.includes(e.trim())&&r.startsWith("**")&&r.endsWith("**"))return r.substring(2,r.length-2)},ls=t=>{let{attributes:{consoleProps:e}}=t,r=!!Qe(t),{props:s,name:n}=e();return["clearLocalStorage"].includes(n)?[]:Object.entries(s).filter(([o,a])=>re(a)&&!(r&&o==="Message"))},Qe=t=>{if(ms(t)){let e=t.attributes.consoleProps().props.Message;if(e&&typeof e=="string")return e}},ms=({attributes:{name:t}})=>t==="assert",ds=()=>x().findLast(_),fs=(t,e)=>{let{groupStart:r,type:s}=t.attributes,{type:n}=e.attributes;return!r&&(s==="child"||n!=="child")},gs=t=>t.attributes.name==="wrap"?()=>!0:({name:e,value:r})=>e!=="Yielded"||r!=="{}";var tr=()=>Cypress.on("fail",er).on("log:added",hs),St=()=>Cypress.Screenshot.defaults({onAfterScreenshot:ys}),ys=(...[,{name:t,path:e}])=>{let r=t??Re(e);Ke(e,r),Ze(t,r)},hs=(t,e)=>{Je(e)&&Xe(e)},er=t=>{if(Ue(t),Ss())throw t},Ss=()=>Object.is(Cypress.listeners("fail").at(-1),er);var rr=()=>{Se(),tr(),ve(),Ve()};var sr=()=>{se()||(ne(),rr(),St())};sr();
2
2
  //# sourceMappingURL=index.js.map