@testrelic/playwright-analytics 1.3.0 → 1.4.0
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/index.cjs +113 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +113 -50
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {randomUUID,createHash}from'crypto';import {mkdirSync,writeFileSync,renameSync,readFileSync,existsSync,copyFileSync}from'fs';import {relative,dirname,join,extname,resolve}from'path';import {isValidConfig,createError,ErrorCode}from'@testrelic/core';import {exec}from'child_process';var
|
|
2
|
-
`);if(t<1||t>s.length)return null;let i=Math.max(1,t-
|
|
3
|
-
`)}catch{return null}}function
|
|
1
|
+
import {randomUUID,createHash}from'crypto';import {mkdirSync,writeFileSync,renameSync,readFileSync,existsSync,copyFileSync}from'fs';import {relative,dirname,join,extname,resolve}from'path';import {isValidConfig,createError,ErrorCode}from'@testrelic/core';import {exec}from'child_process';var at=[/AKIA[A-Z0-9]{16}/g,/Bearer\s+[A-Za-z0-9\-._~+/]+=*/g,/-----BEGIN\s+(RSA\s+)?PRIVATE\sKEY-----[\s\S]*?-----END/g,/\/\/[^:]+:[^@]+@/g];function A(e){if(e!==void 0&&!isValidConfig(e))throw createError(ErrorCode.CONFIG_INVALID,"Invalid reporter configuration");let t=Object.create(null);t.outputPath=e?.outputPath??"./test-results/analytics-timeline.json",t.includeStackTrace=e?.includeStackTrace??false,t.includeCodeSnippets=e?.includeCodeSnippets??true,t.codeContextLines=e?.codeContextLines??3,t.includeNetworkStats=e?.includeNetworkStats??true,t.navigationTypes=e?.navigationTypes??null,t.redactPatterns=[...at,...e?.redactPatterns??[]],t.testRunId=e?.testRunId??null,t.metadata=e?.metadata??null;let r=t.outputPath;return t.openReport=e?.openReport??true,t.htmlReportPath=e?.htmlReportPath??r.replace(/\.json$/,".html"),t.includeArtifacts=e?.includeArtifacts??true,Object.freeze(t)}var x="1.2.0";function I(e,t,r){try{let s=readFileSync(e,"utf-8").split(`
|
|
2
|
+
`);if(t<1||t>s.length)return null;let i=Math.max(1,t-r),o=Math.min(s.length,t+r),d=[];for(let n=i;n<=o;n++){let c=n===t?">":" ",p=String(n).padStart(String(o).length," ");d.push(`${c} ${p} | ${s[n-1]}`);}return d.join(`
|
|
3
|
+
`)}catch{return null}}function F(e){return t=>{let r=t;for(let a of e)if(typeof a=="string"){let s=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");r=r.replace(new RegExp(s,"g"),"[REDACTED]");}else {let s=a.flags.includes("g")?a.flags:a.flags+"g",i=new RegExp(a.source,s);r=r.replace(i,"[REDACTED]");}return r}}function it(e){return e.GITHUB_ACTIONS!=="true"?null:{provider:"github-actions",buildId:e.GITHUB_RUN_ID??null,commitSha:e.GITHUB_SHA??null,branch:e.GITHUB_REF_NAME??null}}function nt(e){return e.GITLAB_CI!=="true"?null:{provider:"gitlab-ci",buildId:e.CI_PIPELINE_ID??null,commitSha:e.CI_COMMIT_SHA??null,branch:e.CI_COMMIT_BRANCH??e.CI_COMMIT_REF_NAME??null}}function ot(e){if(!e.JENKINS_URL)return null;let t=e.GIT_BRANCH??null;return t?.startsWith("origin/")&&(t=t.slice(7)),{provider:"jenkins",buildId:e.BUILD_ID??null,commitSha:e.GIT_COMMIT??null,branch:t}}function lt(e){return e.CIRCLECI!=="true"?null:{provider:"circleci",buildId:e.CIRCLE_BUILD_NUM??null,commitSha:e.CIRCLE_SHA1??null,branch:e.CIRCLE_BRANCH??null}}var dt=[it,nt,ot,lt];function E(e){let t=process.env;for(let r of dt){let a=r(t);if(a)return a}return null}var M=`
|
|
4
4
|
/* Theme Variables */
|
|
5
5
|
:root,[data-theme="dark"]{
|
|
6
6
|
--bg:#0f1117;--bg-1:#161b22;--bg-2:#1c2128;--bg-3:#21262d;--bg-code:#13111c;
|
|
@@ -80,7 +80,7 @@ body{
|
|
|
80
80
|
.s-timedout{background:rgba(249,115,22,0.06)}.s-timedout .s-count{color:#f97316}
|
|
81
81
|
|
|
82
82
|
/* \u2500\u2500 Filter Bar \u2500\u2500 */
|
|
83
|
-
.filter-bar{display:flex;align-items:center;gap:
|
|
83
|
+
.filter-bar{display:flex;align-items:center;gap:8px;margin-bottom:24px;flex-wrap:wrap}
|
|
84
84
|
.filter-chips{display:flex;gap:5px;flex-wrap:wrap}
|
|
85
85
|
.filter-chip{
|
|
86
86
|
font-size:12px;font-weight:500;padding:5px 14px;border-radius:9999px;
|
|
@@ -91,14 +91,32 @@ body{
|
|
|
91
91
|
.filter-chip.active{background:rgba(3,183,156,0.12);border-color:#03b79c;color:#2dd4a8}
|
|
92
92
|
.chip-count{font-weight:700;margin-left:3px}
|
|
93
93
|
.filter-chip--zero{opacity:.35;pointer-events:none}
|
|
94
|
-
.filter-section{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
|
|
95
|
-
.filter-section-label{font-size:10px;font-weight:600;color:var(--fg-2);text-transform:uppercase;letter-spacing:.04em;margin-right:4px}
|
|
96
94
|
.filter-chip--dimmed{opacity:.45}
|
|
97
|
-
.filter-actions{display:flex;align-items:center;gap:12px;margin-left:auto}
|
|
98
95
|
.filter-clear{font-size:11px;font-weight:600;color:#03b79c;background:none;border:none;cursor:pointer;padding:4px 8px;border-radius:6px;font-family:inherit;transition:background .15s}
|
|
99
96
|
.filter-clear:hover{background:rgba(3,183,156,0.1)}
|
|
100
97
|
.filter-indicator{font-size:11px;color:var(--fg-2)}
|
|
101
|
-
|
|
98
|
+
|
|
99
|
+
/* \u2500\u2500 Filter Icon Button \u2500\u2500 */
|
|
100
|
+
.filter-icon-btn{position:relative;display:flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:8px;border:1px solid var(--bd-m);background:transparent;color:var(--fg-2);cursor:pointer;transition:all .15s;flex-shrink:0;margin-left:auto}
|
|
101
|
+
.filter-icon-btn:hover{background:var(--hvr);color:var(--fg);border-color:var(--bd-l)}
|
|
102
|
+
.filter-icon-badge{position:absolute;top:5px;right:5px;width:7px;height:7px;border-radius:50%;background:#03b79c}
|
|
103
|
+
|
|
104
|
+
/* \u2500\u2500 Filter Drawer \u2500\u2500 */
|
|
105
|
+
.filter-drawer-backdrop{position:fixed;inset:0;background:var(--overlay-bg);z-index:100;opacity:0;pointer-events:none;transition:opacity .25s ease}
|
|
106
|
+
.filter-drawer-backdrop.open{opacity:1;pointer-events:auto}
|
|
107
|
+
.filter-drawer{position:fixed;top:0;right:0;bottom:0;width:340px;max-width:90vw;z-index:110;background:var(--bg-1);border-left:1px solid var(--bd);transform:translateX(100%);transition:transform .3s cubic-bezier(.4,0,.2,1);display:flex;flex-direction:column;overflow:hidden;box-shadow:-4px 0 24px var(--shadow-c)}
|
|
108
|
+
.filter-drawer.open{transform:translateX(0)}
|
|
109
|
+
.filter-drawer-bar{display:flex;align-items:center;justify-content:space-between;padding:14px 20px;border-bottom:1px solid var(--bd);background:linear-gradient(180deg,rgba(3,183,156,0.04) 0%,transparent 100%);flex-shrink:0}
|
|
110
|
+
.filter-drawer-title{font-size:12px;font-weight:600;color:var(--fg-1);text-transform:uppercase;letter-spacing:.06em}
|
|
111
|
+
.filter-drawer-close{width:32px;height:32px;border-radius:8px;border:1px solid var(--bd-m);background:transparent;color:var(--fg-1);font-size:18px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s,color .15s}
|
|
112
|
+
.filter-drawer-close:hover{background:var(--bd);color:var(--fg)}
|
|
113
|
+
.filter-drawer-body{flex:1;overflow-y:auto;padding:20px;scrollbar-width:thin;scrollbar-color:var(--scroll-thumb) transparent}
|
|
114
|
+
.filter-drawer-body::-webkit-scrollbar{width:5px}
|
|
115
|
+
.filter-drawer-body::-webkit-scrollbar-thumb{background:var(--bg-3);border-radius:3px}
|
|
116
|
+
.filter-drawer-section{margin-bottom:20px}
|
|
117
|
+
.filter-drawer-section-label{display:block;font-size:10px;font-weight:600;color:var(--fg-2);text-transform:uppercase;letter-spacing:.04em;margin-bottom:8px}
|
|
118
|
+
.filter-drawer-actions{display:flex;align-items:center;gap:12px;padding-top:16px;border-top:1px solid var(--bd)}
|
|
119
|
+
.search-box{position:relative;width:280px;flex-shrink:1;min-width:180px;margin-left:0}
|
|
102
120
|
.search-input{
|
|
103
121
|
width:100%;padding:6px 10px 6px 32px;
|
|
104
122
|
border:1px solid var(--bd-m);border-radius:8px;
|
|
@@ -437,6 +455,8 @@ body{
|
|
|
437
455
|
.summary-chip{min-width:70px}
|
|
438
456
|
.filter-bar{flex-direction:column;align-items:stretch}
|
|
439
457
|
.search-box{width:100%;margin-left:0}
|
|
458
|
+
.filter-icon-btn{margin-left:auto}
|
|
459
|
+
.filter-drawer{width:100%;max-width:100%}
|
|
440
460
|
.drawer{width:100%;max-width:100%}
|
|
441
461
|
.cta-btn{font-size:10px;padding:5px 10px;order:10}
|
|
442
462
|
.detail-title{font-size:14px}
|
|
@@ -446,7 +466,7 @@ body{
|
|
|
446
466
|
/* \u2500\u2500 Print \u2500\u2500 */
|
|
447
467
|
@media print{
|
|
448
468
|
body{background:#fff;color:#000}
|
|
449
|
-
.drawer-backdrop,.drawer{display:none}
|
|
469
|
+
.drawer-backdrop,.drawer,.filter-drawer-backdrop,.filter-drawer{display:none}
|
|
450
470
|
.lightbox-overlay,.lightbox-close{display:none}
|
|
451
471
|
.test-row-arrow{display:none}
|
|
452
472
|
.summary-chip,.filter-chip,.status-indicator,.detail-status-badge,.dm-badge,.nav-badge,.trb,.step-node{
|
|
@@ -457,11 +477,11 @@ body{
|
|
|
457
477
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.75 1.08009C2.034 2.66209 -0.130999 7.63009 0.610001 10.5821C0.969001 12.0121 3.021 15.2131 5.17 17.6971C14.375 28.3321 18 39.7791 18 58.2101V71.0001H12.434C1.16501 71.0001 0 73.4641 0 97.3051C0 106.858 0.298003 128.922 0.662003 146.337L1.323 178H33.606C65.786 178 65.897 178.007 68.544 180.284C72.228 183.453 72.244 189.21 68.579 192.877L65.957 195.5L33.479 195.801L1 196.103V204.551V213H24.577H48.154L51.077 215.923C55.007 219.853 55.007 224.147 51.077 228.077L48.154 231H26.469H4.783L5.41901 233.534C5.76901 234.927 7.143 238.527 8.472 241.534L10.89 247H40.945H71L71.006 241.75C71.017 230.748 76.027 221.606 84.697 216.767C97.854 209.424 114.086 213.895 121.323 226.857C123.659 231.041 124.418 233.833 124.789 239.607L125.263 247H155.187H185.11L187.528 241.534C188.857 238.527 190.231 234.927 190.581 233.534L191.217 231H169.531H147.846L144.923 228.077C142.928 226.082 142 224.152 142 222C142 219.848 142.928 217.918 144.923 215.923L147.846 213H171.423H195V204.551V196.103L162.521 195.801L130.043 195.5L127.421 192.877C123.991 189.445 123.835 183.869 127.074 180.421L129.349 178H162.013H194.677L195.338 146.337C195.702 128.922 196 106.858 196 97.3051C196 73.4641 194.835 71.0001 183.566 71.0001H178V58.2101C178 39.6501 181.397 28.7731 190.538 18.0651C195.631 12.0971 196.572 9.00809 194.511 5.02109C192.672 1.46509 190.197 9.12233e-05 186.028 9.12233e-05C179.761 9.12233e-05 168.713 14.8831 163.388 30.5001C160.975 37.5771 160.608 40.3751 160.213 54.7501L159.765 71.0001H150.732H141.7L142.286 53.2501C142.904 34.5511 144.727 24.3761 148.938 16.1211C151.823 10.4671 151.628 5.90109 148.364 2.63609C145 -0.726907 140.105 -0.887909 136.596 2.25009C133.481 5.03609 128.686 17.0811 126.507 27.5921C125.569 32.1191 124.617 43.0901 124.28 53.2501L123.69 71.0001H115.345H107V38.4231V5.84609L104.077 2.92309C102.082 0.928088 100.152 9.12233e-05 98 9.12233e-05C95.848 9.12233e-05 93.918 0.928088 91.923 2.92309L89 5.84609V38.4231V71.0001H80.655H72.31L71.72 53.2501C71.383 43.0901 70.431 32.1191 69.493 27.5921C67.314 17.0811 62.519 5.03609 59.404 2.25009C55.998 -0.795909 51.059 -0.710905 47.646 2.45209C44.221 5.62609 44.191 9.92109 47.539 17.4911C51.71 26.9241 53.007 34.4791 53.676 53.2501L54.31 71.0001H45.272H36.235L35.787 54.7501C35.392 40.3751 35.025 37.5771 32.612 30.5001C27.194 14.6091 16.228 -0.02891 9.787 0.03009C7.979 0.04709 5.712 0.519093 4.75 1.08009ZM42.687 108.974C33.431 112.591 20.036 125.024 18.408 131.512C17.476 135.223 20.677 140.453 28.253 147.599C37.495 156.319 44.191 159.471 53.5 159.485C59.317 159.494 61.645 158.953 67.274 156.289C77.634 151.385 88.987 139.161 88.996 132.9C89.004 127.304 76.787 114.707 66.745 109.956C59.16 106.368 50.285 106.006 42.687 108.974ZM129.255 109.904C119.151 114.768 106.996 127.33 107.004 132.9C107.013 139.108 118.562 151.475 128.939 156.389C134.338 158.945 136.744 159.496 142.521 159.498C152.526 159.501 160.369 155.502 169.771 145.605C180.444 134.368 180.278 130.975 168.486 119.388C160.043 111.094 152.727 107.595 143 107.201C136.364 106.933 134.78 107.244 129.255 109.904ZM48.5 125.922C46.3 126.969 43.152 128.945 41.505 130.314L38.511 132.802L40.504 135.005C41.601 136.216 44.434 138.342 46.8 139.728C52.577 143.114 57.36 142.466 64.009 137.395L68.978 133.606L66.756 131.24C60.944 125.054 54.357 123.135 48.5 125.922ZM138.386 125.063C136.674 125.571 133.375 127.677 131.057 129.743L126.841 133.5L131.901 137.343C138.65 142.468 143.407 143.124 149.2 139.728C151.566 138.342 154.351 136.269 155.389 135.122C157.684 132.587 156.742 131.097 150.58 127.511C145.438 124.519 142.329 123.895 138.386 125.063ZM91.923 162.923C89.043 165.804 89 166.008 89 176.973C89 184.805 89.435 188.941 90.47 190.941C92.356 194.589 96.918 196.273 101.03 194.84C105.82 193.17 107 189.638 107 176.973C107 166.008 106.957 165.804 104.077 162.923C102.082 160.928 100.152 160 98 160C95.848 160 93.918 160.928 91.923 162.923ZM94.5 232.155C91.026 234.055 90 236.229 90 241.691V247H98H106V242.082C106 235.732 105.37 234.242 101.928 232.463C98.591 230.737 97.197 230.679 94.5 232.155Z" fill="url(#paint0_linear_55_11)"/>
|
|
458
478
|
<defs><linearGradient id="paint0_linear_55_11" x1="98" y1="0.000244141" x2="98" y2="247" gradientUnits="userSpaceOnUse">
|
|
459
479
|
<stop stop-color="#03B79C"/><stop offset="0.504808" stop-color="#4EDAA4"/><stop offset="0.865285" stop-color="#84F3AA"/>
|
|
460
|
-
</linearGradient></defs></svg>`,
|
|
480
|
+
</linearGradient></defs></svg>`,B=`<svg width="32" height="40" viewBox="0 0 196 247" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
461
481
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.75 1.08009C2.034 2.66209 -0.130999 7.63009 0.610001 10.5821C0.969001 12.0121 3.021 15.2131 5.17 17.6971C14.375 28.3321 18 39.7791 18 58.2101V71.0001H12.434C1.16501 71.0001 0 73.4641 0 97.3051C0 106.858 0.298003 128.922 0.662003 146.337L1.323 178H33.606C65.786 178 65.897 178.007 68.544 180.284C72.228 183.453 72.244 189.21 68.579 192.877L65.957 195.5L33.479 195.801L1 196.103V204.551V213H24.577H48.154L51.077 215.923C55.007 219.853 55.007 224.147 51.077 228.077L48.154 231H26.469H4.783L5.41901 233.534C5.76901 234.927 7.143 238.527 8.472 241.534L10.89 247H40.945H71L71.006 241.75C71.017 230.748 76.027 221.606 84.697 216.767C97.854 209.424 114.086 213.895 121.323 226.857C123.659 231.041 124.418 233.833 124.789 239.607L125.263 247H155.187H185.11L187.528 241.534C188.857 238.527 190.231 234.927 190.581 233.534L191.217 231H169.531H147.846L144.923 228.077C142.928 226.082 142 224.152 142 222C142 219.848 142.928 217.918 144.923 215.923L147.846 213H171.423H195V204.551V196.103L162.521 195.801L130.043 195.5L127.421 192.877C123.991 189.445 123.835 183.869 127.074 180.421L129.349 178H162.013H194.677L195.338 146.337C195.702 128.922 196 106.858 196 97.3051C196 73.4641 194.835 71.0001 183.566 71.0001H178V58.2101C178 39.6501 181.397 28.7731 190.538 18.0651C195.631 12.0971 196.572 9.00809 194.511 5.02109C192.672 1.46509 190.197 9.12233e-05 186.028 9.12233e-05C179.761 9.12233e-05 168.713 14.8831 163.388 30.5001C160.975 37.5771 160.608 40.3751 160.213 54.7501L159.765 71.0001H150.732H141.7L142.286 53.2501C142.904 34.5511 144.727 24.3761 148.938 16.1211C151.823 10.4671 151.628 5.90109 148.364 2.63609C145 -0.726907 140.105 -0.887909 136.596 2.25009C133.481 5.03609 128.686 17.0811 126.507 27.5921C125.569 32.1191 124.617 43.0901 124.28 53.2501L123.69 71.0001H115.345H107V38.4231V5.84609L104.077 2.92309C102.082 0.928088 100.152 9.12233e-05 98 9.12233e-05C95.848 9.12233e-05 93.918 0.928088 91.923 2.92309L89 5.84609V38.4231V71.0001H80.655H72.31L71.72 53.2501C71.383 43.0901 70.431 32.1191 69.493 27.5921C67.314 17.0811 62.519 5.03609 59.404 2.25009C55.998 -0.795909 51.059 -0.710905 47.646 2.45209C44.221 5.62609 44.191 9.92109 47.539 17.4911C51.71 26.9241 53.007 34.4791 53.676 53.2501L54.31 71.0001H45.272H36.235L35.787 54.7501C35.392 40.3751 35.025 37.5771 32.612 30.5001C27.194 14.6091 16.228 -0.02891 9.787 0.03009C7.979 0.04709 5.712 0.519093 4.75 1.08009ZM42.687 108.974C33.431 112.591 20.036 125.024 18.408 131.512C17.476 135.223 20.677 140.453 28.253 147.599C37.495 156.319 44.191 159.471 53.5 159.485C59.317 159.494 61.645 158.953 67.274 156.289C77.634 151.385 88.987 139.161 88.996 132.9C89.004 127.304 76.787 114.707 66.745 109.956C59.16 106.368 50.285 106.006 42.687 108.974ZM129.255 109.904C119.151 114.768 106.996 127.33 107.004 132.9C107.013 139.108 118.562 151.475 128.939 156.389C134.338 158.945 136.744 159.496 142.521 159.498C152.526 159.501 160.369 155.502 169.771 145.605C180.444 134.368 180.278 130.975 168.486 119.388C160.043 111.094 152.727 107.595 143 107.201C136.364 106.933 134.78 107.244 129.255 109.904ZM48.5 125.922C46.3 126.969 43.152 128.945 41.505 130.314L38.511 132.802L40.504 135.005C41.601 136.216 44.434 138.342 46.8 139.728C52.577 143.114 57.36 142.466 64.009 137.395L68.978 133.606L66.756 131.24C60.944 125.054 54.357 123.135 48.5 125.922ZM138.386 125.063C136.674 125.571 133.375 127.677 131.057 129.743L126.841 133.5L131.901 137.343C138.65 142.468 143.407 143.124 149.2 139.728C151.566 138.342 154.351 136.269 155.389 135.122C157.684 132.587 156.742 131.097 150.58 127.511C145.438 124.519 142.329 123.895 138.386 125.063ZM91.923 162.923C89.043 165.804 89 166.008 89 176.973C89 184.805 89.435 188.941 90.47 190.941C92.356 194.589 96.918 196.273 101.03 194.84C105.82 193.17 107 189.638 107 176.973C107 166.008 106.957 165.804 104.077 162.923C102.082 160.928 100.152 160 98 160C95.848 160 93.918 160.928 91.923 162.923ZM94.5 232.155C91.026 234.055 90 236.229 90 241.691V247H98H106V242.082C106 235.732 105.37 234.242 101.928 232.463C98.591 230.737 97.197 230.679 94.5 232.155Z" fill="url(#paint0_linear_55_11)"/>
|
|
462
482
|
<defs><linearGradient id="paint0_linear_55_11" x1="98" y1="0.000244141" x2="98" y2="247" gradientUnits="userSpaceOnUse">
|
|
463
483
|
<stop stop-color="#03B79C"/><stop offset="0.504808" stop-color="#4EDAA4"/><stop offset="0.865285" stop-color="#84F3AA"/>
|
|
464
|
-
</linearGradient></defs></svg>`;var
|
|
484
|
+
</linearGradient></defs></svg>`;var N=`
|
|
465
485
|
/* \u2500\u2500 Utilities \u2500\u2500 */
|
|
466
486
|
function esc(s){if(!s)return '';return String(s).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/'/g,''')}
|
|
467
487
|
function stripAnsi(s){return s?s.replace(/\\u001b\\[[0-9;]*m/g,'').replace(/\\x1b\\[[0-9;]*m/g,''):''}
|
|
@@ -657,7 +677,7 @@ body{
|
|
|
657
677
|
|
|
658
678
|
/* \u2500\u2500 Search \u2500\u2500 */
|
|
659
679
|
function doSearch(q){searchQuery=q;applyFilters();}
|
|
660
|
-
`;var
|
|
680
|
+
`;var D=`
|
|
661
681
|
/* \u2500\u2500 Network Visualization Helpers \u2500\u2500 */
|
|
662
682
|
var RES_COLORS={xhr:'#60a5fa',document:'#818cf8',script:'#fbbf24',stylesheet:'#a78bfa',image:'#34d399',font:'#f472b6',other:'#6b7280'};
|
|
663
683
|
var RES_LABELS={xhr:'XHR',document:'Doc',script:'JS',stylesheet:'CSS',image:'Img',font:'Font',other:'Other'};
|
|
@@ -876,12 +896,14 @@ body{
|
|
|
876
896
|
var countEl=ndt.querySelector('.ndt-count');
|
|
877
897
|
if(countEl)countEl.textContent=visible+' / '+rows.length+' requests';
|
|
878
898
|
}
|
|
879
|
-
`;var
|
|
899
|
+
`;var q=`
|
|
880
900
|
var _filterState={status:{},type:{},specFile:{}};
|
|
881
901
|
var _totalTests=0;
|
|
882
902
|
var _originalSummary=null;
|
|
883
903
|
|
|
884
904
|
function renderFilterBar(){
|
|
905
|
+
var filterEl=document.getElementById('filter-bar');
|
|
906
|
+
var drawerBodyEl=document.getElementById('filter-drawer-body');
|
|
885
907
|
var statusCounts={passed:0,failed:0,flaky:0,skipped:0,timedout:0};
|
|
886
908
|
var typeCounts={},specCounts={};
|
|
887
909
|
for(var i=0;i<tests.length;i++){
|
|
@@ -894,12 +916,17 @@ function renderFilterBar(){
|
|
|
894
916
|
var hasStatus=Object.keys(_filterState.status).length>0;
|
|
895
917
|
var hasType=Object.keys(_filterState.type).length>0;
|
|
896
918
|
var hasSpec=Object.keys(_filterState.specFile).length>0;
|
|
897
|
-
var hasAny=hasStatus||hasType||hasSpec;
|
|
919
|
+
var hasAny=hasStatus||hasType||hasSpec||!!searchQuery;
|
|
920
|
+
var hasAdvanced=hasType||hasSpec;
|
|
921
|
+
|
|
922
|
+
/* \u2500\u2500 Filter Bar (search + status chips + filter icon) \u2500\u2500 */
|
|
923
|
+
var h='';
|
|
898
924
|
|
|
899
|
-
|
|
925
|
+
/* Search box (left-aligned, wider) */
|
|
926
|
+
h+='<div class="search-box"><svg class="search-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="M21 21l-4.35-4.35"/></svg><input class="search-input" id="search-input" type="text" placeholder="Search tests..." value="'+esc(searchQuery)+'"></div>';
|
|
900
927
|
|
|
901
|
-
/* Status
|
|
902
|
-
h+='<div class="filter-
|
|
928
|
+
/* Status chips (inline) */
|
|
929
|
+
h+='<div class="filter-chips">';
|
|
903
930
|
var statuses=['passed','failed','flaky','skipped','timedout'];
|
|
904
931
|
var statusLabels={passed:'Passed',failed:'Failed',flaky:'Flaky',skipped:'Skipped',timedout:'Timed Out'};
|
|
905
932
|
for(var i=0;i<statuses.length;i++){
|
|
@@ -909,43 +936,52 @@ function renderFilterBar(){
|
|
|
909
936
|
}
|
|
910
937
|
h+='</div>';
|
|
911
938
|
|
|
939
|
+
/* Filter icon button */
|
|
940
|
+
h+='<button class="filter-icon-btn" title="More filters">';
|
|
941
|
+
h+='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 3H2l8 9.46V19l4 2v-8.54L22 3z"/></svg>';
|
|
942
|
+
if(hasAdvanced)h+='<span class="filter-icon-badge"></span>';
|
|
943
|
+
h+='</button>';
|
|
944
|
+
|
|
945
|
+
if(filterEl)filterEl.innerHTML=h;
|
|
946
|
+
|
|
947
|
+
/* \u2500\u2500 Filter Drawer Body (type + file + actions) \u2500\u2500 */
|
|
948
|
+
var d='';
|
|
949
|
+
|
|
912
950
|
/* Type section */
|
|
913
951
|
var types=Object.keys(typeCounts).sort();
|
|
914
952
|
if(types.length>0){
|
|
915
|
-
|
|
953
|
+
d+='<div class="filter-drawer-section"><span class="filter-drawer-section-label">Type</span>';
|
|
954
|
+
d+='<div class="filter-chips">';
|
|
916
955
|
for(var i=0;i<types.length;i++){
|
|
917
956
|
var tp=types[i];var cnt=typeCounts[tp]||0;
|
|
918
957
|
var cls='filter-chip'+(!!_filterState.type[tp]?' active':'')+(cnt===0?' filter-chip--dimmed':'');
|
|
919
|
-
|
|
958
|
+
d+='<button class="'+cls+'" data-dimension="type" data-value="'+esc(tp)+'">'+esc(tp)+' <span class="chip-count">'+cnt+'</span></button>';
|
|
920
959
|
}
|
|
921
|
-
|
|
960
|
+
d+='</div></div>';
|
|
922
961
|
}
|
|
923
962
|
|
|
924
|
-
/* Spec file section
|
|
963
|
+
/* Spec file section */
|
|
925
964
|
var specs=Object.keys(specCounts).sort();
|
|
926
965
|
if(specs.length>1){
|
|
927
|
-
|
|
966
|
+
d+='<div class="filter-drawer-section"><span class="filter-drawer-section-label">File</span>';
|
|
967
|
+
d+='<div class="filter-chips">';
|
|
928
968
|
for(var i=0;i<specs.length;i++){
|
|
929
969
|
var sp=specs[i];var cnt=specCounts[sp]||0;
|
|
930
970
|
var short=sp.split('/').pop()||sp;
|
|
931
971
|
var cls='filter-chip'+(!!_filterState.specFile[sp]?' active':'')+(cnt===0?' filter-chip--dimmed':'');
|
|
932
|
-
|
|
972
|
+
d+='<button class="'+cls+'" data-dimension="specFile" data-value="'+esc(sp)+'" title="'+esc(sp)+'">'+esc(short)+' <span class="chip-count">'+cnt+'</span></button>';
|
|
933
973
|
}
|
|
934
|
-
|
|
974
|
+
d+='</div></div>';
|
|
935
975
|
}
|
|
936
|
-
h+='</div>';
|
|
937
976
|
|
|
938
|
-
/*
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
h+='<span class="filter-indicator" id="filter-indicator" style="display:'+(hasAny?'inline':'none')+'">';
|
|
945
|
-
h+='Showing <span id="filter-shown">0</span> of <span id="filter-total">'+_totalTests+'</span> tests</span>';
|
|
946
|
-
h+='</div>';
|
|
977
|
+
/* Actions (Clear all + indicator) */
|
|
978
|
+
d+='<div class="filter-drawer-actions">';
|
|
979
|
+
d+='<button class="filter-clear" id="filter-clear" style="display:'+(hasAny?'inline-block':'none')+'">Clear all</button>';
|
|
980
|
+
d+='<span class="filter-indicator" id="filter-indicator" style="display:'+(hasAny?'inline':'none')+'">';
|
|
981
|
+
d+='Showing <span id="filter-shown">0</span> of <span id="filter-total">'+_totalTests+'</span> tests</span>';
|
|
982
|
+
d+='</div>';
|
|
947
983
|
|
|
948
|
-
|
|
984
|
+
if(drawerBodyEl)drawerBodyEl.innerHTML=d;
|
|
949
985
|
}
|
|
950
986
|
|
|
951
987
|
function initFilters(){
|
|
@@ -990,6 +1026,8 @@ function toggleFilter(dim,val){
|
|
|
990
1026
|
function clearAllFilters(){
|
|
991
1027
|
_filterState={status:{},type:{},specFile:{}};
|
|
992
1028
|
searchQuery='';
|
|
1029
|
+
var si=document.getElementById('search-input');
|
|
1030
|
+
if(si)si.value='';
|
|
993
1031
|
applyFilters();
|
|
994
1032
|
}
|
|
995
1033
|
|
|
@@ -999,7 +1037,7 @@ function applyFilters(){
|
|
|
999
1037
|
var hasStatus=Object.keys(_filterState.status).length>0;
|
|
1000
1038
|
var hasType=Object.keys(_filterState.type).length>0;
|
|
1001
1039
|
var hasSpec=Object.keys(_filterState.specFile).length>0;
|
|
1002
|
-
var hasAny=hasStatus||hasType||hasSpec;
|
|
1040
|
+
var hasAny=hasStatus||hasType||hasSpec||!!searchQuery;
|
|
1003
1041
|
if(hasAny){
|
|
1004
1042
|
var filtered=getFilteredTests();
|
|
1005
1043
|
var byStatus={passed:0,failed:0,flaky:0,skipped:0,timedout:0};
|
|
@@ -1050,6 +1088,13 @@ function _updateCard(cls,val){
|
|
|
1050
1088
|
/* Clear all filters */
|
|
1051
1089
|
if(target.closest('.filter-clear')){clearAllFilters();return;}
|
|
1052
1090
|
|
|
1091
|
+
/* Filter icon \u2192 open filter drawer */
|
|
1092
|
+
if(target.closest('.filter-icon-btn')){openFilterDrawer();return;}
|
|
1093
|
+
|
|
1094
|
+
/* Filter drawer close */
|
|
1095
|
+
if(target.closest('#filter-drawer-close')){closeFilterDrawer();return;}
|
|
1096
|
+
if(target.closest('#filter-drawer-backdrop')){closeFilterDrawer();return;}
|
|
1097
|
+
|
|
1053
1098
|
/* Step header \u2192 expand/collapse */
|
|
1054
1099
|
var stepH=target.closest('[data-step]');
|
|
1055
1100
|
if(stepH){var sd=document.getElementById('step-detail-'+stepH.getAttribute('data-step'));if(sd)sd.classList.toggle('show');return;}
|
|
@@ -1152,7 +1197,7 @@ function _updateCard(cls,val){
|
|
|
1152
1197
|
|
|
1153
1198
|
/* Keyboard */
|
|
1154
1199
|
document.addEventListener('keydown',function(e){
|
|
1155
|
-
if(e.key==='Escape'){closeLightbox();closeDrawer();}
|
|
1200
|
+
if(e.key==='Escape'){closeLightbox();closeDrawer();closeFilterDrawer();}
|
|
1156
1201
|
});
|
|
1157
1202
|
|
|
1158
1203
|
/* \u2500\u2500 Theme Management \u2500\u2500 */
|
|
@@ -1178,12 +1223,22 @@ function _updateCard(cls,val){
|
|
|
1178
1223
|
var o=document.querySelector('.lightbox-overlay');if(o)o.remove();
|
|
1179
1224
|
var b=document.querySelector('.lightbox-close');if(b)b.remove();
|
|
1180
1225
|
}
|
|
1226
|
+
|
|
1227
|
+
/* \u2500\u2500 Filter Drawer \u2500\u2500 */
|
|
1228
|
+
function openFilterDrawer(){
|
|
1229
|
+
var d=document.getElementById('filter-drawer');if(d)d.classList.add('open');
|
|
1230
|
+
var b=document.getElementById('filter-drawer-backdrop');if(b)b.classList.add('open');
|
|
1231
|
+
}
|
|
1232
|
+
function closeFilterDrawer(){
|
|
1233
|
+
var d=document.getElementById('filter-drawer');if(d)d.classList.remove('open');
|
|
1234
|
+
var b=document.getElementById('filter-drawer-backdrop');if(b)b.classList.remove('open');
|
|
1235
|
+
}
|
|
1181
1236
|
`;var ct=`
|
|
1182
1237
|
(function(){
|
|
1183
1238
|
var data=JSON.parse(document.getElementById('report-data').textContent);
|
|
1184
|
-
${
|
|
1185
|
-
${B}
|
|
1239
|
+
${N}
|
|
1186
1240
|
${D}
|
|
1241
|
+
${q}
|
|
1187
1242
|
${z}
|
|
1188
1243
|
applyTheme();
|
|
1189
1244
|
renderRunMeta();
|
|
@@ -1191,25 +1246,25 @@ function _updateCard(cls,val){
|
|
|
1191
1246
|
initFilters();
|
|
1192
1247
|
renderFilterBar();
|
|
1193
1248
|
renderTestGrid();
|
|
1194
|
-
})();`;function H(e){let t=e.replace(/<\//g,"<\\/");return `<!-- TestRelic Analytics Report \u2014 self-contained, no external dependencies -->
|
|
1249
|
+
})();`;function H(e){let t=e.replace(/<\//g,"<\\/");return `<!-- TestRelic AI Analytics Report \u2014 self-contained, no external dependencies -->
|
|
1195
1250
|
<!DOCTYPE html>
|
|
1196
1251
|
<html lang="en" data-theme="">
|
|
1197
1252
|
<head>
|
|
1198
1253
|
<meta charset="UTF-8">
|
|
1199
1254
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
1200
1255
|
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; script-src 'unsafe-inline'; img-src data: blob: 'self'; media-src blob: 'self';">
|
|
1201
|
-
<title>TestRelic Analytics Report</title>
|
|
1256
|
+
<title>TestRelic AI Analytics Report</title>
|
|
1202
1257
|
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml;base64,${Buffer.from(_).toString("base64")}">
|
|
1203
|
-
<style>${
|
|
1258
|
+
<style>${M}</style>
|
|
1204
1259
|
<script>(function(){var p=localStorage.getItem('tr-theme')||'system';var t=p==='system'?(window.matchMedia('(prefers-color-scheme:light)').matches?'light':'dark'):p;document.documentElement.setAttribute('data-theme',t);})()</script>
|
|
1205
1260
|
</head>
|
|
1206
1261
|
<body>
|
|
1207
1262
|
<div class="wrap">
|
|
1208
1263
|
<div class="top-bar">
|
|
1209
1264
|
<div class="brand">
|
|
1210
|
-
${
|
|
1265
|
+
${B}
|
|
1211
1266
|
<div class="brand-text">
|
|
1212
|
-
<span class="brand-title">TestRelic</span>
|
|
1267
|
+
<span class="brand-title">TestRelic AI</span>
|
|
1213
1268
|
<span class="brand-sub">Analytics Report</span>
|
|
1214
1269
|
</div>
|
|
1215
1270
|
</div>
|
|
@@ -1219,7 +1274,7 @@ function _updateCard(cls,val){
|
|
|
1219
1274
|
<button class="theme-btn" data-theme-val="light" title="Light"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="5"/><path d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"/></svg></button>
|
|
1220
1275
|
<button class="theme-btn" data-theme-val="dark" title="Dark"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg></button>
|
|
1221
1276
|
</div>
|
|
1222
|
-
<a class="cta-btn" href="https://testrelic.
|
|
1277
|
+
<a class="cta-btn" href="https://testrelic.ai" target="_blank" rel="noopener noreferrer"><svg class="cta-icon" viewBox="0 0 16 16" fill="none"><path d="M8 1l1.545 4.955L14.5 7.5l-4.955 1.545L8 14l-1.545-4.955L1.5 7.5l4.955-1.545L8 1z" fill="currentColor"/></svg>Advanced Insights with AI<span class="cta-sep">\u2013</span><strong>Get Started</strong><svg class="cta-arrow" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M2.5 6h7M6.5 3l3 3-3 3"/></svg></a>
|
|
1223
1278
|
</div>
|
|
1224
1279
|
<div id="summary-strip" class="summary-strip"></div>
|
|
1225
1280
|
<div id="filter-bar" class="filter-bar"></div>
|
|
@@ -1233,12 +1288,20 @@ function _updateCard(cls,val){
|
|
|
1233
1288
|
</div>
|
|
1234
1289
|
<div class="drawer-body" id="drawer-body"></div>
|
|
1235
1290
|
</aside>
|
|
1291
|
+
<div class="filter-drawer-backdrop" id="filter-drawer-backdrop"></div>
|
|
1292
|
+
<aside class="filter-drawer" id="filter-drawer">
|
|
1293
|
+
<div class="filter-drawer-bar">
|
|
1294
|
+
<span class="filter-drawer-title">Filters</span>
|
|
1295
|
+
<button class="filter-drawer-close" id="filter-drawer-close">×</button>
|
|
1296
|
+
</div>
|
|
1297
|
+
<div class="filter-drawer-body" id="filter-drawer-body"></div>
|
|
1298
|
+
</aside>
|
|
1236
1299
|
<script id="report-data" type="application/json">${t}</script>
|
|
1237
1300
|
<script>${ct}</script>
|
|
1238
1301
|
</body>
|
|
1239
|
-
</html>`}function P(e){try{let t=process.platform,
|
|
1240
|
-
`);});}catch{}}function vt(e){let t=JSON.stringify(e);return H(t)}function O(e,t){try{let
|
|
1241
|
-
`);}}function xt(e){let t=e.replace(/[^a-zA-Z0-9\-_ ]/g,"-").replace(/\s+/g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"");return t.length>100&&(t=t.substring(0,100).replace(/-+$/,"")),t||"unnamed-test"}function G(e,t,a
|
|
1242
|
-
`);}}};var J=false;function ve(e,t,
|
|
1243
|
-
`));return}let
|
|
1302
|
+
</html>`}function P(e){try{let t=process.platform,r;t==="darwin"?r=`open "${e}"`:t==="win32"?r=`start "" "${e}"`:r=`xdg-open "${e}"`,exec(r,a=>{a&&process.stderr.write(`[testrelic] Failed to open browser: ${a.message}
|
|
1303
|
+
`);});}catch{}}function vt(e){let t=JSON.stringify(e);return H(t)}function O(e,t){try{let r=vt(e),a=t.htmlReportPath,s=dirname(a);mkdirSync(s,{recursive:!0});let i=a+".tmp";if(writeFileSync(i,r,"utf-8"),renameSync(i,a),t.openReport&&e.ci===null){let o=resolve(a);P(o);}}catch(r){process.stderr.write(`[testrelic] Failed to write HTML report: ${r instanceof Error?r.message:String(r)}
|
|
1304
|
+
`);}}function xt(e){let t=e.replace(/[^a-zA-Z0-9\-_ ]/g,"-").replace(/\s+/g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"");return t.length>100&&(t=t.substring(0,100).replace(/-+$/,"")),t||"unnamed-test"}function G(e,t,r,a){let s=e.find(c=>c.name==="screenshot"&&c.path),i=e.find(c=>c.name==="video"&&c.path);if(!s&&!i)return null;let o=xt(t);r>0&&(o+=`--retry-${r}`);let d=join(a,"artifacts",o),n={};try{mkdirSync(d,{recursive:!0});}catch{return null}if(s?.path)try{if(existsSync(s.path)){let p=`screenshot${extname(s.path)||".png"}`;copyFileSync(s.path,join(d,p)),n.screenshot=`artifacts/${o}/${p}`;}}catch{}if(i?.path)try{if(existsSync(i.path)){let p=`video${extname(i.path)||".webm"}`;copyFileSync(i.path,join(d,p)),n.video=`artifacts/${o}/${p}`;}}catch{}return !n.screenshot&&!n.video?null:n}function w(e){switch(e){case "passed":return "passed";case "failed":return "failed";case "timedOut":return "timedout";case "skipped":return "skipped";case "interrupted":return "failed";default:return "failed"}}function Rt(e,t,r){let a=`${e}::${t}::${r}`;return createHash("sha256").update(a).digest("hex").substring(0,16)}function Lt(e){return e.length<=4?"":e[e.length-2]}function At(e){let t=e.findIndex(r=>r.status==="passed");return t>0?`passed on retry ${t}`:null}function It(e,t){let r=["e2e","api","unit"];for(let a of r)if(e.some(s=>s===`@${a}`||s===a))return a;for(let a of r)if(t.includes(`/${a}/`))return a;return "unknown"}var h=class{constructor(t){this.rootDir="";this.startedAt="";this.testRunId="";this.collectedTests=[];this.config=A(t);}onBegin(t,r){try{this.rootDir=t.rootDir,this.startedAt=new Date().toISOString(),this.testRunId=this.config.testRunId??randomUUID();}catch{}}onTestEnd(t,r){try{let a=r,s=t.outcome(),i;s==="flaky"?i="flaky":s==="skipped"?i="skipped":i=w(a.status);let o=a.startTime.toISOString(),d=new Date(a.startTime.getTime()+a.duration).toISOString(),n=t.tags?[...t.tags]:t.annotations.filter(l=>l.type==="tag").map(l=>l.description??""),c=t.annotations.filter(l=>l.type==="lambdatest-navigation"&&l.description).map(l=>{try{return JSON.parse(l.description)}catch{return null}}).filter(l=>l!==null),p=null,k=t.annotations.find(l=>l.type==="__testrelic_network_requests"&&l.description);if(k)try{p=JSON.parse(k.description);}catch{}let C=null;if(i==="failed"||i==="flaky"){let u=(i==="flaky"?t.results.find(f=>f.status!=="passed")?.errors??[]:a.errors)[0];if(u){let f=F(this.config.redactPatterns),m=u.location?.line??null,b=null;this.config.includeCodeSnippets&&m!==null&&u.location?.file&&(b=I(u.location.file,m,this.config.codeContextLines),b&&(b=f(b))),C={message:f(u.message??"Unknown error"),line:m,code:b,stack:this.config.includeStackTrace&&u.stack?f(u.stack):null};}}let g=t.titlePath().filter(Boolean),S=relative(this.rootDir||".",t.location.file),T=Lt(g),R=g.join(" > "),v=S,Z=Rt(v,T,R),K=It(n,v),Q=s==="flaky",X=At(t.results),W=w(t.expectedStatus),Y=w(a.status),L=null;if(this.config.includeArtifacts&&i!=="skipped"&&a.attachments){let l=dirname(this.config.outputPath),u=g[g.length-1]??t.title;L=G(a.attachments,u,a.retry,l);}this.collectedTests.push({titlePath:g,title:R,status:i,duration:a.duration,startedAt:o,completedAt:d,retryCount:t.results.length-1,tags:n,failure:C,specFile:S,navigations:c,testId:Z,filePath:v,suiteName:T,testType:K,isFlaky:Q,retryStatus:X,expectedStatus:W,actualStatus:Y,artifacts:L,networkRequests:p});}catch{}}onEnd(t){try{let r=new Date().toISOString(),a=new Date(this.startedAt).getTime(),i=new Date(r).getTime()-a,o=this.buildTimeline(),d=this.buildSummary(),n={schemaVersion:x,testRunId:this.testRunId,startedAt:this.startedAt,completedAt:r,totalDuration:i,summary:d,ci:E(),metadata:this.config.metadata,timeline:o,shardRunIds:null};this.writeReport(n),O(n,this.config);}catch{}}printsToStdio(){return false}buildTimeline(){let t=[];for(let r of this.collectedTests){if(r.navigations.length===0){t.push({url:"about:blank",navigationType:"dummy",visitedAt:r.startedAt,duration:r.duration,specFile:r.specFile,domContentLoadedAt:null,networkIdleAt:null,networkStats:null,tests:[this.toTestResult(r)]});continue}for(let a=0;a<r.navigations.length;a++){let s=r.navigations[a],i=r.navigations[a+1];if(this.config.navigationTypes!==null&&!this.config.navigationTypes.includes(s.navigationType))continue;let o=new Date(s.timestamp).getTime(),n=(i?new Date(i.timestamp).getTime():new Date(r.completedAt).getTime())-o;t.push({url:s.url,navigationType:s.navigationType,visitedAt:s.timestamp,duration:Math.max(0,n),specFile:r.specFile,domContentLoadedAt:s.domContentLoadedAt??null,networkIdleAt:s.networkIdleAt??null,networkStats:s.networkStats??null,tests:[this.toTestResult(r)]});}}return t.sort((r,a)=>new Date(r.visitedAt).getTime()-new Date(a.visitedAt).getTime()),t}buildSummary(){let t=0,r=0,a=0,s=0,i=0;for(let o of this.collectedTests)switch(o.status){case "passed":t++;break;case "failed":r++;break;case "flaky":a++;break;case "skipped":s++;break;case "timedout":i++;break}return {total:this.collectedTests.length,passed:t,failed:r,flaky:a,skipped:s,timedout:i}}toTestResult(t){return {title:t.title,status:t.status,duration:t.duration,startedAt:t.startedAt,completedAt:t.completedAt,retryCount:t.retryCount,tags:t.tags,failure:t.failure,testId:t.testId,filePath:t.filePath,suiteName:t.suiteName,testType:t.testType,isFlaky:t.isFlaky,retryStatus:t.retryStatus,expectedStatus:t.expectedStatus,actualStatus:t.actualStatus,artifacts:t.artifacts,networkRequests:t.networkRequests}}writeReport(t){try{let r=JSON.stringify(t,null,2),a=this.config.outputPath,s=dirname(a);mkdirSync(s,{recursive:!0});let i=a+".tmp";writeFileSync(i,r,"utf-8"),renameSync(i,a);}catch(r){process.stderr.write(`[testrelic] Failed to write report: ${r instanceof Error?r.message:String(r)}
|
|
1305
|
+
`);}}};var J=false;function ve(e,t,r="manual_record"){if(!e||!e.annotations){J||(J=true,process.stderr.write(`[testrelic] recordNavigation: reporter not active, navigation not recorded
|
|
1306
|
+
`));return}let a={url:t,navigationType:r,timestamp:new Date().toISOString()};e.annotations.push({type:"lambdatest-navigation",description:JSON.stringify(a)});}export{x as SCHEMA_VERSION,h as default,ve as recordNavigation};//# sourceMappingURL=index.js.map
|
|
1244
1307
|
//# sourceMappingURL=index.js.map
|