allure-cypress 3.0.7 → 3.0.8

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/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- var c=function(t){return t.FAILED="failed",t.BROKEN="broken",t.PASSED="passed",t.SKIPPED="skipped",t}({}),be=[c.FAILED,c.BROKEN,c.PASSED,c.SKIPPED],De=function(t){return t.SCHEDULED="scheduled",t.RUNNING="running",t.FINISHED="finished",t.PENDING="pending",t.INTERRUPTED="interrupted",t}({}),l=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}({}),Pe=function(t){return t.BLOCKER="blocker",t.CRITICAL="critical",t.NORMAL="normal",t.MINOR="minor",t.TRIVIAL="trivial",t}({}),N=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}({}),R=function(t){return t.DEFAULT="link",t.ISSUE="issue",t.TMS="tms",t}({});function _(){_=function(a,n){return new r(a,void 0,n)};var t=RegExp.prototype,e=new WeakMap;function r(o,a,n){var p=RegExp(o,a);return e.set(p,n||e.get(o)),M(p,r.prototype)}function s(o,a){var n=e.get(a);return Object.keys(n).reduce(function(p,i){var y=n[i];if(typeof y=="number")p[i]=o[y];else{for(var S=0;o[y[S]]===void 0&&S+1<y.length;)S++;p[i]=o[y[S]]}return p},Object.create(null))}return Re(r,RegExp),r.prototype.exec=function(o){var a=t.exec.call(this,o);if(a){a.groups=s(a,this);var n=a.indices;n&&(n.groups=s(n,this))}return a},r.prototype[Symbol.replace]=function(o,a){if(typeof a=="string"){var n=e.get(this);return t[Symbol.replace].call(this,o,a.replace(/\$<([^>]+)>/g,function(i,y){var S=n[y];return"$"+(Array.isArray(S)?S.join("$"):S)}))}if(typeof a=="function"){var p=this;return t[Symbol.replace].call(this,o,function(){var i=arguments;return typeof i[i.length-1]!="object"&&(i=[].slice.call(i)).push(s(i,p)),a.apply(this,i)})}return t[Symbol.replace].call(this,o,a)},_.apply(this,arguments)}function Re(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&&M(t,e)}function M(t,e){return M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},M(t,e)}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:return c.FAILED;default:return c.BROKEN}},_e=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")},U=t=>{var e=_e();return t.replace(e,"")},h=t=>{var{message:e,stack:r}=t;return{message:e?U(e):void 0,trace:r?U(r):void 0}},gt=_(/(?:^|\s)@?allure\.id[:=]([^\s]+)/,{id:1}),Me=new RegExp(gt,"g"),yt=_(/(?:^|\s)@?allure\.label\.([^:=\s]+)[:=]([^\s]+)/,{name:1,value:2}),ke=new RegExp(yt,"g");var G=t=>{var e=[];t.split(" ").forEach(s=>{var o,a=(o=s.match(gt))===null||o===void 0||(o=o.groups)===null||o===void 0?void 0:o.id;a&&e.push({name:l.ALLURE_ID,value:a});var n=s.match(yt),{name:p,value:i}=n?.groups||{};p&&i&&e?.push({name:p,value:i})});var r=t.replace(ke,"").replace(Me,"").trim();return{labels:e,cleanTitle:r}};var A=t=>!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function",z=function(e){var{maxDepth:r=0,maxLength:s=0,replacer:o}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Oe(typeof e=="object"?JSON.stringify(e,we(r,o)):String(e),s)},we=(t,e)=>{var r=[],s=function(a,n){if(typeof n!="object"||n===null)return n;for(;r.length>0&&!Object.is(r.at(-1),this);)r.pop();if(!(t&&r.length>=t||r.includes(n)))return r.push(n),n instanceof Map?Fe(r,n):n instanceof Set?Le(r,n):n};return e?Ie(e,s):s},Ie=(t,e)=>function(r,s){return e.call(this,r,t.call(this,r,s))},Fe=(t,e)=>Array.from(e).filter(r=>{var[s]=r;return!t.includes(s)}).map(r=>{var[s,o]=r;return[s,t.includes(o)?void 0:o]}),Le=(t,e)=>Array.from(e).map(r=>t.includes(r)?void 0:r),Oe=(t,e)=>e&&t.length>e?"".concat(t.substring(0,e),"..."):t;function ht(t,e,r,s,o,a,n){try{var p=t[a](n),i=p.value}catch(y){return void r(y)}p.done?e(i):Promise.resolve(i).then(s,o)}function f(t){return function(){var e=this,r=arguments;return new Promise(function(s,o){var a=t.apply(e,r);function n(i){ht(a,s,o,n,p,"next",i)}function p(i){ht(a,s,o,n,p,"throw",i)}n(void 0)})}}var B=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")})()}},T=new B;var St="allureTestRuntime",K=t=>{globalThis[St]=()=>t},W=()=>globalThis?.[St],V=()=>{var t=W();if(t){var e;return(e=t())!==null&&e!==void 0?e:T}return T},$=()=>{var t=W();if(t){var e;return(e=t())!==null&&e!==void 0?e:T}if("_playwrightInstance"in globalThis)try{return(0,eval)("(() => import('allure-playwright/autoconfig'))()").then(()=>{var r,s;return(r=(s=W())===null||s===void 0?void 0:s())!==null&&r!==void 0?r:T})}catch(r){return console.log("can't execute allure-playwright/autoconfig",r),T}return T};var m=function(e){for(var r=arguments.length,s=new Array(r>1?r-1:0),o=1;o<r;o++)s[o-1]=arguments[o];var a=$();return A(a)?a.then(n=>n[e](...s)):a[e](...s)},g=(t,e)=>m("labels",{name:t,value:e}),He=function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return m("labels",...r)},Y=(t,e,r)=>m("links",{url:t,type:r,name:e}),je=function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return m("links",...r)},Ne=(t,e,r)=>m("parameter",t,e,r),Ue=t=>m("description",t),Ge=t=>m("descriptionHtml",t),ze=t=>m("displayName",t),Be=t=>m("historyId",t),We=t=>m("testCaseId",t),Ke=(t,e,r)=>{var s=typeof r=="string"?{contentType:r}:r;return m("attachment",t,e,s)},Ve=(t,e,r)=>{var s=typeof r=="string"?{contentType:r}:r;return m("attachmentFromPath",t,e,s)},$e=()=>({displayName:t=>m("stepDisplayName",t),parameter:(t,e,r)=>m("stepParameter",t,e,r)}),Ye=(t,e,r)=>m("logStep",t,e,r),qe=(t,e)=>m("step",t,()=>e($e())),Je=(t,e)=>Y(t,e,R.ISSUE),Ze=(t,e)=>Y(t,e,R.TMS),Xe=t=>g(l.ALLURE_ID,t),Qe=t=>g(l.EPIC,t),tr=t=>g(l.FEATURE,t),er=t=>g(l.STORY,t),rr=t=>g(l.SUITE,t),sr=t=>g(l.PARENT_SUITE,t),or=t=>g(l.SUB_SUITE,t),nr=t=>g(l.OWNER,t),ar=t=>g(l.SEVERITY,t),ir=t=>g(l.LAYER,t),pr=t=>g(l.TAG,t),ur=function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return m("labels",...r.map(o=>({name:l.TAG,value:o})))};var vt={stepsFromCommands:{maxArgumentLength:128,maxArgumentDepth:3}},xt=(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},Tt=t=>t[t.length-1],Ct=t=>typeof t<"u";var d=()=>{let t=Cypress.env("allure");return t||(t={config:vt,initialized:!1,messages:[],testPlan:void 0,currentTest:void 0,projectDir:void 0,stepStack:[],stepsToFinalize:[],nextApiStepId:0},Cypress.env("allure",t)),t},Et=()=>d().initialized,At=()=>{d().initialized=!0},J=()=>d().messages,bt=t=>{d().messages=t},u=t=>{J().push(t)},Dt=()=>d().testPlan,Pt=()=>d().projectDir,Rt=()=>d().currentTest,_t=t=>{d().currentTest=t},Mt=()=>{d().currentTest=void 0},kt=()=>d().config,x=()=>d().stepStack,wt=()=>Tt(x()),k=t=>x().push(t);var lr=t=>q(x().splice(t)),It=()=>lr(0);var w=(t,e)=>d().stepsToFinalize.push([t,e]),Ft=()=>d().stepsToFinalize,Lt=()=>{let t=d();t.stepsToFinalize=[]};var Ot=(t,e)=>{let r=Dt();if(r){let s=Ht(t);for(let o of mr(e)){let a=dr(r,t,s,o.tests);fr(o.tests,a)}}},mr=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])}},dr=(t,e,r,s)=>{let o=[];return s.forEach((a,n)=>{let{fullNameSuffix:p,labels:i}=Z(e,a),y=`${r}#${p}`,S=i.find(({name:Ae})=>Ae===l.ALLURE_ID)?.value;gr(t,y,S)||o.push(n)}),o},fr=(t,e)=>{for(let r=e.length-1;r>=0;r--)t.splice(e[r],1)},gr=(t,e,r)=>t.tests.some(s=>r&&s.id?.toString()===r||s.selector===e);var I="__allure_report_system_hook__",jt=()=>{Cypress.mocha.getRunner().on("start",yr).on("suite",hr).on("suite end",Wt).on("hook",Sr).on("hook end",vr).on("test",xr).on("pass",Kt).on("fail",Tr).on("pending",Vt).on("test end",rt)},Nt=()=>{afterEach(I,st),after(I,Cr)},yr=()=>{Gt(),zt()},hr=t=>{t.root&&Ot(Cypress.spec,t),Bt(t)},Sr=t=>{C(t)||X(t)},vr=t=>{C(t)||F(t)},xr=t=>{b(t)||Q(t)},Tr=(t,e)=>{let r="hookName"in t;if(r&&Ut(t))return;r&&C(t)&&X(t,Date.now()-(t.duration??0)),tt(e),r&&et(t,e)},Cr=function(){st(),E(this)};var $t=Cypress.platform==="win32",Yt=t=>t.substring(t.lastIndexOf($t?"\\":"/")+1),Ht=t=>{let e=Pt(),r=e?t.absolute.substring(e.length+1):t.relative;return $t?r.replaceAll("\\","/"):r},qt=t=>Array.isArray(t)||t.buffer?btoa(String.fromCharCode.apply(null,t)):t,ot=t=>({...Z(Cypress.spec,t),start:t.wallClockStartedAt?.getTime()||Date.now()}),Jt=t=>({duration:t.duration??0,retries:t._retries??0}),nt=()=>({statusDetails:{message:"This is a pending test"}}),Zt=(t,e,r)=>{let s={id:t.id,stop:Date.now(),status:e??oe(t)};return r&&(s.statusDetails=r),s},Xt=Symbol("The test has been reported to Allure"),at=t=>{t[Xt]=!0},b=t=>t[Xt]===!0,Er=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])}},Qt=function*(t){for(let e of Er(t))yield*e.tests},te=t=>{let e=[];for(let r=t.parent;r;r=r.parent)e.push(r);return e.reverse(),e};var ee=()=>(d().nextApiStepId++).toString(),Z=(t,e)=>{let r=e.title,{cleanTitle:s,labels:o}=G(r),n=`${[...e.titlePath().slice(0,-1),s].join(" ")}`;return{name:s,labels:o,fullNameSuffix:n}},C=t=>t.title.includes(I),Ut=t=>t.parent.root&&t.hookName==="after all",re=t=>{let e=t.test;return t.test.parent.hooks.findLast(a=>a.hookName==="after all")?.hookId===e.hookId},se=(t,e,r,s)=>{let o=e?c.SKIPPED:v(r),{message:a,trace:n}=h(r);return{status:o,statusDetails:{message:e?Ar(t,s):a,trace:n}}},Ar=(t,e)=>{let r=e.title?`'${e.title}'`:"root";return`'${t}' defined in the ${r} suite has failed`};var D={},ne=t=>t.type==="api",P=t=>t.type==="log",it=t=>H(br(),t),br=()=>{let t=ee();return k({id:t,type:"api"}),t},ae=t=>{let e=v(t),r=h(t);Pr(e,r),pe(t)},pt=(t,e)=>L(r=>ne(r),t,e),L=(t,e,r)=>ie(xt(x(),t),e,r),O=(t,e)=>ie(It(),t,e),ut=()=>{O(),Ft().forEach(Dr),Lt()},oe=t=>t.error?v(t.error):c.PASSED,Dr=([t,e])=>{let{id:r,error:s}=t,o={id:r};s&&(o.statusDetails=h(s)),e?.(o),u({type:"cypress_step_finalize",data:o})},Pr=(t,e)=>{let r=x(),s=r.at(r.findLastIndex(P)+1);s&&L(o=>Object.is(o,s),t,e)},Rr=(t,e)=>{if(P(t)){let r=t.log.attributes.error;if(r)return t.error=r}return e&&(t.error=e),t.error},ie=(t,e,r)=>{let s;for(let o of t)s=Rr(o,s),_r(o,e,r);s&&pe(s)},pe=t=>x().forEach(e=>e.error=t),_r=(t,e,r)=>{ue(t,e,r),ne(t)&&t.error&&w(t)};var Gt=()=>K(new ct),lt=()=>V(),ct=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 o=r?.type==="Buffer"?r.data:r,a=typeof o=="string"?"utf8":"base64",n=qt(o);return this.#t({type:"attachment_content",data:{name:e,content:n,encoding:a,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=c.PASSED,s){return cy.wrap(D,{log:!1}).then(()=>(it(e),Cypress.Promise.resolve())).then(()=>(pt(r,s?h(s):void 0),Cypress.Promise.resolve()))}step(e,r){return cy.wrap(D,{log:!1}).then(()=>(it(e),Cypress.Promise.resolve(r()))).then(s=>(pt(),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(){bt([])}#t(e){return u(e),Cypress.Promise.resolve()}#r(){let e=J();return this.#e(),e}};var zt=()=>{u({type:"cypress_run_start",data:{}})},Bt=t=>{u({type:"cypress_suite_start",data:{id:t.id,name:t.title,root:t.root,start:Date.now()}})},Wt=t=>{u({type:"cypress_suite_end",data:{root:t.root,stop:Date.now()}})},X=(t,e)=>{u({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()}})},F=t=>{ut(),u({type:"cypress_hook_end",data:{duration:t.duration??0}})},Q=t=>{_t(t),u({type:"cypress_test_start",data:ot(t)}),at(t)},H=(t,e)=>{u({type:"cypress_step_start",data:{id:t,name:e,start:Date.now()}})},ue=(t,e,r)=>{u({type:"cypress_step_stop",data:Zt(t,e,r)})},Kt=()=>{u({type:"cypress_test_pass",data:{}})},tt=t=>{let e=v(t),r=h(t);O(e,r),u({type:"cypress_fail",data:{status:e,statusDetails:r}})},et=(t,e)=>{let r=t.hookName.includes("each"),s=t.parent,o=se(t.title,r,e,s);F(t),Mr(),kr(s,o)},Vt=t=>{b(t)?O(c.SKIPPED,{message:"The test was skipped before the command was completed"}):Q(t),u({type:"cypress_test_skip",data:nt()})},rt=t=>{ut(),u({type:"cypress_test_end",data:{duration:t.duration??0,retries:t._retries??0}}),Mt()},ce=(t,e)=>{u({type:"attachment_path",data:{path:t,name:e,contentType:N.PNG}})},E=t=>{if(re(t)){let e=t.test;return C(e)||F(e),le()}},mt=(t,e)=>{try{return tt(e),et(t.test,e),le()}catch(r){Ir(t,r)}},dt=(t,e)=>{if(!mt(t,e)?.then(()=>{throw e}))throw e},st=()=>lt().flushAllureMessagesToTask("reportAllureCypressSpecMessages"),le=()=>lt().flushAllureMessagesToTaskAsync("reportFinalAllureCypressSpecMessages"),Mr=()=>{let t=Rt();t&&rt(t)},kr=(t,e)=>{for(let r of Qt(t))b(r)||wr(r,r.pending?{...nt(),status:c.SKIPPED}:e)},wr=(t,e)=>{u({type:"cypress_skipped_test",data:{...ot(t),...e,...Jt(t),suites:te(t).map(r=>r.id)}}),at(t)},Ir=(t,e)=>{try{console.error(`Unexpected error when reporting the failure of ${t.test?.title??"'after all'"}`),console.error(e)}catch{}};var de=()=>{let t=Fr();Lr(t),Or(t)},Fr=()=>{let t=0;return{getSuiteDepth:()=>t,incrementSuiteDepth:()=>{t++},decrementSuiteDepth:()=>{t--}}},Lr=({incrementSuiteDepth:t,decrementSuiteDepth:e})=>{let r=a=>(n,p,i)=>{t();try{return Hr(a,n,p,i)}finally{e()}},s=globalThis.describe,o=r(s);o.only=r(s.only),o.skip=r(s.skip),globalThis.describe=o},Or=({getSuiteDepth:t})=>{let e=globalThis.after,r=(s,o)=>typeof s=="string"?e(s,me(t,o)):e(me(t,s));globalThis.after=r},Hr=(t,...e)=>{let[r,s,o]=e;return typeof o>"u"&&typeof s>"u"?t(r):typeof s=="function"?t(r,s):t(r,s,o)},me=(t,e)=>{if(t()===0&&e){let r=e.length?jr(e):Nr(e);return Object.defineProperty(r,"name",{value:e.name}),r}return e},jr=t=>function(e){let r=s=>{if(s){mt(this,s)?.then(()=>e(s))||e(s);return}try{if(E(this)?.then(()=>e()))return}catch(o){e(o);return}e()};return t.bind(this)(r)},Nr=t=>function(){let e,r;try{e=t.bind(this)()}catch(s){r=s}if(r)dt(this,r);else return A(e)?e.then(()=>E(this),s=>dt(this,s)):(E(this),e)};var fe=t=>Gr(t)?ge(t):z(t,Ur()),Ur=()=>{let{stepsFromCommands:{maxArgumentDepth:t,maxArgumentLength:e}}=kt();return{maxDepth:t,maxLength:e,nonNullReplacerWithDomSupport:zr}},Gr=t=>typeof t=="object"&&t!==null&&Cypress.dom.isDom(t),ge=t=>Cypress.dom.stringify(t,"long"),zr=(t,e)=>{if(typeof e=="object"){if(e===null)return;if(Cypress.dom.isDom(e))return ge(e)}return e};var ye=t=>{let{event:e,instrument:r}=t.attributes;return!(r!=="command"||e||Kr(t))},he=(t,e)=>{let r=wt();if(r&&P(r)){let{name:s,props:{name:o}}=r.log.attributes.consoleProps();s==="screenshot"&&o===t&&(r.attachmentName=e)}},Se=t=>{let e=Xr();typeof e<"u"&&Qr(e.log,t)&&j(e.log.attributes.id),Br(t),H(t.attributes.id,Vr(t)),Wr(t)},j=t=>L(({id:e})=>e===t),Br=t=>{let r={id:t.attributes.id,type:"log",log:t};k(r),w(r,s=>{s.parameters=$r(t),r.attachmentName&&(s.name=r.attachmentName)})},Wr=t=>{let{groupStart:e,end:r,id:s}=t.attributes;if(r)j(s);else if(e){let o=t.endGroup;t.endGroup=function(){return j(s),o.call(this)}}else{let o=t.end;t.end=function(){return j(s),o.call(this)}}},Kr=({attributes:{name:t,consoleProps:e}})=>t==="then"&&Object.is(e().props["Applied To"],D),Vr=t=>{let{name:e,message:r,displayName:s}=t.attributes,o=(s??e).trim(),a=(ve(t)??qr(t)??t.attributes.renderProps().message??r).trim();return[o,a].filter(Boolean).join(" ")},$r=t=>Jr(t).map(([e,r])=>({name:e.toString(),value:fe(r)})).filter(ts(t)),Yr=["Given","When","Then","And"],qr=t=>{let{attributes:{name:e,message:r}}=t;if(Yr.includes(e.trim())&&r.startsWith("**")&&r.endsWith("**"))return r.substring(2,r.length-2)},Jr=t=>{let{attributes:{consoleProps:e}}=t,r=!!ve(t);return Object.entries(e().props).filter(([s,o])=>Ct(o)&&!(r&&s==="Message"))},ve=t=>{if(Zr(t)){let e=t.attributes.consoleProps().props.Message;if(e&&typeof e=="string")return e}},Zr=({attributes:{name:t}})=>t==="assert",Xr=()=>x().findLast(P),Qr=(t,e)=>{let{groupStart:r,type:s}=t.attributes,{type:o}=e.attributes;return!r&&(s==="child"||o!=="child")},ts=t=>t.attributes.name==="wrap"?()=>!0:({name:e,value:r})=>e!=="Yielded"||r!=="{}";var xe=()=>Cypress.on("fail",Te).on("log:added",rs),ft=()=>Cypress.Screenshot.defaults({onAfterScreenshot:es}),es=(...[,{name:t,path:e}])=>{let r=t??Yt(e);ce(e,r),he(t,r)},rs=(t,e)=>{ye(e)&&Se(e)},Te=t=>{if(ae(t),ss())throw t},ss=()=>Object.is(Cypress.listeners("fail").at(-1),Te);var Ce=()=>{jt(),xe(),Nt(),de()};var Ee=()=>{Et()||(At(),Ce(),ft())};Ee();export{N as ContentType,l as LabelName,R as LinkType,Pe as Severity,De as Stage,c as Status,be as StatusByPriority,Xe as allureId,Ke as attachment,Ve as attachmentPath,Ue as description,Ge as descriptionHtml,ze as displayName,Qe as epic,tr as feature,Be as historyId,Je as issue,g as label,He as labels,ir as layer,Y as link,je as links,Ye as logStep,nr as owner,Ne as parameter,sr as parentSuite,ar as severity,qe as step,er as story,or as subSuite,rr as suite,pr as tag,ur as tags,We as testCaseId,Ze as tms};
1
+ var c=function(t){return t.FAILED="failed",t.BROKEN="broken",t.PASSED="passed",t.SKIPPED="skipped",t}({}),be=[c.FAILED,c.BROKEN,c.PASSED,c.SKIPPED],De=function(t){return t.SCHEDULED="scheduled",t.RUNNING="running",t.FINISHED="finished",t.PENDING="pending",t.INTERRUPTED="interrupted",t}({}),l=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}({}),Pe=function(t){return t.BLOCKER="blocker",t.CRITICAL="critical",t.NORMAL="normal",t.MINOR="minor",t.TRIVIAL="trivial",t}({}),N=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}({}),R=function(t){return t.DEFAULT="link",t.ISSUE="issue",t.TMS="tms",t}({});function _(){_=function(a,o){return new r(a,void 0,o)};var t=RegExp.prototype,e=new WeakMap;function r(n,a,o){var p=RegExp(n,a);return e.set(p,o||e.get(n)),M(p,r.prototype)}function s(n,a){var o=e.get(a);return Object.keys(o).reduce(function(p,i){var y=o[i];if(typeof y=="number")p[i]=n[y];else{for(var S=0;n[y[S]]===void 0&&S+1<y.length;)S++;p[i]=n[y[S]]}return p},Object.create(null))}return Re(r,RegExp),r.prototype.exec=function(n){var a=t.exec.call(this,n);if(a){a.groups=s(a,this);var o=a.indices;o&&(o.groups=s(o,this))}return a},r.prototype[Symbol.replace]=function(n,a){if(typeof a=="string"){var o=e.get(this);return t[Symbol.replace].call(this,n,a.replace(/\$<([^>]+)>/g,function(i,y){var S=o[y];return"$"+(Array.isArray(S)?S.join("$"):S)}))}if(typeof a=="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)),a.apply(this,i)})}return t[Symbol.replace].call(this,n,a)},_.apply(this,arguments)}function Re(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&&M(t,e)}function M(t,e){return M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},M(t,e)}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 c.FAILED;default:return c.BROKEN}},_e=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")},U=t=>{var e=_e();return t.replace(e,"")},h=t=>{var{message:e,stack:r}=t;return{message:e?U(e):void 0,trace:r?U(r):void 0}},gt=_(/(?:^|\s)@?allure\.id[:=]([^\s]+)/,{id:1}),Me=new RegExp(gt,"g"),yt=_(/(?:^|\s)@?allure\.label\.([^:=\s]+)[:=]([^\s]+)/,{name:1,value:2}),ke=new RegExp(yt,"g");var G=t=>{var e=[];t.split(" ").forEach(s=>{var n,a=(n=s.match(gt))===null||n===void 0||(n=n.groups)===null||n===void 0?void 0:n.id;a&&e.push({name:l.ALLURE_ID,value:a});var o=s.match(yt),{name:p,value:i}=o?.groups||{};p&&i&&e?.push({name:p,value:i})});var r=t.replace(ke,"").replace(Me,"").trim();return{labels:e,cleanTitle:r}};var A=t=>!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function",z=function(e){var{maxDepth:r=0,maxLength:s=0,replacer:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Oe(typeof e=="object"?JSON.stringify(e,we(r,n)):String(e),s)},we=(t,e)=>{var r=[],s=function(a,o){if(typeof o!="object"||o===null)return o;for(;r.length>0&&!Object.is(r.at(-1),this);)r.pop();if(!(t&&r.length>=t||r.includes(o)))return r.push(o),o instanceof Map?Fe(r,o):o instanceof Set?Le(r,o):o};return e?Ie(e,s):s},Ie=(t,e)=>function(r,s){return e.call(this,r,t.call(this,r,s))},Fe=(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]}),Le=(t,e)=>Array.from(e).map(r=>t.includes(r)?void 0:r),Oe=(t,e)=>e&&t.length>e?"".concat(t.substring(0,e),"..."):t;function ht(t,e,r,s,n,a,o){try{var p=t[a](o),i=p.value}catch(y){return void r(y)}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 a=t.apply(e,r);function o(i){ht(a,s,n,o,p,"next",i)}function p(i){ht(a,s,n,o,p,"throw",i)}o(void 0)})}}var B=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")})()}},T=new B;var St="allureTestRuntime",K=t=>{globalThis[St]=()=>t},W=()=>globalThis?.[St],V=()=>{var t=W();if(t){var e;return(e=t())!==null&&e!==void 0?e:T}return T},$=()=>{var t=W();if(t){var e;return(e=t())!==null&&e!==void 0?e:T}if("_playwrightInstance"in globalThis)try{return(0,eval)("(() => import('allure-playwright/autoconfig'))()").then(()=>{var r,s;return(r=(s=W())===null||s===void 0?void 0:s())!==null&&r!==void 0?r:T})}catch(r){return console.log("can't execute allure-playwright/autoconfig",r),T}return T};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 a=$();return A(a)?a.then(o=>o[e](...s)):a[e](...s)},g=(t,e)=>m("labels",{name:t,value:e}),He=function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return m("labels",...r)},Y=(t,e,r)=>m("links",{url:t,type:r,name:e}),je=function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return m("links",...r)},Ne=(t,e,r)=>m("parameter",t,e,r),Ue=t=>m("description",t),Ge=t=>m("descriptionHtml",t),ze=t=>m("displayName",t),Be=t=>m("historyId",t),We=t=>m("testCaseId",t),Ke=(t,e,r)=>{var s=typeof r=="string"?{contentType:r}:r;return m("attachment",t,e,s)},Ve=(t,e,r)=>{var s=typeof r=="string"?{contentType:r}:r;return m("attachmentFromPath",t,e,s)},$e=()=>({displayName:t=>m("stepDisplayName",t),parameter:(t,e,r)=>m("stepParameter",t,e,r)}),Ye=(t,e,r)=>m("logStep",t,e,r),qe=(t,e)=>m("step",t,()=>e($e())),Je=(t,e)=>Y(t,e,R.ISSUE),Ze=(t,e)=>Y(t,e,R.TMS),Xe=t=>g(l.ALLURE_ID,t),Qe=t=>g(l.EPIC,t),tr=t=>g(l.FEATURE,t),er=t=>g(l.STORY,t),rr=t=>g(l.SUITE,t),sr=t=>g(l.PARENT_SUITE,t),nr=t=>g(l.SUB_SUITE,t),or=t=>g(l.OWNER,t),ar=t=>g(l.SEVERITY,t),ir=t=>g(l.LAYER,t),pr=t=>g(l.TAG,t),ur=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:l.TAG,value:n})))};var vt={stepsFromCommands:{maxArgumentLength:128,maxArgumentDepth:3}},xt=(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},Tt=t=>t[t.length-1],Ct=t=>typeof t<"u";var d=()=>{let t=Cypress.env("allure");return t||(t={config:vt,initialized:!1,messages:[],testPlan:void 0,currentTest:void 0,projectDir:void 0,stepStack:[],stepsToFinalize:[],nextApiStepId:0},Cypress.env("allure",t)),t},Et=()=>d().initialized,At=()=>{d().initialized=!0},J=()=>d().messages,bt=t=>{d().messages=t},u=t=>{J().push(t)},Dt=()=>d().testPlan,Pt=()=>d().projectDir,Rt=()=>d().currentTest,_t=t=>{d().currentTest=t},Mt=()=>{d().currentTest=void 0},kt=()=>d().config,x=()=>d().stepStack,wt=()=>Tt(x()),k=t=>x().push(t);var lr=t=>q(x().splice(t)),It=()=>lr(0);var w=(t,e)=>d().stepsToFinalize.push([t,e]),Ft=()=>d().stepsToFinalize,Lt=()=>{let t=d();t.stepsToFinalize=[]};var Ot=(t,e)=>{let r=Dt();if(r){let s=Ht(t);for(let n of mr(e)){let a=dr(r,t,s,n.tests);fr(n.tests,a)}}},mr=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])}},dr=(t,e,r,s)=>{let n=[];return s.forEach((a,o)=>{let{fullNameSuffix:p,labels:i}=Z(e,a),y=`${r}#${p}`,S=i.find(({name:Ae})=>Ae===l.ALLURE_ID)?.value;gr(t,y,S)||n.push(o)}),n},fr=(t,e)=>{for(let r=e.length-1;r>=0;r--)t.splice(e[r],1)},gr=(t,e,r)=>t.tests.some(s=>r&&s.id?.toString()===r||s.selector===e);var I="__allure_report_system_hook__",jt=()=>{Cypress.mocha.getRunner().on("start",yr).on("suite",hr).on("suite end",Wt).on("hook",Sr).on("hook end",vr).on("test",xr).on("pass",Kt).on("fail",Tr).on("pending",Vt).on("test end",rt)},Nt=()=>{afterEach(I,st),after(I,Cr)},yr=()=>{Gt(),zt()},hr=t=>{t.root&&Ot(Cypress.spec,t),Bt(t)},Sr=t=>{C(t)||X(t)},vr=t=>{C(t)||F(t)},xr=t=>{b(t)||Q(t)},Tr=(t,e)=>{let r="hookName"in t;if(r&&Ut(t))return;r&&C(t)&&X(t,Date.now()-(t.duration??0)),tt(e),r&&et(t,e)},Cr=function(){st(),E(this)};var $t=Cypress.platform==="win32",Yt=t=>t.substring(t.lastIndexOf($t?"\\":"/")+1),Ht=t=>{let e=Pt(),r=e?t.absolute.substring(e.length+1):t.relative;return $t?r.replaceAll("\\","/"):r},qt=t=>Array.isArray(t)||t.buffer?btoa(String.fromCharCode.apply(null,t)):t,nt=t=>({...Z(Cypress.spec,t),start:t.wallClockStartedAt?.getTime()||Date.now()}),Jt=t=>({duration:t.duration??0,retries:t._retries??0}),ot=()=>({statusDetails:{message:"This is a pending test"}}),Zt=(t,e,r)=>{let s={id:t.id,stop:Date.now(),status:e??ne(t)};return r&&(s.statusDetails=r),s},Xt=Symbol("The test has been reported to Allure"),at=t=>{t[Xt]=!0},b=t=>t[Xt]===!0,Er=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])}},Qt=function*(t){for(let e of Er(t))yield*e.tests},te=t=>{let e=[];for(let r=t.parent;r;r=r.parent)e.push(r);return e.reverse(),e};var ee=()=>(d().nextApiStepId++).toString(),Z=(t,e)=>{let r=e.title,{cleanTitle:s,labels:n}=G(r),o=`${[...e.titlePath().slice(0,-1),s].join(" ")}`;return{name:s,labels:n,fullNameSuffix:o}},C=t=>t.title.includes(I),Ut=t=>t.parent.root&&t.hookName==="after all",re=t=>{let e=t.test;return t.test.parent.hooks.findLast(a=>a.hookName==="after all")?.hookId===e.hookId},se=(t,e,r,s)=>{let n=e?c.SKIPPED:v(r),{message:a,trace:o}=h(r);return{status:n,statusDetails:{message:e?Ar(t,s):a,trace:o}}},Ar=(t,e)=>{let r=e.title?`'${e.title}'`:"root";return`'${t}' defined in the ${r} suite has failed`};var D={},oe=t=>t.type==="api",P=t=>t.type==="log",it=t=>H(br(),t),br=()=>{let t=ee();return k({id:t,type:"api"}),t},ae=t=>{let e=v(t),r=h(t);Pr(e,r),pe(t)},pt=(t,e)=>L(r=>oe(r),t,e),L=(t,e,r)=>ie(xt(x(),t),e,r),O=(t,e)=>ie(It(),t,e),ut=()=>{O(),Ft().forEach(Dr),Lt()},ne=t=>t.error?v(t.error):c.PASSED,Dr=([t,e])=>{let{id:r,error:s}=t,n={id:r};s&&(n.statusDetails=h(s)),e?.(n),u({type:"cypress_step_finalize",data:n})},Pr=(t,e)=>{let r=x(),s=r.at(r.findLastIndex(P)+1);s&&L(n=>Object.is(n,s),t,e)},Rr=(t,e)=>{if(P(t)){let r=t.log.attributes.error;if(r)return t.error=r}return e&&(t.error=e),t.error},ie=(t,e,r)=>{let s;for(let n of t)s=Rr(n,s),_r(n,e,r);s&&pe(s)},pe=t=>x().forEach(e=>e.error=t),_r=(t,e,r)=>{ue(t,e,r),oe(t)&&t.error&&w(t)};var Gt=()=>K(new ct),lt=()=>V(),ct=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,a=typeof n=="string"?"utf8":"base64",o=qt(n);return this.#t({type:"attachment_content",data:{name:e,content:o,encoding:a,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=c.PASSED,s){return cy.wrap(D,{log:!1}).then(()=>(it(e),Cypress.Promise.resolve())).then(()=>(pt(r,s?h(s):void 0),Cypress.Promise.resolve()))}step(e,r){return cy.wrap(D,{log:!1}).then(()=>(it(e),Cypress.Promise.resolve(r()))).then(s=>(pt(),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(){bt([])}#t(e){return u(e),Cypress.Promise.resolve()}#r(){let e=J();return this.#e(),e}};var zt=()=>{u({type:"cypress_run_start",data:{}})},Bt=t=>{u({type:"cypress_suite_start",data:{id:t.id,name:t.title,root:t.root,start:Date.now()}})},Wt=t=>{u({type:"cypress_suite_end",data:{root:t.root,stop:Date.now()}})},X=(t,e)=>{u({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()}})},F=t=>{ut(),u({type:"cypress_hook_end",data:{duration:t.duration??0}})},Q=t=>{_t(t),u({type:"cypress_test_start",data:nt(t)}),at(t)},H=(t,e)=>{u({type:"cypress_step_start",data:{id:t,name:e,start:Date.now()}})},ue=(t,e,r)=>{u({type:"cypress_step_stop",data:Zt(t,e,r)})},Kt=()=>{u({type:"cypress_test_pass",data:{}})},tt=t=>{let e=v(t),r=h(t);O(e,r),u({type:"cypress_fail",data:{status:e,statusDetails:r}})},et=(t,e)=>{let r=t.hookName.includes("each"),s=t.parent,n=se(t.title,r,e,s);F(t),Mr(),kr(s,n)},Vt=t=>{b(t)?O(c.SKIPPED,{message:"The test was skipped before the command was completed"}):Q(t),u({type:"cypress_test_skip",data:ot()})},rt=t=>{ut(),u({type:"cypress_test_end",data:{duration:t.duration??0,retries:t._retries??0}}),Mt()},ce=(t,e)=>{u({type:"attachment_path",data:{path:t,name:e,contentType:N.PNG}})},E=t=>{if(re(t)){let e=t.test;return C(e)||F(e),le()}},mt=(t,e)=>{try{return tt(e),et(t.test,e),le()}catch(r){Ir(t,r)}},dt=(t,e)=>{if(!mt(t,e)?.then(()=>{throw e}))throw e},st=()=>lt().flushAllureMessagesToTask("reportAllureCypressSpecMessages"),le=()=>lt().flushAllureMessagesToTaskAsync("reportFinalAllureCypressSpecMessages"),Mr=()=>{let t=Rt();t&&rt(t)},kr=(t,e)=>{for(let r of Qt(t))b(r)||wr(r,r.pending?{...ot(),status:c.SKIPPED}:e)},wr=(t,e)=>{u({type:"cypress_skipped_test",data:{...nt(t),...e,...Jt(t),suites:te(t).map(r=>r.id)}}),at(t)},Ir=(t,e)=>{try{console.error(`Unexpected error when reporting the failure of ${t.test?.title??"'after all'"}`),console.error(e)}catch{}};var de=()=>{let t=Fr();Lr(t),Or(t)},Fr=()=>{let t=0;return{getSuiteDepth:()=>t,incrementSuiteDepth:()=>{t++},decrementSuiteDepth:()=>{t--}}},Lr=({incrementSuiteDepth:t,decrementSuiteDepth:e})=>{let r=a=>(o,p,i)=>{t();try{return Hr(a,o,p,i)}finally{e()}},s=globalThis.describe,n=r(s);n.only=r(s.only),n.skip=r(s.skip),globalThis.describe=n},Or=({getSuiteDepth:t})=>{let e=globalThis.after,r=(s,n)=>typeof s=="string"?e(s,me(t,n)):e(me(t,s));globalThis.after=r},Hr=(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)},me=(t,e)=>{if(t()===0&&e){let r=e.length?jr(e):Nr(e);return Object.defineProperty(r,"name",{value:e.name}),r}return e},jr=t=>function(e){let r=s=>{if(s){mt(this,s)?.then(()=>e(s))||e(s);return}try{if(E(this)?.then(()=>e()))return}catch(n){e(n);return}e()};return t.bind(this)(r)},Nr=t=>function(){let e,r;try{e=t.bind(this)()}catch(s){r=s}if(r)dt(this,r);else return A(e)?e.then(()=>E(this),s=>dt(this,s)):(E(this),e)};var fe=t=>Gr(t)?ge(t):z(t,Ur()),Ur=()=>{let{stepsFromCommands:{maxArgumentDepth:t,maxArgumentLength:e}}=kt();return{maxDepth:t,maxLength:e,nonNullReplacerWithDomSupport:zr}},Gr=t=>typeof t=="object"&&t!==null&&Cypress.dom.isDom(t),ge=t=>Cypress.dom.stringify(t,"long"),zr=(t,e)=>{if(typeof e=="object"){if(e===null)return;if(Cypress.dom.isDom(e))return ge(e)}return e};var ye=t=>{let{event:e,instrument:r}=t.attributes;return!(r!=="command"||e||Kr(t))},he=(t,e)=>{let r=wt();if(r&&P(r)){let{name:s,props:{name:n}}=r.log.attributes.consoleProps();s==="screenshot"&&n===t&&(r.attachmentName=e)}},Se=t=>{let e=Xr();typeof e<"u"&&Qr(e.log,t)&&j(e.log.attributes.id),Br(t),H(t.attributes.id,Vr(t)),Wr(t)},j=t=>L(({id:e})=>e===t),Br=t=>{let r={id:t.attributes.id,type:"log",log:t};k(r),w(r,s=>{s.parameters=$r(t),r.attachmentName&&(s.name=r.attachmentName)})},Wr=t=>{let{groupStart:e,end:r,id:s}=t.attributes;if(r)j(s);else if(e){let n=t.endGroup;t.endGroup=function(){return j(s),n.call(this)}}else{let n=t.end;t.end=function(){return j(s),n.call(this)}}},Kr=({attributes:{name:t,consoleProps:e}})=>t==="then"&&Object.is(e().props["Applied To"],D),Vr=t=>{let{name:e,message:r,displayName:s}=t.attributes,n=(s??e).trim(),a=(ve(t)??qr(t)??t.attributes.renderProps().message??r).trim();return[n,a].filter(Boolean).join(" ")},$r=t=>Jr(t).map(([e,r])=>({name:e.toString(),value:fe(r)})).filter(ts(t)),Yr=["Given","When","Then","And"],qr=t=>{let{attributes:{name:e,message:r}}=t;if(Yr.includes(e.trim())&&r.startsWith("**")&&r.endsWith("**"))return r.substring(2,r.length-2)},Jr=t=>{let{attributes:{consoleProps:e}}=t,r=!!ve(t);return Object.entries(e().props).filter(([s,n])=>Ct(n)&&!(r&&s==="Message"))},ve=t=>{if(Zr(t)){let e=t.attributes.consoleProps().props.Message;if(e&&typeof e=="string")return e}},Zr=({attributes:{name:t}})=>t==="assert",Xr=()=>x().findLast(P),Qr=(t,e)=>{let{groupStart:r,type:s}=t.attributes,{type:n}=e.attributes;return!r&&(s==="child"||n!=="child")},ts=t=>t.attributes.name==="wrap"?()=>!0:({name:e,value:r})=>e!=="Yielded"||r!=="{}";var xe=()=>Cypress.on("fail",Te).on("log:added",rs),ft=()=>Cypress.Screenshot.defaults({onAfterScreenshot:es}),es=(...[,{name:t,path:e}])=>{let r=t??Yt(e);ce(e,r),he(t,r)},rs=(t,e)=>{ye(e)&&Se(e)},Te=t=>{if(ae(t),ss())throw t},ss=()=>Object.is(Cypress.listeners("fail").at(-1),Te);var Ce=()=>{jt(),xe(),Nt(),de()};var Ee=()=>{Et()||(At(),Ce(),ft())};Ee();export{N as ContentType,l as LabelName,R as LinkType,Pe as Severity,De as Stage,c as Status,be as StatusByPriority,Xe as allureId,Ke as attachment,Ve as attachmentPath,Ue as description,Ge as descriptionHtml,ze as displayName,Qe as epic,tr as feature,Be as historyId,Je as issue,g as label,He as labels,ir as layer,Y as link,je as links,Ye as logStep,or as owner,Ne as parameter,sr as parentSuite,ar as severity,qe as step,er as story,nr as subSuite,rr as suite,pr as tag,ur as tags,We as testCaseId,Ze as tms};
2
2
  //# sourceMappingURL=index.js.map