const fs = require('fs'); const path = require('path'); const files = fs.readdirSync('tests/e2e').filter(f => f.endsWith('.spec.ts') && f !== 'onboarding.spec.ts'); files.forEach(file => { const p = path.join('tests/e2e', file); let content = fs.readFileSync(p, 'utf8'); content = content.replace( /\/\/ Bypass onboarding by filling it if visible[\s\S]*?\} catch\(e\) \{\n \/\/ Ignore if not found\n \}/g, `// Bypass onboarding by filling it if visible try { const emailInput = window.locator('input[type="email"]'); await emailInput.waitFor({ state: 'visible', timeout: 3000 }); // Mock the login API to always succeed await window.evaluate(() => { if (window.electronAPI && window.electronAPI.onlineAuth) { window.electronAPI.onlineAuth.login = async () => ({ success: true, data: { user: { email: 't@t.com' }, token: 'm' } }); } }); await emailInput.fill('test@test.com'); await window.locator('input[type="password"]').fill('password'); await window.locator('button', { hasText: '로그인 완료' }).click(); const startBtn = window.locator('button', { hasText: '앱 시작하기' }); await startBtn.waitFor({ state: 'visible', timeout: 3000 }); await startBtn.click(); // Wait for the modal to disappear await startBtn.waitFor({ state: 'hidden', timeout: 3000 }); } catch(e) { // Ignore if not found }` ); fs.writeFileSync(p, content); });