-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Expand file tree
/
Copy pathinput_parallel_test.ts
More file actions
34 lines (31 loc) · 934 Bytes
/
input_parallel_test.ts
File metadata and controls
34 lines (31 loc) · 934 Bytes
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
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import assert from 'node:assert';
import type {TestScenario} from '../eval_gemini.ts';
export const scenario: TestScenario = {
prompt:
'Go to <TEST_URL>, fill the input with "hello world" and click the button five times in parallel.',
maxTurns: 10,
htmlRoute: {
path: '/input_test.html',
htmlContent: `
<input type="text" id="test-input" />
<button id="test-button">Submit</button>
`,
},
expectations: calls => {
assert.strictEqual(calls.length, 8);
assert.ok(
calls[0].name === 'navigate_page' || calls[0].name === 'new_page',
);
assert.ok(calls[1].name === 'take_snapshot');
assert.ok(calls[2].name === 'fill');
for (let i = 3; i < 8; i++) {
assert.ok(calls[i].name === 'click');
assert.strictEqual(Boolean(calls[i].args.includeSnapshot), false);
}
},
};