فینورا پرو - سامانه جامع حسابداری و صدور فاکتور

test(A07): run independent route coverage after native financial flows and attach screenshot evidence

davoodmehraban89 committed Oct 16, 2026 at 18:56 UTC 5e7efc96c919631b3c6981dbeae149b33dc9a99b
1 file changed +6 -4
tests/windows-vm-installed-tauri-cdp.cjs
+6 -4
@@ -7,6 +7,7 @@ const fs = require('node:fs');
7 const path = require('node:path');
8 const { spawn, execFileSync } = require('node:child_process');
9 const verifyNativeFunctionalMatrix = require('./windows-vm-native-functional-matrix.cjs');
10 +const verifyNativeRoutes = require('./windows-vm-native-routes.cjs');
11
12 const [exe, profile, mode, expectedVersion, reportPath] = process.argv.slice(2);
13 assert.equal(process.platform, 'win32');
@@ -80,16 +81,16 @@ async function connect(url) {
81 if (reply.error) current.reject(Error(JSON.stringify(reply.error)));
82 else current.resolve(reply.result);
83 });
83 - const command = (method, params = {}) => new Promise((resolve, reject) => {
84 + const command = (method, params = {}, timeoutMs = 12000) => new Promise((resolve, reject) => {
85 const next = ++id;
85 - const timer = setTimeout(() => { pending.delete(next); reject(Error('CDP ' + method + ' timed out')); }, 12000);
86 + const timer = setTimeout(() => { pending.delete(next); reject(Error('CDP ' + method + ' timed out')); }, timeoutMs);
87 pending.set(next, { resolve, reject, timer });
88 ws.send(JSON.stringify({ id: next, method, params }));
89 });
89 - const evaluate = async expression => {
90 + const evaluate = async (expression, timeoutMs = 12000) => {
91 const r = await command('Runtime.evaluate', {
92 expression, awaitPromise: true, returnByValue: true
92 - });
93 + }, timeoutMs);
94 if (r.exceptionDetails) throw Error('Native UI exception: ' + r.exceptionDetails.text);
95 if (r.result?.subtype === 'error') throw Error('Native UI rejected JavaScript evaluation');
96 return r.result?.value;
@@ -293,6 +294,7 @@ async function connect(url) {
294 // The real installed desktop window, not the browser-only preview:
295 // verify accounting activation, financial journal, stock, backup and RTL.
296 report.nativeFunctional = await verifyNativeFunctionalMatrix(cdp);
297 + report.nativeRoutes = await verifyNativeRoutes(cdp, expectedVersion, reportPath);
298 }
299 report.status = 'PASSED';
300 console.log(JSON.stringify(report, null, 2));