|
1 | 1 | import assert from 'node:assert/strict'; |
| 2 | +import { execFileSync } from 'node:child_process'; |
2 | 3 | import { mkdir, mkdtemp, readFile, writeFile } from 'node:fs/promises'; |
3 | 4 | import http from 'node:http'; |
4 | 5 | import os from 'node:os'; |
@@ -99,6 +100,43 @@ test('records every shard and renders the Summary before Pages deployment', asyn |
99 | 100 | ); |
100 | 101 | }); |
101 | 102 |
|
| 103 | +test('plugin smoke keeps its visual assertion as a reportable Midscene step', async () => { |
| 104 | + const source = await readFile( |
| 105 | + new URL('../e2e/cases/omarchy-plugin-smoke.yaml', import.meta.url), |
| 106 | + 'utf8', |
| 107 | + ); |
| 108 | + const renderer = await readFile( |
| 109 | + new URL('../e2e/render-omarchy-plugin-smoke.mjs', import.meta.url), |
| 110 | + 'utf8', |
| 111 | + ); |
| 112 | + const runner = await readFile( |
| 113 | + new URL('../e2e/run-omarchy-midscene.sh', import.meta.url), |
| 114 | + 'utf8', |
| 115 | + ); |
| 116 | + assert.match(source, /- review\.openConfigured: \{\}[\s\S]*- aiAssert: __REVIEW_VISIBLE_ASSERTION__/); |
| 117 | + assert.doesNotMatch(source, /review\.assertConfiguredVisual/); |
| 118 | + assert.match( |
| 119 | + runner, |
| 120 | + /omarchy-plugin-smoke\)\s+node tests\/e2e\/render-omarchy-plugin-smoke\.mjs\s+npm --prefix tests\/e2e test/, |
| 121 | + ); |
| 122 | + |
| 123 | + const root = await mkdtemp(path.join(os.tmpdir(), 'plugin-smoke-render-')); |
| 124 | + await mkdir(path.join(root, 'cases')); |
| 125 | + await writeFile(path.join(root, 'render-omarchy-plugin-smoke.mjs'), renderer); |
| 126 | + await writeFile(path.join(root, 'cases/omarchy-plugin-smoke.yaml'), source); |
| 127 | + const assertion = 'The Todos popup says "ready": #1\nNo text was delivered.'; |
| 128 | + execFileSync(process.execPath, [path.join(root, 'render-omarchy-plugin-smoke.mjs')], { |
| 129 | + env: { ...process.env, REVIEW_VISIBLE_ASSERTION: assertion }, |
| 130 | + }); |
| 131 | + const rendered = await readFile( |
| 132 | + path.join(root, 'cases/omarchy-plugin-smoke.yaml'), |
| 133 | + 'utf8', |
| 134 | + ); |
| 135 | + assert.match(rendered, /- review\.openConfigured: \{\}/); |
| 136 | + assert.ok(rendered.includes(`- aiAssert: ${JSON.stringify(assertion)}`)); |
| 137 | + assert.doesNotMatch(rendered, /__REVIEW_VISIBLE_ASSERTION__/); |
| 138 | +}); |
| 139 | + |
102 | 140 | test('rerun aggregation excludes the previous combined report artifact', async () => { |
103 | 141 | const source = await readFile( |
104 | 142 | new URL('../../.github/workflows/midscene-omarchy-4.0.3.yml', import.meta.url), |
|
0 commit comments