test(desktop): add automated Playwright Electron real-app E2E verification suites
This commit is contained in:
parent
63b97c4761
commit
9b2b83b2ab
3 changed files with 158 additions and 0 deletions
58
scripts/e2e-desktop-settings.js
Normal file
58
scripts/e2e-desktop-settings.js
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
const { _electron: electron } = require('playwright');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
async function runSettingsUpdaterE2E() {
|
||||
console.log('=== STARTING SETTINGS & UPDATER E2E TEST ===');
|
||||
|
||||
const electronPath = require('electron');
|
||||
const outDir = 'C:/Users/encep/.gemini/antigravity-cli/brain/3ab7ae82-5634-41d5-93a7-3c12c22503e2/screenshots/live_production_verified';
|
||||
|
||||
const app = await electron.launch({
|
||||
executablePath: electronPath,
|
||||
args: ['.'],
|
||||
cwd: path.resolve('apps/desktop'),
|
||||
env: Object.assign({}, process.env, { NODE_ENV: 'production', ELECTRON_ENABLE_LOGGING: '1' })
|
||||
});
|
||||
|
||||
console.log('Electron Process Launched! PID:', String(app.process().pid));
|
||||
const window = await app.firstWindow({timeout: 30000});
|
||||
|
||||
await window.waitForLoadState('domcontentloaded');
|
||||
await window.waitForTimeout(3000);
|
||||
|
||||
// Click Settings (설정)
|
||||
console.log('Navigating to Settings tab...');
|
||||
const settingsBtn = await window.$('text=설정');
|
||||
if (settingsBtn) {
|
||||
await settingsBtn.click();
|
||||
await window.waitForTimeout(1500);
|
||||
console.log('Clicked Settings tab!');
|
||||
}
|
||||
|
||||
|
||||
const shotSettings = path.join(outDir, '10_electron_settings_updater.png');
|
||||
await window.screenshot({path: shotSettings});
|
||||
console.log('Saved Settings Screenshot:', shotSettings);
|
||||
|
||||
// Click History (히스Ī<EC8AA4>림)
|
||||
console.log('Navigating to History tab...');
|
||||
const historyBtn = await window.$('text=히스토리');
|
||||
if (historyBtn) {
|
||||
await historyBtn.click();
|
||||
await window.waitForTimeout(1500);
|
||||
console.log('Clicked History tab!');
|
||||
}
|
||||
|
||||
const shotHistory = path.join(outDir, '11_electron_history_voice_logs.png');
|
||||
await window.screenshot({path: shotHistory});
|
||||
console.log('Saved History Screenshot:', shotHistory);
|
||||
|
||||
await app.close();
|
||||
console.log('=== SETTINGS & UPDATER E2E TEST COMPLETED ===');
|
||||
}
|
||||
|
||||
runSettingsUpdaterE2E().then(() => process.exit(0)).catch(err => {
|
||||
console.error('TEST ERROR:', err);
|
||||
process.exit(1);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue