mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00

This PR is a fix proposal for a bug when trying to record a omnibox navigation after a recorded action (e.g., `fill`). The following test, included in this PR, reproduces the problem: ```ts test('should record omnibox navigations after recordAction', async ({ page, openRecorder, server }) => { const recorder = await openRecorder(); await recorder.setContentAndWait(`<textarea></textarea>`); await Promise.all([ recorder.waitForOutput('JavaScript', 'fill'), page.locator('textarea').fill('Hello world'), ]); // for performed actions, 5 seconds is the time needed to ensure they are committed await page.waitForTimeout(5000); await page.goto(server.PREFIX + `/empty.html`); await recorder.waitForOutput('JavaScript', `await page.goto('${server.PREFIX}/empty.html');`); }); ``` After performed actions (e.g., `click`), it successfully records the navigation as long as there's at least a 5 sec. gap between both actions. That happens because after that 5 sec. interval the performed action is automatically commited and therefore the navigation is not stored as a signal of that action. The proposed fix for recorded actions also forces that action to be automatically commited after 5 sec (for testing, I'm using 500ms to speed up the test execution).