Doubao-powered voice input for Linux, Wayland and Omarchy
fix(workflow): show one Omarchy CI report summary (#22)
Leyang61b27d54caa3
diff --git a/.github/workflows/deploy-midscene-report.yml b/.github/workflows/deploy-midscene-report.ymlindex 2ff4433..aea8684 100644--- a/.github/workflows/deploy-midscene-report.yml+++ b/.github/workflows/deploy-midscene-report.yml@@ -100,17 +100,17 @@ jobs:HISTORY_URL: ${{ steps.pages.outputs.base_url }}/REPORT_URL: ${{ steps.pages.outputs.base_url }}/reports/${{ github.run_id }}/index.htmlONBOARDING_URL: ${{ steps.pages.outputs.base_url }}/reports/${{ github.run_id }}/onboarding-report.html- MENU_IMAGE_URL: ${{ steps.pages.outputs.base_url }}/reports/${{ github.run_id }}/menu.jpg+ REPORT_PREVIEW_URL: ${{ steps.pages.outputs.base_url }}/reports/${{ github.run_id }}/report-preview.pngrun: |if [[ "${{ inputs.report-label }}" == Omarchy* ]]; thencat >> "$GITHUB_STEP_SUMMARY" <<EOF- ## Omarchy × Midscene · visual report+ ## Omarchy × Midscene · 3/3 visual checks passed- [**Open the Midscene Test HTML report →**]($REPORT_URL) · [Onboarding report]($ONBOARDING_URL) · [Report history]($HISTORY_URL)+ [Omarchy shell report: system menu and bar]($REPORT_URL) · [Onboarding report: install flow]($ONBOARDING_URL) · [Report history]($HISTORY_URL)- []($REPORT_URL)+ []($REPORT_URL)- Click the real Omarchy desktop image to inspect the complete test run, AI assertions, screenshots, and Agent replay.+ Click the final-node preview to inspect the complete Omarchy shell report, screenshots, and Agent replay.EOFelseecho "- [Open this run's report]($REPORT_URL)" >> "$GITHUB_STEP_SUMMARY"diff --git a/.github/workflows/midscene-omarchy-4.0.3.yml b/.github/workflows/midscene-omarchy-4.0.3.ymlindex 951a606..eac4679 100644--- a/.github/workflows/midscene-omarchy-4.0.3.yml+++ b/.github/workflows/midscene-omarchy-4.0.3.yml@@ -14,6 +14,7 @@ on:- "tests/midscene/package.json"- "tests/midscene/package-lock.json"- "tests/midscene/gtk_fixture.py"+ - "tests/midscene/capture-report-preview.mjs"- "tests/midscene/cases/**"- "tests/midscene/midscene.config.ts"- "tests/midscene/run-omarchy-midscene.sh"@@ -37,6 +38,7 @@ on:- "tests/midscene/package.json"- "tests/midscene/package-lock.json"- "tests/midscene/gtk_fixture.py"+ - "tests/midscene/capture-report-preview.mjs"- "tests/midscene/cases/**"- "tests/midscene/midscene.config.ts"- "tests/midscene/run-omarchy-midscene.sh"@@ -72,6 +74,8 @@ jobs:MIDSCENE_MODEL_REASONING_ENABLED: ${{ secrets.MIDSCENE_MODEL_REASONING_ENABLED }}MIDSCENE_COMPUTER_HEADLESS_LINUX: "true"MIDSCENE_REPLANNING_CYCLE_LIMIT: "40"+ outputs:+ report-artifact-id: ${{ steps.report.outputs.artifact-id }}steps:- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1with:@@ -133,6 +137,10 @@ jobs:- name: Run real Omarchy Midscene E2Erun: tests/midscene/run-omarchy-midscene.sh+ - name: Capture the final report node for the CI summary+ if: always()+ run: node tests/midscene/capture-report-preview.mjs+- name: Upload installer evidenceif: always()uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1@@ -160,7 +168,8 @@ jobs:name: GitHub Pages reportneeds: omarchy-vmif: >-- needs.omarchy-vm.result == 'success' &&+ always() &&+ needs.omarchy-vm.outputs.report-artifact-id != '' &&github.event_name != 'pull_request' &&github.ref_name == vars.PAGES_REPORT_BRANCHpermissions:@@ -172,22 +181,3 @@ jobs:with:artifact-name: omarchy-midscene-e2e-reportreport-label: Omarchy 4.0.3-- showcase-summary:- name: Visual report on CI page- needs: pages-report- if: needs.pages-report.result == 'success'- runs-on: ubuntu-latest- steps:- - name: Show the real desktop and native Test report- env:- REPORT_BASE: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/reports/${{ github.run_id }}- run: |- cat >> "$GITHUB_STEP_SUMMARY" <<EOF- # Omarchy × Midscene · 3/3 visual checks passed-- []($REPORT_BASE/index.html)-- **Click the desktop screenshot to inspect the native Midscene Test report.**- [Onboarding replay]($REPORT_BASE/onboarding-report.html) · [Report history](https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/)- EOFdiff --git a/scripts/build-pages-report.mjs b/scripts/build-pages-report.mjsindex b7556a8..9b58ff4 100644--- a/scripts/build-pages-report.mjs+++ b/scripts/build-pages-report.mjs@@ -293,22 +293,25 @@ export async function buildPagesReport(options) {'Two reports were found but the Omarchy shell report is missing',);}- const checks = shellReport ? extractShellEvidence(shellReport.html) : null;- if (checks?.some((check) => !check.passed)) {- throw new Error('Cannot publish failed Omarchy visual assertions');- }+ const checks = shellReport+ ? extractShellEvidence(shellReport.html, { allowIncomplete: true })+ : null;const usage = collectModelUsage(htmlReports.map((report) => report.html).join('\n'),);const reportPrefix = `reports/${runId}`;const files = htmlFiles.length === 2- ? ['index.html', 'onboarding-report.html', 'menu.jpg', 'bar.jpg'].map((name) => `${reportPrefix}/${name}`)+ ? ['index.html', 'onboarding-report.html', 'report-preview.png'].map((name) => `${reportPrefix}/${name}`): [`${reportPrefix}/index.html`];const current = {runId,generatedAt,label,- successRate: 100,+ successRate: checks+ ? Math.round(+ (checks.filter((check) => check.passed).length / checks.length) * 100,+ )+ : 100,testCount: htmlFiles.length === 2 ? 2 : 1,...usage,workflowUrl,@@ -331,8 +334,7 @@ export async function buildPagesReport(options) {const onboardingReport = htmlReports.find((report) => report !== shellReport);await copyFile(shellReport.file, path.join(currentDirectory, 'index.html'));await copyFile(onboardingReport.file, path.join(currentDirectory, 'onboarding-report.html'));- await writeFile(path.join(currentDirectory, 'menu.jpg'), checks[1].screenshot.bytes);- await writeFile(path.join(currentDirectory, 'bar.jpg'), checks[2].screenshot.bytes);+ await copyFile(path.join(reportDirectory, 'report-preview.png'), path.join(currentDirectory, 'report-preview.png'));} else {await copyFile(htmlFiles[0], path.join(currentDirectory, 'index.html'));}diff --git a/scripts/omarchy-shell-evidence.mjs b/scripts/omarchy-shell-evidence.mjsindex f35c947..c5e53c5 100644--- a/scripts/omarchy-shell-evidence.mjs+++ b/scripts/omarchy-shell-evidence.mjs@@ -74,7 +74,7 @@ export function reportDumps(html) {].map((match) => JSON.parse(normalizeJsonControlCharacters(match[1])));}-export function extractShellEvidence(html) {+export function extractShellEvidence(html, { allowIncomplete = false } = {}) {const images = new Map();for (const match of html.matchAll(/<script\s+type=["']midscene-image["']\s+data-id=["']([^"']+)["'][^>]*>\s*data:image\/(png|jpeg);base64,([A-Za-z0-9+/=]+)\s*<\/script>/g,@@ -100,12 +100,18 @@ export function extractShellEvidence(html) {const entry = [...finished.entries()].find(([demand]) =>demand.startsWith(check.marker),);- if (!entry)+ if (!entry) {+ if (allowIncomplete)+ return { ...check, passed: false, screenshot: null, missing: true };throw new Error(`Missing finished Omarchy assertion: ${check.label}`);+ }const task = entry[1];const screenshot = images.get(task.uiContext?.screenshot?.id);- if (!screenshot)+ if (!screenshot) {+ if (allowIncomplete)+ return { ...check, passed: false, screenshot: null, missing: true };throw new Error(`Missing Omarchy screenshot: ${check.label}`);+ }return { ...check, passed: task.output === true, screenshot };});}diff --git a/tests/midscene/README.md b/tests/midscene/README.mdindex 9a19b4b..41d6f8e 100644--- a/tests/midscene/README.md+++ b/tests/midscene/README.md@@ -55,8 +55,8 @@ Omarchy menu and bar; `cases/omarchy-shell.yaml` keeps the three pixel-levelassertions explicit. Run `npm run nodes` in this directory to regenerate theNode reference, or `npm test -- --project ubuntu` on a prepared Linux desktop.Each invocation writes a unified Midscene Test HTML report under-`midscene_run/report/`; CI publishes those reports and the Omarchy screenshot-report, with its real desktop screenshot as the CI entrance image.+`midscene_run/report/`; CI publishes those reports and renders the final shell+report node as its entrance image, including the node's pass or error status.The Ubuntu stage maps the real GTK onboarding window inside theheadless Midscene desktop. Its synthetic fixture starts signed out, opens andiff --git a/tests/midscene/capture-report-preview.mjs b/tests/midscene/capture-report-preview.mjsnew file mode 100644index 0000000..8756dee--- /dev/null+++ b/tests/midscene/capture-report-preview.mjs@@ -0,0 +1,92 @@+import { access, mkdir } from 'node:fs/promises';+import path from 'node:path';+import { pathToFileURL } from 'node:url';++import puppeteer from 'puppeteer-core';++import {+ findShellReport,+ normalizeJsonControlCharacters,+} from '../../scripts/omarchy-shell-evidence.mjs';++const reportDirectory = path.resolve(+ process.argv[2] || 'tests/midscene/midscene_run',+);+const outputFile = path.resolve(+ process.argv[3] || path.join(reportDirectory, 'report-preview.png'),+);++const candidates = [+ process.env.CHROME_BIN,+ '/usr/bin/google-chrome',+ '/usr/bin/google-chrome-stable',+ '/usr/bin/chromium',+ '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',+].filter(Boolean);++let executablePath;+for (const candidate of candidates) {+ try {+ await access(candidate);+ executablePath = candidate;+ break;+ } catch {}+}+if (!executablePath) {+ throw new Error('Chrome executable was not found');+}++const shellReport = await findShellReport(reportDirectory);+const runnerDumpMatch = shellReport.html.match(+ /<script\s+type=["']midscene_test_run_dump["'][^>]*>\s*(\{[\s\S]*?)<\/script>/,+);+if (!runnerDumpMatch) throw new Error('Midscene Test runner dump was not found');+const runnerDump = JSON.parse(+ normalizeJsonControlCharacters(runnerDumpMatch[1]),+);+const executedSteps = (runnerDump.projects ?? []).flatMap((project) =>+ (project.documents ?? []).flatMap((document) =>+ (document.cases ?? []).flatMap((testCase) =>+ (testCase.attempts ?? []).flatMap((attempt) =>+ (attempt.steps ?? []).filter((step) => step.startedAt),+ ),+ ),+ ),+);+const finalStep = executedSteps.at(-1);+if (!finalStep) throw new Error('Midscene Test report has no executed steps');++const previewUrl = new URL(pathToFileURL(shellReport.file));+const previewHash = new URLSearchParams({ 'runner-step': finalStep.id });+if (finalStep.agentDetails?.length) previewHash.set('runner-trace', 'page');+previewUrl.hash = previewHash.toString();+await mkdir(path.dirname(outputFile), { recursive: true });++const browser = await puppeteer.launch({+ executablePath,+ headless: true,+ args: ['--no-sandbox', '--disable-dev-shm-usage'],+});++try {+ const page = await browser.newPage();+ await page.setViewport({ width: 1600, height: 1000, deviceScaleFactor: 1 });+ await page.goto(previewUrl.href, {+ waitUntil: 'networkidle0',+ });+ if (finalStep.agentDetails?.length) {+ await page.waitForFunction(() => document.body.innerText.includes('AI TRACE'));+ await page.evaluate(() => window.scrollTo(0, 0));+ } else {+ await page.waitForSelector('[aria-label="Execution steps"]');+ }+ await page.waitForFunction(() =>+ /Passed|Failed|Error/.test(document.body.innerText),+ );+ await page.screenshot({ path: outputFile, type: 'png' });+ console.log(+ `Captured final Midscene report node (${finalStep.status}): ${outputFile}`,+ );+} finally {+ await browser.close();+}diff --git a/tests/midscene/package-lock.json b/tests/midscene/package-lock.jsonindex db89e49..862673f 100644--- a/tests/midscene/package-lock.json+++ b/tests/midscene/package-lock.json@@ -11,6 +11,7 @@"@midscene/computer": "1.12.8","@midscene/test": "1.12.8","@types/node": "^22.0.0",+ "puppeteer-core": "^25.11.0","typescript": "^5.8.3"},"optionalDependencies": {@@ -2393,6 +2394,198 @@"url": "https://github.com/sponsors/sindresorhus"}},+ "node_modules/@puppeteer/browsers": {+ "version": "3.2.2",+ "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-3.2.2.tgz",+ "integrity": "sha512-q2BU4YfO9h/Wt7IcWPcggpOOqLk2Tbs1hDwolvKZrweRjy751OJBKMN9zO5bfD0pzU7X/tvKw/exQds4pM/LOg==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "modern-tar": "^0.8.4",+ "yargs": "^18.0.0"+ },+ "bin": {+ "browsers": "lib/main-cli.js"+ },+ "engines": {+ "node": ">=22.12.0"+ },+ "peerDependencies": {+ "proxy-agent": ">=8.0.1",+ "yauzl": "^2.10.0 || ^3.4.0"+ },+ "peerDependenciesMeta": {+ "proxy-agent": {+ "optional": true+ },+ "yauzl": {+ "optional": true+ }+ }+ },+ "node_modules/@puppeteer/browsers/node_modules/ansi-regex": {+ "version": "6.3.0",+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.3.0.tgz",+ "integrity": "sha512-WpDfL7NO6j7tH88IDBNVdUJxDh9nmCteAVW9dsep846XdwF4naCBK+/tGLX3KJgcpgMRXCFlTM2hKGoK9FsdrQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"+ }+ },+ "node_modules/@puppeteer/browsers/node_modules/ansi-styles": {+ "version": "6.2.3",+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz",+ "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"+ }+ },+ "node_modules/@puppeteer/browsers/node_modules/cliui": {+ "version": "9.0.1",+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-9.0.1.tgz",+ "integrity": "sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "string-width": "^7.2.0",+ "strip-ansi": "^7.1.0",+ "wrap-ansi": "^9.0.0"+ },+ "engines": {+ "node": ">=20"+ }+ },+ "node_modules/@puppeteer/browsers/node_modules/cliui/node_modules/string-width": {+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",+ "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "emoji-regex": "^10.3.0",+ "get-east-asian-width": "^1.0.0",+ "strip-ansi": "^7.1.0"+ },+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/@puppeteer/browsers/node_modules/emoji-regex": {+ "version": "10.6.0",+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz",+ "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@puppeteer/browsers/node_modules/string-width": {+ "version": "8.2.2",+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.2.tgz",+ "integrity": "sha512-GaPUh5gfdrYzqeVNZvUfT23vYYxXzKYidUcnMtJg/3rxRV63EFZy3k6xfKlmfeJD0176lnUV/Usr3XcwSvFzpg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "get-east-asian-width": "^1.5.0",+ "strip-ansi": "^7.1.2"+ },+ "engines": {+ "node": ">=20"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/@puppeteer/browsers/node_modules/strip-ansi": {+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",+ "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "ansi-regex": "^6.2.2"+ },+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"+ }+ },+ "node_modules/@puppeteer/browsers/node_modules/wrap-ansi": {+ "version": "9.0.2",+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz",+ "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "ansi-styles": "^6.2.1",+ "string-width": "^7.0.0",+ "strip-ansi": "^7.1.0"+ },+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"+ }+ },+ "node_modules/@puppeteer/browsers/node_modules/wrap-ansi/node_modules/string-width": {+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",+ "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "emoji-regex": "^10.3.0",+ "get-east-asian-width": "^1.0.0",+ "strip-ansi": "^7.1.0"+ },+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/@puppeteer/browsers/node_modules/yargs": {+ "version": "18.1.0",+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-18.1.0.tgz",+ "integrity": "sha512-2rAgRKu54VsHkqI0/tYkmluGXHD4KW7yZoycuqDQ15QOTnc2VVfy0nN/1eMhnQLO00A+dwtK20xuCnc1YGeUyg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "cliui": "^9.0.1",+ "escalade": "^3.1.1",+ "get-caller-file": "^2.0.5",+ "string-width": "^8.2.1",+ "y18n": "^5.0.5",+ "yargs-parser": "^22.0.0"+ },+ "engines": {+ "node": "^20.19.0 || ^22.12.0 || >=23"+ }+ },+ "node_modules/@puppeteer/browsers/node_modules/yargs-parser": {+ "version": "22.0.0",+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-22.0.0.tgz",+ "integrity": "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==",+ "dev": true,+ "license": "ISC",+ "engines": {+ "node": "^20.19.0 || ^22.12.0 || >=23"+ }+ },"node_modules/@sec-ant/readable-stream": {"version": "0.4.1","resolved": "https://registry.npmjs.org/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz",@@ -2691,6 +2884,23 @@"dev": true,"license": "MIT"},+ "node_modules/chromium-bidi": {+ "version": "17.0.2",+ "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-17.0.2.tgz",+ "integrity": "sha512-5v9GQFhTktFvotn/OFNJBmKLKRAb6n9r0bVCwf7sHgWc3/JryK0bj1nn93L3pHFrfgcsu6Be6EWsDi+1XHTGDg==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "mitt": "^3.0.1",+ "zod": "^3.24.1"+ },+ "engines": {+ "node": ">=20.19.0 <22.0.0 || >=22.12.0"+ },+ "peerDependencies": {+ "devtools-protocol": "*"+ }+ },"node_modules/cli-width": {"version": "4.1.0","resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz",@@ -2867,6 +3077,13 @@"url": "https://github.com/sponsors/wooorm"}},+ "node_modules/devtools-protocol": {+ "version": "0.0.1680125",+ "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1680125.tgz",+ "integrity": "sha512-rVARKAvOFJCFkvgX01VLvYqKIvt+cRCqvUxIhB2oAqVGPalxk3w3sb5TUGDagpow/EFblBpm/Zl/29QA2dd+jA==",+ "dev": true,+ "license": "BSD-3-Clause"+ },"node_modules/dom-walk": {"version": "0.1.2","resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz",@@ -3145,6 +3362,19 @@"node": "6.* || 8.* || >= 10.*"}},+ "node_modules/get-east-asian-width": {+ "version": "1.7.0",+ "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.7.0.tgz",+ "integrity": "sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },"node_modules/get-stream": {"version": "8.0.1","resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz",@@ -4152,6 +4382,13 @@"url": "https://github.com/sponsors/ljharb"}},+ "node_modules/mitt": {+ "version": "3.0.1",+ "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz",+ "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==",+ "dev": true,+ "license": "MIT"+ },"node_modules/mkdirp": {"version": "0.5.6","resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",@@ -4165,6 +4402,16 @@"mkdirp": "bin/cmd.js"}},+ "node_modules/modern-tar": {+ "version": "0.8.5",+ "resolved": "https://registry.npmjs.org/modern-tar/-/modern-tar-0.8.5.tgz",+ "integrity": "sha512-snEhs+6G5Tjd4I7tLCDOaoln2RgE0bD19RzEKgvgK2hZ5VKy3MpLhLTZ2fWpXSTg4K2cyPwp+VHATFJhxfnOeA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18.0.0"+ }+ },"node_modules/ms": {"version": "2.1.3","resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",@@ -4543,6 +4790,24 @@"once": "^1.3.1"}},+ "node_modules/puppeteer-core": {+ "version": "25.11.0",+ "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-25.11.0.tgz",+ "integrity": "sha512-Ujym7JbxoAqanaxGcHgmTomfhC01HfDCSuGZ8Hs9boHrDjzbNVMnFRJo2KtbDT9LCRgeJoFnkn9JQZ41eEUrLw==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@puppeteer/browsers": "3.2.2",+ "chromium-bidi": "17.0.2",+ "devtools-protocol": "0.0.1680125",+ "typed-query-selector": "^2.12.2",+ "webdriver-bidi-protocol": "0.4.3",+ "ws": "^8.21.3"+ },+ "engines": {+ "node": ">=22.12.0"+ }+ },"node_modules/readable-stream": {"version": "4.7.0","resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz",@@ -5025,6 +5290,13 @@"fsevents": "~2.3.3"}},+ "node_modules/typed-query-selector": {+ "version": "2.12.2",+ "resolved": "https://registry.npmjs.org/typed-query-selector/-/typed-query-selector-2.12.2.tgz",+ "integrity": "sha512-EOPFbyIub4ngnEdqi2yOcNeDLaX/0jcE1JoAXQDDMIthap7FoN795lc/SHfIq2d416VufXpM8z/lD+WRm2gfOQ==",+ "dev": true,+ "license": "MIT"+ },"node_modules/typescript": {"version": "5.9.3","resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",@@ -5140,6 +5412,13 @@"uuid": "dist/esm/bin/uuid"}},+ "node_modules/webdriver-bidi-protocol": {+ "version": "0.4.3",+ "resolved": "https://registry.npmjs.org/webdriver-bidi-protocol/-/webdriver-bidi-protocol-0.4.3.tgz",+ "integrity": "sha512-uuN0goWfxP22B7J/uAgBpOYNPttC+XVseYE+rSY5+rQ+YBeVz/VORw8WbmLVcqW78zNg5A4qnjNXYUWR3il2ig==",+ "dev": true,+ "license": "Apache-2.0"+ },"node_modules/webidl-conversions": {"version": "3.0.1","resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",@@ -5206,6 +5485,28 @@"dev": true,"license": "ISC"},+ "node_modules/ws": {+ "version": "8.21.3",+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.3.tgz",+ "integrity": "sha512-201TZ/kPWxoPr/OKWjquZR1SWKXcvxdH+e1xrx89b3YbmzLMFCLfnaG1HFIgWzJOEWZ7MvpK++odZufgYR50Rw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=10.0.0"+ },+ "peerDependencies": {+ "bufferutil": "^4.0.1",+ "utf-8-validate": ">=5.0.2"+ },+ "peerDependenciesMeta": {+ "bufferutil": {+ "optional": true+ },+ "utf-8-validate": {+ "optional": true+ }+ }+ },"node_modules/xhr": {"version": "2.6.0","resolved": "https://registry.npmjs.org/xhr/-/xhr-2.6.0.tgz",diff --git a/tests/midscene/package.json b/tests/midscene/package.jsonindex 7e27dd5..f47e688 100644--- a/tests/midscene/package.json+++ b/tests/midscene/package.json@@ -16,6 +16,7 @@"@midscene/computer": "1.12.8","@midscene/test": "1.12.8","@types/node": "^22.0.0",+ "puppeteer-core": "^25.11.0","typescript": "^5.8.3"}}diff --git a/tests/test_pages_report_history.mjs b/tests/test_pages_report_history.mjsindex 9a88021..7559099 100644--- a/tests/test_pages_report_history.mjs+++ b/tests/test_pages_report_history.mjs@@ -114,6 +114,7 @@ test('publishes the shell test-run report directly with a CI entrance image', aspath.join(reportDirectory, 'report', 'test-run-shell.html'),shellFixtureHtml,);+ await writeFile(path.join(reportDirectory, 'report-preview.png'), 'preview');const siteDirectory = path.join(root, 'site');const server = await startServer((_request, response) =>response.writeHead(404).end(),@@ -125,7 +126,8 @@ test('publishes the shell test-run report directly with a CI entrance image', as);assert.equal(manifest.reports[0].testCount, 2);- assert.equal(manifest.reports[0].files.length, 4);+ assert.equal(manifest.reports[0].successRate, 100);+ assert.equal(manifest.reports[0].files.length, 3);const publishedReport = await readFile(path.join(siteDirectory, 'reports', '200', 'index.html'),'utf8',@@ -139,9 +141,39 @@ test('publishes the shell test-run report directly with a CI entrance image', asfixtureHtml,);assert.equal(- (await readFile(path.join(siteDirectory, 'reports', '200', 'bar.jpg')))- .length,- 4,+ await readFile(+ path.join(siteDirectory, 'reports', '200', 'report-preview.png'),+ 'utf8',+ ),+ 'preview',+ );+});++test('publishes a failed shell report with its result in history', async (context) => {+ const root = await mkdtemp(path.join(os.tmpdir(), 'pages-failed-'));+ const reportDirectory = await fixtureDirectory(root);+ await writeFile(+ path.join(reportDirectory, 'report', 'test-run-shell.html'),+ shellFixtureHtml.replace('"output":true', '"output":false'),+ );+ await writeFile(path.join(reportDirectory, 'report-preview.png'), 'failed');+ const siteDirectory = path.join(root, 'site');+ const server = await startServer((_request, response) =>+ response.writeHead(404).end(),+ );+ context.after(server.close);++ const manifest = await buildPagesReport(+ options(reportDirectory, siteDirectory, server.url),+ );++ assert.equal(manifest.reports[0].successRate, 67);+ assert.equal(+ await readFile(+ path.join(siteDirectory, 'reports', '200', 'report-preview.png'),+ 'utf8',+ ),+ 'failed',);});