chore: do not snapshot on fill (#767)

This commit is contained in:
Pavel Feldman
2025-07-25 15:54:18 -07:00
committed by GitHub
parent dbf113d5e4
commit 2bf57e22c6
3 changed files with 121 additions and 60 deletions

View File

@@ -62,12 +62,11 @@ const type = defineTabTool({
},
handle: async (tab, params, response) => {
response.setIncludeSnapshot();
const locator = await tab.refLocator(params);
await tab.waitForCompletion(async () => {
if (params.slowly) {
response.setIncludeSnapshot();
response.addCode(`// Press "${params.text}" sequentially into "${params.element}"`);
response.addCode(`await page.${await generateLocator(locator)}.pressSequentially(${javascript.quote(params.text)});`);
await locator.pressSequentially(params.text);
@@ -78,6 +77,7 @@ const type = defineTabTool({
}
if (params.submit) {
response.setIncludeSnapshot();
response.addCode(`await page.${await generateLocator(locator)}.press('Enter');`);
await locator.press('Enter');
}