forked from github/copilot-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsmoke-chat-direct.js
More file actions
74 lines (61 loc) · 1.76 KB
/
smoke-chat-direct.js
File metadata and controls
74 lines (61 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/env node
const { spawn } = require('child_process');
const path = require('path');
const testScript = path.join(__dirname, 'test-ui-automation.js');
const startScript = path.join(__dirname, 'start.js');
function runNode(args, name) {
return new Promise((resolve) => {
const child = spawn(process.execPath, [testScript, ...args], { stdio: 'inherit', shell: false });
child.on('exit', (code) => {
if (code === 0) {
console.log(`✅ ${name}`);
resolve(true);
} else {
console.error(`❌ ${name} (exit ${code})`);
resolve(false);
}
});
});
}
async function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
async function main() {
console.log('========================================');
console.log(' Direct Chat Smoke Test (No Keyboard)');
console.log('========================================');
const env = {
...process.env,
LIKU_ENABLE_DEBUG_IPC: '1',
LIKU_SMOKE_DIRECT_CHAT: '1',
};
const app = spawn(process.execPath, [startScript], {
stdio: 'inherit',
env,
shell: false,
});
try {
await sleep(3000);
const overlayOk = await runNode(
['windows', 'Overlay', '--process=electron', '--require-match=true'],
'Overlay visible'
);
const chatVisibleOk = await runNode(
['windows', '--process=electron', '--include-untitled=true', '--min-count=2'],
'Chat became visible via direct toggle'
);
if (!overlayOk || !chatVisibleOk) {
process.exitCode = 1;
return;
}
console.log('\n✅ Direct chat smoke test passed.');
} finally {
if (!app.killed) {
app.kill();
}
}
}
main().catch((err) => {
console.error('Direct smoke test failed:', err.message);
process.exit(1);
});