diff --git a/scripts/eval_scenarios/fill_select_and_checkboxes_test.ts b/scripts/eval_scenarios/fill_select_and_checkboxes_test.ts new file mode 100644 index 000000000..f1300756e --- /dev/null +++ b/scripts/eval_scenarios/fill_select_and_checkboxes_test.ts @@ -0,0 +1,67 @@ +/** + * @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 , fill the form with size = 2 CPUs and components = [docker, nginx].', + maxTurns: 3, + htmlRoute: { + path: '/input_test.html', + htmlContent: ` +
+
+ + +
+
+
+

Pre-installed components:

+ +
+ +
+ +
+ + +
+ +
+ `, + }, + expectations: calls => { + assert.strictEqual(calls.length, 3); + assert.ok( + calls[0].name === 'navigate_page' || calls[0].name === 'new_page', + ); + assert.strictEqual(calls[1].name, 'take_snapshot'); + assert.strictEqual(calls[2].name, 'fill_form'); + + const elements = calls[2].args.elements as Array<{ + uid: string; + value: string; + }>; + assert.strictEqual(elements.length, 3); + + const uids = new Set(elements.map(e => e.uid)); + assert.strictEqual( + uids.size, + 3, + 'fill_form should target three distinct elements', + ); + + const values = elements.map(e => e.value).sort(); + assert.deepStrictEqual(values, ['2 vCPU, 4GB RAM', 'true', 'true']); + }, +};