-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-probe.ts
More file actions
executable file
·36 lines (34 loc) · 1.21 KB
/
Copy pathtest-probe.ts
File metadata and controls
executable file
·36 lines (34 loc) · 1.21 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
import { probeApp } from './src/lib/interaction-probe'
// HTML with a real bug — button click calls undefined function
const htmlWithBug = `<!DOCTYPE html>
<html lang="en">
<head><style>body{background:#0f172a;color:#e2e8f0;font-family:sans-serif;padding:20px}</style></head>
<body>
<main>
<h1>Test App</h1>
<button id="btn1" aria-label="Click me">Click Me</button>
<button id="btn2" aria-label="Reset">Reset</button>
<input type="text" id="input1" aria-label="Name" placeholder="Enter name">
</main>
<script>
document.getElementById('btn1').addEventListener('click', function() {
// BUG: undefinedFunction doesn't exist
undefinedFunction();
});
document.getElementById('btn2').addEventListener('click', function() {
// This one works
document.getElementById('input1').value = '';
});
</script>
</body>
</html>`
console.log('Testing probe with buggy HTML...')
const result = await probeApp(htmlWithBug, false)
console.log('Probe results:')
console.log(' Errors found:', result.errors.length)
console.log(' Buttons clicked:', result.buttonsClicked)
console.log(' Inputs tested:', result.inputsTested)
console.log(' Summary:', result.summary)
if (result.errors.length > 0) {
console.log(' First error:', result.errors[0])
}