monocart-reporter 2.3.1 → 2.3.3
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/README.md
CHANGED
|
@@ -569,7 +569,8 @@ module.exports = {
|
|
|
569
569
|
```
|
|
570
570
|
|
|
571
571
|
## Metadata
|
|
572
|
-
|
|
572
|
+
> All metadata will be listed in the report in a key/value format.
|
|
573
|
+
- Global level `metadata`
|
|
573
574
|
```js
|
|
574
575
|
// playwright.config.js
|
|
575
576
|
module.exports = {
|
|
@@ -591,19 +592,59 @@ module.exports = {
|
|
|
591
592
|
]
|
|
592
593
|
};
|
|
593
594
|
```
|
|
594
|
-
|
|
595
|
+
|
|
596
|
+
- Project level `metadata`
|
|
597
|
+
```js
|
|
598
|
+
// playwright.config.js
|
|
599
|
+
module.exports = {
|
|
600
|
+
projects: [
|
|
601
|
+
{
|
|
602
|
+
name: 'Desktop Chromium',
|
|
603
|
+
use: {
|
|
604
|
+
browserName: 'chromium'
|
|
605
|
+
},
|
|
606
|
+
metadata: {
|
|
607
|
+
projectData: 'project level metadata',
|
|
608
|
+
owner: 'PO',
|
|
609
|
+
link: 'https://github.com/cenfun/monocart-reporter'
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
]
|
|
613
|
+
}
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
- Collect metadata in [global setup or teardown](https://playwright.dev/docs/test-global-setup-teardown)
|
|
595
617
|
```js
|
|
596
618
|
// ./common/global-setup.js
|
|
597
619
|
import { chromium } from '@playwright/test';
|
|
598
620
|
export default async (config) => {
|
|
599
621
|
const metadata = config.metadata;
|
|
600
|
-
// collect data and save to metadata
|
|
622
|
+
// collect data and save to global metadata
|
|
601
623
|
const browser = await chromium.launch();
|
|
602
624
|
const chromiumVersion = await browser.version();
|
|
603
625
|
metadata.chromiumVersion = chromiumVersion;
|
|
604
626
|
};
|
|
605
627
|
```
|
|
606
628
|
|
|
629
|
+
- Collect metadata in a test
|
|
630
|
+
> Playwright Test runs tests in [parallel](https://playwright.dev/docs/test-parallel) with isolate test data by default, so we need to utilize [global state management](#global-state-management) to collect metadata in a test.
|
|
631
|
+
|
|
632
|
+
- Enable global state, see [Setup Global State](#setup-global-state)
|
|
633
|
+
- Update global state in a test
|
|
634
|
+
```js
|
|
635
|
+
const { test } = require('@playwright/test');
|
|
636
|
+
const { useState } = require('monocart-reporter');
|
|
637
|
+
|
|
638
|
+
const state = useState({
|
|
639
|
+
// port: 8130
|
|
640
|
+
});
|
|
641
|
+
|
|
642
|
+
test('test metadata url', async ({ page }) => {
|
|
643
|
+
const url = await page.evaluate(() => window.location.href);
|
|
644
|
+
await state.set('url', url);
|
|
645
|
+
});
|
|
646
|
+
```
|
|
647
|
+
|
|
607
648
|
## Trend Chart
|
|
608
649
|
> Note: The trend chart requires historical data generally stored in the server database. There is a serverless solution which is connecting and collecting historical trend data from previous report data before test every time.
|
|
609
650
|
- If a report is generated in the same place every time, you can simply connect the data with the report JSON path (the data is not 100% safe if there is any runtime error, the previous output dir will be empty by Playwright but the reporter processing not finish)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("turbogrid")):"function"==typeof define&&define.amd?define("monocart-common",["turbogrid"],t):"object"==typeof exports?exports["monocart-common"]=t(require("turbogrid")):e["monocart-common"]=t(e.turbogrid)}(self,(e=>(()=>{var t={162:function(e,t,r){var n,o,a;o=[],void 0===(a="function"==typeof(n=function(){"use strict";function t(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}function n(e,t,r){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){c(n.response,t,r)},n.onerror=function(){console.error("could not download file")},n.send()}function o(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function a(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(r){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof r.g&&r.g.global===r.g?r.g:void 0,s=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),c=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(e,t,r){var s=i.URL||i.webkitURL,c=document.createElement("a");t=t||e.name||"download",c.download=t,c.rel="noopener","string"==typeof e?(c.href=e,c.origin===location.origin?a(c):o(c.href)?n(e,t,r):a(c,c.target="_blank")):(c.href=s.createObjectURL(e),setTimeout((function(){s.revokeObjectURL(c.href)}),4e4),setTimeout((function(){a(c)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,r,i){if(r=r||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(t(e,i),r);else if(o(e))n(e,r,i);else{var s=document.createElement("a");s.href=e,s.target="_blank",setTimeout((function(){a(s)}))}}:function(e,t,r,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof e)return n(e,t,r);var a="application/octet-stream"===e.type,c=/constructor/i.test(i.HTMLElement)||i.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||a&&c||s)&&"undefined"!=typeof FileReader){var l=new FileReader;l.onloadend=function(){var e=l.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=e:location=e,o=null},l.readAsDataURL(e)}else{var f=i.URL||i.webkitURL,d=f.createObjectURL(e);o?o.location=d:location.href=d,o=null,setTimeout((function(){f.revokeObjectURL(d)}),4e4)}});i.saveAs=c.saveAs=c,e.exports=c})?n.apply(t,o):n)||(e.exports=a)},925:e=>{var t,r,n=(t=(e,t)=>{t.exports={data:'(()=>{var x=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports);var S=x((V,R)=>{var _=0,p=-3;function b(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function N(e,n){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=n,this.destLen=0,this.ltree=new b,this.dtree=new b}var y=new b,k=new b,w=new Uint8Array(30),h=new Uint16Array(30),L=new Uint8Array(30),T=new Uint16Array(30),O=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),A=new b,c=new Uint8Array(320);function D(e,n,r,a){var t,i;for(t=0;t<r;++t)e[t]=0;for(t=0;t<30-r;++t)e[t+r]=t/r|0;for(i=a,t=0;t<30;++t)n[t]=i,i+=1<<e[t]}function z(e,n){var r;for(r=0;r<7;++r)e.table[r]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,r=0;r<24;++r)e.trans[r]=256+r;for(r=0;r<144;++r)e.trans[24+r]=r;for(r=0;r<8;++r)e.trans[168+r]=280+r;for(r=0;r<112;++r)e.trans[176+r]=144+r;for(r=0;r<5;++r)n.table[r]=0;for(n.table[5]=32,r=0;r<32;++r)n.trans[r]=r}var I=new Uint16Array(16);function l(e,n,r,a){var t,i;for(t=0;t<16;++t)e.table[t]=0;for(t=0;t<a;++t)e.table[n[r+t]]++;for(e.table[0]=0,i=0,t=0;t<16;++t)I[t]=i,i+=e.table[t];for(t=0;t<a;++t)n[r+t]&&(e.trans[I[n[r+t]]++]=t)}function B(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var n=e.tag&1;return e.tag>>>=1,n}function u(e,n,r){if(!n)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var a=e.tag&65535>>>16-n;return e.tag>>>=n,e.bitcount-=n,a+r}function v(e,n){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var r=0,a=0,t=0,i=e.tag;do a=2*a+(i&1),i>>>=1,++t,r+=n.table[t],a-=n.table[t];while(a>=0);return e.tag=i,e.bitcount-=t,n.trans[r+a]}function C(e,n,r){var a,t,i,o,s,f;for(a=u(e,5,257),t=u(e,5,1),i=u(e,4,4),o=0;o<19;++o)c[o]=0;for(o=0;o<i;++o){var F=u(e,3,0);c[O[o]]=F}for(l(A,c,0,19),s=0;s<a+t;){var g=v(e,A);switch(g){case 16:var M=c[s-1];for(f=u(e,2,3);f;--f)c[s++]=M;break;case 17:for(f=u(e,3,3);f;--f)c[s++]=0;break;case 18:for(f=u(e,7,11);f;--f)c[s++]=0;break;default:c[s++]=g;break}}l(n,c,0,a),l(r,c,a,t)}function U(e,n,r){for(;;){var a=v(e,n);if(a===256)return _;if(a<256)e.dest[e.destLen++]=a;else{var t,i,o,s;for(a-=257,t=u(e,w[a],h[a]),i=v(e,r),o=e.destLen-u(e,L[i],T[i]),s=o;s<o+t;++s)e.dest[e.destLen++]=e.dest[s]}}}function K(e){for(var n,r,a;e.bitcount>8;)e.sourceIndex--,e.bitcount-=8;if(n=e.source[e.sourceIndex+1],n=256*n+e.source[e.sourceIndex],r=e.source[e.sourceIndex+3],r=256*r+e.source[e.sourceIndex+2],n!==(~r&65535))return p;for(e.sourceIndex+=4,a=n;a;--a)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,_}function j(e,n){var r=new N(e,n),a,t,i;do{switch(a=B(r),t=u(r,2,0),t){case 0:i=K(r);break;case 1:i=U(r,y,k);break;case 2:C(r,r.ltree,r.dtree),i=U(r,r.ltree,r.dtree);break;default:i=p}if(i!==_)throw new Error("Data error")}while(!a);return r.destLen<r.dest.length?typeof r.dest.slice=="function"?r.dest.slice(0,r.destLen):r.dest.subarray(0,r.destLen):r.dest}z(y,k);D(w,h,4,3);D(L,T,2,1);w[28]=0;h[28]=258;R.exports=j});var E=x((W,q)=>{var G=S(),H=e=>Uint8Array.from(atob(e),n=>n.charCodeAt(0)),J=e=>new TextDecoder().decode(e);q.exports=function(e){if(e){let[n,r]=e.split(".");if(n&&r){let a=H(n),t=new Uint8Array(parseInt(r));return G(a,t),J(t)}}}});var P=E();onmessage=function(e){postMessage(P(e.data))};postMessage("workerReady");})();\n'}},()=>(r||t((r={exports:{}}).exports,r),r.exports))();e.exports=e=>new Promise((t=>{let r=new Worker(URL.createObjectURL(new Blob([n.data],{type:"application/javascript"})));r.onmessage=n=>{"workerReady"!==n.data?(t(n.data),r.terminate()):r.postMessage(e)},r.onerror=e=>{t({error:e}),r.terminate()}}))},209:e=>{const t={tagPattern:/(\s*)@([^@\s]+)(\s*)/g,attachments:{audit:{name:"audit",contentType:"text/html",reportFile:"audit-report.json"},coverage:{name:"coverage",contentType:"text/html",reportFile:"coverage-report.json"},network:{name:"network",contentType:"text/html",reportFile:"network-report.json"}},pageTimings:[{key:"onContentLoad",name:"Content Loaded",color:"#1a1aa6"},{key:"onLoad",name:"Page Loaded",color:"#c80000"}],timings:[{key:"blocked",name:"Blocking",color:"#858585"},{key:"dns",name:"DNS Lookup",color:"#009688"},{key:"connect",name:"Connecting",color:"#b52dcd"},{key:"send",name:"Sending",color:"#74979a"},{key:"wait",name:"Waiting",color:"#00a846"},{key:"receive",name:"Receiving",color:"#0299de"}],hasOwn:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},isNull:function(e){return null==e},uid:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;const t="0123456789abcdefghijklmnopqrstuvwxyz";let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";for(;e--;)r+=t[36*Math.random()|0];return r},zero:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return(e=`${e}`).padStart(t,"0")},toNum:function(e,t){return"number"!=typeof e&&(e=parseFloat(e)),isNaN(e)&&(e=0),t&&(e=Math.round(e)),e},isList:function(e){return!!(e&&e instanceof Array&&e.length>0)},forEach:function(e,r){const n=e=>"break"===e||!1===e,o=(e,a)=>{if(t.isList(e))for(const t of e){const e=r(t,a);if(n(e))return e;const i=o(t.subs,t);if(n(i))return i}};o(e)},formatPath:function(e){return e&&(e=e.replace(/\\/g,"/")),e},getCurrentTrendInfo:e=>{const{date:t,duration:r,summary:n}=e,o={date:t,duration:r};return Object.keys(n).forEach((e=>{const t=n[e];o[e]=t.value})),o},isTagItem:e=>"case"===e.type||"suite"===e.type&&"describe"===e.suiteType,delay:function(e){return new Promise((t=>{e?setTimeout(t,e):setImmediate(t)}))},generatePercentChart:function(e){return`<div style="--mcr-percent:${e}%;" class="mcr-percent-chart"></div>`},getStatus:(e,t)=>t?e<t[0]?"low":e<t[1]?"medium":"high":"unknown",isJsonType:e=>!(!e||"application/json"!==e&&"json"!==e),isMarkdownType:e=>!(!e||"text/markdown"!==e&&"markdown"!==e),isTextType(e){if(e){if(e.startsWith("text"))return!0;if(t.isMarkdownType(e))return!0;if(t.isJsonType(e))return!0}return!1},dFixed:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isInteger(e)?e:t.toNum(t.toNum(e).toFixed(r))},pxFixed:e=>{const t=Math.floor(e);return e<t+.5?t+.5:t+1.5},point:(e,r)=>`${t.dFixed(e)},${t.dFixed(r)}`,NF:function(e){return"number"==typeof e&&e?e.toLocaleString():e},PF:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"%",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";e=t.toNum(e),r=t.toNum(r);let i=0;r&&(i=e/r);const s=(100*i).toFixed(n);return o?s+a+o:parseFloat(s)},PSF:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return t.PF(e,r,n,"%"," ")},PNF:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return t.PF(e,r,n,"")},BF:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(0===(e=t.toNum(e,!0)))return`0${n}B`;let o="";e<0&&(e=Math.abs(e),o="-");const a=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];for(let t=0,i=a.length;t<i;t++){const i=Math.pow(1024,t),s=Math.pow(1024,t+1);if(e>i&&e<s){const s=a[t];e=o+(e/i).toFixed(r)+n+s;break}}return e},BSF:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t.BF(e,r," ")},TF:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t.toNum(e,!0);if(n<1e3)return`${n}${r}ms`;if(n<6e4){const e=Math.floor(n/1e3),t=Math.round((n-1e3*e)/100);return t?`${e}.${t}${r}s`:`${e}${r}s`}const o=Math.round(n/1e3),a=60,i=3600,s=24*i;if(o<i){const e=Math.floor(o/a);return`${e}${r}m ${o-e*a}${r}s`}if(o<s){const e=Math.floor(o/i),t=Math.floor((o-e*i)/a);return`${e}${r}h ${t}${r}m ${o-e*i-t*a}${r}s`}const c=Math.floor(o/s),u=Math.floor((o-c*s)/i),l=Math.floor((o-c*s-u*i)/a);return`${c}${r}d ${u}${r}h ${l}${r}m ${o-c*s-u*i-l*a}${r}s`},TSF:function(e){return t.TF(e," ")}};e.exports=t},46:t=>{"use strict";t.exports=e}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var a=r[e]={exports:{}};return t[e].call(a.exports,a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";n.r(o),n.d(o,{CommonUtil:()=>k,debounce:()=>t,decodeIcons:()=>M,hash:()=>g,inflate:()=>i(),microtask:()=>r,niceTicks:()=>p,saveAs:()=>h.saveAs,setFavicon:()=>A,store:()=>b});class e{start(e){this.callback=e,this.started||(this.started=!0,this.create())}create(){if("function"!=typeof window.queueMicrotask){if("function"!=typeof Promise)throw new Error("Current browser does NOT support queueMicrotask or Promise");Promise.resolve().then((()=>{this.execute()}))}else window.queueMicrotask((()=>{this.execute()}))}execute(){if(!this.started)return;this.started=!1;const e=this.callback;this.callback=null,"function"==typeof e&&e.call(this)}cancel(){this.started=!1,this.callback=null}}const t=function(e,t=100){let r;const n=function(){clearTimeout(r),r=setTimeout((()=>{e.apply(this,arguments)}),t)};return n.cancel=()=>{clearTimeout(r)},n},r=function(t){const r=new e,n=function(){r.start((()=>{t.apply(this,arguments)}))};return n.cancel=()=>{r.cancel()},n};var a=n(925),i=n.n(a);function s(e){return""+e}function c(e){var t=s(e).split(".");return t.length>1?t[1].length:0}function u(e){var t=s(e);return parseInt(t.replace(".",""))}function l(e,t){var r=c(e),n=c(t);if(r+n===0)return e+t;var o=Math.pow(10,Math.max(r,n));return(Math.round(e*o)+Math.round(t*o))/o}function f(e,t){var r=c(e),n=c(t);return r+n===0?e*t:u(e)*u(t)/Math.pow(10,r+n)}function d(e,t){var r=Math.floor(Math.log(e)/Math.log(10)),n=e/Math.pow(10,r);return(t?n<1.5?1:n<3?2:n<7?5:10:n<=1?1:n<=2?2:n<=5?5:10)*Math.pow(10,r)}var w=function(e){return"number"!=typeof e&&(e=parseFloat(e)),isNaN(e)&&(e=0),e};function p(e,t,r){if(e=w(e),t=w(t),(r=w(r))||(r=4),e===t)t=e+1;else if(e>t){var n=e;e=t,t=n}for(var o=d(t-e,!1),a=d(o/(r-1),!0),i=f(Math.floor(e/a),a),s=f(Math.ceil(t/a),a),c=[],u=i;u<=s;)c.push(u),u=l(u,a);return c}var h=n(162);const m={get:function(e){let t={};const r=location.hash.slice(1);if(r){const e=new URLSearchParams(r);t=Object.fromEntries(e)}return e?t[e]:t},set:function(e,t){if(!e)return;let r=e;2===arguments.length&&(r={},r[e]=t);const n=m.get();Object.keys(r).forEach((e=>{n[e]=r[e]}));const o=new URLSearchParams(n);location.hash=o.toString()},remove:function(e){if(!e)return void(location.hash="");let t=e;Array.isArray(e)||(t=[e]);const r=m.get();t.forEach((e=>{delete r[e]}));const n=new URLSearchParams(r);location.hash=n.toString()}},g=m,v=e=>`mcr-${e}`,b={get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=window.localStorage.getItem(v(e));return null===r?t:r},set(e,t){window.localStorage.setItem(v(e),t)},remove(e){window.localStorage.removeItem(v(e))}},M=e=>{const t=e.keys(),r={};return t.forEach((t=>{const n=t.toLowerCase().split("/").pop().slice(0,-4),o=e(t),a=o.slice(o.indexOf(",")+1),i=atob(a);r[n]=i})),r};var y=n(46),x=n(209),T=n.n(x);const k={...y.Util,...T(),isTouchDevice:function(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}},A=()=>{const e=document.querySelector('link[rel="icon"]');e&&(e.href="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNjAwIDE2MDAiPg0KICAgIDxwYXRoIGZpbGw9ImNob2NvbGF0ZSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAwLDBMMjU3LDMwMmwxOTIsOThINjAwbDUwLTQ5LDE1MC01MCwxNTAsNTAsNTAsNDloMTQ5bDE5NS05OEwxMzAwLDBsMzAwLDQwMEwxMzAwLDYwMWwyMDEsOTlMMTI0OCw4MDBsMiwxMDEtMTUwLDMwMCw1MCwxOTktMTUwLDIwMEg2MDBMNDUwLDE0MDBsNTEtMTk5TDM1MCw5MDFWODAwTDEwMSw3MDBsMjAwLTk5TDAsNDAwWk01MDAsNTUwSDYwMEw4MDAsNjUwbDIwMC0xMDBoMTAwVjg1MEgxMDAwVjY1MEw4MDAsNzUwLDYwMCw2NTBWODUwSDUwMFY1NTBaIi8+DQo8L3N2Zz4=")}})(),o})()));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("turbogrid")):"function"==typeof define&&define.amd?define("monocart-common",["turbogrid"],t):"object"==typeof exports?exports["monocart-common"]=t(require("turbogrid")):e["monocart-common"]=t(e.turbogrid)}(self,(e=>(()=>{var t={213:function(e,t,r){var n,o,a;o=[],void 0===(a="function"==typeof(n=function(){"use strict";function t(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}function n(e,t,r){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){c(n.response,t,r)},n.onerror=function(){console.error("could not download file")},n.send()}function o(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function a(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(r){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof r.g&&r.g.global===r.g?r.g:void 0,s=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),c=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(e,t,r){var s=i.URL||i.webkitURL,c=document.createElement("a");t=t||e.name||"download",c.download=t,c.rel="noopener","string"==typeof e?(c.href=e,c.origin===location.origin?a(c):o(c.href)?n(e,t,r):a(c,c.target="_blank")):(c.href=s.createObjectURL(e),setTimeout((function(){s.revokeObjectURL(c.href)}),4e4),setTimeout((function(){a(c)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,r,i){if(r=r||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(t(e,i),r);else if(o(e))n(e,r,i);else{var s=document.createElement("a");s.href=e,s.target="_blank",setTimeout((function(){a(s)}))}}:function(e,t,r,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof e)return n(e,t,r);var a="application/octet-stream"===e.type,c=/constructor/i.test(i.HTMLElement)||i.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||a&&c||s)&&"undefined"!=typeof FileReader){var l=new FileReader;l.onloadend=function(){var e=l.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=e:location=e,o=null},l.readAsDataURL(e)}else{var f=i.URL||i.webkitURL,d=f.createObjectURL(e);o?o.location=d:location.href=d,o=null,setTimeout((function(){f.revokeObjectURL(d)}),4e4)}});i.saveAs=c.saveAs=c,e.exports=c})?n.apply(t,o):n)||(e.exports=a)},187:e=>{var t,r,n=(t=(e,t)=>{t.exports={data:'(()=>{var x=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports);var S=x((V,R)=>{var _=0,p=-3;function b(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function N(e,n){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=n,this.destLen=0,this.ltree=new b,this.dtree=new b}var y=new b,k=new b,w=new Uint8Array(30),h=new Uint16Array(30),L=new Uint8Array(30),T=new Uint16Array(30),O=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),A=new b,c=new Uint8Array(320);function D(e,n,r,a){var t,i;for(t=0;t<r;++t)e[t]=0;for(t=0;t<30-r;++t)e[t+r]=t/r|0;for(i=a,t=0;t<30;++t)n[t]=i,i+=1<<e[t]}function z(e,n){var r;for(r=0;r<7;++r)e.table[r]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,r=0;r<24;++r)e.trans[r]=256+r;for(r=0;r<144;++r)e.trans[24+r]=r;for(r=0;r<8;++r)e.trans[168+r]=280+r;for(r=0;r<112;++r)e.trans[176+r]=144+r;for(r=0;r<5;++r)n.table[r]=0;for(n.table[5]=32,r=0;r<32;++r)n.trans[r]=r}var I=new Uint16Array(16);function l(e,n,r,a){var t,i;for(t=0;t<16;++t)e.table[t]=0;for(t=0;t<a;++t)e.table[n[r+t]]++;for(e.table[0]=0,i=0,t=0;t<16;++t)I[t]=i,i+=e.table[t];for(t=0;t<a;++t)n[r+t]&&(e.trans[I[n[r+t]]++]=t)}function B(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var n=e.tag&1;return e.tag>>>=1,n}function u(e,n,r){if(!n)return r;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var a=e.tag&65535>>>16-n;return e.tag>>>=n,e.bitcount-=n,a+r}function v(e,n){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var r=0,a=0,t=0,i=e.tag;do a=2*a+(i&1),i>>>=1,++t,r+=n.table[t],a-=n.table[t];while(a>=0);return e.tag=i,e.bitcount-=t,n.trans[r+a]}function C(e,n,r){var a,t,i,o,s,f;for(a=u(e,5,257),t=u(e,5,1),i=u(e,4,4),o=0;o<19;++o)c[o]=0;for(o=0;o<i;++o){var F=u(e,3,0);c[O[o]]=F}for(l(A,c,0,19),s=0;s<a+t;){var g=v(e,A);switch(g){case 16:var M=c[s-1];for(f=u(e,2,3);f;--f)c[s++]=M;break;case 17:for(f=u(e,3,3);f;--f)c[s++]=0;break;case 18:for(f=u(e,7,11);f;--f)c[s++]=0;break;default:c[s++]=g;break}}l(n,c,0,a),l(r,c,a,t)}function U(e,n,r){for(;;){var a=v(e,n);if(a===256)return _;if(a<256)e.dest[e.destLen++]=a;else{var t,i,o,s;for(a-=257,t=u(e,w[a],h[a]),i=v(e,r),o=e.destLen-u(e,L[i],T[i]),s=o;s<o+t;++s)e.dest[e.destLen++]=e.dest[s]}}}function K(e){for(var n,r,a;e.bitcount>8;)e.sourceIndex--,e.bitcount-=8;if(n=e.source[e.sourceIndex+1],n=256*n+e.source[e.sourceIndex],r=e.source[e.sourceIndex+3],r=256*r+e.source[e.sourceIndex+2],n!==(~r&65535))return p;for(e.sourceIndex+=4,a=n;a;--a)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,_}function j(e,n){var r=new N(e,n),a,t,i;do{switch(a=B(r),t=u(r,2,0),t){case 0:i=K(r);break;case 1:i=U(r,y,k);break;case 2:C(r,r.ltree,r.dtree),i=U(r,r.ltree,r.dtree);break;default:i=p}if(i!==_)throw new Error("Data error")}while(!a);return r.destLen<r.dest.length?typeof r.dest.slice=="function"?r.dest.slice(0,r.destLen):r.dest.subarray(0,r.destLen):r.dest}z(y,k);D(w,h,4,3);D(L,T,2,1);w[28]=0;h[28]=258;R.exports=j});var E=x((W,q)=>{var G=S(),H=e=>Uint8Array.from(atob(e),n=>n.charCodeAt(0)),J=e=>new TextDecoder().decode(e);q.exports=function(e){if(e){let[n,r]=e.split(".");if(n&&r){let a=H(n),t=new Uint8Array(parseInt(r));return G(a,t),J(t)}}}});var P=E();onmessage=function(e){postMessage(P(e.data))};postMessage("workerReady");})();\n'}},()=>(r||t((r={exports:{}}).exports,r),r.exports))();e.exports=e=>new Promise((t=>{let r=new Worker(URL.createObjectURL(new Blob([n.data],{type:"application/javascript"})));r.onmessage=n=>{"workerReady"!==n.data?(t(n.data),r.terminate()):r.postMessage(e)},r.onerror=e=>{t({error:e}),r.terminate()}}))},858:e=>{const t={tagPattern:/(\s*)@([^@\s]+)(\s*)/g,attachments:{audit:{name:"audit",contentType:"text/html",reportFile:"audit-report.json"},coverage:{name:"coverage",contentType:"text/html",reportFile:"coverage-report.json"},network:{name:"network",contentType:"text/html",reportFile:"network-report.json"}},pageTimings:[{key:"onContentLoad",name:"Content Loaded",color:"#1a1aa6"},{key:"onLoad",name:"Page Loaded",color:"#c80000"}],timings:[{key:"blocked",name:"Blocking",color:"#858585"},{key:"dns",name:"DNS Lookup",color:"#009688"},{key:"connect",name:"Connecting",color:"#b52dcd"},{key:"send",name:"Sending",color:"#74979a"},{key:"wait",name:"Waiting",color:"#00a846"},{key:"receive",name:"Receiving",color:"#0299de"}],hasOwn:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},isNull:function(e){return null==e},uid:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;const t="0123456789abcdefghijklmnopqrstuvwxyz";let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";for(;e--;)r+=t[36*Math.random()|0];return r},zero:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return(e=`${e}`).padStart(t,"0")},toNum:function(e,t){return"number"!=typeof e&&(e=parseFloat(e)),isNaN(e)&&(e=0),t&&(e=Math.round(e)),e},isList:function(e){return!!(e&&e instanceof Array&&e.length>0)},forEach:function(e,r){const n=e=>"break"===e||!1===e,o=(e,a)=>{if(t.isList(e))for(const t of e){const e=r(t,a);if(n(e))return e;const i=o(t.subs,t);if(n(i))return i}};o(e)},formatPath:function(e){return e&&(e=e.replace(/\\/g,"/")),e},getCurrentTrendInfo:e=>{const{date:t,duration:r,summary:n}=e,o={date:t,duration:r};return Object.keys(n).forEach((e=>{const t=n[e];o[e]=t.value})),o},isTagItem:e=>"case"===e.type||"suite"===e.type&&"describe"===e.suiteType,delay:function(e){return new Promise((t=>{e?setTimeout(t,e):setImmediate(t)}))},generatePercentChart:function(e){return`<div style="--mcr-percent:${e}%;" class="mcr-percent-chart"></div>`},getStatus:(e,t)=>t?e<t[0]?"low":e<t[1]?"medium":"high":"unknown",isJsonType:e=>!(!e||"application/json"!==e&&"json"!==e),isMarkdownType:e=>!(!e||"text/markdown"!==e&&"markdown"!==e),isTextType(e){if(e){if(e.startsWith("text"))return!0;if(t.isMarkdownType(e))return!0;if(t.isJsonType(e))return!0}return!1},dFixed:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isInteger(e)?e:t.toNum(t.toNum(e).toFixed(r))},pxFixed:e=>{const t=Math.floor(e);return e<t+.5?t+.5:t+1.5},point:(e,r)=>`${t.dFixed(e)},${t.dFixed(r)}`,NF:function(e){return"number"==typeof e&&e?e.toLocaleString():e},PF:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"%",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";e=t.toNum(e),r=t.toNum(r);let i=0;r&&(i=e/r);const s=(100*i).toFixed(n);return o?s+a+o:parseFloat(s)},PSF:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return t.PF(e,r,n,"%"," ")},PNF:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return t.PF(e,r,n,"")},BF:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(0===(e=t.toNum(e,!0)))return`0${n}B`;let o="";e<0&&(e=Math.abs(e),o="-");const a=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];for(let t=0,i=a.length;t<i;t++){const i=Math.pow(1024,t),s=Math.pow(1024,t+1);if(e>i&&e<s){const s=a[t];e=o+(e/i).toFixed(r)+n+s;break}}return e},BSF:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t.BF(e,r," ")},TF:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t.toNum(e,!0);if(n<1e3)return`${n}${r}ms`;if(n<6e4){const e=Math.floor(n/1e3),t=Math.round((n-1e3*e)/100);return t?`${e}.${t}${r}s`:`${e}${r}s`}const o=Math.round(n/1e3),a=60,i=3600,s=24*i;if(o<i){const e=Math.floor(o/a);return`${e}${r}m ${o-e*a}${r}s`}if(o<s){const e=Math.floor(o/i),t=Math.floor((o-e*i)/a);return`${e}${r}h ${t}${r}m ${o-e*i-t*a}${r}s`}const c=Math.floor(o/s),u=Math.floor((o-c*s)/i),l=Math.floor((o-c*s-u*i)/a);return`${c}${r}d ${u}${r}h ${l}${r}m ${o-c*s-u*i-l*a}${r}s`},TSF:function(e){return t.TF(e," ")}};e.exports=t},448:t=>{"use strict";t.exports=e}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var a=r[e]={exports:{}};return t[e].call(a.exports,a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";n.r(o),n.d(o,{CommonUtil:()=>k,debounce:()=>t,decodeIcons:()=>M,hash:()=>g,inflate:()=>i(),microtask:()=>r,niceTicks:()=>p,saveAs:()=>h.saveAs,setFavicon:()=>A,store:()=>b});class e{start(e){this.callback=e,this.started||(this.started=!0,this.create())}create(){if("function"!=typeof window.queueMicrotask){if("function"!=typeof Promise)throw new Error("Current browser does NOT support queueMicrotask or Promise");Promise.resolve().then((()=>{this.execute()}))}else window.queueMicrotask((()=>{this.execute()}))}execute(){if(!this.started)return;this.started=!1;const e=this.callback;this.callback=null,"function"==typeof e&&e.call(this)}cancel(){this.started=!1,this.callback=null}}const t=function(e,t=100){let r;const n=function(){clearTimeout(r),r=setTimeout((()=>{e.apply(this,arguments)}),t)};return n.cancel=()=>{clearTimeout(r)},n},r=function(t){const r=new e,n=function(){r.start((()=>{t.apply(this,arguments)}))};return n.cancel=()=>{r.cancel()},n};var a=n(187),i=n.n(a);function s(e){return""+e}function c(e){var t=s(e).split(".");return t.length>1?t[1].length:0}function u(e){var t=s(e);return parseInt(t.replace(".",""))}function l(e,t){var r=c(e),n=c(t);if(r+n===0)return e+t;var o=Math.pow(10,Math.max(r,n));return(Math.round(e*o)+Math.round(t*o))/o}function f(e,t){var r=c(e),n=c(t);return r+n===0?e*t:u(e)*u(t)/Math.pow(10,r+n)}function d(e,t){var r=Math.floor(Math.log(e)/Math.log(10)),n=e/Math.pow(10,r);return(t?n<1.5?1:n<3?2:n<7?5:10:n<=1?1:n<=2?2:n<=5?5:10)*Math.pow(10,r)}var w=function(e){return"number"!=typeof e&&(e=parseFloat(e)),isNaN(e)&&(e=0),e};function p(e,t,r){if(e=w(e),t=w(t),(r=w(r))||(r=4),e===t)t=e+1;else if(e>t){var n=e;e=t,t=n}for(var o=d(t-e,!1),a=d(o/(r-1),!0),i=f(Math.floor(e/a),a),s=f(Math.ceil(t/a),a),c=[],u=i;u<=s;)c.push(u),u=l(u,a);return c}var h=n(213);const m={get:function(e){let t={};const r=location.hash.slice(1);if(r){const e=new URLSearchParams(r);t=Object.fromEntries(e)}return e?t[e]:t},set:function(e,t){if(!e)return;let r=e;2===arguments.length&&(r={},r[e]=t);const n=m.get();Object.keys(r).forEach((e=>{n[e]=r[e]}));const o=new URLSearchParams(n);location.hash=o.toString()},remove:function(e){if(!e)return void(location.hash="");let t=e;Array.isArray(e)||(t=[e]);const r=m.get();t.forEach((e=>{delete r[e]}));const n=new URLSearchParams(r);location.hash=n.toString()}},g=m,v=e=>`mcr-${e}`,b={get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const r=window.localStorage.getItem(v(e));return null===r?t:r},set(e,t){window.localStorage.setItem(v(e),t)},remove(e){window.localStorage.removeItem(v(e))}},M=e=>{const t=e.keys(),r={};return t.forEach((t=>{const n=t.toLowerCase().split("/").pop().slice(0,-4),o=e(t),a=o.slice(o.indexOf(",")+1),i=atob(a);r[n]=i})),r};var y=n(448),x=n(858),T=n.n(x);const k={...y.Util,...T(),isTouchDevice:function(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}},A=()=>{const e=document.querySelector('link[rel="icon"]');e&&(e.href="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNjAwIDE2MDAiPg0KICAgIDxwYXRoIGZpbGw9ImNob2NvbGF0ZSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAwLDBMMjU3LDMwMmwxOTIsOThINjAwbDUwLTQ5LDE1MC01MCwxNTAsNTAsNTAsNDloMTQ5bDE5NS05OEwxMzAwLDBsMzAwLDQwMEwxMzAwLDYwMWwyMDEsOTlMMTI0OCw4MDBsMiwxMDEtMTUwLDMwMCw1MCwxOTktMTUwLDIwMEg2MDBMNDUwLDE0MDBsNTEtMTk5TDM1MCw5MDFWODAwTDEwMSw3MDBsMjAwLTk5TDAsNDAwWk01MDAsNTUwSDYwMEw4MDAsNjUwbDIwMC0xMDBoMTAwVjg1MEgxMDAwVjY1MEw4MDAsNzUwLDYwMCw2NTBWODUwSDUwMFY1NTBaIi8+DQo8L3N2Zz4=")}})(),o})()));
|