Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
chore: remove intent and timestamp from cache files (#38761)
Pavel Feldman8692484c2a06
diff --git a/examples/todomvc/tests/perform/completing-todos/should-complete-multiple-todos.spec.ts-cache.json b/examples/todomvc/tests/perform/completing-todos/should-complete-multiple-todos.spec.ts-cache.jsonindex 866cfd064a..6a8123e86a 100644--- a/examples/todomvc/tests/perform/completing-todos/should-complete-multiple-todos.spec.ts-cache.json+++ b/examples/todomvc/tests/perform/completing-todos/should-complete-multiple-todos.spec.ts-cache.json@@ -1,146 +1,123 @@{"Add three todos: 'Buy milk', 'Walk dog', 'Finish report'": {- "timestamp": 1767733695917,"actions": [{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Buy milk","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy milk');\nawait page.keyboard.press('Enter');",- "intent": "I'll help you add three todos to the page. Let me start by taking a snapshot to see the current state of the page, then add each todo item."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy milk');\nawait page.keyboard.press('Enter');"},{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Walk dog","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Walk dog');\nawait page.keyboard.press('Enter');",- "intent": "Good! The first todo \"Buy milk\" has been added successfully. Now let me add the second todo \"Walk dog\"."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Walk dog');\nawait page.keyboard.press('Enter');"},{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Finish report","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Finish report');\nawait page.keyboard.press('Enter');",- "intent": "Excellent! Two todos have been added successfully. Now let me add the third and final todo \"Finish report\"."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Finish report');\nawait page.keyboard.press('Enter');"}]},"All three todos are visible": {- "timestamp": 1767733706471,"actions": [{"method": "expectAria","template": "- list:\n - listitem: Buy milk\n - listitem: Walk dog\n - listitem: Finish report",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy milk\n - listitem: Walk dog\n - listitem: Finish report\n`);",- "intent": "I need to verify that all three todos are visible on the page. Looking at the page snapshot, I can see there's a list with three listitem elements containing the todos: \"Buy milk\", \"Walk dog\", and \"Finish report\".\n\nI'll use the `browser_expect_list_visible` tool to assert that all three todos are present in the list in the correct order."+ "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy milk\n - listitem: Walk dog\n - listitem: Finish report\n`);"}]},"Complete the first todo by clicking its checkbox": {- "timestamp": 1767733727773,"actions": [{"method": "click","selector": "internal:role=listitem >> internal:has-text=\"Buy milk\"i >> internal:label=\"Toggle Todo\"i","options": {},- "code": "await page.getByRole('listitem').filter({ hasText: 'Buy milk' }).getByLabel('Toggle Todo').click();",- "intent": "I need to complete the first todo by clicking its checkbox. Looking at the page snapshot, I can see there are three todos:\n1. \"Buy milk\" - with checkbox ref=e21\n2. \"Walk dog\" - with checkbox ref=e35\n3. \"Finish report\" - with checkbox ref=e39\n\nThe first todo is \"Buy milk\" and its checkbox has the reference `e21`. I'll click on that checkbox to complete it."+ "code": "await page.getByRole('listitem').filter({ hasText: 'Buy milk' }).getByLabel('Toggle Todo').click();"}]},"Complete the third todo by clicking its checkbox": {- "timestamp": 1767733759338,"actions": [{"method": "click","selector": "internal:role=listitem >> internal:has-text=\"Finish report\"i >> internal:label=\"Toggle Todo\"i","options": {},- "code": "await page.getByRole('listitem').filter({ hasText: 'Finish report' }).getByLabel('Toggle Todo').click();",- "intent": "I need to click the checkbox for the third todo item, which is \"Finish report\". Based on the page snapshot, the third listitem contains a checkbox with ref=e39."+ "code": "await page.getByRole('listitem').filter({ hasText: 'Finish report' }).getByLabel('Toggle Todo').click();"}]},"Counter shows '1 item left'": {- "timestamp": 1767733781971,"actions": [{"method": "expectVisible","selector": "internal:text=\"item left\"i",- "code": "await expect(page.getByText('item left')).toBeVisible();",- "intent": "I need to verify that the counter shows '1 item left'. Looking at the page snapshot, I can see:\n\n- In the generic element [ref=e24], there's a strong element [ref=e25] containing \"1\" followed by text \"item left\"\n\nI'll use the `browser_expect_visible_text` tool to verify this text is visible on the page."+ "code": "await expect(page.getByText('item left')).toBeVisible();"}]},"Counter shows '2 items left'": {- "timestamp": 1767733749422,"actions": [{"method": "expectVisible","selector": "internal:text=\"2 items left\"i",- "code": "await expect(page.getByText('2 items left')).toBeVisible();",- "intent": "I need to verify that the counter shows '2 items left'. Looking at the page snapshot, I can see:\n\n- A strong element [ref=e25] containing \"2\"\n- Followed by text \"items left\"\n\nThis matches the expectation. I'll use `browser_expect_visible_text` to verify this text is visible on the page."+ "code": "await expect(page.getByText('2 items left')).toBeVisible();"}]},"Counter shows '3 items left'": {- "timestamp": 1767733716337,"actions": [{"method": "expectVisible","selector": "internal:text=\"3 items left\"i",- "code": "await expect(page.getByText('3 items left')).toBeVisible();",- "intent": "I need to verify that the counter shows \"3 items left\". Looking at the page snapshot, I can see:\n\n- strong [ref=e25]: \"3\"\n- text: items left\n\nThis indicates the counter is displaying \"3 items left\". I'll use `browser_expect_visible_text` to verify this text is visible on the page."+ "code": "await expect(page.getByText('3 items left')).toBeVisible();"}]},"First todo is marked as complete": {- "timestamp": 1767733739293,"actions": [{"method": "expectValue","selector": "internal:role=listitem >> internal:has-text=\"Buy milk\"i >> internal:label=\"Toggle Todo\"i","type": "checkbox","value": "true",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Buy milk' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });",- "intent": "I need to verify that the first todo item is marked as complete. Looking at the page snapshot, I can see there are three todo items in a list. The first listitem contains a checkbox with the label \"Toggle Todo\" that has the `[checked]` attribute, indicating it is marked as complete.\n\nLet me assert that this checkbox is checked:"+ "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Buy milk' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });"}]},"The 'Clear completed' button appears": {- "timestamp": 1767733791523,"actions": [{"method": "expectVisible","selector": "internal:role=button[name=\"Clear completed\"i]",- "code": "await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible();",- "intent": "I need to verify that the 'Clear completed' button appears on the page. Looking at the page snapshot, I can see there is a button with the accessible name \"Clear completed\" and reference e42."+ "code": "await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible();"}]},"The page loads with an empty todo list": {- "timestamp": 1767733665931,"actions": [{"method": "expectVisible",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();",- "intent": "I need to verify that the page loads with an empty todo list. Looking at the page snapshot, I can see:\n\n1. There's a textbox \"What needs to be done?\" which is the input for adding todos\n2. There's no list of todos visible in the snapshot\n3. The main structure shows the header with \"todos\" and the input field, but no todo items\n\nTo verify the todo list is empty, I should check that there are no todo items visible. Since I don't see any list structure with todo items in the snapshot, I'll verify that a common todo list element or todo items are NOT visible.\n\nHowever, looking more carefully, a typical TodoMVC app would have a list structure when there are todos. The absence of such a list in the snapshot suggests it's empty. Let me verify by checking that specific todo-related elements that would appear with items are not present.\n\nLet me check that the page has loaded correctly by verifying a key element is visible (the input textbox), which confirms the page is loaded and ready:"+ "selector": "internal:text=\"0 items left\"i",+ "isNot": true,+ "code": "await expect(page.getByText('0 items left')).not.toBeVisible();"}]},"Third todo is marked as complete": {- "timestamp": 1767733771487,"actions": [{"method": "expectValue","selector": "internal:role=listitem >> internal:has-text=\"Finish report\"i >> internal:label=\"Toggle Todo\"i","type": "checkbox","value": "true",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Finish report' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });",- "intent": "I need to verify that the third todo item is marked as complete. Looking at the page snapshot, I can see three todo items in the list:\n\n1. \"Buy milk\" - has checkbox [checked]\n2. \"Walk dog\" - checkbox is not checked\n3. \"Finish report\" - has checkbox [checked] [active]\n\nThe third todo item \"Finish report\" has its checkbox marked as [checked], which means it is complete. I'll verify this by checking that the \"Toggle Todo\" checkbox for the third item is checked."+ "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Finish report' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });"}]}diff --git a/examples/todomvc/tests/perform/completing-todos/should-complete-single-todo.spec.ts-cache.json b/examples/todomvc/tests/perform/completing-todos/should-complete-single-todo.spec.ts-cache.jsonindex 4eb43f5fc6..edb4f906cf 100644--- a/examples/todomvc/tests/perform/completing-todos/should-complete-single-todo.spec.ts-cache.json+++ b/examples/todomvc/tests/perform/completing-todos/should-complete-single-todo.spec.ts-cache.json@@ -1,96 +1,79 @@{"Add a todo 'Buy groceries'": {- "timestamp": 1767733671351,"actions": [{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Buy groceries","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries');\nawait page.keyboard.press('Enter');",- "intent": "I'll help you add a todo 'Buy groceries' to the page. I can see there's a textbox with the placeholder \"What needs to be done?\" which is where I need to type the todo item."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries');\nawait page.keyboard.press('Enter');"}]},"Click the checkbox next to the todo": {- "timestamp": 1767733704421,"actions": [{"method": "click","selector": "internal:role=checkbox[name=\"Toggle Todo\"i]","options": {},- "code": "await page.getByRole('checkbox', { name: 'Toggle Todo' }).click();",- "intent": "I'll click the checkbox next to the todo item \"Buy groceries\"."+ "code": "await page.getByRole('checkbox', { name: 'Toggle Todo' }).click();"}]},"Counter shows '0 items left'": {- "timestamp": 1767733726894,"actions": [{"method": "expectVisible","selector": "internal:text=\"0 items left\"i",- "code": "await expect(page.getByText('0 items left')).toBeVisible();",- "intent": "I need to verify that the counter shows '0 items left'. Looking at the page snapshot, I can see:\n\n- generic [ref=e24]:\n - strong [ref=e25]: \"0\"\n - text: items left\n\nThis shows that there is a strong element containing \"0\" followed by text \"items left\". I should verify that this text is visible on the page."+ "code": "await expect(page.getByText('0 items left')).toBeVisible();"}]},"Counter shows '1 item left'": {- "timestamp": 1767733694471,"actions": [{"method": "expectVisible","selector": "internal:text=\"1 item left\"i",- "code": "await expect(page.getByText('1 item left')).toBeVisible();",- "intent": "I need to verify that the counter shows '1 item left'. Looking at the page snapshot, I can see:\n\n- A `strong` element with ref=e25 containing \"1\"\n- Followed by text \"item left\"\n\nThis matches the expected condition. I'll use `browser_expect_visible_text` to verify this text is visible on the page."+ "code": "await expect(page.getByText('1 item left')).toBeVisible();"}]},"The 'Clear completed' button appears in the footer": {- "timestamp": 1767733737976,"actions": [{"method": "expectVisible","selector": "internal:role=button[name=\"Clear completed\"i]",- "code": "await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible();",- "intent": "I need to verify that the 'Clear completed' button appears in the footer. Looking at the page snapshot, I can see there's a button with the text \"Clear completed\" with ref=e34 in the generic section with ref=e23, which appears to be the footer area of the todo list."+ "code": "await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible();"}]},"The checkbox is checked": {- "timestamp": 1767733716505,"actions": [{"method": "expectValue","selector": "internal:role=checkbox[name=\"Toggle Todo\"i]","type": "checkbox","value": "true",- "code": "await expect(page.getByRole('checkbox', { name: 'Toggle Todo' })).toBeChecked({ checked: true });",- "intent": "I need to verify that a checkbox is checked. Looking at the page snapshot, I can see there are two checkboxes:\n\n1. `checkbox \"❯Mark all as complete\" [checked] [ref=e16]` - This one is checked\n2. `checkbox \"Toggle Todo\" [checked] [active] [ref=e21]` - This one is also checked\n\nSince the task asks to verify \"the checkbox is checked\" without specifying which one, and the \"Toggle Todo\" checkbox appears to be the main interactive element for the todo item, I'll verify that one. However, both are actually checked, so I could verify either one.\n\nLet me verify the \"Toggle Todo\" checkbox is checked:"+ "code": "await expect(page.getByRole('checkbox', { name: 'Toggle Todo' })).toBeChecked({ checked: true });"}]},"The page loads with an empty todo list": {- "timestamp": 1767733661182,"actions": [{"method": "expectVisible",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();",- "intent": "I need to verify that the page loads with an empty todo list. Looking at the page snapshot, I can see there's a textbox \"What needs to be done?\" which is the input field for adding todos, but there are no todo items visible in the list. \n\nTo verify the list is empty, I'll check that the textbox for adding todos is visible (confirming the page loaded) and that there are no todo list items present."+ "selector": "internal:role=list[name=\"Todo List\"i]",+ "isNot": true,+ "code": "await expect(page.getByRole('list', { name: 'Todo List' })).not.toBeVisible();"}]},"The todo appears as active": {- "timestamp": 1767733683021,"actions": [{- "method": "expectValue",- "selector": "internal:role=checkbox[name=\"Toggle Todo\"i]",- "type": "checkbox",- "value": "false",- "code": "await expect(page.getByRole('checkbox', { name: 'Toggle Todo' })).toBeChecked({ checked: false });",- "intent": "I need to verify that the todo appears as active. Looking at the page snapshot, I can see a todo item \"Buy groceries\" with an unchecked checkbox (ref=e21). An active/incomplete todo in TodoMVC is typically represented by an unchecked checkbox.\n\nLet me assert that the checkbox for \"Toggle Todo\" is not checked, which would indicate the todo is active (not completed):"+ "method": "expectVisible",+ "selector": "internal:text=\"Buy groceries\"i",+ "code": "await expect(page.getByText('Buy groceries')).toBeVisible();"}]}diff --git a/examples/todomvc/tests/perform/completing-todos/should-toggle-all-todos-complete.spec.ts-cache.json b/examples/todomvc/tests/perform/completing-todos/should-toggle-all-todos-complete.spec.ts-cache.jsonindex 4da1083941..14a93f8484 100644--- a/examples/todomvc/tests/perform/completing-todos/should-toggle-all-todos-complete.spec.ts-cache.json+++ b/examples/todomvc/tests/perform/completing-todos/should-toggle-all-todos-complete.spec.ts-cache.json@@ -1,131 +1,96 @@{"Add three todos: 'Task 1', 'Task 2', 'Task 3'": {- "timestamp": 1767733696937,"actions": [{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Task 1","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 1');\nawait page.keyboard.press('Enter');",- "intent": "Now I'll add the first todo \"Task 1\" by typing it into the textbox and submitting it."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 1');\nawait page.keyboard.press('Enter');"},{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Task 2","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 2');\nawait page.keyboard.press('Enter');",- "intent": "Great! \"Task 1\" has been added successfully. Now I'll add \"Task 2\"."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 2');\nawait page.keyboard.press('Enter');"},{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Task 3","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 3');\nawait page.keyboard.press('Enter');",- "intent": "Perfect! \"Task 2\" has been added. Now I'll add the final todo \"Task 3\"."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 3');\nawait page.keyboard.press('Enter');"}]},"All checkboxes are checked": {- "timestamp": 1767733766305,- "actions": []+ "actions": [+ {+ "method": "expectVisible",+ "selector": "internal:role=checkbox[name=\"❯Mark all as complete\"i]",+ "code": "await expect(page.getByRole('checkbox', { name: '❯Mark all as complete' })).toBeVisible();"+ }+ ]},"All three todos are marked as complete": {- "timestamp": 1767733759432,"actions": [{"method": "expectValue","selector": "internal:role=listitem >> internal:has-text=\"Task 1\"i >> internal:label=\"Toggle Todo\"i","type": "checkbox","value": "true",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Task 1' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });",- "intent": "I need to verify that all three todos are marked as complete. Looking at the page snapshot, I can see three listitem elements (refs e19, e33, e37), each containing a \"Toggle Todo\" checkbox. All three checkboxes show `[checked]` in their state, indicating they are marked as complete.\n\nAdditionally, the \"Mark all as complete\" checkbox (ref e16) is also `[checked]`, and the items counter shows \"0 items left\", which further confirms all todos are complete.\n\nI'll verify this by checking that all three \"Toggle Todo\" checkboxes are checked."- },- {- "method": "expectValue",- "selector": "internal:role=listitem >> internal:has-text=\"Task 2\"i >> internal:label=\"Toggle Todo\"i",- "type": "checkbox",- "value": "true",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Task 2' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });",- "intent": ""- },- {- "method": "expectValue",- "selector": "internal:role=listitem >> internal:has-text=\"Task 3\"i >> internal:label=\"Toggle Todo\"i",- "type": "checkbox",- "value": "true",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Task 3' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });",- "intent": "I've successfully verified that Task 2's checkbox is checked. Now I need to check the third todo (Task 3) to complete the verification of all three todos."+ "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Task 1' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });"}]},"All three todos are visible and active": {- "timestamp": 1767733708517,"actions": [{"method": "expectAria","template": "- list:\n - listitem: Task 1\n - listitem: Task 2\n - listitem: Task 3",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Task 1\n - listitem: Task 2\n - listitem: Task 3\n`);",- "intent": "I need to verify that all three todos are visible and active. Looking at the page snapshot, I can see there are three todo items (Task 1, Task 2, Task 3) in a list, and the page shows \"3 items left\" which indicates all three are active (not completed). The checkboxes for all three todos are unchecked, confirming they are active.\n\nI'll use the `browser_expect_list_visible` tool to verify that all three todos are present in the list in the correct order."+ "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Task 1\n - listitem: Task 2\n - listitem: Task 3\n`);"}]},"Click the 'Mark all as complete' checkbox": {- "timestamp": 1767733727810,"actions": [{"method": "click","selector": "internal:role=checkbox[name=\"❯Mark all as complete\"i]","options": {},- "code": "await page.getByRole('checkbox', { name: '❯Mark all as complete' }).click();",- "intent": "I'll click the 'Mark all as complete' checkbox to complete the task."+ "code": "await page.getByRole('checkbox', { name: '❯Mark all as complete' }).click();"}]},"Counter shows '0 items left'": {- "timestamp": 1767733776710,"actions": [{"method": "expectVisible","selector": "internal:text=\"0 items left\"i",- "code": "await expect(page.getByText('0 items left')).toBeVisible();",- "intent": "I need to verify that the counter shows '0 items left'. Looking at the page snapshot, I can see:\n\n- In the generic [ref=e24], there's a strong element [ref=e25] containing \"0\"\n- Followed by text \"items left\"\n\nThis matches the expectation. I'll use `browser_expect_visible_text` to verify this text is visible on the page."+ "code": "await expect(page.getByText('0 items left')).toBeVisible();"}]},"Counter shows '3 items left'": {- "timestamp": 1767733718746,"actions": [{"method": "expectVisible","selector": "internal:text=\"3 items left\"i",- "code": "await expect(page.getByText('3 items left')).toBeVisible();",- "intent": "I need to verify that the counter shows \"3 items left\". Looking at the page snapshot, I can see:\n\n- A strong element [ref=e25] containing \"3\"\n- Followed by text \"items left\"\n\nThis matches the expected condition. I'll use `browser_expect_visible_text` to verify that the text \"3 items left\" is visible on the page."+ "code": "await expect(page.getByText('3 items left')).toBeVisible();"}]},"The 'Clear completed' button appears": {- "timestamp": 1767733786301,"actions": [{"method": "expectVisible","selector": "internal:role=button[name=\"Clear completed\"i]",- "code": "await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible();",- "intent": "I need to verify that the 'Clear completed' button appears on the page. Looking at the page snapshot, I can see there is a button with the text \"Clear completed\" at ref=e41."+ "code": "await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible();"}]},"The page loads with an empty todo list": {- "timestamp": 1767733662760,- "actions": [- {- "method": "expectVisible",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();",- "intent": "I need to verify that the todo list is empty on page load. Looking at the page snapshot, I can see there's a textbox \"What needs to be done?\" but I don't see any todo items listed. The page structure shows the header, input field, and footer, but no list of todos is visible in the snapshot, which indicates the list is indeed empty.\n\nTo assert this condition, I'll check that a todo list or todo items are NOT visible on the page. Since there's no list element or todo items shown in the snapshot, I can verify this by checking that typical todo list elements are not present."- }- ]+ "actions": []}}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/completing-todos/should-toggle-all-todos-incomplete.spec.ts-cache.json b/examples/todomvc/tests/perform/completing-todos/should-toggle-all-todos-incomplete.spec.ts-cache.jsonindex 580abba087..4023b4bed3 100644--- a/examples/todomvc/tests/perform/completing-todos/should-toggle-all-todos-incomplete.spec.ts-cache.json+++ b/examples/todomvc/tests/perform/completing-todos/should-toggle-all-todos-incomplete.spec.ts-cache.json@@ -1,117 +1,111 @@{"Add three todos: 'Task 1', 'Task 2', 'Task 3' and mark all as complete using the toggle all checkbox": {- "timestamp": 1767733703434,"actions": [{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Task 1","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 1');\nawait page.keyboard.press('Enter');",- "intent": "Now I'll add the first todo \"Task 1\" by typing into the textbox and submitting it."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 1');\nawait page.keyboard.press('Enter');"},{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Task 2","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 2');\nawait page.keyboard.press('Enter');",- "intent": "Great! \"Task 1\" has been added. Now I'll add \"Task 2\"."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 2');\nawait page.keyboard.press('Enter');"},{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Task 3","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 3');\nawait page.keyboard.press('Enter');",- "intent": "Perfect! \"Task 2\" has been added. Now I'll add \"Task 3\"."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 3');\nawait page.keyboard.press('Enter');"},{"method": "click","selector": "internal:role=checkbox[name=\"❯Mark all as complete\"i]","options": {},- "code": "await page.getByRole('checkbox', { name: '❯Mark all as complete' }).click();",- "intent": "Excellent! All three tasks have been added. Now I'll click the \"Mark all as complete\" checkbox to mark all todos as complete."+ "code": "await page.getByRole('checkbox', { name: '❯Mark all as complete' }).click();"}]},"All checkboxes are unchecked": {- "timestamp": 1767733761275,"actions": [{"method": "expectValue","selector": "internal:role=listitem >> internal:has-text=\"Task 1\"i >> internal:label=\"Toggle Todo\"i","type": "checkbox","value": "false",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Task 1' }).getByLabel('Toggle Todo')).toBeChecked({ checked: false });",- "intent": "I need to verify that all checkboxes are unchecked. Looking at the page snapshot, I can see there are 4 checkboxes:\n\n1. \"❯Mark all as complete\" checkbox [ref=e16] - marked as [active]\n2. \"Toggle Todo\" checkbox [ref=e21] for Task 1\n3. \"Toggle Todo\" checkbox [ref=e35] for Task 2\n4. \"Toggle Todo\" checkbox [ref=e39] for Task 3\n\nThe snapshot shows these checkboxes but doesn't explicitly indicate they are checked. The \"Mark all as complete\" checkbox shows [active] but that typically means it's focused or interactive, not necessarily checked. None of the checkboxes show a \"checked\" attribute in the snapshot.\n\nTo verify all checkboxes are unchecked, I'll check one of the \"Toggle Todo\" checkboxes to assert it has a value of \"false\" (unchecked)."+ "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Task 1' }).getByLabel('Toggle Todo')).toBeChecked({ checked: false });"}]},"All todos are marked as active": {- "timestamp": 1767733748147,"actions": [{"method": "expectVisible","selector": "internal:text=\"3 items left\"i",- "code": "await expect(page.getByText('3 items left')).toBeVisible();",- "intent": "I need to verify that all todos are marked as active. Looking at the page snapshot, I can see:\n\n1. There are 3 todo items (Task 1, Task 2, Task 3)\n2. Each has a \"Toggle Todo\" checkbox that is unchecked (not marked as [checked])\n3. The counter shows \"3 items left\", indicating all 3 are active\n4. There's a \"Mark all as complete\" checkbox that is also unchecked\n\nIn TodoMVC, unchecked todo checkboxes mean the tasks are active (not completed). Let me verify this by checking that the \"3 items left\" text is visible, which confirms all todos are active."+ "code": "await expect(page.getByText('3 items left')).toBeVisible();"}]},"All todos are marked as complete": {- "timestamp": 1767733715225,"actions": [{"method": "expectValue",- "selector": "internal:role=checkbox[name=\"❯Mark all as complete\"i]",+ "selector": "internal:role=listitem >> internal:has-text=\"Task 1\"i >> internal:label=\"Toggle Todo\"i","type": "checkbox","value": "true",- "code": "await expect(page.getByRole('checkbox', { name: '❯Mark all as complete' })).toBeChecked({ checked: true });",- "intent": "I need to verify that all todos are marked as complete. Looking at the page snapshot, I can see:\n\n1. There are 3 todo items (Task 1, Task 2, Task 3)\n2. Each has a \"Toggle Todo\" checkbox\n3. All three checkboxes show `[checked]` in their state\n4. The \"Mark all as complete\" checkbox at the top is also `[checked]`\n5. The counter shows \"0 items left\"\n\nThis indicates all todos are indeed marked as complete. I'll verify this by checking that the \"Mark all as complete\" checkbox is checked, which serves as an indicator that all items are complete."+ "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Task 1' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });"}]},"Click the 'Mark all as complete' checkbox again": {- "timestamp": 1767733736258,"actions": [{"method": "click","selector": "internal:role=checkbox[name=\"❯Mark all as complete\"i]","options": {},- "code": "await page.getByRole('checkbox', { name: '❯Mark all as complete' }).click();",- "intent": "I'll click the 'Mark all as complete' checkbox to uncheck it (since it's currently checked)."+ "code": "await page.getByRole('checkbox', { name: '❯Mark all as complete' }).click();"}]},"Counter shows '0 items left'": {- "timestamp": 1767733726030,"actions": [{"method": "expectVisible","selector": "internal:text=\"0 items left\"i",- "code": "await expect(page.getByText('0 items left')).toBeVisible();",- "intent": "I need to verify that the counter shows '0 items left'. Looking at the page snapshot, I can see in ref=e23 there's a generic element containing:\n- A strong element (ref=e25) with text \"0\"\n- Text \"items left\"\n\nI'll use the browser_expect_visible_text tool to verify that \"0 items left\" text is visible on the page."+ "code": "await expect(page.getByText('0 items left')).toBeVisible();"}]},"Counter shows '3 items left'": {- "timestamp": 1767733771261,"actions": [{"method": "expectVisible","selector": "internal:text=\"3 items left\"i",- "code": "await expect(page.getByText('3 items left')).toBeVisible();",- "intent": "I need to verify that the counter shows '3 items left'. Looking at the page snapshot, I can see there's a generic element (ref=e24) that contains a strong element with \"3\" (ref=e25) followed by text \"items left\".\n\nI'll use the `browser_expect_visible_text` tool to verify this text is visible on the page."+ "code": "await expect(page.getByText('3 items left')).toBeVisible();"}]},"The 'Clear completed' button disappears": {- "timestamp": 1767733776607,- "actions": []+ "actions": [+ {+ "method": "expectVisible",+ "selector": "internal:role=button[name=\"Clear completed\"i]",+ "isNot": true,+ "code": "await expect(page.getByRole('button', { name: 'Clear completed' })).not.toBeVisible();"+ }+ ]},"The page loads with an empty todo list": {- "timestamp": 1767733659545,- "actions": []+ "actions": [+ {+ "method": "expectVisible",+ "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",+ "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();"+ }+ ]}}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/completing-todos/should-uncomplete-completed-todo.spec.ts-cache.json b/examples/todomvc/tests/perform/completing-todos/should-uncomplete-completed-todo.spec.ts-cache.jsonindex a7d32d415e..44d36487c4 100644--- a/examples/todomvc/tests/perform/completing-todos/should-uncomplete-completed-todo.spec.ts-cache.json+++ b/examples/todomvc/tests/perform/completing-todos/should-uncomplete-completed-todo.spec.ts-cache.json@@ -1,96 +1,87 @@{"Add a todo 'Buy groceries' and mark it as complete by clicking its checkbox": {- "timestamp": 1767733685318,"actions": [{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Buy groceries","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries');\nawait page.keyboard.press('Enter');",- "intent": "I'll help you add a todo 'Buy groceries' and mark it as complete. Let me start by taking a snapshot to see the current state of the page, then type the todo text into the input field."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries');\nawait page.keyboard.press('Enter');"},{"method": "click","selector": "internal:role=checkbox[name=\"Toggle Todo\"i]","options": {},- "code": "await page.getByRole('checkbox', { name: 'Toggle Todo' }).click();",- "intent": "Great! The todo 'Buy groceries' has been added successfully. Now I need to mark it as complete by clicking the checkbox next to it."+ "code": "await page.getByRole('checkbox', { name: 'Toggle Todo' }).click();"}]},"Click the checkbox again to uncomplete it": {- "timestamp": 1767733717588,"actions": [{"method": "click","selector": "internal:role=checkbox[name=\"Toggle Todo\"i]","options": {},- "code": "await page.getByRole('checkbox', { name: 'Toggle Todo' }).click();",- "intent": "I need to click the checkbox to uncomplete the \"Buy groceries\" todo item. Looking at the snapshot, I can see there's a checked checkbox with ref=e21 labeled \"Toggle Todo\" that corresponds to the \"Buy groceries\" item."+ "code": "await page.getByRole('checkbox', { name: 'Toggle Todo' }).click();"}]},"Counter shows '0 items left'": {- "timestamp": 1767733707148,"actions": [{"method": "expectVisible","selector": "internal:text=\"0 items left\"i",- "code": "await expect(page.getByText('0 items left')).toBeVisible();",- "intent": "I need to verify that the counter shows '0 items left'. Looking at the page snapshot, I can see:\n\n- A strong element [ref=e25] with text \"0\"\n- Followed by text \"items left\"\n\nThese elements are within a generic container [ref=e24]. I'll use `browser_expect_visible_text` to check for the exact text \"0 items left\" since it appears as separate elements but should be visible together on the page."+ "code": "await expect(page.getByText('0 items left')).toBeVisible();"}]},"Counter shows '1 item left'": {- "timestamp": 1767733740290,"actions": [{"method": "expectVisible",- "selector": "internal:text=\"1 item left\"i",- "code": "await expect(page.getByText('1 item left')).toBeVisible();",- "intent": "I need to verify that the counter shows '1 item left'. Looking at the page snapshot, I can see:\n\n- A strong element with \"1\" (ref=e25)\n- Text \"item left\" immediately following it\n\nThese together form the counter display \"1 item left\". I'll use `browser_expect_visible_text` to verify this text is visible on the page."+ "selector": "internal:text=\"item left\"i",+ "code": "await expect(page.getByText('item left')).toBeVisible();"}]},"The 'Clear completed' button disappears": {- "timestamp": 1767733746196,- "actions": []+ "actions": [+ {+ "method": "expectVisible",+ "selector": "internal:role=button[name=\"Clear completed\"i]",+ "isNot": true,+ "code": "await expect(page.getByRole('button', { name: 'Clear completed' })).not.toBeVisible();"+ }+ ]},"The checkbox is unchecked": {- "timestamp": 1767733730258,"actions": [{"method": "expectValue",- "selector": "internal:role=checkbox[name=\"❯Mark all as complete\"i]",+ "selector": "internal:role=checkbox[name=\"Toggle Todo\"i]","type": "checkbox","value": "false",- "code": "await expect(page.getByRole('checkbox', { name: '❯Mark all as complete' })).toBeChecked({ checked: false });",- "intent": "I need to verify that a checkbox is unchecked. Looking at the page snapshot, I can see two checkboxes:\n\n1. `checkbox \"❯Mark all as complete\" [ref=e16]` - This appears to be unchecked (no [active] attribute)\n2. `checkbox \"Toggle Todo\" [active] [ref=e21]` - This one has the [active] attribute, meaning it's checked\n\nSince the task is to verify \"the checkbox is unchecked\" without specifying which one, I should check the most prominent checkbox that is actually unchecked. The \"Mark all as complete\" checkbox (ref=e16) does not have the [active] attribute, indicating it is unchecked.\n\nI'll use the browser_expect_value tool to assert that this checkbox has a value of \"false\" (unchecked)."+ "code": "await expect(page.getByRole('checkbox', { name: 'Toggle Todo' })).toBeChecked({ checked: false });"}]},"The page loads with an empty todo list": {- "timestamp": 1767733664536,"actions": [{"method": "expectVisible","selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();",- "intent": "I need to verify that the todo list is empty on page load. Looking at the page snapshot, I can see there's a textbox \"What needs to be done?\" but I don't see any list of todos or todo items present. This suggests the list is indeed empty.\n\nTo assert this condition, I should check that there is no visible list or todo items on the page. The most appropriate way would be to verify that a todo list element (if it exists) is not visible, or that specific todo items are not present.\n\nHowever, since there's no todo list or items shown in the snapshot at all, I'll verify that the page shows the expected empty state by confirming that the input textbox is visible (which indicates the app loaded correctly) and implicitly shows the list is empty.\n\nLet me use browser_expect_visible to check that the input field is present, which confirms the page loaded correctly with its initial empty state:"+ "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();"}]},"The todo is marked as complete": {- "timestamp": 1767733696184,"actions": [{"method": "expectValue","selector": "internal:role=checkbox[name=\"Toggle Todo\"i]","type": "checkbox","value": "true",- "code": "await expect(page.getByRole('checkbox', { name: 'Toggle Todo' })).toBeChecked({ checked: true });",- "intent": "I need to verify that the todo item is marked as complete. Looking at the page snapshot, I can see there is a checkbox labeled \"Toggle Todo\" with the `[checked]` attribute, which indicates the todo \"Buy groceries\" is marked as complete."+ "code": "await expect(page.getByRole('checkbox', { name: 'Toggle Todo' })).toBeChecked({ checked: true });"}]}diff --git a/examples/todomvc/tests/perform/deleting-todos/should-clear-all-completed-todos.spec.ts-cache.json b/examples/todomvc/tests/perform/deleting-todos/should-clear-all-completed-todos.spec.ts-cache.jsonindex 8268912c09..bd4c5060cb 100644--- a/examples/todomvc/tests/perform/deleting-todos/should-clear-all-completed-todos.spec.ts-cache.json+++ b/examples/todomvc/tests/perform/deleting-todos/should-clear-all-completed-todos.spec.ts-cache.json@@ -1,136 +1,126 @@{"'Task 1' and 'Task 3' are removed from the list": {- "timestamp": 1767733771064,"actions": [{"method": "expectAria","template": "- list:\n - listitem: Task 2",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Task 2\n`);",- "intent": "I need to verify that 'Task 1' and 'Task 3' are removed from the list, which means only 'Task 2' should remain visible.\n\nLooking at the page snapshot, I can see there's a list with `[ref=e18]` that currently contains only one listitem with \"Task 2\" visible. This confirms that 'Task 1' and 'Task 3' have been removed.\n\nI'll use the `browser_expect_list_visible` tool to assert that the list contains only 'Task 2':"+ "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Task 2\n`);"}]},"Add three todos: 'Task 1', 'Task 2', 'Task 3'": {- "timestamp": 1767733692529,"actions": [{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Task 1","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 1');\nawait page.keyboard.press('Enter');",- "intent": "I'll help you add three todos to the TodoMVC app. Let me start by taking a snapshot to see the current state of the page, then add each todo."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 1');\nawait page.keyboard.press('Enter');"},{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Task 2","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 2');\nawait page.keyboard.press('Enter');",- "intent": "Great! The first todo \"Task 1\" has been added. Now let me add the second todo \"Task 2\"."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 2');\nawait page.keyboard.press('Enter');"},{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Task 3","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 3');\nawait page.keyboard.press('Enter');",- "intent": "Perfect! Both \"Task 1\" and \"Task 2\" have been added successfully. Now let me add the third and final todo \"Task 3\"."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 3');\nawait page.keyboard.press('Enter');"}]},"All three todos are visible": {- "timestamp": 1767733703260,"actions": [{"method": "expectAria","template": "- list:\n - listitem: Task 1\n - listitem: Task 2\n - listitem: Task 3",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Task 1\n - listitem: Task 2\n - listitem: Task 3\n`);",- "intent": "I need to verify that all three todos are visible on the page. Looking at the page snapshot, I can see there's a list with three listitems containing \"Task 1\", \"Task 2\", and \"Task 3\". I'll use the `browser_expect_list_visible` tool to assert that all three todos are present in the list in the correct order."+ "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Task 1\n - listitem: Task 2\n - listitem: Task 3\n`);"}]},"Click the 'Clear completed' button": {- "timestamp": 1767733759715,"actions": [{"method": "click","selector": "internal:role=button[name=\"Clear completed\"i]","options": {},- "code": "await page.getByRole('button', { name: 'Clear completed' }).click();",- "intent": "I'll click the 'Clear completed' button for you."+ "code": "await page.getByRole('button', { name: 'Clear completed' }).click();"}]},"Counter shows '1 item left'": {- "timestamp": 1767733741032,"actions": [{"method": "expectVisible","selector": "internal:text=\"1 item left\"i",- "code": "await expect(page.getByText('1 item left')).toBeVisible();",- "intent": "I need to verify that the counter shows '1 item left'. Looking at the page snapshot, I can see:\n\n- In generic [ref=e23] -> generic [ref=e24], there is:\n - strong [ref=e25]: \"1\"\n - text: item left\n\nThis matches the expected text \"1 item left\". I'll use `browser_expect_visible_text` to verify this text is visible on the page."+ "code": "await expect(page.getByText('1 item left')).toBeVisible();"}]},"Mark 'Task 1' and 'Task 3' as complete by clicking their checkboxes": {- "timestamp": 1767733724185,"actions": [{"method": "click","selector": "internal:role=listitem >> internal:has-text=\"Task 1\"i >> internal:label=\"Toggle Todo\"i","options": {},- "code": "await page.getByRole('listitem').filter({ hasText: 'Task 1' }).getByLabel('Toggle Todo').click();",- "intent": "I'll help you mark 'Task 1' and 'Task 3' as complete by clicking their checkboxes. Let me identify the correct checkboxes from the page snapshot.\n\nLooking at the page structure:\n- Task 1 has a checkbox with ref=e21\n- Task 3 has a checkbox with ref=e39\n\nI'll click both checkboxes to mark these tasks as complete."+ "code": "await page.getByRole('listitem').filter({ hasText: 'Task 1' }).getByLabel('Toggle Todo').click();"},{"method": "click","selector": "internal:role=listitem >> internal:has-text=\"Task 3\"i >> internal:label=\"Toggle Todo\"i","options": {},- "code": "await page.getByRole('listitem').filter({ hasText: 'Task 3' }).getByLabel('Toggle Todo').click();",- "intent": "Good! Task 1 is now marked as complete (the checkbox shows as [checked]). Now I need to click the checkbox for Task 3 to complete the task."+ "code": "await page.getByRole('listitem').filter({ hasText: 'Task 3' }).getByLabel('Toggle Todo').click();"}]},"Only 'Task 2' remains visible": {- "timestamp": 1767733780668,"actions": [{- "method": "expectVisible",- "selector": "internal:text=\"Task 2\"i",- "code": "await expect(page.getByText('Task 2')).toBeVisible();",- "intent": "I need to verify that only \"Task 2\" remains visible on the page. Looking at the page snapshot, I can see there's a list with one listitem containing \"Task 2\". Let me assert that this task is visible."+ "method": "expectAria",+ "template": "- list:\n - listitem: Task 2",+ "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Task 2\n`);"}]},"The 'Clear completed' button appears": {- "timestamp": 1767733750767,"actions": [{"method": "expectVisible","selector": "internal:role=button[name=\"Clear completed\"i]",- "code": "await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible();",- "intent": "I need to verify that the 'Clear completed' button appears on the page. Looking at the page snapshot, I can see there is a button with the accessible name \"Clear completed\" at reference e42."+ "code": "await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible();"}]},"The 'Clear completed' button disappears": {- "timestamp": 1767733785778,- "actions": []+ "actions": [+ {+ "method": "expectVisible",+ "selector": "internal:role=button[name=\"Clear completed\"i]",+ "isNot": true,+ "code": "await expect(page.getByRole('button', { name: 'Clear completed' })).not.toBeVisible();"+ }+ ]},"The page loads with an empty todo list": {- "timestamp": 1767733661875,"actions": [{"method": "expectVisible","selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();",- "intent": "I'll verify that the page loads with an empty todo list by checking that the todo list container is not visible or that no todo items are present.\n\nLooking at the page snapshot, I can see:\n- A heading \"todos\"\n- A textbox \"What needs to be done?\" \n- Footer information\n\nThere's no visible list or todo items in the snapshot, which indicates an empty todo list. I'll assert that a typical todo list element or todo items are not visible on the page."+ "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();"}]},"Two todos are marked as complete": {- "timestamp": 1767733730304,- "actions": []+ "actions": [+ {+ "method": "expectVisible",+ "selector": "internal:text=\"item left\"i",+ "code": "await expect(page.getByText('item left')).toBeVisible();"+ }+ ]}}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/deleting-todos/should-delete-single-todo.spec.ts-cache.json b/examples/todomvc/tests/perform/deleting-todos/should-delete-single-todo.spec.ts-cache.jsonindex 22a29156f2..dd8e0aa3bf 100644--- a/examples/todomvc/tests/perform/deleting-todos/should-delete-single-todo.spec.ts-cache.json+++ b/examples/todomvc/tests/perform/deleting-todos/should-delete-single-todo.spec.ts-cache.json@@ -1,88 +1,91 @@{"A delete button (x) appears on the right side of the todo": {- "timestamp": 1767733708690,"actions": [{"method": "expectVisible","selector": "internal:role=button[name=\"Delete\"i]",- "code": "await expect(page.getByRole('button', { name: 'Delete' })).toBeVisible();",- "intent": "I need to verify that a delete button (×) appears on the right side of the todo. Looking at the page snapshot, I can see there is a button with the role \"button\", accessible name \"Delete\", and it displays \"×\" as its content. This button is located within the todo item structure."+ "code": "await expect(page.getByRole('button', { name: 'Delete' })).toBeVisible();"}]},"Add a todo 'Task to delete'": {- "timestamp": 1767733674137,"actions": [{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Task to delete","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task to delete');\nawait page.keyboard.press('Enter');",- "intent": "I'll help you add a todo with the text 'Task to delete'. I can see there's a textbox with the placeholder \"What needs to be done?\" that I can use to add the todo."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task to delete');\nawait page.keyboard.press('Enter');"}]},"Click the delete button": {- "timestamp": 1767733717883,"actions": [{"method": "click","selector": "internal:role=button[name=\"Delete\"i]","options": {},- "code": "await page.getByRole('button', { name: 'Delete' }).click();",- "intent": "I'll click the delete button for the todo item."+ "code": "await page.getByRole('button', { name: 'Delete' }).click();"}]},"Counter shows '1 item left'": {- "timestamp": 1767733689090,"actions": [{"method": "expectVisible","selector": "internal:text=\"1 item left\"i",- "code": "await expect(page.getByText('1 item left')).toBeVisible();",- "intent": "I need to verify that the counter shows \"1 item left\" on the page. Looking at the page snapshot, I can see there's a generic element [ref=e24] that contains a strong element with \"1\" and text \"item left\".\n\nI'll use the browser_expect_visible_text tool to verify this text is visible on the page."+ "code": "await expect(page.getByText('1 item left')).toBeVisible();"}]},"Hover over the todo item": {- "timestamp": 1767733698595,"actions": [{"method": "hover",- "selector": "internal:testid=[data-testid=\"todo-item\"s]",+ "selector": "internal:testid=[data-testid=\"todo-item\"s] >> div","options": {},- "code": "await page.getByTestId('todo-item').hover();",- "intent": "I'll hover over the todo item on the page. Looking at the snapshot, I can see there's a todo item with the text \"Task to delete\" in a listitem."+ "code": "await page.getByTestId('todo-item').locator('div').hover();"}]},"The footer is hidden or shows '0 items left'": {- "timestamp": 1767733737658,- "actions": []+ "actions": [+ {+ "method": "expectVisible",+ "selector": "internal:text=\"0 items left\"i",+ "isNot": true,+ "code": "await expect(page.getByText('0 items left')).not.toBeVisible();"+ }+ ]},"The list is empty": {- "timestamp": 1767733731611,"actions": []},"The page loads with an empty todo list": {- "timestamp": 1767733664316,"actions": [{"method": "expectVisible","selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();",- "intent": "I need to verify that the page loads with an empty todo list. Looking at the page snapshot, I can see:\n\n1. A heading \"todos\"\n2. A textbox \"What needs to be done?\" \n3. Footer information\n\nNotably, there are no todo list items visible in the snapshot. The structure shows the input field is present, but there's no list of todos displayed, which indicates an empty state.\n\nTo assert that the todo list is empty, I should verify that a todo list structure or todo items are NOT visible on the page. However, since I need to make a positive assertion about what IS visible (the empty state), I'll verify that the input textbox is visible, which confirms the page has loaded properly with the todo input field ready but no todos present."+ "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();"}]},"The todo appears in the list": {- "timestamp": 1767733678806,- "actions": []+ "actions": [+ {+ "method": "expectVisible",+ "selector": "internal:text=\"Task to delete\"i",+ "code": "await expect(page.getByText('Task to delete')).toBeVisible();"+ }+ ]},"The todo is removed from the list": {- "timestamp": 1767733723981,- "actions": []+ "actions": [+ {+ "method": "expectVisible",+ "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",+ "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();"+ }+ ]}}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/deleting-todos/should-delete-specific-todo-from-multiple.spec.ts-cache.json b/examples/todomvc/tests/perform/deleting-todos/should-delete-specific-todo-from-multiple.spec.ts-cache.jsonindex b1c657ff78..2b54ed47e3 100644--- a/examples/todomvc/tests/perform/deleting-todos/should-delete-specific-todo-from-multiple.spec.ts-cache.json+++ b/examples/todomvc/tests/perform/deleting-todos/should-delete-specific-todo-from-multiple.spec.ts-cache.json@@ -1,108 +1,98 @@{"'Task 1' and 'Task 3' remain visible": {- "timestamp": 1767733754268,"actions": [{"method": "expectAria","template": "- list:\n - listitem: Task 1\n - listitem: Task 3",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Task 1\n - listitem: Task 3\n`);",- "intent": "I need to verify that 'Task 1' and 'Task 3' remain visible on the page. Looking at the page snapshot, I can see both tasks are present in a list:\n\n- Task 1 is in a listitem with a generic element containing the text \"Task 1\"\n- Task 3 is in a listitem with a generic element containing the text \"Task 3\"\n\nI'll use the `browser_expect_list_visible` tool to verify that both tasks are visible in the correct order within the list."+ "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Task 1\n - listitem: Task 3\n`);"}]},"'Task 2' is removed from the list": {- "timestamp": 1767733742347,- "actions": []+ "actions": [+ {+ "method": "expectVisible",+ "selector": "internal:text=\"Task 2\"i",+ "isNot": true,+ "code": "await expect(page.getByText('Task 2')).not.toBeVisible();"+ }+ ]},"Add three todos: 'Task 1', 'Task 2', 'Task 3'": {- "timestamp": 1767733694625,"actions": [{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Task 1","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 1');\nawait page.keyboard.press('Enter');",- "intent": "I'll help you add three todos to the TodoMVC app. Let me start by taking a snapshot to see the current state of the page, then add each task."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 1');\nawait page.keyboard.press('Enter');"},{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Task 2","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 2');\nawait page.keyboard.press('Enter');",- "intent": "Great! Task 1 has been added. Now I'll add Task 2."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 2');\nawait page.keyboard.press('Enter');"},{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Task 3","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 3');\nawait page.keyboard.press('Enter');",- "intent": "Excellent! Task 2 has been added. Now I'll add the final task, Task 3."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 3');\nawait page.keyboard.press('Enter');"}]},"All three todos appear in the list": {- "timestamp": 1767733705022,"actions": [{"method": "expectAria","template": "- list:\n - listitem: Task 1\n - listitem: Task 2\n - listitem: Task 3",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Task 1\n - listitem: Task 2\n - listitem: Task 3\n`);",- "intent": "I need to verify that all three todos appear in the list. Looking at the page snapshot, I can see there's a list (ref=e18) containing three listitems with the todos \"Task 1\", \"Task 2\", and \"Task 3\".\n\nI'll use the `browser_expect_list_visible` tool to assert that all three todos are present in the correct order."+ "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Task 1\n - listitem: Task 2\n - listitem: Task 3\n`);"}]},"Counter shows '2 items left'": {- "timestamp": 1767733766575,"actions": [{"method": "expectVisible","selector": "internal:text=\"2 items left\"i",- "code": "await expect(page.getByText('2 items left')).toBeVisible();",- "intent": "I need to verify that the counter shows \"2 items left\". Looking at the page snapshot, I can see:\n\n- In the generic element [ref=e23], there's a structure with:\n - A strong element [ref=e25] containing \"2\"\n - Text that says \"items left\"\n\nThis matches the expectation that the counter shows \"2 items left\". I'll use the browser_expect_visible_text tool to verify this text is visible on the page."+ "code": "await expect(page.getByText('2 items left')).toBeVisible();"}]},"Counter shows '3 items left'": {- "timestamp": 1767733716001,"actions": [{"method": "expectVisible","selector": "internal:text=\"3 items left\"i",- "code": "await expect(page.getByText('3 items left')).toBeVisible();",- "intent": "I need to verify that the counter shows \"3 items left\". Looking at the page snapshot, I can see:\n\n- A strong element [ref=e25] containing \"3\"\n- Text \"items left\" that follows it\n\nThese are within a generic container [ref=e24]. I'll use the browser_expect_visible_text tool to check for the complete text \"3 items left\"."+ "code": "await expect(page.getByText('3 items left')).toBeVisible();"}]},"Hover over 'Task 2' and click its delete button": {- "timestamp": 1767733735584,"actions": [{"method": "hover","selector": "internal:role=listitem >> internal:has-text=\"Task 2\"i","options": {},- "code": "await page.getByRole('listitem').filter({ hasText: 'Task 2' }).hover();",- "intent": "I'll help you hover over 'Task 2' and click its delete button. Let me first hover over Task 2, then click the delete button (×)."+ "code": "await page.getByRole('listitem').filter({ hasText: 'Task 2' }).hover();"},{"method": "click","selector": "internal:role=button[name=\"Delete\"i]","options": {},- "code": "await page.getByRole('button', { name: 'Delete' }).click();",- "intent": "Perfect! After hovering over Task 2, the delete button is now visible as a button element. Now I'll click it."+ "code": "await page.getByRole('button', { name: 'Delete' }).click();"}]},"The page loads with an empty todo list": {- "timestamp": 1767733665167,"actions": [{"method": "expectVisible","selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();",- "intent": "I need to verify that the page loads with an empty todo list. Looking at the page snapshot, I can see:\n\n1. There's a heading \"todos\"\n2. There's a textbox \"What needs to be done?\" \n3. There's no visible list of todo items in the snapshot\n\nThe absence of any list elements or todo items in the snapshot indicates the todo list is empty. I'll verify this by checking that a specific element that would only appear when there are todos is NOT visible. However, since I need to assert a positive condition about the empty state, I should verify that the main input textbox is visible (which confirms the page loaded correctly) and that there are no todo items.\n\nLet me check that the textbox is visible, which confirms the page loaded properly with its empty state:"+ "isNot": false,+ "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();"}]}diff --git a/examples/todomvc/tests/perform/editing-todos/should-cancel-edit-on-escape.spec.ts-cache.json b/examples/todomvc/tests/perform/editing-todos/should-cancel-edit-on-escape.spec.ts-cache.jsonindex f5bf1d7e03..834cfb604b 100644--- a/examples/todomvc/tests/perform/editing-todos/should-cancel-edit-on-escape.spec.ts-cache.json+++ b/examples/todomvc/tests/perform/editing-todos/should-cancel-edit-on-escape.spec.ts-cache.json@@ -1,48 +1,51 @@{"Add a todo 'Original text'": {- "timestamp": 1767733672971,"actions": [{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Original text","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Original text');\nawait page.keyboard.press('Enter');",- "intent": "I need to add a todo with the text 'Original text'. I can see there's a textbox with the placeholder \"What needs to be done?\" that is currently active. I'll type the text into that textbox and submit it."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Original text');\nawait page.keyboard.press('Enter');"}]},"Change the text to 'Modified text' but press Escape instead of Enter": {- "timestamp": 1767733724021,"actions": [+ {+ "method": "click",+ "selector": "internal:role=textbox[name=\"Edit\"i]",+ "options": {},+ "code": "await page.getByRole('textbox', { name: 'Edit' }).click();"+ },+ {+ "method": "pressKey",+ "key": "Control+a",+ "code": "await page.keyboard.press('Control+a');"+ },{"method": "fill","selector": "internal:role=textbox[name=\"Edit\"i]","text": "Modified text",- "code": "await page.getByRole('textbox', { name: 'Edit' }).fill('Modified text');",- "intent": "I'll help you complete this task. I need to:\n1. Change the text in the textbox to 'Modified text'\n2. Press Escape instead of Enter\n\nLet me start by typing the new text into the active textbox, then press Escape."+ "code": "await page.getByRole('textbox', { name: 'Edit' }).fill('Modified text');"},{"method": "pressKey","key": "Escape",- "code": "await page.keyboard.press('Escape');",- "intent": "Good! The text has been changed to \"Modified text\". Now I need to press the Escape key to cancel the edit instead of submitting it with Enter."+ "code": "await page.keyboard.press('Escape');"}]},"Changes are not saved": {- "timestamp": 1767733757406,"actions": [{"method": "expectVisible","selector": "internal:text=\"Original text\"i",- "code": "await expect(page.getByText('Original text')).toBeVisible();",- "intent": "I need to verify that changes are not saved. Looking at the page snapshot, I can see there's a todo item with the text \"Original text\". The expectation \"Changes are not saved\" suggests that if any edits were made to this todo item, they should not have persisted - meaning the original text should still be visible.\n\nLet me assert that the original text is still visible on the page, which would confirm that changes were not saved."+ "code": "await expect(page.getByText('Original text')).toBeVisible();"}]},"Double-click on the todo to enter edit mode": {- "timestamp": 1767733694339,"actions": [{"method": "click",@@ -50,65 +53,54 @@"options": {"clickCount": 2},- "code": "await page.getByTestId('todo-title').click({\nclickCount: 2\n});",- "intent": "I need to double-click on the todo item to enter edit mode. Looking at the page snapshot, I can see there's a todo item with the text \"Original text\" in the list. This is located within the generic element with ref=e22."+ "code": "await page.getByTestId('todo-title').click({\nclickCount: 2\n});"}]},"Edit mode is cancelled": {- "timestamp": 1767733736028,"actions": [{"method": "expectVisible","selector": "internal:text=\"Original text\"i",- "code": "await expect(page.getByText('Original text')).toBeVisible();",- "intent": "I need to verify that edit mode is cancelled. Looking at the page snapshot, I can see there's a listitem with \"Original text\" displayed as a generic element, and there's no textbox for editing within that todo item. If edit mode were active, there would typically be a textbox for editing the todo text. The presence of the static text \"Original text\" without an associated edit textbox indicates that edit mode is not active.\n\nLet me verify that the todo item is displaying as regular text (not in edit mode) by checking that the text \"Original text\" is visible:"+ "code": "await expect(page.getByText('Original text')).toBeVisible();"}]},"Edit textbox appears with 'Original text'": {- "timestamp": 1767733704886,"actions": [{"method": "expectValue","selector": "internal:role=textbox[name=\"Edit\"i]","type": "textbox","value": "Original text",- "code": "await expect(page.getByRole('textbox', { name: 'Edit' })).toHaveValue('Original text');",- "intent": "I need to verify that an Edit textbox appears with the text 'Original text'. Looking at the page snapshot, I can see:\n\n- textbox \"Edit\" [active] [ref=e33]: Original text\n\nThis matches the expectation - there's a textbox with accessible name \"Edit\" that contains \"Original text\"."+ "code": "await expect(page.getByRole('textbox', { name: 'Edit' })).toHaveValue('Original text');"}]},"The page loads with an empty todo list": {- "timestamp": 1767733661809,"actions": [{"method": "expectVisible","selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();",- "intent": "I'll verify that the page loads with an empty todo list by checking that the textbox \"What needs to be done?\" is visible, which indicates the todo input is present and the list is ready to accept items (implying it's empty since there are no todo items shown in the snapshot)."+ "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();"}]},"The todo appears in the list": {- "timestamp": 1767733683756,"actions": [{"method": "expectVisible","selector": "internal:text=\"Original text\"i",- "code": "await expect(page.getByText('Original text')).toBeVisible();",- "intent": "I need to verify that a todo appears in the list. Looking at the page snapshot, I can see there is a list with a listitem containing the text \"Original text\", which appears to be a todo item.\n\nLet me assert that this todo item is visible in the list:"+ "code": "await expect(page.getByText('Original text')).toBeVisible();"}]},"The todo text reverts to 'Original text'": {- "timestamp": 1767733745757,"actions": [{"method": "expectVisible","selector": "internal:text=\"Original text\"i",- "code": "await expect(page.getByText('Original text')).toBeVisible();",- "intent": "I need to verify that the todo text has reverted to 'Original text'. Looking at the page snapshot, I can see there's a todo item with the text \"Original text\" in the list."+ "code": "await expect(page.getByText('Original text')).toBeVisible();"}]}diff --git a/examples/todomvc/tests/perform/editing-todos/should-delete-todo-when-edited-to-empty.spec.ts-cache.json b/examples/todomvc/tests/perform/editing-todos/should-delete-todo-when-edited-to-empty.spec.ts-cache.jsonindex 9dea1d5055..e960139b1b 100644--- a/examples/todomvc/tests/perform/editing-todos/should-delete-todo-when-edited-to-empty.spec.ts-cache.json+++ b/examples/todomvc/tests/perform/editing-todos/should-delete-todo-when-edited-to-empty.spec.ts-cache.json@@ -1,47 +1,46 @@{"Add a todo 'Temporary task'": {- "timestamp": 1767733672099,"actions": [{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Temporary task","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Temporary task');\nawait page.keyboard.press('Enter');",- "intent": "I'll help you add a todo item with the text 'Temporary task'. I can see there's a textbox with the placeholder \"What needs to be done?\" that I can use to add the todo."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Temporary task');\nawait page.keyboard.press('Enter');"}]},"Clear all the text and press Enter": {- "timestamp": 1767733716578,"actions": [{"method": "fill","selector": "internal:role=textbox[name=\"Edit\"i]","text": "","submit": true,- "code": "await page.getByRole('textbox', { name: 'Edit' }).fill('');\nawait page.keyboard.press('Enter');",- "intent": "I need to clear the text in the active textbox (which currently contains \"Temporary task\") and press Enter."+ "code": "await page.getByRole('textbox', { name: 'Edit' }).fill('');\nawait page.keyboard.press('Enter');"}]},"Counter shows '0 items left' or the footer is hidden": {- "timestamp": 1767733735536,- "actions": []+ "actions": [+ {+ "method": "expectVisible",+ "selector": "internal:text=\"0 items left\"i",+ "isNot": true,+ "code": "await expect(page.getByText('0 items left')).not.toBeVisible();"+ }+ ]},"Counter shows '1 item left'": {- "timestamp": 1767733686343,"actions": [{"method": "expectVisible","selector": "internal:text=\"1 item left\"i",- "code": "await expect(page.getByText('1 item left')).toBeVisible();",- "intent": "I need to verify that the counter shows '1 item left'. Looking at the page snapshot, I can see:\n\n- A `strong` element [ref=e25] containing \"1\"\n- Followed by text \"item left\"\n\nThis matches the expected condition. I'll use `browser_expect_visible_text` to assert that the text \"1 item left\" is visible on the page."+ "code": "await expect(page.getByText('1 item left')).toBeVisible();"}]},"Double-click on the todo to enter edit mode": {- "timestamp": 1767733695914,"actions": [{"method": "click",@@ -49,43 +48,57 @@"options": {"clickCount": 2},- "code": "await page.getByTestId('todo-title').click({\nclickCount: 2\n});",- "intent": "I need to double-click on the todo item to enter edit mode. Looking at the page snapshot, I can see there is a todo item with the text \"Temporary task\" in the list."+ "code": "await page.getByTestId('todo-title').click({\nclickCount: 2\n});"}]},"Edit textbox appears": {- "timestamp": 1767733705752,"actions": [{"method": "expectVisible","selector": "internal:role=textbox[name=\"Edit\"i]",- "code": "await expect(page.getByRole('textbox', { name: 'Edit' })).toBeVisible();",- "intent": "I need to verify that an \"Edit\" textbox appears on the page. Looking at the page snapshot, I can see there is a textbox with the accessible name \"Edit\" that is currently active and contains \"Temporary task\"."+ "code": "await expect(page.getByRole('textbox', { name: 'Edit' })).toBeVisible();"}]},"The list is empty": {- "timestamp": 1767733729714,- "actions": []+ "actions": [+ {+ "method": "expectVisible",+ "selector": "internal:role=listitem[name=\"Temporary task\"i]",+ "isNot": true,+ "code": "await expect(page.getByRole('listitem', { name: 'Temporary task' })).not.toBeVisible();"+ }+ ]},"The page loads with an empty todo list": {- "timestamp": 1767733662208,"actions": [{- "method": "expectVisible",+ "method": "expectValue","selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();",- "intent": "I need to verify that the page loads with an empty todo list. Looking at the page snapshot, I can see there's a textbox \"What needs to be done?\" but no visible todo items or list structure containing any todos. The presence of just the input field and heading \"todos\" without any list of items indicates an empty todo list.\n\nLet me assert that the textbox for adding todos is visible, which confirms the page has loaded properly with an empty state:"+ "type": "textbox",+ "value": "",+ "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toHaveValue('');"}]},"The todo appears in the list": {- "timestamp": 1767733676386,- "actions": []+ "actions": [+ {+ "method": "expectVisible",+ "selector": "internal:text=\"Temporary task\"i",+ "code": "await expect(page.getByText('Temporary task')).toBeVisible();"+ }+ ]},"The todo is deleted from the list": {- "timestamp": 1767733723016,- "actions": []+ "actions": [+ {+ "method": "expectVisible",+ "selector": "internal:text=\"Temporary task\"i",+ "isNot": true,+ "code": "await expect(page.getByText('Temporary task')).not.toBeVisible();"+ }+ ]}}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/editing-todos/should-edit-todo-by-double-clicking.spec.ts-cache.json b/examples/todomvc/tests/perform/editing-todos/should-edit-todo-by-double-clicking.spec.ts-cache.jsonindex 6aeb3fbbf1..35428eca76 100644--- a/examples/todomvc/tests/perform/editing-todos/should-edit-todo-by-double-clicking.spec.ts-cache.json+++ b/examples/todomvc/tests/perform/editing-todos/should-edit-todo-by-double-clicking.spec.ts-cache.json@@ -1,45 +1,38 @@{"Add a todo 'Buy milk'": {- "timestamp": 1767733674180,"actions": [{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Buy milk","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy milk');\nawait page.keyboard.press('Enter');",- "intent": "I'll help you add a todo 'Buy milk' to the page. I can see there's a textbox with the placeholder \"What needs to be done?\" which is where I need to type the todo item."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy milk');\nawait page.keyboard.press('Enter');"}]},"An edit textbox appears with the current text 'Buy milk'": {- "timestamp": 1767733709587,"actions": [{"method": "expectValue","selector": "internal:role=textbox[name=\"Edit\"i]","type": "textbox","value": "Buy milk",- "code": "await expect(page.getByRole('textbox', { name: 'Edit' })).toHaveValue('Buy milk');",- "intent": "I need to verify that an edit textbox appears with the current text \"Buy milk\". Looking at the page snapshot, I can see there is a textbox with the role \"textbox\", accessible name \"Edit\", which is marked as [active] and contains the text \"Buy milk\"."+ "code": "await expect(page.getByRole('textbox', { name: 'Edit' })).toHaveValue('Buy milk');"}]},"Change the text to 'Buy organic milk' and press Enter": {- "timestamp": 1767733729538,"actions": [{"method": "fill","selector": "internal:role=textbox[name=\"Edit\"i]","text": "Buy organic milk","submit": true,- "code": "await page.getByRole('textbox', { name: 'Edit' }).fill('Buy organic milk');\nawait page.keyboard.press('Enter');",- "intent": "I need to change the text in the active textbox from \"Buy milk\" to \"Buy organic milk\" and press Enter."+ "code": "await page.getByRole('textbox', { name: 'Edit' }).fill('Buy organic milk');\nawait page.keyboard.press('Enter');"}]},"Double-click on the todo text": {- "timestamp": 1767733688238,"actions": [{"method": "click",@@ -47,78 +40,71 @@"options": {"clickCount": 2},- "code": "await page.getByTestId('todo-title').click({\nclickCount: 2\n});",- "intent": "I need to double-click on the todo text \"Buy milk\" to edit it."+ "code": "await page.getByTestId('todo-title').click({\nclickCount: 2\n});"}]},"Edit mode is exited": {- "timestamp": 1767733750110,"actions": [{"method": "expectVisible",- "selector": "internal:text=\"Buy organic milk\"i",- "code": "await expect(page.getByText('Buy organic milk')).toBeVisible();",- "intent": "I need to verify that edit mode is exited. Looking at the page snapshot, I can see a todo item \"Buy organic milk\" displayed as regular text within a generic element, not as an editable textbox. If edit mode were active, there would typically be a textbox for editing the todo item text. The absence of such a textbox and the presence of the todo as plain text indicates that edit mode is not active."+ "selector": "internal:role=textbox[name=\"Buy organic milk\"i]",+ "isNot": true,+ "code": "await expect(page.getByRole('textbox', { name: 'Buy organic milk' })).not.toBeVisible();"}]},"The page loads with an empty todo list": {- "timestamp": 1767733664011,"actions": [{"method": "expectVisible",- "selector": "internal:text=\"Double-click to edit a todo\"i",- "code": "await expect(page.getByText('Double-click to edit a todo')).toBeVisible();",- "intent": "I need to verify that the todo list is empty on page load. Looking at the page snapshot, I can see there's a textbox \"What needs to be done?\" but there's no visible list of todo items, which indicates the list is empty.\n\nTo assert this condition, I should check that no todo list items are visible. However, I notice there's no list element or list items shown in the snapshot, which confirms the list is empty. Let me use the browser_expect_visible tool to check that a specific todo-related element is NOT present, or use browser_expect_visible_text to confirm explanatory text is visible.\n\nActually, the best approach is to verify that the instruction text \"Double-click to edit a todo\" is visible, which is shown on the page and confirms the page loaded correctly with its initial state (empty todo list)."+ "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",+ "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();"}]},"The textbox is focused": {- "timestamp": 1767733719933,"actions": [{"method": "expectVisible","selector": "internal:role=textbox[name=\"Edit\"i]",- "code": "await expect(page.getByRole('textbox', { name: 'Edit' })).toBeVisible();",- "intent": "I need to verify that a textbox is focused. Looking at the page snapshot, I can see there's a textbox with ref=e33 that has the `[active]` attribute, which indicates it's currently focused. This textbox has the accessible name \"Edit\" and contains the text \"Buy milk\"."+ "code": "await expect(page.getByRole('textbox', { name: 'Edit' })).toBeVisible();"}]},"The todo appears in the list": {- "timestamp": 1767733679102,- "actions": []+ "actions": [+ {+ "method": "expectAria",+ "template": "- list:\n - listitem: Buy milk",+ "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy milk\n`);"+ }+ ]},"The todo enters edit mode": {- "timestamp": 1767733699451,"actions": [{"method": "expectVisible","selector": "internal:role=textbox[name=\"Edit\"i]",- "code": "await expect(page.getByRole('textbox', { name: 'Edit' })).toBeVisible();",- "intent": "I need to verify that the todo has entered edit mode. Looking at the page snapshot, I can see there's a textbox with the accessible name \"Edit\" that is marked as [active] and contains the text \"Buy milk\". This indicates the todo is in edit mode."+ "code": "await expect(page.getByRole('textbox', { name: 'Edit' })).toBeVisible();"}]},"The todo is updated to 'Buy organic milk'": {- "timestamp": 1767733739262,"actions": [{"method": "expectVisible","selector": "internal:text=\"Buy organic milk\"i",- "code": "await expect(page.getByText('Buy organic milk')).toBeVisible();",- "intent": "I need to verify that the todo item has been updated to 'Buy organic milk'. Looking at the page snapshot, I can see there is a todo item with the text \"Buy organic milk\" in a listitem element at ref=e22."+ "code": "await expect(page.getByText('Buy organic milk')).toBeVisible();"}]},"The updated text is displayed in the list": {- "timestamp": 1767733759917,"actions": [{"method": "expectVisible","selector": "internal:text=\"Buy organic milk\"i",- "code": "await expect(page.getByText('Buy organic milk')).toBeVisible();",- "intent": "I need to verify that the updated text \"Buy organic milk\" is displayed in the todo list. Looking at the page snapshot, I can see there's a list with a listitem containing the text \"Buy organic milk\"."+ "code": "await expect(page.getByText('Buy organic milk')).toBeVisible();"}]}diff --git a/examples/todomvc/tests/perform/editing-todos/should-save-edit-on-blur.spec.ts-cache.json b/examples/todomvc/tests/perform/editing-todos/should-save-edit-on-blur.spec.ts-cache.jsonindex 410c634e93..834c6523ff 100644--- a/examples/todomvc/tests/perform/editing-todos/should-save-edit-on-blur.spec.ts-cache.json+++ b/examples/todomvc/tests/perform/editing-todos/should-save-edit-on-blur.spec.ts-cache.json@@ -1,38 +1,32 @@{"Add a todo 'Call dentist'": {- "timestamp": 1767733676337,"actions": [{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Call dentist","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Call dentist');\nawait page.keyboard.press('Enter');",- "intent": "I'll help you add a todo 'Call dentist' to the page. I can see there's a textbox with the placeholder \"What needs to be done?\" that I can use to add the todo item."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Call dentist');\nawait page.keyboard.press('Enter');"}]},"Change the text to 'Schedule dentist appointment' and click elsewhere to blur the input": {- "timestamp": 1767733727186,"actions": [{"method": "fill","selector": "internal:role=textbox[name=\"Edit\"i]","text": "Schedule dentist appointment",- "code": "await page.getByRole('textbox', { name: 'Edit' }).fill('Schedule dentist appointment');",- "intent": "I'll help you change the text to 'Schedule dentist appointment' and blur the input. Let me do this in two steps:\n\n1. First, I'll clear the current text and type the new text\n2. Then I'll click elsewhere to blur the input"+ "code": "await page.getByRole('textbox', { name: 'Edit' }).fill('Schedule dentist appointment');"},{"method": "click","selector": "internal:role=heading[name=\"todos\"i]","options": {},- "code": "await page.getByRole('heading', { name: 'todos' }).click();",- "intent": "Now I'll click elsewhere to blur the input. I'll click on the \"todos\" heading:"+ "code": "await page.getByRole('heading', { name: 'todos' }).click();"}]},"Double-click on the todo to enter edit mode": {- "timestamp": 1767733697503,"actions": [{"method": "click",@@ -40,67 +34,62 @@"options": {"clickCount": 2},- "code": "await page.getByTestId('todo-title').click({\nclickCount: 2\n});",- "intent": "I need to double-click on the todo item \"Call dentist\" to enter edit mode. Looking at the page snapshot, the todo text is in the generic element with ref=e22."+ "code": "await page.getByTestId('todo-title').click({\nclickCount: 2\n});"}]},"Edit mode is exited": {- "timestamp": 1767733756175,- "actions": []+ "actions": [+ {+ "method": "expectVisible",+ "selector": "internal:role=textbox[name=\"Schedule dentist appointment\"i]",+ "isNot": true,+ "code": "await expect(page.getByRole('textbox', { name: 'Schedule dentist appointment' })).not.toBeVisible();"+ }+ ]},"Edit textbox appears": {- "timestamp": 1767733707241,"actions": [{"method": "expectVisible","selector": "internal:role=textbox[name=\"Edit\"i]",- "code": "await expect(page.getByRole('textbox', { name: 'Edit' })).toBeVisible();",- "intent": "I need to verify that an edit textbox appears on the page. Looking at the page snapshot, I can see there is a textbox with the accessible name \"Edit\" that is currently active and contains the text \"Call dentist\"."+ "code": "await expect(page.getByRole('textbox', { name: 'Edit' })).toBeVisible();"}]},"The changes are saved": {- "timestamp": 1767733738819,"actions": [{"method": "expectVisible","selector": "internal:text=\"Schedule dentist appointment\"i",- "code": "await expect(page.getByText('Schedule dentist appointment')).toBeVisible();",- "intent": "I need to verify that changes are saved. Looking at the page snapshot, I can see a TodoMVC application with one todo item \"Schedule dentist appointment\" that appears to be active (unchecked). The footer shows \"1 item left\" which indicates there is one active todo item.\n\nTo verify that changes are saved, I should check for the presence of the todo item that was presumably just added or modified. The most concrete evidence that changes are saved is the presence of the todo item in the list."+ "code": "await expect(page.getByText('Schedule dentist appointment')).toBeVisible();"}]},"The page loads with an empty todo list": {- "timestamp": 1767733665981,"actions": [{"method": "expectVisible","selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();",- "intent": "I need to verify that the page loads with an empty todo list. Looking at the page snapshot, I can see:\n\n1. There's a textbox \"What needs to be done?\" which is the input field for adding todos\n2. There's no list of todos visible in the snapshot\n3. The page structure shows the header with \"todos\" and the input field, but no todo items\n\nTo assert that the todo list is empty, I should check that a todo list element is NOT visible, or more specifically, that there are no todo items displayed. Since I don't see any list structure with todo items in the snapshot, I'll verify that the textbox is visible (confirming the page loaded) and that we can expect the list to be empty by checking that no todo items are present.\n\nLet me use `browser_expect_list_visible` with an empty items array to verify the list exists but is empty, or use `browser_expect_visible` to check that certain elements that would only appear with todos are not present.\n\nActually, looking at the snapshot more carefully, there's no list element visible at all when the todo list is empty. I should verify that the input textbox is visible, which confirms the page loaded correctly with the todo functionality ready but no todos yet."+ "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();"}]},"The todo appears in the list": {- "timestamp": 1767733686790,"actions": [{"method": "expectVisible","selector": "internal:text=\"Call dentist\"i",- "code": "await expect(page.getByText('Call dentist')).toBeVisible();",- "intent": "I need to verify that a todo appears in the list. Looking at the page snapshot, I can see there is a list with a todo item \"Call dentist\" in it. I'll use the browser_expect_visible tool to check that this todo item is visible."+ "code": "await expect(page.getByText('Call dentist')).toBeVisible();"}]},"The todo text is updated to 'Schedule dentist appointment'": {- "timestamp": 1767733749568,"actions": [{"method": "expectVisible","selector": "internal:text=\"Schedule dentist appointment\"i",- "code": "await expect(page.getByText('Schedule dentist appointment')).toBeVisible();",- "intent": "I need to verify that the todo text is updated to 'Schedule dentist appointment'. Looking at the page snapshot, I can see there's a listitem with a generic element containing the text \"Schedule dentist appointment\" at ref=e22.\n\nI'll use the browser_expect_visible_text tool to assert that this text is visible on the page."+ "code": "await expect(page.getByText('Schedule dentist appointment')).toBeVisible();"}]}diff --git a/examples/todomvc/tests/perform/editing-todos/should-trim-whitespace-when-editing.spec.ts-cache.json b/examples/todomvc/tests/perform/editing-todos/should-trim-whitespace-when-editing.spec.ts-cache.jsonindex 89fd92fbcc..7a46e97a34 100644--- a/examples/todomvc/tests/perform/editing-todos/should-trim-whitespace-when-editing.spec.ts-cache.json+++ b/examples/todomvc/tests/perform/editing-todos/should-trim-whitespace-when-editing.spec.ts-cache.json@@ -1,19 +1,16 @@{"Add a todo 'Original task'": {- "timestamp": 1767733670530,"actions": [{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Original task","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Original task');\nawait page.keyboard.press('Enter');",- "intent": "I need to add a todo with the text 'Original task'. I can see there's a textbox with the placeholder \"What needs to be done?\" that I should type into."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Original task');\nawait page.keyboard.press('Enter');"}]},"Double-click to edit and change text to ' Edited task ' (with leading and trailing spaces)": {- "timestamp": 1767733705280,"actions": [{"method": "click",@@ -21,62 +18,53 @@"options": {"clickCount": 2},- "code": "await page.getByTestId('todo-title').click({\nclickCount: 2\n});",- "intent": "I'll help you edit the task. First, let me take a snapshot to see the current state, then I'll double-click on the task to edit it and change the text."+ "code": "await page.getByTestId('todo-title').click({\nclickCount: 2\n});"},{"method": "fill","selector": "internal:role=textbox[name=\"Edit\"i]","text": " Edited task ",- "code": "await page.getByRole('textbox', { name: 'Edit' }).fill(' Edited task ');",- "intent": "Perfect! The double-click opened the edit mode and now I can see an active textbox with \"Original task\". Now I'll clear the current text and type the new text with leading and trailing spaces."- },- {- "method": "pressKey",- "key": "Enter",- "code": "await page.keyboard.press('Enter');",- "intent": "I can see the textbox is now showing \"Edited task\" (though the snapshot may not show the exact spacing). Now I need to press Enter to submit the change and complete the edit."+ "submit": true,+ "code": "await page.getByRole('textbox', { name: 'Edit' }).fill(' Edited task ');\nawait page.keyboard.press('Enter');"}]},"Edit textbox shows the text with spaces": {- "timestamp": 1767733715850,"actions": []},"Press Enter to save": {- "timestamp": 1767733726530,"actions": [{"method": "pressKey","key": "Enter",- "code": "await page.keyboard.press('Enter');",- "intent": "I need to press Enter to save. Looking at the page snapshot, this appears to be a TodoMVC application. The context suggests that something needs to be saved by pressing Enter, which typically happens after editing or creating a todo item.\n\nThe most likely scenario is that there's a text input field that needs Enter to be pressed. I can see a textbox \"What needs to be done?\" in the snapshot. Let me press the Enter key to save."+ "code": "await page.keyboard.press('Enter');"}]},"The page loads with an empty todo list": {- "timestamp": 1767733660201,"actions": [{"method": "expectVisible","selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();",- "intent": "I'll verify that the page loads with an empty todo list by checking that the textbox \"What needs to be done?\" is visible, which indicates the todo input is present and ready for use in an empty state."+ "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();"}]},"The todo appears in the list": {- "timestamp": 1767733675284,- "actions": []+ "actions": [+ {+ "method": "expectVisible",+ "selector": "internal:text=\"Original task\"i",+ "code": "await expect(page.getByText('Original task')).toBeVisible();"+ }+ ]},"The todo is saved as 'Edited task' without leading or trailing whitespace": {- "timestamp": 1767733736150,"actions": [{"method": "expectVisible","selector": "internal:text=\"Edited task\"i",- "code": "await expect(page.getByText('Edited task')).toBeVisible();",- "intent": "I need to verify that the todo is saved as 'Edited task' without leading or trailing whitespace. Looking at the page snapshot, I can see a listitem with a generic element containing the text \"Edited task\" at ref=e22.\n\nI'll use the browser_expect_visible_text tool to verify that the exact text \"Edited task\" is visible on the page."+ "code": "await expect(page.getByText('Edited task')).toBeVisible();"}]}diff --git a/examples/todomvc/tests/perform/filtering-todos/should-filter-active-todos.spec.ts-cache.json b/examples/todomvc/tests/perform/filtering-todos/should-filter-active-todos.spec.ts-cache.jsonindex 434637bd42..585d182e07 100644--- a/examples/todomvc/tests/perform/filtering-todos/should-filter-active-todos.spec.ts-cache.json+++ b/examples/todomvc/tests/perform/filtering-todos/should-filter-active-todos.spec.ts-cache.json@@ -1,137 +1,121 @@{"'Will complete' is not visible": {- "timestamp": 1767733770707,- "actions": []+ "actions": [+ {+ "method": "expectVisible",+ "selector": "internal:text=\"Will complete\"i",+ "isNot": true,+ "code": "await expect(page.getByText('Will complete')).not.toBeVisible();"+ }+ ]},"Add three todos: 'Active 1', 'Active 2', 'Will complete'": {- "timestamp": 1767733689768,"actions": [{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Active 1","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Active 1');\nawait page.keyboard.press('Enter');",- "intent": "I'll help you add three todos to the page. Let me start by taking a snapshot to see the current state, then add each todo item."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Active 1');\nawait page.keyboard.press('Enter');"},{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Active 2","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Active 2');\nawait page.keyboard.press('Enter');",- "intent": "Good! The first todo \"Active 1\" has been added. Now I'll add the second todo \"Active 2\"."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Active 2');\nawait page.keyboard.press('Enter');"},{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Will complete","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Will complete');\nawait page.keyboard.press('Enter');",- "intent": "Excellent! Two todos have been added successfully. Now I'll add the third and final todo \"Will complete\"."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Will complete');\nawait page.keyboard.press('Enter');"}]},"All three todos are visible": {- "timestamp": 1767733700481,"actions": [{"method": "expectAria","template": "- list:\n - listitem: Active 1\n - listitem: Active 2\n - listitem: Will complete",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Active 1\n - listitem: Active 2\n - listitem: Will complete\n`);",- "intent": "I need to verify that all three todos are visible on the page. Looking at the snapshot, I can see there's a list with three todo items:\n1. \"Active 1\"\n2. \"Active 2\"\n3. \"Will complete\"\n\nI'll use the `browser_expect_list_visible` tool to assert that all three todos are present in the list in the exact order shown."+ "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Active 1\n - listitem: Active 2\n - listitem: Will complete\n`);"}]},"Click on the 'Active' filter link": {- "timestamp": 1767733743714,"actions": [{"method": "click","selector": "internal:role=link[name=\"Active\"i]","options": {},- "code": "await page.getByRole('link', { name: 'Active' }).click();",- "intent": "I need to click on the 'Active' filter link. Looking at the page snapshot, I can see the filter links are in a list at ref=e26, and the 'Active' link is specifically at ref=e30."+ "code": "await page.getByRole('link', { name: 'Active' }).click();"}]},"Counter shows '2 items left'": {- "timestamp": 1767733733351,"actions": [{"method": "expectVisible","selector": "internal:text=\"2 items left\"i",- "code": "await expect(page.getByText('2 items left')).toBeVisible();",- "intent": "I need to verify that the counter shows \"2 items left\". Looking at the page snapshot, I can see:\n\n- A `strong` element with ref=e25 containing \"2\"\n- Followed by text \"items left\"\n\nThese elements are within a generic container (ref=e24). I'll use `browser_expect_visible_text` to verify that the text \"2 items left\" is visible on the page."+ "code": "await expect(page.getByText('2 items left')).toBeVisible();"}]},"Mark 'Will complete' as completed by clicking its checkbox": {- "timestamp": 1767733710707,"actions": [{"method": "click","selector": "internal:role=listitem >> internal:has-text=\"Will complete\"i >> internal:label=\"Toggle Todo\"i","options": {},- "code": "await page.getByRole('listitem').filter({ hasText: 'Will complete' }).getByLabel('Toggle Todo').click();",- "intent": "I need to mark 'Will complete' as completed by clicking its checkbox. Looking at the page snapshot, I can see that 'Will complete' is in a listitem with a checkbox labeled \"Toggle Todo\" at ref=e39."+ "code": "await page.getByRole('listitem').filter({ hasText: 'Will complete' }).getByLabel('Toggle Todo').click();"}]},"One todo is marked as complete": {- "timestamp": 1767733722615,"actions": [{"method": "expectValue","selector": "internal:role=listitem >> internal:has-text=\"Will complete\"i >> internal:label=\"Toggle Todo\"i","type": "checkbox","value": "true",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Will complete' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });",- "intent": "I need to verify that one todo is marked as complete. Looking at the page snapshot, I can see there are three todos in the list, and one of them has a checkbox that is marked as \"checked\" - specifically the one with the text \"Will complete\" (ref=e39).\n\nI'll use the browser_expect_value tool to verify that this checkbox is checked."+ "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Will complete' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });"}]},"Only 'Active 1' and 'Active 2' are displayed": {- "timestamp": 1767733766023,"actions": [{"method": "expectAria","template": "- list:\n - listitem: Active 1\n - listitem: Active 2",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Active 1\n - listitem: Active 2\n`);",- "intent": "I need to verify that only 'Active 1' and 'Active 2' are displayed in the todo list. Looking at the page snapshot, I can see there's a list with two listitems containing \"Active 1\" and \"Active 2\". I'll use the `browser_expect_list_visible` tool to assert that these exact items are present in the correct order."+ "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Active 1\n - listitem: Active 2\n`);"}]},"The 'Active' filter link is highlighted": {- "timestamp": 1767733780585,"actions": [{"method": "expectVisible","selector": "internal:role=link[name=\"Active\"i]",- "code": "await expect(page.getByRole('link', { name: 'Active' })).toBeVisible();",- "intent": "I need to verify that the 'Active' filter link is highlighted. Looking at the page snapshot, I can see the 'Active' link has the `[active]` attribute, which indicates it is highlighted/selected."+ "code": "await expect(page.getByRole('link', { name: 'Active' })).toBeVisible();"}]},"The page loads with an empty todo list": {- "timestamp": 1767733660334,"actions": [{"method": "expectVisible","selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();",- "intent": "I'll verify that the page loads with an empty todo list by checking that the textbox \"What needs to be done?\" is visible, which is the input field for adding todos and would be present on an empty list."+ "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();"}]},"The URL changes to #/active": {- "timestamp": 1767733755397,"actions": [{"method": "expectVisible","selector": "internal:role=link[name=\"Active\"i]",- "code": "await expect(page.getByRole('link', { name: 'Active' })).toBeVisible();",- "intent": "I need to verify that the URL changes to #/active. Looking at the page snapshot, I can see that the \"Active\" link (ref=e30) is marked as [active], which indicates it's currently selected, and its URL is \"#/active\". This suggests the URL has indeed changed to #/active.\n\nI'll use the browser_expect_visible tool to verify that the \"Active\" link is visible and active on the page."+ "code": "await expect(page.getByRole('link', { name: 'Active' })).toBeVisible();"}]}diff --git a/examples/todomvc/tests/perform/filtering-todos/should-filter-completed-todos.spec.ts-cache.json b/examples/todomvc/tests/perform/filtering-todos/should-filter-completed-todos.spec.ts-cache.jsonindex e2926ca21b..d01527705b 100644--- a/examples/todomvc/tests/perform/filtering-todos/should-filter-completed-todos.spec.ts-cache.json+++ b/examples/todomvc/tests/perform/filtering-todos/should-filter-completed-todos.spec.ts-cache.json@@ -1,131 +1,125 @@{"'Active task' is not visible": {- "timestamp": 1767733777768,- "actions": []+ "actions": [+ {+ "method": "expectVisible",+ "selector": "internal:text=\"Active task\"i",+ "isNot": true,+ "code": "await expect(page.getByText('Active task')).not.toBeVisible();"+ }+ ]},"Add three todos: 'Active task', 'Completed 1', 'Completed 2'": {- "timestamp": 1767733694088,"actions": [{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Active task","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Active task');\nawait page.keyboard.press('Enter');",- "intent": "I'll help you add three todos to this TodoMVC application. Let me start by taking a snapshot to see the current state of the page, then add each todo one by one."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Active task');\nawait page.keyboard.press('Enter');"},{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Completed 1","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Completed 1');\nawait page.keyboard.press('Enter');",- "intent": "Great! The first todo \"Active task\" has been added. Now let me add the second todo \"Completed 1\"."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Completed 1');\nawait page.keyboard.press('Enter');"},{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Completed 2","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Completed 2');\nawait page.keyboard.press('Enter');",- "intent": "Perfect! Two todos have been added. Now let me add the third and final todo \"Completed 2\"."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Completed 2');\nawait page.keyboard.press('Enter');"}]},"All three todos are visible": {- "timestamp": 1767733704813,"actions": [{"method": "expectAria","template": "- list:\n - listitem: Active task\n - listitem: Completed 1\n - listitem: Completed 2",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Active task\n - listitem: Completed 1\n - listitem: Completed 2\n`);",- "intent": "I need to verify that all three todos are visible on the page. Looking at the page snapshot, I can see there's a list with three listitem elements containing the todos:\n1. \"Active task\"\n2. \"Completed 1\"\n3. \"Completed 2\"\n\nI'll use the `browser_expect_list_visible` tool to verify that all three todos are present in the list in the correct order."+ "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Active task\n - listitem: Completed 1\n - listitem: Completed 2\n`);"}]},"Click on the 'Completed' filter link": {- "timestamp": 1767733748904,"actions": [{"method": "click","selector": "internal:role=link[name=\"Completed\"i]","options": {},- "code": "await page.getByRole('link', { name: 'Completed' }).click();",- "intent": "I need to click on the 'Completed' filter link. Based on the page snapshot, I can see that there's a link with text \"Completed\" at ref=e32."+ "code": "await page.getByRole('link', { name: 'Completed' }).click();"}]},"Mark 'Completed 1' and 'Completed 2' as completed by clicking their checkboxes": {- "timestamp": 1767733725603,"actions": [{"method": "click","selector": "internal:role=listitem >> internal:has-text=\"Completed 1\"i >> internal:label=\"Toggle Todo\"i","options": {},- "code": "await page.getByRole('listitem').filter({ hasText: 'Completed 1' }).getByLabel('Toggle Todo').click();",- "intent": "I need to mark 'Completed 1' and 'Completed 2' as completed by clicking their checkboxes. Looking at the page snapshot, I can see:\n\n- 'Completed 1' has a checkbox with ref=e35\n- 'Completed 2' has a checkbox with ref=e39\n\nBoth checkboxes are currently unchecked (they're labeled as \"Toggle Todo\" checkboxes). I'll click both of them to mark these items as completed."+ "code": "await page.getByRole('listitem').filter({ hasText: 'Completed 1' }).getByLabel('Toggle Todo').click();"},{"method": "click","selector": "internal:role=listitem >> internal:has-text=\"Completed 2\"i >> internal:label=\"Toggle Todo\"i","options": {},- "code": "await page.getByRole('listitem').filter({ hasText: 'Completed 2' }).getByLabel('Toggle Todo').click();",- "intent": "Good! I successfully clicked the checkbox for 'Completed 1' and it's now checked. I can see the item count changed from \"3 items left\" to \"2 items left\". Now I need to click the checkbox for 'Completed 2' (ref=e39) to complete the task."+ "code": "await page.getByRole('listitem').filter({ hasText: 'Completed 2' }).getByLabel('Toggle Todo').click();"}]},"Only 'Completed 1' and 'Completed 2' are displayed": {- "timestamp": 1767733773784,"actions": [{"method": "expectAria","template": "- list:\n - listitem: Completed 1\n - listitem: Completed 2",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Completed 1\n - listitem: Completed 2\n`);",- "intent": "I need to verify that only 'Completed 1' and 'Completed 2' are displayed in the todo list. Looking at the page snapshot, I can see there's a list with two listitem elements, and each contains the text \"Completed 1\" and \"Completed 2\" respectively.\n\nI'll use the browser_expect_list_visible tool to assert that the list contains exactly these two items in order."+ "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Completed 1\n - listitem: Completed 2\n`);"}]},"The 'Completed' filter link is highlighted": {- "timestamp": 1767733787667,"actions": [{"method": "expectVisible","selector": "internal:role=link[name=\"Completed\"i]",- "code": "await expect(page.getByRole('link', { name: 'Completed' })).toBeVisible();",- "intent": "I need to verify that the 'Completed' filter link is highlighted. Looking at the page snapshot, I can see that the \"Completed\" link has the `[active]` attribute, which indicates it is highlighted/selected."+ "code": "await expect(page.getByRole('link', { name: 'Completed' })).toBeVisible();"}]},"The page loads with an empty todo list": {- "timestamp": 1767733661280,"actions": [{"method": "expectVisible","selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();",- "intent": "I'll verify that the page loads with an empty todo list by checking that the textbox \"What needs to be done?\" is visible, which is the input field for adding todos. The presence of this empty textbox without any todo items in the snapshot confirms the list is empty."+ "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();"}]},"The URL changes to #/completed": {- "timestamp": 1767733763121,"actions": [{"method": "expectVisible","selector": "internal:role=link[name=\"Completed\"i]",- "code": "await expect(page.getByRole('link', { name: 'Completed' })).toBeVisible();",- "intent": "I need to verify that the URL has changed to #/completed. Looking at the page snapshot, I can see that the \"Completed\" link is marked as `[active]`, which indicates the current page state corresponds to the completed filter.\n\nTo assert this condition, I'll check that the \"Completed\" link element is visible, as its active state confirms we're on the #/completed URL."+ "code": "await expect(page.getByRole('link', { name: 'Completed' })).toBeVisible();"}]},"Two todos are marked as complete": {- "timestamp": 1767733739260,"actions": [{- "method": "expectVisible",- "selector": "internal:role=button[name=\"Clear completed\"i]",- "code": "await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible();",- "intent": "I need to verify that two todos are marked as complete. Looking at the page snapshot, I can see there are checkboxes for \"Toggle Todo\" and two of them are checked (refs e35 and e39), which correspond to \"Completed 1\" and \"Completed 2\".\n\nLet me assert that there are exactly 2 completed items by checking the \"Clear completed\" button is visible, which appears when there are completed items. However, a more direct approach would be to verify the count of checked \"Toggle Todo\" checkboxes.\n\nLooking at the structure, I can see:\n- One checkbox [ref=e21] - unchecked (Active task)\n- One checkbox [ref=e35] - checked (Completed 1)\n- One checkbox [ref=e39] - checked and active (Completed 2)\n\nI'll verify that the \"Clear completed\" button is visible, which only appears when there are completed todos:"+ "method": "expectValue",+ "selector": "internal:role=listitem >> internal:has-text=\"Completed 1\"i >> internal:label=\"Toggle Todo\"i",+ "type": "checkbox",+ "value": "true",+ "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Completed 1' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });"+ },+ {+ "method": "expectValue",+ "selector": "internal:role=listitem >> internal:has-text=\"Completed 2\"i >> internal:label=\"Toggle Todo\"i",+ "type": "checkbox",+ "value": "true",+ "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Completed 2' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });"}]}diff --git a/examples/todomvc/tests/perform/filtering-todos/should-show-all-todos-with-all-filter.spec.ts-cache.json b/examples/todomvc/tests/perform/filtering-todos/should-show-all-todos-with-all-filter.spec.ts-cache.jsonindex 2323177b34..d8c3497141 100644--- a/examples/todomvc/tests/perform/filtering-todos/should-show-all-todos-with-all-filter.spec.ts-cache.json+++ b/examples/todomvc/tests/perform/filtering-todos/should-show-all-todos-with-all-filter.spec.ts-cache.json@@ -1,127 +1,106 @@{"Add three todos and mark one as complete": {- "timestamp": 1767733703925,"actions": [{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Buy groceries","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries');\nawait page.keyboard.press('Enter');",- "intent": "I'll help you add three todos and mark one as complete. Let me start by taking a snapshot to see the current state of the page, then proceed with the task."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries');\nawait page.keyboard.press('Enter');"},{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "text": "Finish homework",+ "text": "Walk the dog","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Finish homework');\nawait page.keyboard.press('Enter');",- "intent": "Great! The first todo \"Buy groceries\" has been added. Now let me add the second todo."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Walk the dog');\nawait page.keyboard.press('Enter');"},{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "text": "Call the dentist",+ "text": "Finish homework","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Call the dentist');\nawait page.keyboard.press('Enter');",- "intent": "Perfect! Two todos have been added. Now let me add the third todo."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Finish homework');\nawait page.keyboard.press('Enter');"},{"method": "click","selector": "internal:role=listitem >> internal:has-text=\"Buy groceries\"i >> internal:label=\"Toggle Todo\"i","options": {},- "code": "await page.getByRole('listitem').filter({ hasText: 'Buy groceries' }).getByLabel('Toggle Todo').click();",- "intent": "Excellent! All three todos have been added successfully. Now I need to mark one of them as complete by clicking one of the \"Toggle Todo\" checkboxes."+ "code": "await page.getByRole('listitem').filter({ hasText: 'Buy groceries' }).getByLabel('Toggle Todo').click();"}]},"All todos (both completed and active) are displayed": {- "timestamp": 1767733770499,"actions": [{"method": "expectAria",- "template": "- list:\n - listitem: Buy groceries\n - listitem: Finish homework\n - listitem: Call the dentist",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy groceries\n - listitem: Finish homework\n - listitem: Call the dentist\n`);",- "intent": "I need to verify that all todos (both completed and active) are displayed. From the page snapshot, I can see there's a list containing 3 todo items:\n\n1. \"Buy groceries\" (checked/completed)\n2. \"Finish homework\" (unchecked/active)\n3. \"Call the dentist\" (unchecked/active)\n\nThe \"All\" filter is currently active (shown as `link \"All\" [active]`), which should display all todos regardless of their completion status. I can verify this by checking that the list contains all three items in order."+ "template": "- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n - listitem: Finish homework",+ "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n - listitem: Finish homework\n`);"}]},"Click on the 'All' filter link": {- "timestamp": 1767733748069,"actions": [{"method": "click","selector": "internal:role=link[name=\"All\"i]","options": {},- "code": "await page.getByRole('link', { name: 'All' }).click();",- "intent": "I need to click on the 'All' filter link. Based on the page snapshot, I can see the 'All' link is located in a list of filters with ref=e28."+ "code": "await page.getByRole('link', { name: 'All' }).click();"}]},"Navigate to the 'Active' filter by clicking on it": {- "timestamp": 1767733725838,"actions": [{"method": "click","selector": "internal:role=link[name=\"Active\"i]","options": {},- "code": "await page.getByRole('link', { name: 'Active' }).click();",- "intent": "I need to click on the \"Active\" filter link to navigate to it."+ "code": "await page.getByRole('link', { name: 'Active' }).click();"}]},"Only active todos are visible": {- "timestamp": 1767733737809,"actions": [{"method": "expectAria",- "template": "- list:\n - listitem: Finish homework\n - listitem: Call the dentist",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Finish homework\n - listitem: Call the dentist\n`);",- "intent": "I need to verify that only active todos are visible on the page. Looking at the snapshot, I can see:\n\n1. The \"Active\" filter link is marked as [active], indicating we're viewing active todos\n2. There's a list with 2 list items showing:\n - \"Finish homework\" (unchecked)\n - \"Call the dentist\" (unchecked)\n3. The counter shows \"2 items left\"\n\nSince both todos are unchecked (not completed), they are active todos. I should verify that these specific items are visible in the list in the correct order."+ "template": "- list:\n - listitem: Walk the dog\n - listitem: Finish homework",+ "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Walk the dog\n - listitem: Finish homework\n`);"}]},"The 'All' filter link is highlighted": {- "timestamp": 1767733786993,"actions": [{"method": "expectVisible","selector": "internal:role=link[name=\"All\"i]",- "code": "await expect(page.getByRole('link', { name: 'All' })).toBeVisible();",- "intent": "I need to verify that the 'All' filter link is highlighted. Looking at the page snapshot, I can see that the 'All' link has the `[active]` attribute, which indicates it is highlighted/selected."+ "code": "await expect(page.getByRole('link', { name: 'All' })).toBeVisible();"}]},"The page loads with an empty todo list": {- "timestamp": 1767733664525,"actions": [{"method": "expectVisible","selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();",- "intent": "I need to verify that the page loads with an empty todo list. Looking at the page snapshot, I can see:\n\n1. There's a heading \"todos\"\n2. There's a textbox \"What needs to be done?\" \n3. There's no list of todo items visible in the snapshot\n\nThe absence of any todo list structure (like a list with items) indicates the todo list is empty. I'll verify that a todo list structure is NOT visible on the page, or alternatively, I can check that the key elements of an empty state are present (the input box for adding todos exists but no todo items are shown).\n\nLet me assert that there's no visible list of todos by checking that the main interactive element (the input textbox) is visible, which confirms the app loaded correctly with an empty state."+ "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();"}]},"The URL changes to #/": {- "timestamp": 1767733759187,"actions": [{"method": "expectVisible","selector": "internal:role=link[name=\"All\"i]",- "code": "await expect(page.getByRole('link', { name: 'All' })).toBeVisible();",- "intent": "I need to verify that the URL changes to \"#/\". Looking at the page snapshot, I can see there's a link with the accessible name \"All\" that is marked as [active] and has the URL \"#/\". This suggests the current URL is already \"#/\".\n\nTo verify this expectation, I should check that the \"All\" link is visible and active, which would confirm the URL is at \"#/\"."+ "code": "await expect(page.getByRole('link', { name: 'All' })).toBeVisible();"}]},"Three todos exist, one completed and two active": {- "timestamp": 1767733715973,"actions": [{"method": "expectAria",- "template": "- list:\n - listitem: Buy groceries\n - listitem: Finish homework\n - listitem: Call the dentist",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy groceries\n - listitem: Finish homework\n - listitem: Call the dentist\n`);",- "intent": "I need to verify that there are three todos total, with one completed and two active. Looking at the page snapshot, I can see:\n\n1. A list with 3 list items (refs e19, e33, e37)\n2. The first item \"Buy groceries\" has a checked checkbox (ref e21)\n3. The second item \"Finish homework\" has an unchecked checkbox (ref e35)\n4. The third item \"Call the dentist\" has an unchecked checkbox (ref e39)\n5. The footer shows \"2 items left\" which confirms 2 active todos\n\nI'll verify this by checking that the list contains exactly these three items in order."+ "template": "- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n - listitem: Finish homework",+ "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n - listitem: Finish homework\n`);"}]}diff --git a/examples/todomvc/tests/perform/persistence/should-persist-todos-after-page-reload.spec.ts-cache.json b/examples/todomvc/tests/perform/persistence/should-persist-todos-after-page-reload.spec.ts-cache.jsonindex d1d6c5d969..62ead87f9f 100644--- a/examples/todomvc/tests/perform/persistence/should-persist-todos-after-page-reload.spec.ts-cache.json+++ b/examples/todomvc/tests/perform/persistence/should-persist-todos-after-page-reload.spec.ts-cache.json@@ -1,123 +1,103 @@{"'Persistent 2' is marked as complete": {- "timestamp": 1767733726926,"actions": [{"method": "expectValue","selector": "internal:role=listitem >> internal:has-text=\"Persistent 2\"i >> internal:label=\"Toggle Todo\"i","type": "checkbox","value": "true",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Persistent 2' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });",- "intent": "I need to verify that 'Persistent 2' is marked as complete. Looking at the page snapshot, I can see that the checkbox for \"Persistent 2\" has the `[checked]` attribute, which indicates it is marked as complete.\n\nThe checkbox is at ref=e35 and is described as: `checkbox \"Toggle Todo\" [checked] [active]`\n\nI'll use the browser_expect_value tool to assert that this checkbox is checked."+ "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Persistent 2' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });"}]},"'Persistent 2' is still marked as complete": {- "timestamp": 1767733757369,"actions": [{"method": "expectValue","selector": "internal:role=listitem >> internal:has-text=\"Persistent 2\"i >> internal:label=\"Toggle Todo\"i","type": "checkbox","value": "true",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Persistent 2' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });",- "intent": "I need to verify that 'Persistent 2' is marked as complete. Looking at the page snapshot, I can see that the checkbox for \"Persistent 2\" has the `[checked]` attribute, indicating it is marked as complete.\n\nThe relevant element is:\n- checkbox \"Toggle Todo\" [checked] [active] [ref=e35]\n\nThis checkbox is associated with the \"Persistent 2\" item in the todo list."+ "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Persistent 2' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });"}]},"Add three todos: 'Persistent 1', 'Persistent 2', 'Persistent 3'": {- "timestamp": 1767733695757,"actions": [{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Persistent 1","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Persistent 1');\nawait page.keyboard.press('Enter');",- "intent": "I'll help you add three todos to the TodoMVC app. Let me start by taking a snapshot to see the current state of the page, then add each todo."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Persistent 1');\nawait page.keyboard.press('Enter');"},{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Persistent 2","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Persistent 2');\nawait page.keyboard.press('Enter');",- "intent": "Great! The first todo \"Persistent 1\" has been added. Now I'll add the second todo \"Persistent 2\"."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Persistent 2');\nawait page.keyboard.press('Enter');"},{"method": "fill","selector": "internal:role=textbox[name=\"What needs to be done?\"i]","text": "Persistent 3","submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Persistent 3');\nawait page.keyboard.press('Enter');",- "intent": "Perfect! Two todos have been added. Now I'll add the third and final todo \"Persistent 3\"."+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Persistent 3');\nawait page.keyboard.press('Enter');"}]},"All three todos appear in the list": {- "timestamp": 1767733706567,"actions": [{"method": "expectAria","template": "- list:\n - listitem: Persistent 1\n - listitem: Persistent 2\n - listitem: Persistent 3",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Persistent 1\n - listitem: Persistent 2\n - listitem: Persistent 3\n`);",- "intent": "I need to verify that all three todos appear in the list. Looking at the page snapshot, I can see there's a list with ref=e18 that contains three listitems with the text \"Persistent 1\", \"Persistent 2\", and \"Persistent 3\".\n\nI'll use the `browser_expect_list_visible` tool to assert that all three todos are present in the correct order."+ "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Persistent 1\n - listitem: Persistent 2\n - listitem: Persistent 3\n`);"}]},"All three todos are still present after reload": {- "timestamp": 1767733746638,"actions": [{"method": "expectAria","template": "- list:\n - listitem: Persistent 1\n - listitem: Persistent 2\n - listitem: Persistent 3",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Persistent 1\n - listitem: Persistent 2\n - listitem: Persistent 3\n`);",- "intent": "I need to verify that all three todos are still present after reload. Looking at the page snapshot, I can see a list with three listitem elements containing:\n1. \"Persistent 1\"\n2. \"Persistent 2\" \n3. \"Persistent 3\"\n\nI'll use the `browser_expect_list_visible` tool to assert that all three todos are present in the correct order."+ "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Persistent 1\n - listitem: Persistent 2\n - listitem: Persistent 3\n`);"}]},"Mark 'Persistent 2' as completed by clicking its checkbox": {- "timestamp": 1767733715624,"actions": [{"method": "click","selector": "internal:role=listitem >> internal:has-text=\"Persistent 2\"i >> internal:label=\"Toggle Todo\"i","options": {},- "code": "await page.getByRole('listitem').filter({ hasText: 'Persistent 2' }).getByLabel('Toggle Todo').click();",- "intent": "I'll help you mark 'Persistent 2' as completed by clicking its checkbox."+ "code": "await page.getByRole('listitem').filter({ hasText: 'Persistent 2' }).getByLabel('Toggle Todo').click();"}]},"Reload the page": {- "timestamp": 1767733736331,"actions": [{"method": "pressKey","key": "F5",- "code": "await page.keyboard.press('F5');",- "intent": "I need to reload the page. To do this, I'll use the browser_press_key function to press the F5 key, which is the standard keyboard shortcut for reloading a page."+ "code": "await page.keyboard.press('F5');"}]},"The counter shows '2 items left'": {- "timestamp": 1767733769067,"actions": [{"method": "expectVisible","selector": "internal:text=\"2 items left\"i",- "code": "await expect(page.getByText('2 items left')).toBeVisible();",- "intent": "I need to verify that the counter shows '2 items left'. Looking at the page snapshot, I can see:\n\n- A strong element [ref=e25] containing \"2\"\n- Followed by text: \"items left\"\n\nThese are within a generic element [ref=e24], which together display \"2 items left\". I'll use `browser_expect_visible_text` to verify this text is visible on the page."+ "code": "await expect(page.getByText('2 items left')).toBeVisible();"}]},"The page loads with an empty todo list": {- "timestamp": 1767733665328,"actions": [{"method": "expectVisible","selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();",- "intent": "I need to verify that the page loads with an empty todo list. Looking at the page snapshot, I can see:\n\n1. There's a textbox \"What needs to be done?\" which is the input for adding todos\n2. There's no list element visible containing any todo items\n3. The page structure shows the header with \"todos\" and the input field, but no todo list is present\n\nTo assert that the todo list is empty, I should check that a typical todo list element is NOT visible. In TodoMVC applications, todos are typically displayed in a list structure. Since there's no list of todos visible in the snapshot, I'll verify that the page has loaded correctly by confirming a key element is visible (like the input textbox), which indicates the page loaded but without any todos.\n\nLet me verify that the todo input textbox is visible, which confirms the page loaded, and the absence of any list elements in the snapshot confirms the list is empty:"+ "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();"}]}diff --git a/packages/playwright-core/src/server/agent/actions.ts b/packages/playwright-core/src/server/agent/actions.tsindex cf5e0ca2ad..1eeabbfa1c 100644--- a/packages/playwright-core/src/server/agent/actions.ts+++ b/packages/playwright-core/src/server/agent/actions.ts@@ -100,5 +100,4 @@ export type Action =export type ActionWithCode = Action & {code: string;- intent?: string;};diff --git a/packages/playwright-core/src/server/agent/context.ts b/packages/playwright-core/src/server/agent/context.tsindex 925399826f..ead11d060d 100644--- a/packages/playwright-core/src/server/agent/context.ts+++ b/packages/playwright-core/src/server/agent/context.ts@@ -29,17 +29,16 @@ import type * as channels from '@protocol/channels';type HistoryItem = {- type: 'expect' | 'perform' | 'extract';+ type: 'expect' | 'perform';description: string;};export class Context {readonly page: Page;- readonly actions: actions.ActionWithCode[] = [];readonly sdkLanguage: Language;readonly agentParams: channels.PageAgentParams;readonly events: loopTypes.LoopEvents;- private _currentCallIntent: string | undefined;- readonly history: HistoryItem[] = [];+ private _actions: actions.ActionWithCode[] = [];+ private _history: HistoryItem[] = [];constructor(page: Page, agentParms: channels.PageAgentParams, events: loopTypes.LoopEvents) {this.page = page;@@ -48,13 +47,8 @@ export class Context {this.events = events;}- async callTool(progress: Progress, tool: ToolDefinition, params: any, options: { intent?: string }) {- this._currentCallIntent = options.intent;- try {- return await tool.handle(progress, this, params);- } finally {- this._currentCallIntent = undefined;- }+ async callTool(progress: Progress, tool: ToolDefinition, params: any) {+ return await tool.handle(progress, this, params);}async runActionAndWait(progress: Progress, action: actions.Action) {@@ -66,13 +60,26 @@ export class Context {for (const a of action) {await runAction(progress, 'generate', this.page, a, this.agentParams?.secrets ?? []);const code = await generateCode(this.sdkLanguage, a);- this.actions.push({ ...a, code, intent: this._currentCallIntent });+ this._actions.push({ ...a, code });}return undefined;}).catch((error: Error) => error);return await this.snapshotResult(progress, error);}+ actions() {+ return this._actions.slice();+ }++ history(): HistoryItem[] {+ return this._history;+ }++ pushHistory(item: HistoryItem) {+ this._history.push(item);+ this._actions = [];+ }+async waitForCompletion<R>(progress: Progress, callback: () => Promise<R>): Promise<R> {const requests: Request[] = [];const requestListener = (request: Request) => requests.push(request);diff --git a/packages/playwright-core/src/server/agent/expectTools.ts b/packages/playwright-core/src/server/agent/expectTools.tsindex 439ca499e2..51c3184a52 100644--- a/packages/playwright-core/src/server/agent/expectTools.ts+++ b/packages/playwright-core/src/server/agent/expectTools.ts@@ -104,7 +104,7 @@ const expectList = defineTool({handle: async (progress, context, params) => {const template = `- ${params.listRole}:-progress, ${params.items.map(item => ` - ${params.itemRole}: ${yamlEscapeValueIfNeeded(item)}`).join('\n')}`;+${params.items.map(item => ` - ${params.itemRole}: ${yamlEscapeValueIfNeeded(item)}`).join('\n')}`;return await context.runActionAndWait(progress, {method: 'expectAria',template,diff --git a/packages/playwright-core/src/server/agent/pageAgent.ts b/packages/playwright-core/src/server/agent/pageAgent.tsindex 91b595fbd6..90532cb156 100644--- a/packages/playwright-core/src/server/agent/pageAgent.ts+++ b/packages/playwright-core/src/server/agent/pageAgent.ts@@ -50,7 +50,6 @@ ${userTask}`;await runLoop(progress, context, performTools, task, undefined, callParams);- context.history.push({ type: 'perform', description: userTask });await updateCache(context, cacheKey);}@@ -69,7 +68,6 @@ ${expectation}`;await runLoop(progress, context, expectTools, task, undefined, callParams);- context.history.push({ type: 'expect', description: expectation });await updateCache(context, cacheKey);}@@ -82,7 +80,6 @@ Extract the following information from the page. Do not perform any actions, jus### Query${query}`;const { result } = await runLoop(progress, context, [], task, schema, callParams);- context.history.push({ type: 'extract', description: query });return result;}@@ -90,8 +87,10 @@ async function runLoop(progress: Progress, context: Context, toolDefinitions: Toresult: any}> {const { page } = context;- if (!context.agentParams.api || !context.agentParams.apiKey || !context.agentParams.model)- throw new Error(`This action requires the API and API key to be set on the page agent. Are you running with --run-agents=none mode?`);+ if (!context.agentParams.api || !context.agentParams.model)+ throw new Error(`This action requires the API and API key to be set on the page agent. Did you mean to --run-agents=all?`);+ if (!context.agentParams.apiKey)+ throw new Error(`This action requires API key to be set on the page agent.`);const { full } = await page.snapshotForAI(progress);const { tools, callTool, reportedResult } = toolsForLoop(progress, context, toolDefinitions, { resultSchema });@@ -120,9 +119,9 @@ async function runLoop(progress: Progress, context: Context, toolDefinitions: Totask.push('### Task');task.push(userTask);- if (context.history.length) {+ if (context.history().length) {task.push('### Context history');- task.push(context.history.map(h => `- ${h.type}: ${h.description}`).join('\n'));+ task.push(context.history().map(h => `- ${h.type}: ${h.description}`).join('\n'));task.push('');}task.push('### Page snapshot');@@ -134,7 +133,6 @@ async function runLoop(progress: Progress, context: Context, toolDefinitions: To}type CachedActions = Record<string, {- timestamp: number,actions: actions.ActionWithCode[],}>;@@ -158,10 +156,7 @@ async function updateCache(context: Context, cacheKey: string) {const cacheFileKey = cacheFile ?? cacheOutFile;const cache = cacheFileKey ? await cachedActions(cacheFileKey) : { actions: {}, newActions: {} };- const newEntry = {- timestamp: Date.now(),- actions: context.actions,- };+ const newEntry = { actions: context.actions() };cache.actions[cacheKey] = newEntry;cache.newActions[cacheKey] = newEntry;diff --git a/packages/playwright-core/src/server/agent/tool.ts b/packages/playwright-core/src/server/agent/tool.tsindex 95333685bc..0394edb4bf 100644--- a/packages/playwright-core/src/server/agent/tool.ts+++ b/packages/playwright-core/src/server/agent/tool.ts@@ -55,7 +55,6 @@ export function toolsForLoop(progress: Progress, context: Context, toolDefinitiolet reportedResult: any;const callTool: loopTypes.ToolCallback = async params => {- const intent = params.arguments._meta?.['dev.lowire/intent'];if (params.name === 'report_result') {reportedResult = params.arguments;return {@@ -75,7 +74,7 @@ export function toolsForLoop(progress: Progress, context: Context, toolDefinitio}try {- return await context.callTool(progress, tool, params.arguments, { intent });+ return await context.callTool(progress, tool, params.arguments);} catch (error) {return {content: [{ type: 'text', text: error.message }],diff --git a/packages/playwright-core/src/server/dispatchers/pageAgentDispatcher.ts b/packages/playwright-core/src/server/dispatchers/pageAgentDispatcher.tsindex caca0f394e..c0f3455308 100644--- a/packages/playwright-core/src/server/dispatchers/pageAgentDispatcher.ts+++ b/packages/playwright-core/src/server/dispatchers/pageAgentDispatcher.ts@@ -40,12 +40,20 @@ export class PageAgentDispatcher extends Dispatcher<SdkObject, channels.PageAgen}async perform(params: channels.PageAgentPerformParams, progress: Progress): Promise<channels.PageAgentPerformResult> {- await pageAgentPerform(progress, this._context, params.task, params);+ try {+ await pageAgentPerform(progress, this._context, params.task, params);+ } finally {+ this._context.pushHistory({ type: 'perform', description: params.task });+ }return { usage: this._usage };}async expect(params: channels.PageAgentExpectParams, progress: Progress): Promise<channels.PageAgentExpectResult> {- await pageAgentExpect(progress, this._context, params.expectation, params);+ try {+ await pageAgentExpect(progress, this._context, params.expectation, params);+ } finally {+ this._context.pushHistory({ type: 'expect', description: params.expectation });+ }return { usage: this._usage };}diff --git a/packages/playwright/src/index.ts b/packages/playwright/src/index.tsindex 0e7ee8375c..90c942f28c 100644--- a/packages/playwright/src/index.ts+++ b/packages/playwright/src/index.ts@@ -468,6 +468,8 @@ const playwrightFixtures: Fixtures<TestFixtures, WorkerFixtures> = ({apiKey: agentOptions.apiKey,model: agentOptions.model,} : undefined;+ if (provider)+ testInfo.setTimeout(0);const cache = {cacheFile,diff --git a/packages/playwright/src/runner/storage.ts b/packages/playwright/src/runner/storage.tsindex 59987f2f52..8ac4e84125 100644--- a/packages/playwright/src/runner/storage.ts+++ b/packages/playwright/src/runner/storage.ts@@ -19,7 +19,7 @@ import path from 'path';import { createGuid } from 'playwright-core/lib/utils';-type StorageEnties = Record<string, { timestamp: number, value: any }>;+type StorageEnties = Record<string, unknown>;export class Storage {private static _storages = new Map<string, Storage>();diff --git a/tests/library/perform-task.spec.ts-cache.json b/tests/library/perform-task.spec.ts-cache.jsonindex 032a36ef31..7b7bf4c53c 100644--- a/tests/library/perform-task.spec.ts-cache.json+++ b/tests/library/perform-task.spec.ts-cache.json@@ -1,84 +1,61 @@{"Enter x-secret-email into the email field": {- "timestamp": 1767663309639,"actions": [{"method": "fill","selector": "internal:role=textbox[name=\"Email Address\"i]","text": "x-secret-email",- "code": "await page.getByRole('textbox', { name: 'Email Address' }).fill('x-secret-email');",- "intent": "I'll enter \"x-secret-email\" into the email field."+ "code": "await page.getByRole('textbox', { name: 'Email Address' }).fill('x-secret-email');"}]},"Fill out the form with the following details:\nName: John Smith\nAddress: 1045 La Avenida St, Mountain View, CA 94043\nEmail: [email protected]": {- "timestamp": 1767663315315,"actions": [{"method": "fill","selector": "internal:role=textbox[name=\"Full Name *\"i]","text": "John Smith",- "code": "await page.getByRole('textbox', { name: 'Full Name *' }).fill('John Smith');",- "intent": "I'll fill out the form with the provided details. Let me fill in the name, email, and address fields."+ "code": "await page.getByRole('textbox', { name: 'Full Name *' }).fill('John Smith');"},{"method": "fill","selector": "internal:role=textbox[name=\"Email Address *\"i]","text": "[email protected]",- "code": "await page.getByRole('textbox', { name: 'Email Address *' }).fill('[email protected]');",- "intent": "I'll fill out the form with the provided details. Let me fill in the name, email, and address fields."+ "code": "await page.getByRole('textbox', { name: 'Email Address *' }).fill('[email protected]');"},{"method": "fill","selector": "internal:role=textbox[name=\"Street Address *\"i]","text": "1045 La Avenida St",- "code": "await page.getByRole('textbox', { name: 'Street Address *' }).fill('1045 La Avenida St');",- "intent": "I'll fill out the form with the provided details. Let me fill in the name, email, and address fields."+ "code": "await page.getByRole('textbox', { name: 'Street Address *' }).fill('1045 La Avenida St');"},{"method": "fill","selector": "internal:role=textbox[name=\"City *\"i]","text": "Mountain View",- "code": "await page.getByRole('textbox', { name: 'City *' }).fill('Mountain View');",- "intent": "I'll fill out the form with the provided details. Let me fill in the name, email, and address fields."+ "code": "await page.getByRole('textbox', { name: 'City *' }).fill('Mountain View');"},{"method": "fill","selector": "internal:role=textbox[name=\"State/Province *\"i]","text": "CA",- "code": "await page.getByRole('textbox', { name: 'State/Province *' }).fill('CA');",- "intent": "I'll fill out the form with the provided details. Let me fill in the name, email, and address fields."+ "code": "await page.getByRole('textbox', { name: 'State/Province *' }).fill('CA');"},{"method": "fill","selector": "internal:role=textbox[name=\"ZIP/Postal Code *\"i]","text": "94043",- "code": "await page.getByRole('textbox', { name: 'ZIP/Postal Code *' }).fill('94043');",- "intent": "I'll fill out the form with the provided details. Let me fill in the name, email, and address fields."+ "code": "await page.getByRole('textbox', { name: 'ZIP/Postal Code *' }).fill('94043');"}]},"- Enter \"bogus\" into the email field\n - Check that the value is in fact \"bogus\"\n - Check that the error message is displayed": {- "timestamp": 1767663315431,"actions": [{"method": "fill","selector": "internal:role=textbox[name=\"Email Address\"i]","text": "bogus",- "code": "await page.getByRole('textbox', { name: 'Email Address' }).fill('bogus');",- "intent": "I'll help you complete this task. Let me first enter \"bogus\" into the email field."- }- ]- },- "click the Fox button": {- "timestamp": 1768072608059,- "actions": [- {- "method": "click",- "selector": "internal:role=button[name=\"Fox\"i]",- "options": {},- "code": "await page.getByRole('button', { name: 'Fox' }).click();",- "intent": "I'll click the Fox button for you."+ "code": "await page.getByRole('textbox', { name: 'Email Address' }).fill('bogus');"}]}