Some checks failed
CI Pipeline / Code Quality & Typecheck (push) Waiting to run
CI Pipeline / Test Suite (macos-latest) (push) Blocked by required conditions
CI Pipeline / Test Suite (ubuntu-latest) (push) Blocked by required conditions
CI Pipeline / Test Suite (windows-latest) (push) Blocked by required conditions
CI Pipeline / Build Validation (admin) (push) Blocked by required conditions
CI Pipeline / Build Validation (desktop) (push) Blocked by required conditions
Deploy Landing Page / deploy (push) Blocked by required conditions
Deploy Landing Page / build (push) Waiting to run
Release & Packaging Pipeline / Build & Publish Admin Docker Image (push) Failing after 8s
Release & Code Signing CA Pipeline / build-and-sign-windows (push) Failing after 1m51s
Build macOS / Build & Package (macOS) (push) Failing after 4s
Build macOS / Build & Package (macOS)-1 (push) Failing after 5s
Release & Code Signing CA Pipeline / build-and-sign-macos (push) Failing after 3s
Release & Packaging Pipeline / Package macOS Desktop App (push) Failing after 4s
Release & Packaging Pipeline / Package Windows Desktop App (push) Failing after 2m28s
Release & Packaging Pipeline / Publish Official GitHub Release (push) Has been skipped
44 lines
1.6 KiB
JavaScript
44 lines
1.6 KiB
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const e2eDir = 'tests/e2e';
|
|
const files = fs.readdirSync(e2eDir).filter(f => f.endsWith('.spec.ts'));
|
|
|
|
files.forEach(file => {
|
|
if (file === 'onboarding.spec.ts') return;
|
|
const p = path.join(e2eDir, file);
|
|
let content = fs.readFileSync(p, 'utf8');
|
|
|
|
// Remove the previous config.json injection logic
|
|
content = content.replace(/\/\/ Pre-fill d3ro-voice-config\.json to bypass onboarding[\s\S]*?(?=electronApp = await electron\.launch)/g, '');
|
|
|
|
// Extract the original window waiting logic and append the IPC bypass
|
|
// We can just find the end of `if (!found) { ... }` block
|
|
|
|
const targetStr = ` });
|
|
}`;
|
|
|
|
const injectStr = ` });
|
|
}
|
|
|
|
// Bypass onboarding via IPC config set
|
|
await window.evaluate(async () => {
|
|
if (window.electronAPI && window.electronAPI.config) {
|
|
await window.electronAPI.config.set({ key: 'onboardingCompleted', value: true });
|
|
await window.electronAPI.config.set({ key: 'appUsageMode', value: 'online' });
|
|
await window.electronAPI.config.set({ key: 'llmBackend', value: 'online' });
|
|
}
|
|
});
|
|
// Wait for the config to propagate then reload the page
|
|
await window.waitForTimeout(500);
|
|
await window.reload();
|
|
await window.waitForLoadState('domcontentloaded');
|
|
// Wait for React to mount AppLayout
|
|
await window.waitForTimeout(1000);`;
|
|
|
|
if (content.includes(targetStr) && !content.includes('// Bypass onboarding via IPC config set')) {
|
|
content = content.replace(targetStr, injectStr);
|
|
}
|
|
|
|
fs.writeFileSync(p, content);
|
|
});
|