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
clean: remove post-conditions (#38694)
Pavel Feldmanb1e595476910
diff --git a/docs/src/api/params.md b/docs/src/api/params.mdindex 49848910c2..64ed0173b7 100644--- a/docs/src/api/params.md+++ b/docs/src/api/params.md@@ -375,7 +375,6 @@ Emulates consistent window screen size available inside web page via `window.scr- `api` ?<[string]> API to use, `openapi`, `google` or `anthropic`. Required in non-cache mode.- `apiEndpoint` ?<[string]> Endpoint to use if different from default.- `apiKey` ?<[string]> API key for the LLM provider.- - `apiVersion` ?<[string]> API version if relevant.- `model` ?<[string]> Model identifier within the provider. Required in non-cache mode.- `cacheFile` ?<[string]> Cache file to use/generate code for performed actions into. Cache is not used if not specified (default).- `cacheOutFile` ?<[string]> When specified, generated entries are written into the `cacheOutFile` instead of updating the `cacheFile`.@@ -403,10 +402,6 @@ Endpoint to use if different from default.API key for the LLM provider.-## page-agent-api-version-* since: v1.58-- `apiVersion` <[string]>-API version if relevant.## page-agent-cache-key@@ -433,7 +428,6 @@ Maximum number of agentic turns during this call, defaults to context-wide value- %%-page-agent-api-%%- %%-page-agent-api-key-%%- %%-page-agent-api-endpoint-%%-- %%-page-agent-api-version-%%- %%-page-agent-cache-key-%%- %%-page-agent-max-tokens-%%- %%-page-agent-max-turns-%%diff --git a/examples/todomvc/.github/prompts/playwright-test-generate.prompt.md b/examples/todomvc/.github/prompts/playwright-test-generate.prompt.mdindex 335e9fd8ad..183cb846c8 100644--- a/examples/todomvc/.github/prompts/playwright-test-generate.prompt.md+++ b/examples/todomvc/.github/prompts/playwright-test-generate.prompt.md@@ -3,6 +3,6 @@ agent: playwright-test-generatordescription: Generate test plan----Generate tests for the test plan's bullet 1.1 Add item to card.+Generate tests for the test plan's bullet 1. Adding Todos. Generate one test at a time, never in parallel.-Test plan: `specs/coverage.plan.md`+Test plan: `specs/basic-operations.plan.md`diff --git a/examples/todomvc/.github/prompts/playwright-test-plan.prompt.md b/examples/todomvc/.github/prompts/playwright-test-plan.prompt.mdindex 1c1f3a1871..730d26688d 100644--- a/examples/todomvc/.github/prompts/playwright-test-plan.prompt.md+++ b/examples/todomvc/.github/prompts/playwright-test-plan.prompt.md@@ -3,7 +3,7 @@ agent: playwright-test-plannerdescription: Create test plan----Create test plan for "add to cart" functionality of my app.+Create test plan for basic operations of the todo app. Test plan should contain around 20 tests.- Seed file: `tests/seed.spec.ts`-- Test plan: `specs/coverage.plan.md`+- Test plan: `specs/basic-operations.plan.md`diff --git a/examples/todomvc/specs/basic-operations.plan.md b/examples/todomvc/specs/basic-operations.plan.mdindex dc06a8be5c..a6e3d353d1 100644--- a/examples/todomvc/specs/basic-operations.plan.md+++ b/examples/todomvc/specs/basic-operations.plan.md@@ -2,577 +2,343 @@## Application Overview-TodoMVC is a single-page application that helps users manage their tasks. The application provides functionality to add, edit, complete, delete, and filter todos. Users can manage individual todos or perform bulk operations like marking all as complete or clearing all completed items. The interface includes a text input for adding new todos, a list view showing all todos with their completion status, filter buttons to view all/active/completed todos, and a footer displaying the count of active items.+This test plan covers the core functionality of the TodoMVC application, a simple todo list management tool. The application allows users to add, edit, complete, delete, and filter todo items. It includes features such as bulk operations (toggle all), filtering by status (All, Active, Completed), clearing completed items, and local storage persistence. The tests ensure comprehensive coverage of basic operations, edge cases, and data validation.## Test Scenarios-### 1. Todo Creation+### 1. Adding Todos**Seed:** `tests/seed.spec.ts`-#### 1.1. Add a single todo+#### 1.1. should-add-single-todo-**File:** `tests/todo-creation/add-single-todo.spec.ts`+**File:** `tests/adding-todos/should-add-single-todo.spec.ts`**Steps:**1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list and input field 'What needs to be done?' is visible+ - expect: The application loads successfully+ - expect: The input field 'What needs to be done?' is visible2. Type 'Buy groceries' into the input field- Expect: The text appears in the input field+ - expect: The text appears in the input field3. Press Enter to submit the todo- Expect: The todo 'Buy groceries' appears in the list and the input field is cleared+ - expect: The new todo 'Buy groceries' appears in the todo list+ - expect: The input field is cleared+ - expect: The todo counter shows '1 item left'-**Post Conditions:**- - The todo counter shows '1 item left'- - The new todo is unchecked (active state)+#### 1.2. should-add-multiple-todos-#### 1.2. Add multiple todos--**File:** `tests/todo-creation/add-multiple-todos.spec.ts`+**File:** `tests/adding-todos/should-add-multiple-todos.spec.ts`**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add first todo 'Buy groceries' by typing and pressing Enter- Expect: The first todo appears in the list- 3. Add second todo 'Walk the dog' by typing and pressing Enter- Expect: The second todo appears in the list below the first- 4. Add third todo 'Read a book' by typing and pressing Enter- Expect: The third todo appears in the list below the second--**Post Conditions:**- - All three todos are visible in the list- - The todo counter shows '3 items left'- - All todos are in active (unchecked) state+ 1. Add first todo 'Buy milk'+ - expect: The todo appears in the list+ - expect: Counter shows '1 item left'+ 2. Add second todo 'Walk the dog'+ - expect: Both todos appear in the list+ - expect: Counter shows '2 items left'+ 3. Add third todo 'Finish report'+ - expect: All three todos appear in the list+ - expect: Counter shows '3 items left'-#### 1.3. Prevent adding empty todo+#### 1.3. should-trim-whitespace-from-new-todo-**File:** `tests/todo-creation/prevent-empty-todo.spec.ts`+**File:** `tests/adding-todos/should-trim-whitespace-from-new-todo.spec.ts`**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Click into the input field without typing anything and press Enter- Expect: No todo is added to the list--**Post Conditions:**- - The todo list remains empty- - The input field is still focused and empty--#### 1.4. Prevent adding whitespace-only todo--**File:** `tests/todo-creation/prevent-whitespace-todo.spec.ts`--**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Type only spaces ' ' into the input field and press Enter- Expect: No todo is added to the list--**Post Conditions:**- - The todo list remains empty- - The input field is cleared or shows the spaces+ 1. Type ' Todo with spaces ' (with leading and trailing spaces) and press Enter+ - expect: The todo is added as 'Todo with spaces' without leading or trailing whitespace+ - expect: Counter shows '1 item left'-#### 1.5. Add todo with special characters+#### 1.4. should-not-add-empty-todo-**File:** `tests/todo-creation/add-todo-special-chars.spec.ts`+**File:** `tests/adding-todos/should-not-add-empty-todo.spec.ts`**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Type 'Buy @groceries & supplies (urgent!)' into the input field and press Enter- Expect: The todo appears in the list with all special characters preserved--**Post Conditions:**- - The todo displays exactly as entered with special characters- - The todo counter shows '1 item left'+ 1. Click on the input field without typing anything+ - expect: The input field is focused+ 2. Press Enter+ - expect: No todo is added to the list+ - expect: The todo list remains empty-### 2. Todo Completion+### 2. Completing Todos**Seed:** `tests/seed.spec.ts`-#### 2.1. Mark a single todo as complete--**File:** `tests/todo-completion/mark-single-complete.spec.ts`--**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add a todo 'Buy groceries'- Expect: The todo appears in the list unchecked- 3. Click the checkbox next to 'Buy groceries'- Expect: The checkbox becomes checked and the todo text may show visual indication of completion (strikethrough or style change)--**Post Conditions:**- - The todo counter shows '0 items left'- - The 'Clear completed' button appears in the footer--#### 2.2. Unmark a completed todo--**File:** `tests/todo-completion/unmark-completed.spec.ts`--**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add a todo 'Buy groceries'- Expect: The todo appears in the list unchecked- 3. Click the checkbox to mark it as complete- Expect: The checkbox becomes checked- 4. Click the checkbox again to unmark it- Expect: The checkbox becomes unchecked and the todo returns to active state--**Post Conditions:**- - The todo counter shows '1 item left'- - The 'Clear completed' button is no longer visible--#### 2.3. Mark all todos as complete+#### 2.1. should-complete-single-todo-**File:** `tests/todo-completion/mark-all-complete.spec.ts`+**File:** `tests/completing-todos/should-complete-single-todo.spec.ts`**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'- Expect: All three todos appear in the list unchecked- 3. Click the '❯Mark all as complete' checkbox at the top of the list- Expect: All three todos become checked--**Post Conditions:**- - The todo counter shows '0 items left'- - The 'Clear completed' button appears- - The '❯Mark all as complete' checkbox is checked--#### 2.4. Unmark all completed todos--**File:** `tests/todo-completion/unmark-all-complete.spec.ts`--**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'- Expect: All three todos appear in the list- 3. Click the '❯Mark all as complete' checkbox to mark all as complete- Expect: All todos become checked- 4. Click the '❯Mark all as complete' checkbox again- Expect: All todos become unchecked--**Post Conditions:**- - The todo counter shows '3 items left'- - The 'Clear completed' button is no longer visible- - The '❯Mark all as complete' checkbox is unchecked+ 1. Add a todo 'Buy groceries'+ - expect: The todo appears as active+ - expect: Counter shows '1 item left'+ 2. Click the checkbox next to the todo+ - expect: The checkbox is checked+ - expect: Counter shows '0 items left'+ - expect: The 'Clear completed' button appears in the footer-#### 2.5. Mixed completion state+#### 2.2. should-uncomplete-completed-todo-**File:** `tests/todo-completion/mixed-completion.spec.ts`+**File:** `tests/completing-todos/should-uncomplete-completed-todo.spec.ts`**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'- Expect: All three todos appear in the list- 3. Mark 'Buy groceries' as complete- Expect: First todo is checked- 4. Mark 'Read a book' as complete- Expect: Third todo is checked--**Post Conditions:**- - The todo counter shows '1 item left'- - The 'Clear completed' button is visible- - 'Walk the dog' remains unchecked- - The '❯Mark all as complete' checkbox is unchecked (since not all are complete)--### 3. Todo Editing--**Seed:** `tests/seed.spec.ts`+ 1. Add a todo 'Buy groceries' and mark it as complete+ - expect: The todo is marked as complete+ - expect: Counter shows '0 items left'+ 2. Click the checkbox again to uncomplete it+ - expect: The checkbox is unchecked+ - expect: Counter shows '1 item left'+ - expect: The 'Clear completed' button disappears-#### 3.1. Edit todo text+#### 2.3. should-complete-multiple-todos-**File:** `tests/todo-editing/edit-todo-text.spec.ts`+**File:** `tests/completing-todos/should-complete-multiple-todos.spec.ts`**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add a todo 'Buy groceries'- Expect: The todo appears in the list- 3. Double-click on the todo text 'Buy groceries'- Expect: The todo enters edit mode with a text input showing 'Buy groceries'- 4. Clear the text and type 'Buy groceries and milk'- Expect: The new text appears in the edit field- 5. Press Enter to save the changes- Expect: The todo exits edit mode and displays 'Buy groceries and milk'--**Post Conditions:**- - The todo shows the updated text- - The todo remains in its original completion state+ 1. Add three todos: 'Buy milk', 'Walk dog', 'Finish report'+ - expect: All three todos are visible+ - expect: Counter shows '3 items left'+ 2. Complete the first todo+ - expect: First todo is marked as complete+ - expect: Counter shows '2 items left'+ 3. Complete the third todo+ - expect: Third todo is marked as complete+ - expect: Counter shows '1 item left'+ - expect: The 'Clear completed' button appears-#### 3.2. Cancel editing with Escape+#### 2.4. should-toggle-all-todos-complete-**File:** `tests/todo-editing/cancel-edit-escape.spec.ts`+**File:** `tests/completing-todos/should-toggle-all-todos-complete.spec.ts`**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add a todo 'Buy groceries'- Expect: The todo appears in the list- 3. Double-click on the todo text to enter edit mode- Expect: The edit input appears with 'Buy groceries'- 4. Change the text to 'Something else'- Expect: The new text appears in the edit field- 5. Press Escape key- Expect: The edit is cancelled and the original text 'Buy groceries' is preserved+ 1. Add three todos: 'Task 1', 'Task 2', 'Task 3'+ - expect: All three todos are visible and active+ - expect: Counter shows '3 items left'+ 2. Click the 'Mark all as complete' checkbox+ - expect: All three todos are marked as complete+ - expect: All checkboxes are checked+ - expect: Counter shows '0 items left'+ - expect: The 'Clear completed' button appears-**Post Conditions:**- - The todo shows the original text 'Buy groceries'- - The todo is no longer in edit mode+#### 2.5. should-toggle-all-todos-incomplete-#### 3.3. Delete todo by clearing text--**File:** `tests/todo-editing/delete-by-clearing.spec.ts`+**File:** `tests/completing-todos/should-toggle-all-todos-incomplete.spec.ts`**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add a todo 'Buy groceries'- Expect: The todo appears in the list- 3. Double-click on the todo text to enter edit mode- Expect: The edit input appears- 4. Clear all the text in the edit field- Expect: The edit field is empty- 5. Press Enter to save- Expect: The todo is removed from the list--**Post Conditions:**- - The todo list is empty- - The todo counter and footer controls are hidden--#### 3.4. Edit completed todo--**File:** `tests/todo-editing/edit-completed-todo.spec.ts`+ 1. Add three todos and mark all as complete using the toggle all checkbox+ - expect: All todos are marked as complete+ - expect: Counter shows '0 items left'+ 2. Click the 'Mark all as complete' checkbox again+ - expect: All todos are marked as active+ - expect: All checkboxes are unchecked+ - expect: Counter shows '3 items left'+ - expect: The 'Clear completed' button disappears-**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add a todo 'Buy groceries'- Expect: The todo appears in the list- 3. Mark the todo as complete by clicking its checkbox- Expect: The todo is marked as complete- 4. Double-click on the completed todo text- Expect: The todo enters edit mode- 5. Change the text to 'Buy groceries and milk' and press Enter- Expect: The todo text is updated--**Post Conditions:**- - The todo shows the updated text 'Buy groceries and milk'- - The todo remains in completed state (checked)--### 4. Todo Deletion+### 3. Editing Todos**Seed:** `tests/seed.spec.ts`-#### 4.1. Delete a single todo+#### 3.1. should-edit-todo-by-double-clicking-**File:** `tests/todo-deletion/delete-single-todo.spec.ts`+**File:** `tests/editing-todos/should-edit-todo-by-double-clicking.spec.ts`**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add a todo 'Buy groceries'- Expect: The todo appears in the list- 3. Hover over the todo to reveal the delete button (×)- Expect: The delete button becomes visible- 4. Click the delete button (×)- Expect: The todo is removed from the list+ 1. Add a todo 'Buy milk'+ - expect: The todo appears in the list+ 2. Double-click on the todo text+ - expect: The todo enters edit mode+ - expect: An edit textbox appears with the current text 'Buy milk'+ - expect: The textbox is focused+ 3. Change the text to 'Buy organic milk' and press Enter+ - expect: The todo is updated to 'Buy organic milk'+ - expect: Edit mode is exited+ - expect: The updated text is displayed in the list-**Post Conditions:**- - The todo list is empty- - The footer and counter are hidden+#### 3.2. should-cancel-edit-on-escape-#### 4.2. Delete todo from multiple todos--**File:** `tests/todo-deletion/delete-from-multiple.spec.ts`+**File:** `tests/editing-todos/should-cancel-edit-on-escape.spec.ts`**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'- Expect: All three todos appear in the list- 3. Hover over 'Walk the dog' to reveal the delete button- Expect: The delete button becomes visible for 'Walk the dog'- 4. Click the delete button for 'Walk the dog'- Expect: The 'Walk the dog' todo is removed--**Post Conditions:**- - Only 'Buy groceries' and 'Read a book' remain in the list- - The todo counter shows '2 items left'+ 1. Add a todo 'Original text'+ - expect: The todo appears in the list+ 2. Double-click on the todo to enter edit mode+ - expect: Edit textbox appears with 'Original text'+ 3. Change the text to 'Modified text' but press Escape instead of Enter+ - expect: Edit mode is cancelled+ - expect: The todo text reverts to 'Original text'+ - expect: Changes are not saved-#### 4.3. Clear all completed todos+#### 3.3. should-save-edit-on-blur-**File:** `tests/todo-deletion/clear-completed.spec.ts`+**File:** `tests/editing-todos/should-save-edit-on-blur.spec.ts`**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'- Expect: All three todos appear in the list- 3. Mark 'Buy groceries' and 'Read a book' as complete- Expect: Two todos are checked- 4. Click the 'Clear completed' button in the footer- Expect: The completed todos are removed from the list--**Post Conditions:**- - Only 'Walk the dog' remains in the list- - The todo counter shows '1 item left'- - The 'Clear completed' button is no longer visible+ 1. Add a todo 'Call dentist'+ - expect: The todo appears in the list+ 2. Double-click on the todo to enter edit mode+ - expect: Edit textbox appears+ 3. Change the text to 'Schedule dentist appointment' and click elsewhere (blur the input)+ - expect: The changes are saved+ - expect: The todo text is updated to 'Schedule dentist appointment'+ - expect: Edit mode is exited-#### 4.4. Clear completed when all are completed+#### 3.4. should-delete-todo-when-edited-to-empty-**File:** `tests/todo-deletion/clear-all-completed.spec.ts`+**File:** `tests/editing-todos/should-delete-todo-when-edited-to-empty.spec.ts`**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add two todos: 'Buy groceries', 'Walk the dog'- Expect: Both todos appear in the list- 3. Mark both todos as complete- Expect: Both todos are checked- 4. Click the 'Clear completed' button- Expect: All todos are removed+ 1. Add a todo 'Temporary task'+ - expect: The todo appears in the list+ - expect: Counter shows '1 item left'+ 2. Double-click on the todo to enter edit mode+ - expect: Edit textbox appears+ 3. Clear all the text and press Enter+ - expect: The todo is deleted from the list+ - expect: The list is empty+ - expect: Counter shows '0 items left' or the footer is hidden-**Post Conditions:**- - The todo list is empty- - The footer and counter are hidden- - Only the input field remains visible+#### 3.5. should-trim-whitespace-when-editing-#### 4.5. Delete completed todo individually--**File:** `tests/todo-deletion/delete-completed-individually.spec.ts`+**File:** `tests/editing-todos/should-trim-whitespace-when-editing.spec.ts`**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add a todo 'Buy groceries'- Expect: The todo appears in the list- 3. Mark the todo as complete- Expect: The todo is checked- 4. Hover over the completed todo and click the delete button (×)- Expect: The completed todo is removed+ 1. Add a todo 'Original task'+ - expect: The todo appears in the list+ 2. Double-click to edit and change text to ' Edited task ' (with spaces)+ - expect: Edit textbox shows the text with spaces+ 3. Press Enter to save+ - expect: The todo is saved as 'Edited task' without leading or trailing whitespace-**Post Conditions:**- - The todo list is empty- - The footer is hidden--### 5. Todo Filtering+### 4. Deleting Todos**Seed:** `tests/seed.spec.ts`-#### 5.1. View all todos--**File:** `tests/todo-filtering/view-all-todos.spec.ts`--**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'- Expect: All three todos appear in the list- 3. Mark 'Buy groceries' as complete- Expect: First todo is checked- 4. Click the 'All' filter link- Expect: All three todos (both active and completed) are visible--**Post Conditions:**- - All three todos are visible in the list- - The 'All' filter link is highlighted/active- - The URL hash is '#/' or empty--#### 5.2. View active todos only--**File:** `tests/todo-filtering/view-active-todos.spec.ts`--**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'- Expect: All three todos appear in the list- 3. Mark 'Buy groceries' as complete- Expect: First todo is checked- 4. Click the 'Active' filter link- Expect: Only 'Walk the dog' and 'Read a book' are visible--**Post Conditions:**- - Only unchecked todos are visible- - The 'Active' filter link is highlighted/active- - The URL hash is '#/active'- - The todo counter still shows the correct count of active items--#### 5.3. View completed todos only+#### 4.1. should-delete-single-todo-**File:** `tests/todo-filtering/view-completed-todos.spec.ts`+**File:** `tests/deleting-todos/should-delete-single-todo.spec.ts`**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'- Expect: All three todos appear in the list- 3. Mark 'Buy groceries' and 'Read a book' as complete- Expect: Two todos are checked- 4. Click the 'Completed' filter link- Expect: Only 'Buy groceries' and 'Read a book' are visible+ 1. Add a todo 'Task to delete'+ - expect: The todo appears in the list+ - expect: Counter shows '1 item left'+ 2. Hover over the todo item+ - expect: A delete button (×) appears on the right side of the todo+ 3. Click the delete button+ - expect: The todo is removed from the list+ - expect: The list is empty+ - expect: The footer is hidden or shows '0 items left'-**Post Conditions:**- - Only checked todos are visible- - The 'Completed' filter link is highlighted/active- - The URL hash is '#/completed'- - The 'Clear completed' button is visible+#### 4.2. should-delete-specific-todo-from-multiple-#### 5.4. Switch between filters--**File:** `tests/todo-filtering/switch-filters.spec.ts`+**File:** `tests/deleting-todos/should-delete-specific-todo-from-multiple.spec.ts`**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'- Expect: All three todos appear- 3. Mark 'Buy groceries' as complete- Expect: First todo is checked- 4. Click 'Active' filter- Expect: Only active todos are shown (2 todos)- 5. Click 'Completed' filter- Expect: Only completed todos are shown (1 todo)- 6. Click 'All' filter- Expect: All todos are shown again (3 todos)--**Post Conditions:**- - The filter switches correctly each time- - The appropriate filter link is highlighted- - The URL hash updates accordingly--#### 5.5. Filter with no matching todos--**File:** `tests/todo-filtering/filter-no-matches.spec.ts`+ 1. Add three todos: 'Task 1', 'Task 2', 'Task 3'+ - expect: All three todos appear in the list+ - expect: Counter shows '3 items left'+ 2. Hover over 'Task 2' and click its delete button+ - expect: 'Task 2' is removed from the list+ - expect: 'Task 1' and 'Task 3' remain visible+ - expect: Counter shows '2 items left'-**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add two todos: 'Buy groceries', 'Walk the dog'- Expect: Both todos appear in the list unchecked- 3. Click the 'Completed' filter link- Expect: No todos are visible (empty list area)--**Post Conditions:**- - The main todo list area is empty or shows no items- - The footer with filters is still visible- - The 'Completed' filter link is highlighted--#### 5.6. Complete todo while viewing active filter+#### 4.3. should-clear-all-completed-todos-**File:** `tests/todo-filtering/complete-in-active-view.spec.ts`+**File:** `tests/deleting-todos/should-clear-all-completed-todos.spec.ts`**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add two todos: 'Buy groceries', 'Walk the dog'- Expect: Both todos appear in the list- 3. Click the 'Active' filter link- Expect: Both todos are visible- 4. Mark 'Buy groceries' as complete- Expect: The 'Buy groceries' todo disappears from the active view--**Post Conditions:**- - Only 'Walk the dog' is visible in the active view- - The todo counter shows '1 item left'- - Switching to 'All' or 'Completed' shows 'Buy groceries' is still there and checked--### 6. Todo Counter+ 1. Add three todos: 'Task 1', 'Task 2', 'Task 3'+ - expect: All three todos are visible+ 2. Mark 'Task 1' and 'Task 3' as complete+ - expect: Two todos are marked as complete+ - expect: Counter shows '1 item left'+ - expect: The 'Clear completed' button appears+ 3. Click the 'Clear completed' button+ - expect: 'Task 1' and 'Task 3' are removed from the list+ - expect: Only 'Task 2' remains visible+ - expect: Counter shows '1 item left'+ - expect: The 'Clear completed' button disappears++### 5. Filtering Todos**Seed:** `tests/seed.spec.ts`-#### 6.1. Counter updates when adding todos+#### 5.1. should-filter-active-todos-**File:** `tests/todo-counter/counter-add.spec.ts`+**File:** `tests/filtering-todos/should-filter-active-todos.spec.ts`**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add a todo 'Buy groceries'- Expect: The counter shows '1 item left'- 3. Add a todo 'Walk the dog'- Expect: The counter shows '2 items left'- 4. Add a todo 'Read a book'- Expect: The counter shows '3 items left'--**Post Conditions:**- - The counter accurately reflects the number of active todos- - The counter uses plural 'items' when count is not 1+ 1. Add three todos: 'Active 1', 'Active 2', 'Will complete'+ - expect: All three todos are visible+ 2. Mark 'Will complete' as completed+ - expect: One todo is marked as complete+ - expect: Counter shows '2 items left'+ 3. Click on the 'Active' filter link+ - expect: The URL changes to #/active+ - expect: Only 'Active 1' and 'Active 2' are displayed+ - expect: 'Will complete' is not visible+ - expect: The 'Active' filter link is highlighted-#### 6.2. Counter updates when completing todos+#### 5.2. should-filter-completed-todos-**File:** `tests/todo-counter/counter-complete.spec.ts`+**File:** `tests/filtering-todos/should-filter-completed-todos.spec.ts`**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'- Expect: The counter shows '3 items left'- 3. Mark 'Buy groceries' as complete- Expect: The counter shows '2 items left'- 4. Mark 'Walk the dog' as complete- Expect: The counter shows '1 item left'- 5. Mark 'Read a book' as complete- Expect: The counter shows '0 items left'--**Post Conditions:**- - The counter decreases as todos are completed- - The counter uses singular 'item' when count is 1+ 1. Add three todos: 'Active task', 'Completed 1', 'Completed 2'+ - expect: All three todos are visible+ 2. Mark 'Completed 1' and 'Completed 2' as completed+ - expect: Two todos are marked as complete+ 3. Click on the 'Completed' filter link+ - expect: The URL changes to #/completed+ - expect: Only 'Completed 1' and 'Completed 2' are displayed+ - expect: 'Active task' is not visible+ - expect: The 'Completed' filter link is highlighted-#### 6.3. Counter updates when deleting todos+#### 5.3. should-show-all-todos-with-all-filter-**File:** `tests/todo-counter/counter-delete.spec.ts`+**File:** `tests/filtering-todos/should-show-all-todos-with-all-filter.spec.ts`**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'- Expect: The counter shows '3 items left'- 3. Delete 'Walk the dog' using the delete button (×)- Expect: The counter shows '2 items left'+ 1. Add three todos and mark one as complete+ - expect: Three todos exist+ - expect: one completed and two active+ 2. Navigate to the 'Active' filter+ - expect: Only active todos are visible+ 3. Click on the 'All' filter link+ - expect: The URL changes to #/+ - expect: All todos (both completed and active) are displayed+ - expect: The 'All' filter link is highlighted++### 6. Persistence-**Post Conditions:**- - The counter decreases when an active todo is deleted+**Seed:** `tests/seed.spec.ts`-#### 6.4. Counter unchanged when deleting completed todo+#### 6.1. should-persist-todos-after-page-reload-**File:** `tests/todo-counter/counter-delete-completed.spec.ts`+**File:** `tests/persistence/should-persist-todos-after-page-reload.spec.ts`**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add two todos: 'Buy groceries', 'Walk the dog'- Expect: The counter shows '2 items left'- 3. Mark 'Buy groceries' as complete- Expect: The counter shows '1 item left'- 4. Delete 'Buy groceries' using the delete button- Expect: The counter still shows '1 item left'+ 1. Add three todos: 'Persistent 1', 'Persistent 2', 'Persistent 3'+ - expect: All three todos appear in the list+ 2. Mark 'Persistent 2' as completed+ - expect: 'Persistent 2' is marked as complete+ 3. Reload the page+ - expect: All three todos are still present after reload+ - expect: 'Persistent 2' is still marked as complete+ - expect: The counter shows '2 items left'-**Post Conditions:**- - The counter only counts active (uncompleted) todos- - Deleting completed todos doesn't affect the counter+### 7. UI State-#### 6.5. Counter persists across filter views+**Seed:** `tests/seed.spec.ts`-**File:** `tests/todo-counter/counter-across-filters.spec.ts`+#### 7.1. should-hide-footer-when-no-todos++**File:** `tests/ui-state/should-hide-footer-when-no-todos.spec.ts`**Steps:**- 1. Navigate to the TodoMVC application- Expect: The page loads with an empty todo list- 2. Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'- Expect: The counter shows '3 items left'- 3. Mark 'Buy groceries' as complete- Expect: The counter shows '2 items left'- 4. Click 'Active' filter- Expect: The counter still shows '2 items left'- 5. Click 'Completed' filter- Expect: The counter still shows '2 items left'--**Post Conditions:**- - The counter always shows the count of active todos regardless of the current filter view+ 1. Start with an empty todo list (no todos added)+ - expect: The footer with counter and filters is not visible+ - expect: Only the input field and heading are visible+ 2. Add a todo 'First task'+ - expect: The footer appears with counter '1 item left' and filter links+ 3. Delete the todo+ - expect: The footer is hidden againdiff --git a/examples/todomvc/tests/adding-todos/should-add-multiple-todos.spec.ts b/examples/todomvc/tests/adding-todos/should-add-multiple-todos.spec.tsnew file mode 100644index 0000000000..f441965b70--- /dev/null+++ b/examples/todomvc/tests/adding-todos/should-add-multiple-todos.spec.ts@@ -0,0 +1,34 @@+// seed: tests/seed.spec.ts++import { test, expect } from '../fixtures';++test.describe('Adding Todos', () => {+ test('should add multiple todos', async ({ page }) => {+ // 1. Add first todo 'Buy milk'+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy milk');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');++ // Expect: The todo appears in the list, Counter shows '1 item left'+ await expect(page.getByText('Buy milk')).toBeVisible();+ await expect(page.getByText('1 item left')).toBeVisible();++ // 2. Add second todo 'Walk the dog'+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Walk the dog');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');++ // Expect: Both todos appear in the list, Counter shows '2 items left'+ await expect(page.getByText('Buy milk')).toBeVisible();+ await expect(page.getByText('Walk the dog')).toBeVisible();+ await expect(page.getByText('2 items left')).toBeVisible();++ // 3. Add third todo 'Finish report'+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Finish report');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');++ // Expect: All three todos appear in the list, Counter shows '3 items left'+ await expect(page.getByText('Buy milk')).toBeVisible();+ await expect(page.getByText('Walk the dog')).toBeVisible();+ await expect(page.getByText('Finish report')).toBeVisible();+ await expect(page.getByText('3 items left')).toBeVisible();+ });+});diff --git a/examples/todomvc/tests/adding-todos/should-add-single-todo.spec.ts b/examples/todomvc/tests/adding-todos/should-add-single-todo.spec.tsnew file mode 100644index 0000000000..ce844be2a7--- /dev/null+++ b/examples/todomvc/tests/adding-todos/should-add-single-todo.spec.ts@@ -0,0 +1,25 @@+// seed: tests/seed.spec.ts++import { test, expect } from '../fixtures';++test.describe('Adding Todos', () => {+ test('should add single todo', async ({ page }) => {+ // Step 1: Navigate to the TodoMVC application+ // Expect: The application loads successfully, The input field 'What needs to be done?' is visible+ await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeVisible();++ // Step 2: Type 'Buy groceries' into the input field+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries');+ // Expect: The text appears in the input field+ await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toHaveValue('Buy groceries');++ // Step 3: Press Enter to submit the todo+ await page.keyboard.press('Enter');+ // Expect: The new todo 'Buy groceries' appears in the todo list+ await expect(page.getByText('Buy groceries')).toBeVisible();+ // Expect: The input field is cleared+ await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toHaveValue('');+ // Expect: The todo counter shows '1 item left'+ await expect(page.getByText('1 item left')).toBeVisible();+ });+});diff --git a/examples/todomvc/tests/adding-todos/should-not-add-empty-todo.spec.ts b/examples/todomvc/tests/adding-todos/should-not-add-empty-todo.spec.tsnew file mode 100644index 0000000000..a2eb8bd9fc--- /dev/null+++ b/examples/todomvc/tests/adding-todos/should-not-add-empty-todo.spec.ts@@ -0,0 +1,20 @@+// spec: Adding Todos - should not add empty todo+// seed: tests/seed.spec.ts++import { test, expect } from '../fixtures';++test.describe('Adding Todos', () => {+ test('should not add empty todo', async ({ page }) => {+ // 1. Click on the input field without typing anything+ await page.getByRole('textbox', { name: 'What needs to be done?' }).click();++ // Expect: The input field is focused+ await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toBeFocused();++ // 2. Press Enter+ await page.keyboard.press('Enter');++ // Expect: No todo is added to the list, The todo list remains empty+ await expect(page.getByRole('list')).not.toBeVisible();+ });+});diff --git a/examples/todomvc/tests/adding-todos/should-trim-whitespace-from-new-todo.spec.ts b/examples/todomvc/tests/adding-todos/should-trim-whitespace-from-new-todo.spec.tsnew file mode 100644index 0000000000..0128117949--- /dev/null+++ b/examples/todomvc/tests/adding-todos/should-trim-whitespace-from-new-todo.spec.ts@@ -0,0 +1,16 @@+// spec: Adding Todos+// seed: tests/seed.spec.ts++import { test, expect } from '../fixtures';++test.describe('Adding Todos', () => {+ test('should trim whitespace from new todo', async ({ page }) => {+ // 1. Type ' Todo with spaces ' (with leading and trailing spaces) and press Enter+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill(' Todo with spaces ');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');++ // Expect: The todo is added as 'Todo with spaces' without leading or trailing whitespace, Counter shows '1 item left'+ await expect(page.getByText('Todo with spaces')).toBeVisible();+ await expect(page.getByText('1 item left')).toBeVisible();+ });+});diff --git a/examples/todomvc/tests/completing-todos/should-complete-multiple-todos.spec.ts b/examples/todomvc/tests/completing-todos/should-complete-multiple-todos.spec.tsnew file mode 100644index 0000000000..d035d4a9ef--- /dev/null+++ b/examples/todomvc/tests/completing-todos/should-complete-multiple-todos.spec.ts@@ -0,0 +1,37 @@+// spec: specs/basic-operations.plan.md+// seed: tests/seed.spec.ts++import { test, expect } from '../fixtures';++test.describe('Completing Todos', () => {+ test('should complete multiple todos', async ({ page }) => {+ // 1. Add three todos: 'Buy milk', 'Walk dog', 'Finish report'+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy milk');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Walk dog');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Finish report');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');++ // Expect: All three todos are visible, Counter shows '3 items left'+ await expect(page.getByText('Buy milk')).toBeVisible();+ await expect(page.getByText('Walk dog')).toBeVisible();+ await expect(page.getByText('Finish report')).toBeVisible();+ await expect(page.getByText('3 items left')).toBeVisible();++ // 2. Complete the first todo+ await page.getByRole('listitem').filter({ hasText: 'Buy milk' }).getByLabel('Toggle Todo').click();++ // Expect: First todo is marked as complete, Counter shows '2 items left'+ await expect(page.getByRole('listitem').filter({ hasText: 'Buy milk' }).getByLabel('Toggle Todo')).toBeChecked();+ await expect(page.getByText('2 items left')).toBeVisible();++ // 3. Complete the third todo+ await page.getByRole('listitem').filter({ hasText: 'Finish report' }).getByLabel('Toggle Todo').click();++ // Expect: Third todo is marked as complete, Counter shows '1 item left', The 'Clear completed' button appears+ await expect(page.getByRole('listitem').filter({ hasText: 'Finish report' }).getByLabel('Toggle Todo')).toBeChecked();+ await expect(page.getByText('1 item left')).toBeVisible();+ await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible();+ });+});diff --git a/examples/todomvc/tests/completing-todos/should-complete-single-todo.spec.ts b/examples/todomvc/tests/completing-todos/should-complete-single-todo.spec.tsnew file mode 100644index 0000000000..86c79ef2bf--- /dev/null+++ b/examples/todomvc/tests/completing-todos/should-complete-single-todo.spec.ts@@ -0,0 +1,24 @@+// spec: specs/basic-operations.plan.md+// seed: tests/seed.spec.ts++import { test, expect } from '../fixtures';++test.describe('Completing Todos', () => {+ test('should-complete-single-todo', async ({ page }) => {+ // 1. Add a todo 'Buy groceries'+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');++ // Expect: The todo appears as active, Counter shows '1 item left'+ await expect(page.getByText('Buy groceries')).toBeVisible();+ await expect(page.getByText('1 item left')).toBeVisible();++ // 2. Click the checkbox next to the todo+ await page.getByRole('checkbox', { name: 'Toggle Todo' }).click();++ // Expect: The checkbox is checked, Counter shows '0 items left', The 'Clear completed' button appears in the footer+ await expect(page.getByRole('checkbox', { name: 'Toggle Todo' })).toBeChecked();+ await expect(page.getByText('0 items left')).toBeVisible();+ await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible();+ });+});diff --git a/examples/todomvc/tests/completing-todos/should-toggle-all-todos-complete.spec.ts b/examples/todomvc/tests/completing-todos/should-toggle-all-todos-complete.spec.tsnew file mode 100644index 0000000000..1c1517b649--- /dev/null+++ b/examples/todomvc/tests/completing-todos/should-toggle-all-todos-complete.spec.ts@@ -0,0 +1,30 @@+// spec: specs/basic-operations.plan.md+// seed: tests/seed.spec.ts++import { test, expect } from '../fixtures';++test.describe('Completing Todos', () => {+ test('should-toggle-all-todos-complete', async ({ page }) => {+ // 1. Add three todos: 'Task 1', 'Task 2', 'Task 3'+ const newTodoInput = page.getByRole('textbox', { name: 'What needs to be done?' });+ await newTodoInput.fill('Task 1');+ await newTodoInput.press('Enter');+ await newTodoInput.fill('Task 2');+ await newTodoInput.press('Enter');+ await newTodoInput.fill('Task 3');+ await newTodoInput.press('Enter');++ // Expect: All three todos are visible and active, Counter shows '3 items left'+ await expect(page.getByText('Task 1')).toBeVisible();+ await expect(page.getByText('Task 2')).toBeVisible();+ await expect(page.getByText('Task 3')).toBeVisible();+ await expect(page.getByText('3 items left')).toBeVisible();++ // 2. Click the 'Mark all as complete' checkbox+ await page.getByRole('checkbox', { name: '❯Mark all as complete' }).click();++ // Expect: All three todos are marked as complete, All checkboxes are checked, Counter shows '0 items left', The 'Clear completed' button appears+ await expect(page.getByText('0 items left')).toBeVisible();+ await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible();+ });+});diff --git a/examples/todomvc/tests/completing-todos/should-toggle-all-todos-incomplete.spec.ts b/examples/todomvc/tests/completing-todos/should-toggle-all-todos-incomplete.spec.tsnew file mode 100644index 0000000000..80d8cb9bec--- /dev/null+++ b/examples/todomvc/tests/completing-todos/should-toggle-all-todos-incomplete.spec.ts@@ -0,0 +1,22 @@+// spec: specs/basic-operations.plan.md+// seed: tests/seed.spec.ts++import { test, expect } from '../fixtures';++test.describe('Completing Todos', () => {+ test('should toggle all todos incomplete', async ({ page }) => {+ // 1. Add three todos and mark all as complete using the toggle all checkbox+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('First todo');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Second todo');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Third todo');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');+ await page.getByRole('checkbox', { name: '❯Mark all as complete' }).click();+ await expect(page.getByText('0 items left')).toBeVisible();++ // 2. Click the 'Mark all as complete' checkbox again+ await page.getByRole('checkbox', { name: '❯Mark all as complete' }).click();+ await expect(page.getByText('3 items left')).toBeVisible();+ });+});diff --git a/examples/todomvc/tests/completing-todos/should-uncomplete-completed-todo.spec.ts b/examples/todomvc/tests/completing-todos/should-uncomplete-completed-todo.spec.tsnew file mode 100644index 0000000000..1060996701--- /dev/null+++ b/examples/todomvc/tests/completing-todos/should-uncomplete-completed-todo.spec.ts@@ -0,0 +1,16 @@+// spec: specs/basic-operations.plan.md+// seed: tests/seed.spec.ts++import { test, expect } from '../fixtures';++test.describe('Completing Todos', () => {+ test('should-uncomplete-completed-todo', async ({ page }) => {+ // 1. Add a todo 'Buy groceries' and mark it as complete+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');+ await page.getByRole('checkbox', { name: 'Toggle Todo' }).click();++ // 2. Click the checkbox again to uncomplete it+ await page.getByRole('checkbox', { name: 'Toggle Todo' }).click();+ });+});diff --git a/examples/todomvc/tests/deleting-todos/should-clear-all-completed-todos.spec.ts b/examples/todomvc/tests/deleting-todos/should-clear-all-completed-todos.spec.tsnew file mode 100644index 0000000000..37e9eb6ec5--- /dev/null+++ b/examples/todomvc/tests/deleting-todos/should-clear-all-completed-todos.spec.ts@@ -0,0 +1,33 @@+// spec: specs/basic-operations.plan.md+// seed: tests/seed.spec.ts++import { test, expect } from '../fixtures';++test.describe('Deleting Todos', () => {+ test('should-clear-all-completed-todos', async ({ page }) => {+ // 1. Add three todos: 'Task 1', 'Task 2', 'Task 3'+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 1');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 2');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 3');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');+ await expect(page.locator('body')).toMatchAriaSnapshot(`+- list:+ - listitem: "Task 1"+ - listitem: "Task 2"+ - listitem: "Task 3"+`);++ // 2. Mark 'Task 1' and 'Task 3' as complete+ await page.getByRole('listitem').filter({ hasText: 'Task 1' }).getByLabel('Toggle Todo').click();+ await page.getByRole('listitem').filter({ hasText: 'Task 3' }).getByLabel('Toggle Todo').click();+ await expect(page.getByText('1 item left')).toBeVisible();+ await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible();++ // 3. Click the 'Clear completed' button+ await page.getByRole('button', { name: 'Clear completed' }).click();+ await expect(page.getByText('Task 2')).toBeVisible();+ await expect(page.getByText('1 item left')).toBeVisible();+ });+});diff --git a/examples/todomvc/tests/deleting-todos/should-delete-single-todo.spec.ts b/examples/todomvc/tests/deleting-todos/should-delete-single-todo.spec.tsnew file mode 100644index 0000000000..38814183b6--- /dev/null+++ b/examples/todomvc/tests/deleting-todos/should-delete-single-todo.spec.ts@@ -0,0 +1,24 @@+// spec: specs/basic-operations.plan.md+// seed: tests/seed.spec.ts++import { test, expect } from '../fixtures';++test.describe('Deleting Todos', () => {+ test('should-delete-single-todo', async ({ page }) => {+ // 1. Add a todo 'Task to delete'+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task to delete');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');+ await expect(page.getByText('Task to delete')).toBeVisible();+ await expect(page.getByText('1 item left')).toBeVisible();++ // 2. Hover over the todo item+ await page.getByTestId('todo-item').hover();+ await expect(page.getByRole('button', { name: 'Delete' })).toBeVisible();++ // 3. Click the delete button+ const deleteButton = page.getByRole('button', { name: 'Delete' });+ await deleteButton.click();+ await expect(page.getByText('Task to delete')).not.toBeVisible();+ await expect(page.getByTestId('todo-item')).not.toBeVisible();+ });+});diff --git a/examples/todomvc/tests/deleting-todos/should-delete-specific-todo-from-multiple.spec.ts b/examples/todomvc/tests/deleting-todos/should-delete-specific-todo-from-multiple.spec.tsnew file mode 100644index 0000000000..cd978a83e7--- /dev/null+++ b/examples/todomvc/tests/deleting-todos/should-delete-specific-todo-from-multiple.spec.ts@@ -0,0 +1,31 @@+// spec: specs/basic-operations.plan.md+// seed: tests/seed.spec.ts++import { test, expect } from '../fixtures';++test.describe('Deleting Todos', () => {+ test('should-delete-specific-todo-from-multiple', async ({ page }) => {+ // 1. Add three todos: 'Task 1', 'Task 2', 'Task 3'+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 1');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 2');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Task 3');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');++ // Expect: All three todos appear in the list,Counter shows '3 items left'+ await expect(page.getByText('Task 1')).toBeVisible();+ await expect(page.getByText('Task 2')).toBeVisible();+ await expect(page.getByText('Task 3')).toBeVisible();+ await expect(page.getByText('3 items left')).toBeVisible();++ // 2. Hover over 'Task 2' and click its delete button+ await page.getByRole('listitem').filter({ hasText: 'Task 2' }).hover();+ await page.getByRole('button', { name: 'Delete' }).click();++ // Expect: 'Task 2' is removed from the list,'Task 1' and 'Task 3' remain visible,Counter shows '2 items left'+ await expect(page.getByText('Task 1')).toBeVisible();+ await expect(page.getByText('Task 3')).toBeVisible();+ await expect(page.getByText('2 items left')).toBeVisible();+ });+});diff --git a/examples/todomvc/tests/editing-todos/should-cancel-edit-on-escape.spec.ts b/examples/todomvc/tests/editing-todos/should-cancel-edit-on-escape.spec.tsnew file mode 100644index 0000000000..0f4f72615b--- /dev/null+++ b/examples/todomvc/tests/editing-todos/should-cancel-edit-on-escape.spec.ts@@ -0,0 +1,28 @@+// spec: specs/editing-todos.plan.md+// seed: tests/seed.spec.ts++import { test, expect } from '../fixtures';++test.describe('Editing Todos', () => {+ test('should-cancel-edit-on-escape', async ({ page }) => {+ // 1. Add a todo 'Original text'+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Original text');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');++ // Expect: The todo appears in the list+ await expect(page.getByText('Original text')).toBeVisible();++ // 2. Double-click on the todo to enter edit mode+ await page.getByTestId('todo-title').dblclick();++ // Expect: Edit textbox appears with 'Original text'+ await expect(page.getByRole('textbox', { name: 'Edit' })).toHaveValue('Original text');++ // 3. Change the text to 'Modified text' but press Escape instead of Enter+ await page.getByRole('textbox', { name: 'Edit' }).fill('Modified text');+ await page.keyboard.press('Escape');++ // Expect: Edit mode is cancelled, The todo text reverts to 'Original text', Changes are not saved+ await expect(page.getByText('Original text')).toBeVisible();+ });+});diff --git a/examples/todomvc/tests/editing-todos/should-delete-todo-when-edited-to-empty.spec.ts b/examples/todomvc/tests/editing-todos/should-delete-todo-when-edited-to-empty.spec.tsnew file mode 100644index 0000000000..388e53ed42--- /dev/null+++ b/examples/todomvc/tests/editing-todos/should-delete-todo-when-edited-to-empty.spec.ts@@ -0,0 +1,25 @@+// spec: Editing Todos - should delete todo when edited to empty+// seed: tests/seed.spec.ts++import { test, expect } from '../fixtures';++test.describe('Editing Todos', () => {+ test('should delete todo when edited to empty', async ({ page }) => {+ // 1. Add a todo 'Temporary task'+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Temporary task');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');+ await expect(page.getByText('Temporary task')).toBeVisible();+ await expect(page.getByText('1 item left')).toBeVisible();++ // 2. Double-click on the todo to enter edit mode+ await page.getByTestId('todo-title').dblclick();+ await expect(page.getByRole('textbox', { name: 'Edit' })).toBeVisible();++ // 3. Clear all the text and press Enter+ const editTextbox = page.getByRole('textbox', { name: 'Edit' });+ await editTextbox.fill('');+ await editTextbox.press('Enter');+ await expect(page.getByText('Temporary task')).not.toBeVisible();+ await expect(page.getByTestId('todo-title')).not.toBeVisible();+ });+});diff --git a/examples/todomvc/tests/editing-todos/should-edit-todo-by-double-clicking.spec.ts b/examples/todomvc/tests/editing-todos/should-edit-todo-by-double-clicking.spec.tsnew file mode 100644index 0000000000..9971fef3d9--- /dev/null+++ b/examples/todomvc/tests/editing-todos/should-edit-todo-by-double-clicking.spec.ts@@ -0,0 +1,23 @@+// spec: specs/editing-todos.plan.md+// seed: tests/seed.spec.ts++import { test, expect } from '../fixtures';++test.describe('Editing Todos', () => {+ test('should edit todo by double-clicking', async ({ page }) => {+ // 1. Add a todo 'Buy milk'+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy milk');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');+ await expect(page.getByText('Buy milk')).toBeVisible();++ // 2. Double-click on the todo text+ await page.getByTestId('todo-title').dblclick();+ await expect(page.getByRole('textbox', { name: 'Edit' })).toBeVisible();+ await expect(page.getByRole('textbox', { name: 'Edit' })).toHaveValue('Buy milk');++ // 3. Change the text to 'Buy organic milk' and press Enter+ await page.getByRole('textbox', { name: 'Edit' }).fill('Buy organic milk');+ await page.getByRole('textbox', { name: 'Edit' }).press('Enter');+ await expect(page.getByText('Buy organic milk')).toBeVisible();+ });+});diff --git a/examples/todomvc/tests/editing-todos/should-save-edit-on-blur.spec.ts b/examples/todomvc/tests/editing-todos/should-save-edit-on-blur.spec.tsnew file mode 100644index 0000000000..970ce1ebd3--- /dev/null+++ b/examples/todomvc/tests/editing-todos/should-save-edit-on-blur.spec.ts@@ -0,0 +1,21 @@+// spec: specs/basic-operations.plan.md+// seed: tests/seed.spec.ts++import { test, expect } from '../fixtures';++test.describe('Editing Todos', () => {+ test('should-save-edit-on-blur', async ({ page }) => {+ // 1. Add a todo 'Call dentist'+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Call dentist');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');++ // 2. Double-click on the todo to enter edit mode+ await page.getByTestId('todo-title').dblclick();++ // 3. Change the text to 'Schedule dentist appointment' and click elsewhere (blur the input)+ await page.getByRole('textbox', { name: 'Edit' }).fill('Schedule dentist appointment');+ await page.getByRole('heading', { name: 'todos' }).click();++ await expect(page.getByText('Schedule dentist appointment')).toBeVisible();+ });+});diff --git a/examples/todomvc/tests/editing-todos/should-trim-whitespace-when-editing.spec.ts b/examples/todomvc/tests/editing-todos/should-trim-whitespace-when-editing.spec.tsnew file mode 100644index 0000000000..c799b2ac6a--- /dev/null+++ b/examples/todomvc/tests/editing-todos/should-trim-whitespace-when-editing.spec.ts@@ -0,0 +1,27 @@+// seed: tests/seed.spec.ts++import { test, expect } from '../fixtures';++test.describe('Editing Todos', () => {+ test('should trim whitespace when editing', async ({ page }) => {+ // 1. Add a todo 'Original task'+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Original task');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');++ // Expect: The todo appears in the list+ await expect(page.getByText('Original task')).toBeVisible();++ // 2. Double-click to edit and change text to ' Edited task ' (with spaces)+ await page.getByTestId('todo-title').dblclick();+ await page.getByRole('textbox', { name: 'Edit' }).fill(' Edited task ');++ // Expect: Edit textbox shows the text with spaces+ await expect(page.getByRole('textbox', { name: 'Edit' })).toHaveValue(' Edited task ');++ // 3. Press Enter to save+ await page.keyboard.press('Enter');++ // Expect: The todo is saved as 'Edited task' without leading or trailing whitespace+ await expect(page.getByText('Edited task')).toBeVisible();+ });+});diff --git a/examples/todomvc/tests/filtering-todos/should-filter-active-todos.spec.ts b/examples/todomvc/tests/filtering-todos/should-filter-active-todos.spec.tsnew file mode 100644index 0000000000..53ad9c65cf--- /dev/null+++ b/examples/todomvc/tests/filtering-todos/should-filter-active-todos.spec.ts@@ -0,0 +1,44 @@+// spec: Filtering Todos+// seed: tests/seed.spec.ts++import { test, expect } from '../fixtures';++test.describe('Filtering Todos', () => {+ test('should-filter-active-todos', async ({ page }) => {+ // 1. Add three todos: 'Active 1', 'Active 2', 'Will complete'+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Active 1');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Active 2');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Will complete');+ await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');++ // Expect: All three todos are visible+ await expect(page.getByText('Active 1')).toBeVisible();+ await expect(page.getByText('Active 2')).toBeVisible();+ await expect(page.getByText('Will complete')).toBeVisible();++ // 2. Mark 'Will complete' as completed+ await page.getByRole('listitem').filter({ hasText: 'Will complete' }).getByLabel('Toggle Todo').click();++ // Expect: One todo is marked as complete, Counter shows '2 items left'+ await expect(page.getByRole('listitem').filter({ hasText: 'Will complete' }).getByLabel('Toggle Todo')).toBeChecked();+ await expect(page.getByText('2 items left')).toBeVisible();++ // 3. Click on the 'Active' filter link+ await page.getByRole('link', { name: 'Active' }).click();++ // Expect: The URL changes to #/active+ await expect(page).toHaveURL(/#\/active$/);++ // Expect: Only 'Active 1' and 'Active 2' are displayed+ await expect(page.getByText('Active 1')).toBeVisible();+ await expect(page.getByText('Active 2')).toBeVisible();++ // Expect: 'Will complete' is not visible+ await expect(page.getByText('Will complete')).not.toBeVisible();++ // Expect: The 'Active' filter link is highlighted+ await expect(page.getByRole('link', { name: 'Active' })).toBeVisible();+ });+});diff --git a/examples/todomvc/tests/perform/completing-todos/should-complete-multiple-todos.spec.ts b/examples/todomvc/tests/perform/completing-todos/should-complete-multiple-todos.spec.tsnew file mode 100644index 0000000000..dfaa105ecc--- /dev/null+++ b/examples/todomvc/tests/perform/completing-todos/should-complete-multiple-todos.spec.ts@@ -0,0 +1,27 @@+import { test } from '../../fixtures';++test.use({+ agent: {+ api: 'anthropic',+ apiKey: process.env.AZURE_SONNET_API_KEY!,+ apiEndpoint: process.env.AZURE_SONNET_ENDPOINT!,+ model: 'claude-sonnet-4-5',+ }+});++test('should complete multiple todos', async ({ page }) => {+ await page.agent.expect(`The page loads with an empty todo list`);++ await page.agent.perform(`Add three todos: 'Buy milk', 'Walk dog', 'Finish report'`);+ await page.agent.expect(`All three todos are visible`);+ await page.agent.expect(`Counter shows '3 items left'`);++ await page.agent.perform(`Complete the first todo by clicking its checkbox`);+ await page.agent.expect(`First todo is marked as complete`);+ await page.agent.expect(`Counter shows '2 items left'`);++ await page.agent.perform(`Complete the third todo by clicking its checkbox`);+ await page.agent.expect(`Third todo is marked as complete`);+ await page.agent.expect(`Counter shows '1 item left'`);+ await page.agent.expect(`The 'Clear completed' button appears`);+});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.jsonnew file mode 100644index 0000000000..866cfd064a--- /dev/null+++ b/examples/todomvc/tests/perform/completing-todos/should-complete-multiple-todos.spec.ts-cache.json@@ -0,0 +1,147 @@+{+ "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."+ },+ {+ "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\"."+ },+ {+ "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\"."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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:"+ }+ ]+ },+ "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."+ }+ ]+ },+ "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:"+ }+ ]+ },+ "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."+ }+ ]+ }+}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/completing-todos/should-complete-single-todo.spec.ts b/examples/todomvc/tests/perform/completing-todos/should-complete-single-todo.spec.tsnew file mode 100644index 0000000000..614c868661--- /dev/null+++ b/examples/todomvc/tests/perform/completing-todos/should-complete-single-todo.spec.ts@@ -0,0 +1,23 @@+import { test } from '../../fixtures';++test.use({+ agent: {+ api: 'anthropic',+ apiKey: process.env.AZURE_SONNET_API_KEY!,+ apiEndpoint: process.env.AZURE_SONNET_ENDPOINT!,+ model: 'claude-sonnet-4-5',+ }+});++test('should complete single todo', async ({ page }) => {+ await page.agent.expect(`The page loads with an empty todo list`);++ await page.agent.perform(`Add a todo 'Buy groceries'`);+ await page.agent.expect(`The todo appears as active`);+ await page.agent.expect(`Counter shows '1 item left'`);++ await page.agent.perform(`Click the checkbox next to the todo`);+ await page.agent.expect(`The checkbox is checked`);+ await page.agent.expect(`Counter shows '0 items left'`);+ await page.agent.expect(`The 'Clear completed' button appears in the footer`);+});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.jsonnew file mode 100644index 0000000000..4eb43f5fc6--- /dev/null+++ b/examples/todomvc/tests/perform/completing-todos/should-complete-single-todo.spec.ts-cache.json@@ -0,0 +1,97 @@+{+ "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."+ }+ ]+ },+ "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\"."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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:"+ }+ ]+ },+ "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."+ }+ ]+ },+ "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):"+ }+ ]+ }+}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/completing-todos/should-toggle-all-todos-complete.spec.ts b/examples/todomvc/tests/perform/completing-todos/should-toggle-all-todos-complete.spec.tsnew file mode 100644index 0000000000..7623fb5499--- /dev/null+++ b/examples/todomvc/tests/perform/completing-todos/should-toggle-all-todos-complete.spec.ts@@ -0,0 +1,24 @@+import { test } from '../../fixtures';++test.use({+ agent: {+ api: 'anthropic',+ apiKey: process.env.AZURE_SONNET_API_KEY!,+ apiEndpoint: process.env.AZURE_SONNET_ENDPOINT!,+ model: 'claude-sonnet-4-5',+ }+});++test('should toggle all todos complete', async ({ page }) => {+ await page.agent.expect(`The page loads with an empty todo list`);++ await page.agent.perform(`Add three todos: 'Task 1', 'Task 2', 'Task 3'`);+ await page.agent.expect(`All three todos are visible and active`);+ await page.agent.expect(`Counter shows '3 items left'`);++ await page.agent.perform(`Click the 'Mark all as complete' checkbox`);+ await page.agent.expect(`All three todos are marked as complete`);+ await page.agent.expect(`All checkboxes are checked`);+ await page.agent.expect(`Counter shows '0 items left'`);+ await page.agent.expect(`The 'Clear completed' button appears`);+});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.jsonnew file mode 100644index 0000000000..4da1083941--- /dev/null+++ b/examples/todomvc/tests/perform/completing-todos/should-toggle-all-todos-complete.spec.ts-cache.json@@ -0,0 +1,131 @@+{+ "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."+ },+ {+ "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\"."+ },+ {+ "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\"."+ }+ ]+ },+ "All checkboxes are checked": {+ "timestamp": 1767733766305,+ "actions": []+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ }+}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/completing-todos/should-toggle-all-todos-incomplete.spec.ts b/examples/todomvc/tests/perform/completing-todos/should-toggle-all-todos-incomplete.spec.tsnew file mode 100644index 0000000000..05767261a2--- /dev/null+++ b/examples/todomvc/tests/perform/completing-todos/should-toggle-all-todos-incomplete.spec.ts@@ -0,0 +1,24 @@+import { test } from '../../fixtures';++test.use({+ agent: {+ api: 'anthropic',+ apiKey: process.env.AZURE_SONNET_API_KEY!,+ apiEndpoint: process.env.AZURE_SONNET_ENDPOINT!,+ model: 'claude-sonnet-4-5',+ }+});++test('should toggle all todos incomplete', async ({ page }) => {+ await page.agent.expect(`The page loads with an empty todo list`);++ await page.agent.perform(`Add three todos: 'Task 1', 'Task 2', 'Task 3' and mark all as complete using the toggle all checkbox`);+ await page.agent.expect(`All todos are marked as complete`);+ await page.agent.expect(`Counter shows '0 items left'`);++ await page.agent.perform(`Click the 'Mark all as complete' checkbox again`);+ await page.agent.expect(`All todos are marked as active`);+ await page.agent.expect(`All checkboxes are unchecked`);+ await page.agent.expect(`Counter shows '3 items left'`);+ await page.agent.expect(`The 'Clear completed' button disappears`);+});diff --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.jsonnew file mode 100644index 0000000000..580abba087--- /dev/null+++ b/examples/todomvc/tests/perform/completing-todos/should-toggle-all-todos-incomplete.spec.ts-cache.json@@ -0,0 +1,117 @@+{+ "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."+ },+ {+ "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\"."+ },+ {+ "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\"."+ },+ {+ "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."+ }+ ]+ },+ "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)."+ }+ ]+ },+ "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."+ }+ ]+ },+ "All todos are marked as complete": {+ "timestamp": 1767733715225,+ "actions": [+ {+ "method": "expectValue",+ "selector": "internal:role=checkbox[name=\"❯Mark all as complete\"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."+ }+ ]+ },+ "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)."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "The 'Clear completed' button disappears": {+ "timestamp": 1767733776607,+ "actions": []+ },+ "The page loads with an empty todo list": {+ "timestamp": 1767733659545,+ "actions": []+ }+}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/completing-todos/should-uncomplete-completed-todo.spec.ts b/examples/todomvc/tests/perform/completing-todos/should-uncomplete-completed-todo.spec.tsnew file mode 100644index 0000000000..db4d2cc974--- /dev/null+++ b/examples/todomvc/tests/perform/completing-todos/should-uncomplete-completed-todo.spec.ts@@ -0,0 +1,23 @@+import { test } from '../../fixtures';++test.use({+ agent: {+ api: 'anthropic',+ apiKey: process.env.AZURE_SONNET_API_KEY!,+ apiEndpoint: process.env.AZURE_SONNET_ENDPOINT!,+ model: 'claude-sonnet-4-5',+ }+});++test('should uncomplete completed todo', async ({ page }) => {+ await page.agent.expect(`The page loads with an empty todo list`);++ await page.agent.perform(`Add a todo 'Buy groceries' and mark it as complete by clicking its checkbox`);+ await page.agent.expect(`The todo is marked as complete`);+ await page.agent.expect(`Counter shows '0 items left'`);++ await page.agent.perform(`Click the checkbox again to uncomplete it`);+ await page.agent.expect(`The checkbox is unchecked`);+ await page.agent.expect(`Counter shows '1 item left'`);+ await page.agent.expect(`The 'Clear completed' button disappears`);+});diff --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.jsonnew file mode 100644index 0000000000..a7d32d415e--- /dev/null+++ b/examples/todomvc/tests/perform/completing-todos/should-uncomplete-completed-todo.spec.ts-cache.json@@ -0,0 +1,97 @@+{+ "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."+ },+ {+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "The 'Clear completed' button disappears": {+ "timestamp": 1767733746196,+ "actions": []+ },+ "The checkbox is unchecked": {+ "timestamp": 1767733730258,+ "actions": [+ {+ "method": "expectValue",+ "selector": "internal:role=checkbox[name=\"❯Mark all as complete\"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)."+ }+ ]+ },+ "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:"+ }+ ]+ },+ "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."+ }+ ]+ }+}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/deleting-todos/should-clear-all-completed-todos.spec.ts b/examples/todomvc/tests/perform/deleting-todos/should-clear-all-completed-todos.spec.tsnew file mode 100644index 0000000000..3f5804e027--- /dev/null+++ b/examples/todomvc/tests/perform/deleting-todos/should-clear-all-completed-todos.spec.ts@@ -0,0 +1,28 @@+import { test } from '../../fixtures';++test.use({+ agent: {+ api: 'anthropic',+ apiKey: process.env.AZURE_SONNET_API_KEY!,+ apiEndpoint: process.env.AZURE_SONNET_ENDPOINT!,+ model: 'claude-sonnet-4-5',+ }+});++test('should clear all completed todos', async ({ page }) => {+ await page.agent.expect(`The page loads with an empty todo list`);++ await page.agent.perform(`Add three todos: 'Task 1', 'Task 2', 'Task 3'`);+ await page.agent.expect(`All three todos are visible`);++ await page.agent.perform(`Mark 'Task 1' and 'Task 3' as complete by clicking their checkboxes`);+ await page.agent.expect(`Two todos are marked as complete`);+ await page.agent.expect(`Counter shows '1 item left'`);+ await page.agent.expect(`The 'Clear completed' button appears`);++ await page.agent.perform(`Click the 'Clear completed' button`);+ await page.agent.expect(`'Task 1' and 'Task 3' are removed from the list`);+ await page.agent.expect(`Only 'Task 2' remains visible`);+ await page.agent.expect(`Counter shows '1 item left'`);+ await page.agent.expect(`The 'Clear completed' button disappears`);+});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.jsonnew file mode 100644index 0000000000..8268912c09--- /dev/null+++ b/examples/todomvc/tests/perform/deleting-todos/should-clear-all-completed-todos.spec.ts-cache.json@@ -0,0 +1,136 @@+{+ "'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':"+ }+ ]+ },+ "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."+ },+ {+ "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\"."+ },+ {+ "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\"."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ },+ {+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "The 'Clear completed' button disappears": {+ "timestamp": 1767733785778,+ "actions": []+ },+ "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."+ }+ ]+ },+ "Two todos are marked as complete": {+ "timestamp": 1767733730304,+ "actions": []+ }+}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/deleting-todos/should-delete-single-todo.spec.ts b/examples/todomvc/tests/perform/deleting-todos/should-delete-single-todo.spec.tsnew file mode 100644index 0000000000..59610a89a9--- /dev/null+++ b/examples/todomvc/tests/perform/deleting-todos/should-delete-single-todo.spec.ts@@ -0,0 +1,26 @@+import { test } from '../../fixtures';++test.use({+ agent: {+ api: 'anthropic',+ apiKey: process.env.AZURE_SONNET_API_KEY!,+ apiEndpoint: process.env.AZURE_SONNET_ENDPOINT!,+ model: 'claude-sonnet-4-5',+ }+});++test('should delete single todo', async ({ page }) => {+ await page.agent.expect(`The page loads with an empty todo list`);++ await page.agent.perform(`Add a todo 'Task to delete'`);+ await page.agent.expect(`The todo appears in the list`);+ await page.agent.expect(`Counter shows '1 item left'`);++ await page.agent.perform(`Hover over the todo item`);+ await page.agent.expect(`A delete button (x) appears on the right side of the todo`);++ await page.agent.perform(`Click the delete button`);+ await page.agent.expect(`The todo is removed from the list`);+ await page.agent.expect(`The list is empty`);+ await page.agent.expect(`The footer is hidden or shows '0 items left'`);+});diff --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.jsonnew file mode 100644index 0000000000..22a29156f2--- /dev/null+++ b/examples/todomvc/tests/perform/deleting-todos/should-delete-single-todo.spec.ts-cache.json@@ -0,0 +1,88 @@+{+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "Hover over the todo item": {+ "timestamp": 1767733698595,+ "actions": [+ {+ "method": "hover",+ "selector": "internal:testid=[data-testid=\"todo-item\"s]",+ "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."+ }+ ]+ },+ "The footer is hidden or shows '0 items left'": {+ "timestamp": 1767733737658,+ "actions": []+ },+ "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."+ }+ ]+ },+ "The todo appears in the list": {+ "timestamp": 1767733678806,+ "actions": []+ },+ "The todo is removed from the list": {+ "timestamp": 1767733723981,+ "actions": []+ }+}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/deleting-todos/should-delete-specific-todo-from-multiple.spec.ts b/examples/todomvc/tests/perform/deleting-todos/should-delete-specific-todo-from-multiple.spec.tsnew file mode 100644index 0000000000..4ccb1393b4--- /dev/null+++ b/examples/todomvc/tests/perform/deleting-todos/should-delete-specific-todo-from-multiple.spec.ts@@ -0,0 +1,23 @@+import { test } from '../../fixtures';++test.use({+ agent: {+ api: 'anthropic',+ apiKey: process.env.AZURE_SONNET_API_KEY!,+ apiEndpoint: process.env.AZURE_SONNET_ENDPOINT!,+ model: 'claude-sonnet-4-5',+ }+});++test('should delete specific todo from multiple', async ({ page }) => {+ await page.agent.expect(`The page loads with an empty todo list`);++ await page.agent.perform(`Add three todos: 'Task 1', 'Task 2', 'Task 3'`);+ await page.agent.expect(`All three todos appear in the list`);+ await page.agent.expect(`Counter shows '3 items left'`);++ await page.agent.perform(`Hover over 'Task 2' and click its delete button`);+ await page.agent.expect(`'Task 2' is removed from the list`);+ await page.agent.expect(`'Task 1' and 'Task 3' remain visible`);+ await page.agent.expect(`Counter shows '2 items left'`);+});diff --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.jsonnew file mode 100644index 0000000000..b1c657ff78--- /dev/null+++ b/examples/todomvc/tests/perform/deleting-todos/should-delete-specific-todo-from-multiple.spec.ts-cache.json@@ -0,0 +1,109 @@+{+ "'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."+ }+ ]+ },+ "'Task 2' is removed from the list": {+ "timestamp": 1767733742347,+ "actions": []+ },+ "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."+ },+ {+ "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."+ },+ {+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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\"."+ }+ ]+ },+ "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 (×)."+ },+ {+ "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."+ }+ ]+ },+ "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:"+ }+ ]+ }+}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/editing-todos/should-cancel-edit-on-escape.spec.ts b/examples/todomvc/tests/perform/editing-todos/should-cancel-edit-on-escape.spec.tsnew file mode 100644index 0000000000..4e684a89d7--- /dev/null+++ b/examples/todomvc/tests/perform/editing-todos/should-cancel-edit-on-escape.spec.ts@@ -0,0 +1,25 @@+import { test } from '../../fixtures';++test.use({+ agent: {+ api: 'anthropic',+ apiKey: process.env.AZURE_SONNET_API_KEY!,+ apiEndpoint: process.env.AZURE_SONNET_ENDPOINT!,+ model: 'claude-sonnet-4-5',+ }+});++test('should cancel edit on escape', async ({ page }) => {+ await page.agent.expect(`The page loads with an empty todo list`);++ await page.agent.perform(`Add a todo 'Original text'`);+ await page.agent.expect(`The todo appears in the list`);++ await page.agent.perform(`Double-click on the todo to enter edit mode`);+ await page.agent.expect(`Edit textbox appears with 'Original text'`);++ await page.agent.perform(`Change the text to 'Modified text' but press Escape instead of Enter`);+ await page.agent.expect(`Edit mode is cancelled`);+ await page.agent.expect(`The todo text reverts to 'Original text'`);+ await page.agent.expect(`Changes are not saved`);+});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.jsonnew file mode 100644index 0000000000..f5bf1d7e03--- /dev/null+++ b/examples/todomvc/tests/perform/editing-todos/should-cancel-edit-on-escape.spec.ts-cache.json@@ -0,0 +1,115 @@+{+ "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."+ }+ ]+ },+ "Change the text to 'Modified text' but press Escape instead of Enter": {+ "timestamp": 1767733724021,+ "actions": [+ {+ "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."+ },+ {+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "Double-click on the todo to enter edit mode": {+ "timestamp": 1767733694339,+ "actions": [+ {+ "method": "click",+ "selector": "internal:testid=[data-testid=\"todo-title\"s]",+ "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."+ }+ ]+ },+ "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:"+ }+ ]+ },+ "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\"."+ }+ ]+ },+ "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)."+ }+ ]+ },+ "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:"+ }+ ]+ },+ "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."+ }+ ]+ }+}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/editing-todos/should-delete-todo-when-edited-to-empty.spec.ts b/examples/todomvc/tests/perform/editing-todos/should-delete-todo-when-edited-to-empty.spec.tsnew file mode 100644index 0000000000..122ae73bf2--- /dev/null+++ b/examples/todomvc/tests/perform/editing-todos/should-delete-todo-when-edited-to-empty.spec.ts@@ -0,0 +1,26 @@+import { test } from '../../fixtures';++test.use({+ agent: {+ api: 'anthropic',+ apiKey: process.env.AZURE_SONNET_API_KEY!,+ apiEndpoint: process.env.AZURE_SONNET_ENDPOINT!,+ model: 'claude-sonnet-4-5',+ }+});++test('should delete todo when edited to empty', async ({ page }) => {+ await page.agent.expect(`The page loads with an empty todo list`);++ await page.agent.perform(`Add a todo 'Temporary task'`);+ await page.agent.expect(`The todo appears in the list`);+ await page.agent.expect(`Counter shows '1 item left'`);++ await page.agent.perform(`Double-click on the todo to enter edit mode`);+ await page.agent.expect(`Edit textbox appears`);++ await page.agent.perform(`Clear all the text and press Enter`);+ await page.agent.expect(`The todo is deleted from the list`);+ await page.agent.expect(`The list is empty`);+ await page.agent.expect(`Counter shows '0 items left' or the footer is hidden`);+});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.jsonnew file mode 100644index 0000000000..9dea1d5055--- /dev/null+++ b/examples/todomvc/tests/perform/editing-todos/should-delete-todo-when-edited-to-empty.spec.ts-cache.json@@ -0,0 +1,91 @@+{+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "Counter shows '0 items left' or the footer is hidden": {+ "timestamp": 1767733735536,+ "actions": []+ },+ "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."+ }+ ]+ },+ "Double-click on the todo to enter edit mode": {+ "timestamp": 1767733695914,+ "actions": [+ {+ "method": "click",+ "selector": "internal:testid=[data-testid=\"todo-title\"s]",+ "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."+ }+ ]+ },+ "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\"."+ }+ ]+ },+ "The list is empty": {+ "timestamp": 1767733729714,+ "actions": []+ },+ "The page loads with an empty todo list": {+ "timestamp": 1767733662208,+ "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?\" 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:"+ }+ ]+ },+ "The todo appears in the list": {+ "timestamp": 1767733676386,+ "actions": []+ },+ "The todo is deleted from the list": {+ "timestamp": 1767733723016,+ "actions": []+ }+}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/editing-todos/should-edit-todo-by-double-clicking.spec.ts b/examples/todomvc/tests/perform/editing-todos/should-edit-todo-by-double-clicking.spec.tsnew file mode 100644index 0000000000..067af01a40--- /dev/null+++ b/examples/todomvc/tests/perform/editing-todos/should-edit-todo-by-double-clicking.spec.ts@@ -0,0 +1,27 @@+import { test } from '../../fixtures';++test.use({+ agent: {+ api: 'anthropic',+ apiKey: process.env.AZURE_SONNET_API_KEY!,+ apiEndpoint: process.env.AZURE_SONNET_ENDPOINT!,+ model: 'claude-sonnet-4-5',+ }+});++test('should edit todo by double clicking', async ({ page }) => {+ await page.agent.expect(`The page loads with an empty todo list`);++ await page.agent.perform(`Add a todo 'Buy milk'`);+ await page.agent.expect(`The todo appears in the list`);++ await page.agent.perform(`Double-click on the todo text`);+ await page.agent.expect(`The todo enters edit mode`);+ await page.agent.expect(`An edit textbox appears with the current text 'Buy milk'`);+ await page.agent.expect(`The textbox is focused`);++ await page.agent.perform(`Change the text to 'Buy organic milk' and press Enter`);+ await page.agent.expect(`The todo is updated to 'Buy organic milk'`);+ await page.agent.expect(`Edit mode is exited`);+ await page.agent.expect(`The updated text is displayed in the list`);+});diff --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.jsonnew file mode 100644index 0000000000..6aeb3fbbf1--- /dev/null+++ b/examples/todomvc/tests/perform/editing-todos/should-edit-todo-by-double-clicking.spec.ts-cache.json@@ -0,0 +1,125 @@+{+ "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."+ }+ ]+ },+ "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\"."+ }+ ]+ },+ "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."+ }+ ]+ },+ "Double-click on the todo text": {+ "timestamp": 1767733688238,+ "actions": [+ {+ "method": "click",+ "selector": "internal:testid=[data-testid=\"todo-title\"s]",+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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)."+ }+ ]+ },+ "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\"."+ }+ ]+ },+ "The todo appears in the list": {+ "timestamp": 1767733679102,+ "actions": []+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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\"."+ }+ ]+ }+}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/editing-todos/should-save-edit-on-blur.spec.ts b/examples/todomvc/tests/perform/editing-todos/should-save-edit-on-blur.spec.tsnew file mode 100644index 0000000000..2d0c59835a--- /dev/null+++ b/examples/todomvc/tests/perform/editing-todos/should-save-edit-on-blur.spec.ts@@ -0,0 +1,25 @@+import { test } from '../../fixtures';++test.use({+ agent: {+ api: 'anthropic',+ apiKey: process.env.AZURE_SONNET_API_KEY!,+ apiEndpoint: process.env.AZURE_SONNET_ENDPOINT!,+ model: 'claude-sonnet-4-5',+ }+});++test('should save edit on blur', async ({ page }) => {+ await page.agent.expect(`The page loads with an empty todo list`);++ await page.agent.perform(`Add a todo 'Call dentist'`);+ await page.agent.expect(`The todo appears in the list`);++ await page.agent.perform(`Double-click on the todo to enter edit mode`);+ await page.agent.expect(`Edit textbox appears`);++ await page.agent.perform(`Change the text to 'Schedule dentist appointment' and click elsewhere to blur the input`);+ await page.agent.expect(`The changes are saved`);+ await page.agent.expect(`The todo text is updated to 'Schedule dentist appointment'`);+ await page.agent.expect(`Edit mode is exited`);+});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.jsonnew file mode 100644index 0000000000..410c634e93--- /dev/null+++ b/examples/todomvc/tests/perform/editing-todos/should-save-edit-on-blur.spec.ts-cache.json@@ -0,0 +1,107 @@+{+ "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."+ }+ ]+ },+ "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"+ },+ {+ "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:"+ }+ ]+ },+ "Double-click on the todo to enter edit mode": {+ "timestamp": 1767733697503,+ "actions": [+ {+ "method": "click",+ "selector": "internal:testid=[data-testid=\"todo-title\"s]",+ "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."+ }+ ]+ },+ "Edit mode is exited": {+ "timestamp": 1767733756175,+ "actions": []+ },+ "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\"."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ }+}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/editing-todos/should-trim-whitespace-when-editing.spec.ts b/examples/todomvc/tests/perform/editing-todos/should-trim-whitespace-when-editing.spec.tsnew file mode 100644index 0000000000..218a608727--- /dev/null+++ b/examples/todomvc/tests/perform/editing-todos/should-trim-whitespace-when-editing.spec.ts@@ -0,0 +1,23 @@+import { test } from '../../fixtures';++test.use({+ agent: {+ api: 'anthropic',+ apiKey: process.env.AZURE_SONNET_API_KEY!,+ apiEndpoint: process.env.AZURE_SONNET_ENDPOINT!,+ model: 'claude-sonnet-4-5',+ }+});++test('should trim whitespace when editing', async ({ page }) => {+ await page.agent.expect(`The page loads with an empty todo list`);++ await page.agent.perform(`Add a todo 'Original task'`);+ await page.agent.expect(`The todo appears in the list`);++ await page.agent.perform(`Double-click to edit and change text to ' Edited task ' (with leading and trailing spaces)`);+ await page.agent.expect(`Edit textbox shows the text with spaces`);++ await page.agent.perform(`Press Enter to save`);+ await page.agent.expect(`The todo is saved as 'Edited task' without leading or trailing whitespace`);+});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.jsonnew file mode 100644index 0000000000..89fd92fbcc--- /dev/null+++ b/examples/todomvc/tests/perform/editing-todos/should-trim-whitespace-when-editing.spec.ts-cache.json@@ -0,0 +1,83 @@+{+ "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."+ }+ ]+ },+ "Double-click to edit and change text to ' Edited task ' (with leading and trailing spaces)": {+ "timestamp": 1767733705280,+ "actions": [+ {+ "method": "click",+ "selector": "internal:testid=[data-testid=\"todo-title\"s]",+ "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."+ },+ {+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "The todo appears in the list": {+ "timestamp": 1767733675284,+ "actions": []+ },+ "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."+ }+ ]+ }+}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/filtering-todos/should-filter-active-todos.spec.ts b/examples/todomvc/tests/perform/filtering-todos/should-filter-active-todos.spec.tsnew file mode 100644index 0000000000..2ee27d8a0e--- /dev/null+++ b/examples/todomvc/tests/perform/filtering-todos/should-filter-active-todos.spec.ts@@ -0,0 +1,27 @@+import { test } from '../../fixtures';++test.use({+ agent: {+ api: 'anthropic',+ apiKey: process.env.AZURE_SONNET_API_KEY!,+ apiEndpoint: process.env.AZURE_SONNET_ENDPOINT!,+ model: 'claude-sonnet-4-5',+ }+});++test('should filter active todos', async ({ page }) => {+ await page.agent.expect(`The page loads with an empty todo list`);++ await page.agent.perform(`Add three todos: 'Active 1', 'Active 2', 'Will complete'`);+ await page.agent.expect(`All three todos are visible`);++ await page.agent.perform(`Mark 'Will complete' as completed by clicking its checkbox`);+ await page.agent.expect(`One todo is marked as complete`);+ await page.agent.expect(`Counter shows '2 items left'`);++ await page.agent.perform(`Click on the 'Active' filter link`);+ await page.agent.expect(`The URL changes to #/active`);+ await page.agent.expect(`Only 'Active 1' and 'Active 2' are displayed`);+ await page.agent.expect(`'Will complete' is not visible`);+ await page.agent.expect(`The 'Active' filter link is highlighted`);+});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.jsonnew file mode 100644index 0000000000..434637bd42--- /dev/null+++ b/examples/todomvc/tests/perform/filtering-todos/should-filter-active-todos.spec.ts-cache.json@@ -0,0 +1,138 @@+{+ "'Will complete' is not visible": {+ "timestamp": 1767733770707,+ "actions": []+ },+ "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."+ },+ {+ "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\"."+ },+ {+ "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\"."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ }+}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/filtering-todos/should-filter-completed-todos.spec.ts b/examples/todomvc/tests/perform/filtering-todos/should-filter-completed-todos.spec.tsnew file mode 100644index 0000000000..5f987140b6--- /dev/null+++ b/examples/todomvc/tests/perform/filtering-todos/should-filter-completed-todos.spec.ts@@ -0,0 +1,26 @@+import { test } from '../../fixtures';++test.use({+ agent: {+ api: 'anthropic',+ apiKey: process.env.AZURE_SONNET_API_KEY!,+ apiEndpoint: process.env.AZURE_SONNET_ENDPOINT!,+ model: 'claude-sonnet-4-5',+ }+});++test('should filter completed todos', async ({ page }) => {+ await page.agent.expect(`The page loads with an empty todo list`);++ await page.agent.perform(`Add three todos: 'Active task', 'Completed 1', 'Completed 2'`);+ await page.agent.expect(`All three todos are visible`);++ await page.agent.perform(`Mark 'Completed 1' and 'Completed 2' as completed by clicking their checkboxes`);+ await page.agent.expect(`Two todos are marked as complete`);++ await page.agent.perform(`Click on the 'Completed' filter link`);+ await page.agent.expect(`The URL changes to #/completed`);+ await page.agent.expect(`Only 'Completed 1' and 'Completed 2' are displayed`);+ await page.agent.expect(`'Active task' is not visible`);+ await page.agent.expect(`The 'Completed' filter link is highlighted`);+});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.jsonnew file mode 100644index 0000000000..e2926ca21b--- /dev/null+++ b/examples/todomvc/tests/perform/filtering-todos/should-filter-completed-todos.spec.ts-cache.json@@ -0,0 +1,132 @@+{+ "'Active task' is not visible": {+ "timestamp": 1767733777768,+ "actions": []+ },+ "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."+ },+ {+ "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\"."+ },+ {+ "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\"."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ },+ {+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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:"+ }+ ]+ }+}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/filtering-todos/should-show-all-todos-with-all-filter.spec.ts b/examples/todomvc/tests/perform/filtering-todos/should-show-all-todos-with-all-filter.spec.tsnew file mode 100644index 0000000000..9835b46d50--- /dev/null+++ b/examples/todomvc/tests/perform/filtering-todos/should-show-all-todos-with-all-filter.spec.ts@@ -0,0 +1,25 @@+import { test } from '../../fixtures';++test.use({+ agent: {+ api: 'anthropic',+ apiKey: process.env.AZURE_SONNET_API_KEY!,+ apiEndpoint: process.env.AZURE_SONNET_ENDPOINT!,+ model: 'claude-sonnet-4-5',+ }+});++test('should show all todos with all filter', async ({ page }) => {+ await page.agent.expect(`The page loads with an empty todo list`);++ await page.agent.perform(`Add three todos and mark one as complete`);+ await page.agent.expect(`Three todos exist, one completed and two active`);++ await page.agent.perform(`Navigate to the 'Active' filter by clicking on it`);+ await page.agent.expect(`Only active todos are visible`);++ await page.agent.perform(`Click on the 'All' filter link`);+ await page.agent.expect(`The URL changes to #/`);+ await page.agent.expect(`All todos (both completed and active) are displayed`);+ await page.agent.expect(`The 'All' filter link is highlighted`);+});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.jsonnew file mode 100644index 0000000000..2323177b34--- /dev/null+++ b/examples/todomvc/tests/perform/filtering-todos/should-show-all-todos-with-all-filter.spec.ts-cache.json@@ -0,0 +1,128 @@+{+ "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."+ },+ {+ "method": "fill",+ "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",+ "text": "Finish homework",+ "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."+ },+ {+ "method": "fill",+ "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",+ "text": "Call the dentist",+ "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."+ },+ {+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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 \"#/\"."+ }+ ]+ },+ "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."+ }+ ]+ }+}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/persistence/should-persist-todos-after-page-reload.spec.ts b/examples/todomvc/tests/perform/persistence/should-persist-todos-after-page-reload.spec.tsnew file mode 100644index 0000000000..ac40e3a638--- /dev/null+++ b/examples/todomvc/tests/perform/persistence/should-persist-todos-after-page-reload.spec.ts@@ -0,0 +1,25 @@+import { test } from '../../fixtures';++test.use({+ agent: {+ api: 'anthropic',+ apiKey: process.env.AZURE_SONNET_API_KEY!,+ apiEndpoint: process.env.AZURE_SONNET_ENDPOINT!,+ model: 'claude-sonnet-4-5',+ }+});++test('should persist todos after page reload', async ({ page }) => {+ await page.agent.expect(`The page loads with an empty todo list`);++ await page.agent.perform(`Add three todos: 'Persistent 1', 'Persistent 2', 'Persistent 3'`);+ await page.agent.expect(`All three todos appear in the list`);++ await page.agent.perform(`Mark 'Persistent 2' as completed by clicking its checkbox`);+ await page.agent.expect(`'Persistent 2' is marked as complete`);++ await page.agent.perform(`Reload the page`);+ await page.agent.expect(`All three todos are still present after reload`);+ await page.agent.expect(`'Persistent 2' is still marked as complete`);+ await page.agent.expect(`The counter shows '2 items left'`);+});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.jsonnew file mode 100644index 0000000000..d1d6c5d969--- /dev/null+++ b/examples/todomvc/tests/perform/persistence/should-persist-todos-after-page-reload.spec.ts-cache.json@@ -0,0 +1,124 @@+{+ "'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."+ }+ ]+ },+ "'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."+ }+ ]+ },+ "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."+ },+ {+ "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\"."+ },+ {+ "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\"."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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."+ }+ ]+ },+ "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:"+ }+ ]+ }+}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/todo-completion.spec.ts b/examples/todomvc/tests/perform/todo-completion.spec.tsdeleted file mode 100644index eea7ac16cd..0000000000--- a/examples/todomvc/tests/perform/todo-completion.spec.ts+++ /dev/null@@ -1,97 +0,0 @@-import { test } from '../fixtures';--test.use({- agent: {- api: 'anthropic',- apiKey: process.env.AZURE_SONNET_API_KEY!,- apiEndpoint: process.env.AZURE_SONNET_ENDPOINT!,- model: 'claude-sonnet-4-5',- }-});--test.describe('Todo Completion', () => {-- test('Mark a single todo as complete', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add a todo 'Buy groceries'`);- await page.agent.expect(`The todo appears in the list unchecked`);-- await page.agent.perform(`Click the checkbox next to 'Buy groceries'`);- await page.agent.expect(`The checkbox becomes checked and the todo text may show visual indication of completion (strikethrough or style change)`);-- // Post Conditions- await page.agent.expect(`The todo counter shows '0 items left'`);- await page.agent.expect(`The 'Clear completed' button appears in the footer`);- });-- test('Unmark a completed todo', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add a todo 'Buy groceries'`);- await page.agent.expect(`The todo appears in the list unchecked`);-- await page.agent.perform(`Click the checkbox to mark it as complete`);- await page.agent.expect(`The checkbox becomes checked`);-- await page.agent.perform(`Click the checkbox again to unmark it`);- await page.agent.expect(`The checkbox becomes unchecked and the todo returns to active state`);-- // Post Conditions- await page.agent.expect(`The todo counter shows '1 item left'`);- await page.agent.expect(`The 'Clear completed' button is no longer visible`);- });-- test('Mark all todos as complete', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'`);- await page.agent.expect(`All three todos appear in the list unchecked`);-- await page.agent.perform(`Click the '❯Mark all as complete' checkbox at the top of the list`);- await page.agent.expect(`All three todos become checked`);-- // Post Conditions- await page.agent.expect(`The todo counter shows '0 items left'`);- await page.agent.expect(`The 'Clear completed' button appears`);- await page.agent.expect(`The '❯Mark all as complete' checkbox is checked`);- });-- test('Unmark all completed todos', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'`);- await page.agent.expect(`All three todos appear in the list`);-- await page.agent.perform(`Click the '❯Mark all as complete' checkbox to mark all as complete`);- await page.agent.expect(`All todos become checked`);-- await page.agent.perform(`Click the '❯Mark all as complete' checkbox again`);- await page.agent.expect(`All todos become unchecked`);-- // Post Conditions- await page.agent.expect(`The todo counter shows '3 items left'`);- await page.agent.expect(`The 'Clear completed' button is no longer visible`);- await page.agent.expect(`The '❯Mark all as complete' checkbox is unchecked`);- });-- test('Mixed completion state', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'`);- await page.agent.expect(`All three todos appear in the list`);-- await page.agent.perform(`Mark 'Buy groceries' as complete`);- await page.agent.expect(`First todo is checked`);-- await page.agent.perform(`Mark 'Read a book' as complete`);- await page.agent.expect(`Third todo is checked`);-- // Post Conditions- await page.agent.expect(`The todo counter shows '1 item left'`);- await page.agent.expect(`The 'Clear completed' button is visible`);- await page.agent.expect(`'Walk the dog' remains unchecked`);- await page.agent.expect(`The '❯Mark all as complete' checkbox is unchecked (since not all are complete)`);- });--});diff --git a/examples/todomvc/tests/perform/todo-completion.spec.ts-cache.json b/examples/todomvc/tests/perform/todo-completion.spec.ts-cache.jsondeleted file mode 100644index 260801f61a..0000000000--- a/examples/todomvc/tests/perform/todo-completion.spec.ts-cache.json+++ /dev/null@@ -1,428 +0,0 @@-{- "Add a todo 'Buy groceries'": {- "timestamp": 1767669474711,- "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 TodoMVC app. I can see there's a textbox with the placeholder \"What needs to be done?\" that I can use to add the todo."- }- ]- },- "Click the checkbox next to 'Buy groceries'": {- "timestamp": 1767669417185,- "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 next to 'Buy groceries'. Looking at the page snapshot, I can see there's a checkbox with the label \"Toggle Todo\" (ref=e21) that corresponds to the 'Buy groceries' item (ref=e22)."- }- ]- },- "The 'Clear completed' button appears in the footer": {- "timestamp": 1767669449277,- "actions": [- {- "method": "expectVisible",- "selector": "internal:role=button[name=\"Clear completed\"i]",- "code": "await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible();",- "intent": "I'll verify that the 'Clear completed' button appears in the footer by checking if it's visible on the page."- }- ]- },- "The checkbox becomes checked and the todo text may show visual indication of completion (strikethrough or style change)": {- "timestamp": 1767669428486,- "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 checkbox is checked and the todo item shows visual indication of completion.\n\nLooking at the page snapshot, I can see:\n- A checkbox \"Toggle Todo\" with `[checked]` status at ref=e21\n- The todo text \"Buy groceries\" at ref=e22\n\nThe checkbox is already checked. Now I should verify this state using one of the browser_expect_* tools. I'll check that the checkbox is in the checked state."- }- ]- },- "The page loads with an empty todo list": {- "timestamp": 1767669814862,- "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 the TodoMVC application structure with a heading \"todos\" and a textbox \"What needs to be done?\", but I don't see any todo list items present. This indicates the list is empty.\n\nTo assert this condition, I should verify that a todo list structure exists but contains no items. However, looking at the snapshot, I don't see any list element at all, which is typical for an empty todo list in TodoMVC applications - the list only appears when items are added.\n\nLet me verify that the input textbox is visible, which confirms the page has loaded properly with the empty state:"- }- ]- },- "The todo appears in the list unchecked": {- "timestamp": 1767669485131,- "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 a todo item appears in the list unchecked. Looking at the page snapshot, I can see there's a todo item \"Buy groceries\" in the list with an unchecked checkbox.\n\nLet me verify that this checkbox is unchecked:"- }- ]- },- "The todo counter shows '0 items left'": {- "timestamp": 1767669631774,- "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 todo counter shows '0 items left'. Looking at the page snapshot, I can see:\n\n- 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 assert that \"0 items left\" is visible on the page."- }- ]- },- "Click the checkbox again to unmark it": {- "timestamp": 1767669516278,- "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 unmark it. Looking at the page snapshot, I can see there's a checked checkbox with ref=e21 labeled \"Toggle Todo\" that is currently checked and active. This appears to be the checkbox for the \"Buy groceries\" todo item."- }- ]- },- "Click the checkbox to mark it as complete": {- "timestamp": 1767669495301,- "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 mark the todo item as complete. Looking at the page snapshot, I can see there's a checkbox with the label \"Toggle Todo\" at ref=e21, which is associated with the \"Buy groceries\" todo item."- }- ]- },- "The 'Clear completed' button is no longer visible": {- "timestamp": 1767669790359,- "actions": []- },- "The checkbox becomes checked": {- "timestamp": 1767669506270,- "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 becomes checked. Looking at the page snapshot, I can see there's a checkbox labeled \"Toggle Todo\" with ref=e21 that is already marked as [checked] and [active].\n\nLet me assert that this checkbox is checked:"- }- ]- },- "The checkbox becomes unchecked and the todo returns to active state": {- "timestamp": 1767669528646,- "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 a checkbox becomes unchecked and the todo returns to active state. Looking at the page snapshot, I can see there's a checkbox with the label \"Toggle Todo\" that is currently marked as [active], which means the todo item \"Buy groceries\" is in active state (unchecked).\n\nThe expectation is that the checkbox becomes unchecked and returns to active state. Since the checkbox is already showing as [active] (not checked/completed), I should verify that the checkbox is indeed unchecked."- }- ]- },- "The todo counter shows '1 item left'": {- "timestamp": 1767669912753,- "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 todo counter shows '1 item left'. Looking at the page snapshot, I can see:\n\n- In the generic [ref=e23] section, there's a generic [ref=e24] that contains:\n - strong [ref=e25]: \"1\"\n - text: item left\n\nThis matches the expectation that the counter shows \"1 item left\". I'll use the browser_expect_visible_text tool to verify this text is visible."- }- ]- },- "Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'": {- "timestamp": 1767669845108,- "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 to the list. Let me start by typing the first todo \"Buy groceries\" into the textbox and submitting it."- },- {- "method": "fill",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "text": "Walk the dog",- "submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Walk the dog');\nawait page.keyboard.press('Enter');",- "intent": "Great! The first todo \"Buy groceries\" has been added. Now I'll add the second todo \"Walk the dog\"."- },- {- "method": "fill",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "text": "Read a book",- "submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Read a book');\nawait page.keyboard.press('Enter');",- "intent": "Excellent! Two todos have been added successfully. Now I'll add the third and final todo \"Read a book\"."- }- ]- },- "All three todos appear in the list unchecked": {- "timestamp": 1767669599411,- "actions": [- {- "method": "expectAria",- "template": "- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n - listitem: Read a book",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n - listitem: Read a book\n`);",- "intent": "I need to verify that all three todos appear in the list unchecked. Looking at the page snapshot, I can see:\n\n1. A list with ref=e18 containing three listitems\n2. Each listitem has a checkbox labeled \"Toggle Todo\" and text content:\n - \"Buy groceries\" (ref=e22)\n - \"Walk the dog\" (ref=e36)\n - \"Read a book\" (ref=e40)\n3. The checkboxes (refs e21, e35, e39) don't show a \"checked\" state in the snapshot\n\nI'll use the `browser_expect_list_visible` tool to verify that all three todos appear in the correct order in the list."- }- ]- },- "All three todos become checked": {- "timestamp": 1767669621415,- "actions": [- {- "method": "expectValue",- "selector": "internal:role=checkbox[name=\"❯Mark all as complete\"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 three todos are checked. Looking at the page snapshot, I can see three todo items with checkboxes:\n\n1. \"Buy groceries\" - checkbox [ref=e21] shows [checked]\n2. \"Walk the dog\" - checkbox [ref=e35] shows [checked]\n3. \"Read a book\" - checkbox [ref=e39] shows [checked]\n\nAll three checkboxes are already marked as [checked] in the snapshot. I'll verify one of them as a representative check, or I can verify the \"Mark all as complete\" checkbox which should be checked when all items are complete.\n\nLet me verify the \"Mark all as complete\" checkbox which is shown as [checked] and [active] in the snapshot:"- }- ]- },- "Click the '❯Mark all as complete' checkbox at the top of the list": {- "timestamp": 1767669608897,- "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 at the top of the list."- }- ]- },- "The '❯Mark all as complete' checkbox is checked": {- "timestamp": 1767669652292,- "actions": [- {- "method": "expectValue",- "selector": "internal:role=checkbox[name=\"❯Mark all as complete\"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 the '❯Mark all as complete' checkbox is checked. Looking at the page snapshot, I can see:\n\n- checkbox \"❯Mark all as complete\" [checked] [active] [ref=e16]\n\nThis shows the checkbox is indeed checked. I'll use the browser_expect_value tool to assert this condition."- }- ]- },- "The 'Clear completed' button appears": {- "timestamp": 1767669641435,- "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 ref=e41."- }- ]- },- "All three todos appear in the list": {- "timestamp": 1767669855620,- "actions": [- {- "method": "expectAria",- "template": "- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n - listitem: Read a book",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n - listitem: Read a book\n`);",- "intent": "I need to verify that all three todos appear in the list. Looking at the page snapshot, I can see a list with three items:\n1. \"Buy groceries\"\n2. \"Walk the dog\"\n3. \"Read a book\"\n\nI'll use the `browser_expect_list_visible` tool to verify that all three todos are present in the correct order."- }- ]- },- "All todos become checked": {- "timestamp": 1767669729314,- "actions": [- {- "method": "expectValue",- "selector": "internal:role=checkbox[name=\"❯Mark all as complete\"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 checked. Looking at the page snapshot, I can see there are 3 todos, and each has a \"Toggle Todo\" checkbox. All three checkboxes show `[checked]` in their state, which indicates they are all checked.\n\nLet me verify this by checking that all three \"Toggle Todo\" checkboxes are checked. I'll use the browser_expect_value tool to assert that one of the checkboxes is checked (since they're all the same role and accessible name, checking one representative checkbox would confirm the pattern, but to be thorough, I should verify the overall state).\n\nActually, a better approach is to check the \"Mark all as complete\" checkbox at ref=e16, which shows `[checked]`. When this checkbox is checked, it indicates that all todos are complete/checked."- }- ]- },- "All todos become unchecked": {- "timestamp": 1767669771511,- "actions": [- {- "method": "expectValue",- "selector": "internal:role=listitem >> internal:has-text=\"Buy groceries\"i >> internal:label=\"Toggle Todo\"i",- "type": "checkbox",- "value": "false",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Buy groceries' }).getByLabel('Toggle Todo')).toBeChecked({ checked: false });",- "intent": "I need to verify that all todos become unchecked. Looking at the page snapshot, I can see three todo items, each with a \"Toggle Todo\" checkbox (refs e21, e35, e39). The expectation is that all these checkboxes should be unchecked.\n\nLet me check the first todo checkbox to verify it's unchecked:"- },- {- "method": "expectValue",- "selector": "internal:role=listitem >> internal:has-text=\"Walk the dog\"i >> internal:label=\"Toggle Todo\"i",- "type": "checkbox",- "value": "false",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Walk the dog' }).getByLabel('Toggle Todo')).toBeChecked({ checked: false });",- "intent": "Good! The first checkbox is unchecked. Now let me check the second todo checkbox:"- },- {- "method": "expectValue",- "selector": "internal:role=listitem >> internal:has-text=\"Read a book\"i >> internal:label=\"Toggle Todo\"i",- "type": "checkbox",- "value": "false",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Read a book' }).getByLabel('Toggle Todo')).toBeChecked({ checked: false });",- "intent": "Great! The second checkbox is also unchecked. Now let me verify the third and final todo checkbox to ensure all todos are unchecked:"- }- ]- },- "Click the '❯Mark all as complete' checkbox again": {- "timestamp": 1767669739261,- "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 need to click the '❯Mark all as complete' checkbox. According to the page snapshot, this checkbox is currently checked and has ref=e16."- }- ]- },- "Click the '❯Mark all as complete' checkbox to mark all as complete": {- "timestamp": 1767669714610,- "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 need to click the checkbox labeled \"❯Mark all as complete\" to mark all todo items as complete."- }- ]- },- "The '❯Mark all as complete' checkbox is unchecked": {- "timestamp": 1767669801409,- "actions": [- {- "method": "expectValue",- "selector": "internal:role=checkbox[name=\"❯Mark all as complete\"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 the '❯Mark all as complete' checkbox is unchecked. Looking at the page snapshot, I can see the checkbox element at ref=e16 with the accessible name \"❯Mark all as complete\" and it shows [active] but no indication of being checked.\n\nTo verify a checkbox is unchecked, I should use the browser_expect_value tool with the checkbox type and expect the value to be \"false\"."- }- ]- },- "The todo counter shows '3 items left'": {- "timestamp": 1767669782783,- "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 todo counter shows '3 items left'. Looking at the page snapshot, I can see:\n\n- generic [ref=e23]:\n - generic [ref=e24]:\n - strong [ref=e25]: \"3\"\n - text: items left\n\nThis shows that there's a strong element containing \"3\" followed by text \"items left\". I'll use `browser_expect_visible_text` to verify the text \"3 items left\" is visible on the page."- }- ]- },- "'Walk the dog' remains unchecked": {- "timestamp": 1767669934471,- "actions": [- {- "method": "expectValue",- "selector": "internal:role=listitem >> internal:has-text=\"Walk the dog\"i >> internal:label=\"Toggle Todo\"i",- "type": "checkbox",- "value": "false",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Walk the dog' }).getByLabel('Toggle Todo')).toBeChecked({ checked: false });",- "intent": "I need to verify that the \"Walk the dog\" todo item remains unchecked. Looking at the page snapshot, I can see that \"Walk the dog\" has a checkbox with ref=e35 that is NOT marked as [checked], which means it is unchecked.\n\nI'll use the browser_expect_value tool to assert that this checkbox is not checked (has a value of \"false\")."- }- ]- },- "First todo is checked": {- "timestamp": 1767669878567,- "actions": [- {- "method": "expectValue",- "selector": "internal:role=listitem >> internal:has-text=\"Buy groceries\"i >> internal:label=\"Toggle Todo\"i",- "type": "checkbox",- "value": "true",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Buy groceries' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });",- "intent": "I need to verify that the first todo item is checked. Looking at the page snapshot, I can see there are three todo items:\n\n1. \"Buy groceries\" - has a checkbox with [checked] attribute (ref=e21)\n2. \"Walk the dog\" - has an unchecked checkbox (ref=e35)\n3. \"Read a book\" - has an unchecked checkbox (ref=e39)\n\nThe first todo \"Buy groceries\" has a checkbox that is marked as [checked], so I need to assert that this checkbox is checked."- }- ]- },- "Mark 'Buy groceries' as complete": {- "timestamp": 1767669866307,- "actions": [- {- "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": "I need to mark 'Buy groceries' as complete. Looking at the page snapshot, I can see a checkbox for \"Buy groceries\" at ref=e21 (labeled as \"Toggle Todo\"). I'll click on this checkbox to mark the todo item as complete."- }- ]- },- "Mark 'Read a book' as complete": {- "timestamp": 1767669888712,- "actions": [- {- "method": "click",- "selector": "internal:role=listitem >> internal:has-text=\"Read a book\"i >> internal:label=\"Toggle Todo\"i",- "options": {},- "code": "await page.getByRole('listitem').filter({ hasText: 'Read a book' }).getByLabel('Toggle Todo').click();",- "intent": "I need to mark 'Read a book' as complete by clicking its checkbox. Looking at the page snapshot, I can see that 'Read a book' is in a listitem with a checkbox that is currently unchecked (ref=e39)."- }- ]- },- "The '❯Mark all as complete' checkbox is unchecked (since not all are complete)": {- "timestamp": 1767669946924,- "actions": [- {- "method": "expectValue",- "selector": "internal:role=checkbox[name=\"❯Mark all as complete\"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 the '❯Mark all as complete' checkbox is unchecked. Looking at the page snapshot, I can see:\n\n- checkbox \"❯Mark all as complete\" [ref=e16]\n\nThis checkbox does not have the [checked] attribute, which means it is unchecked. I can also observe that not all todos are complete - \"Walk the dog\" (ref=e35) is unchecked while \"Buy groceries\" (ref=e21) and \"Read a book\" (ref=e39) are checked.\n\nI'll use the browser_expect_value tool to assert that this checkbox is unchecked (value should be \"false\")."- }- ]- },- "The 'Clear completed' button is visible": {- "timestamp": 1767669923402,- "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 is visible on the page. Looking at the page snapshot, I can see:\n\n```\n- button \"Clear completed\" [ref=e42] [cursor=pointer]\n```\n\nThis button is present in the snapshot under the generic element with ref=e23. I'll use the browser_expect_visible tool to assert that this button is visible."- }- ]- },- "Third todo is checked": {- "timestamp": 1767669900619,- "actions": [- {- "method": "expectValue",- "selector": "internal:role=listitem >> internal:has-text=\"Read a book\"i >> internal:label=\"Toggle Todo\"i",- "type": "checkbox",- "value": "true",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Read a book' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });",- "intent": "I need to verify that the third todo item is checked. Looking at the page snapshot, I can see a list with three todo items:\n\n1. \"Buy groceries\" - has checkbox [checked]\n2. \"Walk the dog\" - has checkbox (not checked)\n3. \"Read a book\" - has checkbox [checked] [active]\n\nThe third todo is \"Read a book\" and its checkbox (ref=e39) is marked as [checked]. I'll use browser_expect_value to assert this."- }- ]- }-}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/todo-counter.spec.ts b/examples/todomvc/tests/perform/todo-counter.spec.tsdeleted file mode 100644index 3583a8fa1d..0000000000--- a/examples/todomvc/tests/perform/todo-counter.spec.ts+++ /dev/null@@ -1,100 +0,0 @@-import { test } from '../fixtures';--test.use({- agent: {- api: 'anthropic',- apiKey: process.env.AZURE_SONNET_API_KEY!,- apiEndpoint: process.env.AZURE_SONNET_ENDPOINT!,- model: 'claude-sonnet-4-5',- }-});--test.describe('Todo Counter', () => {-- test('Counter updates when adding todos', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add a todo 'Buy groceries'`);- await page.agent.expect(`The counter shows '1 item left'`);-- await page.agent.perform(`Add a todo 'Walk the dog'`);- await page.agent.expect(`The counter shows '2 items left'`);-- await page.agent.perform(`Add a todo 'Read a book'`);- await page.agent.expect(`The counter shows '3 items left'`);-- // Post Conditions- await page.agent.expect(`The counter accurately reflects the number of active todos`);- await page.agent.expect(`The counter uses plural 'items' when count is not 1`);- });-- test('Counter updates when completing todos', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'`);- await page.agent.expect(`The counter shows '3 items left'`);-- await page.agent.perform(`Mark 'Buy groceries' as complete`);- await page.agent.expect(`The counter shows '2 items left'`);-- await page.agent.perform(`Mark 'Walk the dog' as complete`);- await page.agent.expect(`The counter shows '1 item left'`);-- await page.agent.perform(`Mark 'Read a book' as complete`);- await page.agent.expect(`The counter shows '0 items left'`);-- // Post Conditions- await page.agent.expect(`The counter decreases as todos are completed`);- await page.agent.expect(`The counter uses singular 'item' when count is 1`);- });-- test('Counter updates when deleting todos', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'`);- await page.agent.expect(`The counter shows '3 items left'`);-- await page.agent.perform(`Delete 'Walk the dog' using the delete button (×)`);- await page.agent.expect(`The counter shows '2 items left'`);-- // Post Conditions- await page.agent.expect(`The counter decreases when an active todo is deleted`);- });-- test('Counter unchanged when deleting completed todo', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add two todos: 'Buy groceries', 'Walk the dog'`);- await page.agent.expect(`The counter shows '2 items left'`);-- await page.agent.perform(`Mark 'Buy groceries' as complete`);- await page.agent.expect(`The counter shows '1 item left'`);-- await page.agent.perform(`Delete 'Buy groceries' using the delete button`);- await page.agent.expect(`The counter still shows '1 item left'`);-- // Post Conditions- await page.agent.expect(`The counter only counts active (uncompleted) todos`);- await page.agent.expect(`Deleting completed todos doesn't affect the counter`);- });-- test('Counter persists across filter views', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'`);- await page.agent.expect(`The counter shows '3 items left'`);-- await page.agent.perform(`Mark 'Buy groceries' as complete`);- await page.agent.expect(`The counter shows '2 items left'`);-- await page.agent.perform(`Click 'Active' filter`);- await page.agent.expect(`The counter still shows '2 items left'`);-- await page.agent.perform(`Click 'Completed' filter`);- await page.agent.expect(`The counter still shows '2 items left'`);-- // Post Conditions- await page.agent.expect(`The counter always shows the count of active todos regardless of the current filter view`);- });--});diff --git a/examples/todomvc/tests/perform/todo-counter.spec.ts-cache.json b/examples/todomvc/tests/perform/todo-counter.spec.ts-cache.jsondeleted file mode 100644index 2bb5e80611..0000000000--- a/examples/todomvc/tests/perform/todo-counter.spec.ts-cache.json+++ /dev/null@@ -1,305 +0,0 @@-{- "Add a todo 'Buy groceries'": {- "timestamp": 1767669398039,- "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 need to add a todo item \"Buy groceries\" to this TodoMVC application. I can see there's a textbox with the placeholder \"What needs to be done?\" which is currently active. I'll type the text into this textbox and submit it."- }- ]- },- "Add a todo 'Read a book'": {- "timestamp": 1767669441140,- "actions": [- {- "method": "fill",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "text": "Read a book",- "submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Read a book');\nawait page.keyboard.press('Enter');",- "intent": "I need to add a todo with the text 'Read a book'. 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 this textbox and submit it."- }- ]- },- "Add a todo 'Walk the dog'": {- "timestamp": 1767669419369,- "actions": [- {- "method": "fill",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "text": "Walk the dog",- "submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Walk the dog');\nawait page.keyboard.press('Enter');",- "intent": "I'll help you add a todo 'Walk the dog' to the list. I need to type the text into the textbox and then submit it."- }- ]- },- "The counter accurately reflects the number of active todos": {- "timestamp": 1767669457643,- "actions": []- },- "The counter shows '1 item left'": {- "timestamp": 1767669758070,- "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- strong [ref=e25]: \"1\"\n- text: item left\n\nThis indicates that the counter is displaying \"1 item left\" as expected. I'll use the `browser_expect_visible_text` tool to verify this text is visible on the page."- }- ]- },- "The counter shows '2 items left'": {- "timestamp": 1767669883229,- "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- strong [ref=e25]: \"2\"\n- text: items left\n\nThese elements together form the text \"2 items left\". I'll use the `browser_expect_visible_text` tool to assert this text is visible on the page."- }- ]- },- "The counter shows '3 items left'": {- "timestamp": 1767669862238,- "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 that the counter displays \"3 items left\". I'll use the `browser_expect_visible_text` tool to verify this text is visible on the page."- }- ]- },- "The counter uses plural 'items' when count is not 1": {- "timestamp": 1767669467690,- "actions": [- {- "method": "expectVisible",- "selector": "internal:text=\"items left\"i",- "code": "await expect(page.getByText('items left')).toBeVisible();",- "intent": "I need to verify that the counter uses plural \"items\" when the count is not 1. Looking at the snapshot, I can see there are 3 items left, and the text shows \"items left\" (plural form).\n\nLet me check for the presence of this plural text:"- }- ]- },- "The page loads with an empty todo list": {- "timestamp": 1767669821412,- "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 I don't see any list of todos or todo items in the snapshot. This indicates the todo list is indeed empty.\n\nThe best way to verify an empty todo list would be to check that a list element (if it exists) has no items, or to verify that certain elements that would only appear with todos are not visible. However, since I can only see the input textbox and no list structure in the snapshot, I'll verify that the input textbox is visible (which confirms the page loaded correctly) and that there are no todo items visible.\n\nLet me check that the main input textbox is visible, which would confirm the page has loaded properly with the todo interface:"- }- ]- },- "Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'": {- "timestamp": 1767669851751,- "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 to the list. Let me start by typing the first todo \"Buy groceries\" in the textbox and submitting it."- },- {- "method": "fill",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "text": "Walk the dog",- "submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Walk the dog');\nawait page.keyboard.press('Enter');",- "intent": "Good! The first todo \"Buy groceries\" has been added successfully. Now I'll add the second todo \"Walk the dog\"."- },- {- "method": "fill",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "text": "Read a book",- "submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Read a book');\nawait page.keyboard.press('Enter');",- "intent": "Great! Now I've added the second todo \"Walk the dog\". I can see both todos are in the list. Now I'll add the third and final todo \"Read a book\"."- }- ]- },- "Mark 'Buy groceries' as complete": {- "timestamp": 1767669872628,- "actions": [- {- "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": "I need to mark 'Buy groceries' as complete. Looking at the page snapshot, I can see that 'Buy groceries' is the first item in the todo list, and it has an unchecked checkbox labeled \"Toggle Todo\" with ref=e21. I'll click on that checkbox to mark it as complete."- }- ]- },- "Mark 'Read a book' as complete": {- "timestamp": 1767669575105,- "actions": [- {- "method": "click",- "selector": "internal:role=listitem >> internal:has-text=\"Read a book\"i >> internal:label=\"Toggle Todo\"i",- "options": {},- "code": "await page.getByRole('listitem').filter({ hasText: 'Read a book' }).getByLabel('Toggle Todo').click();",- "intent": "I need to mark 'Read a book' as complete. Looking at the page snapshot, I can see there's a todo item \"Read a book\" with an unchecked checkbox (ref=e39). I need to click on that checkbox to mark it as complete."- }- ]- },- "Mark 'Walk the dog' as complete": {- "timestamp": 1767669553698,- "actions": [- {- "method": "click",- "selector": "internal:role=listitem >> internal:has-text=\"Walk the dog\"i >> internal:label=\"Toggle Todo\"i",- "options": {},- "code": "await page.getByRole('listitem').filter({ hasText: 'Walk the dog' }).getByLabel('Toggle Todo').click();",- "intent": "I need to mark 'Walk the dog' as complete by clicking its checkbox.\n\nLooking at the page snapshot, I can see that 'Walk the dog' is in a listitem with a checkbox labeled \"Toggle Todo\" at ref=e35. This checkbox is currently unchecked (unlike the first item 'Buy groceries' which shows [checked]). I need to click this checkbox to mark it as complete."- }- ]- },- "The counter decreases as todos are completed": {- "timestamp": 1767669592355,- "actions": []- },- "The counter shows '0 items left'": {- "timestamp": 1767669585415,- "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] containing \"0\"\n- Followed by text \"items left\"\n\nThis matches the expected condition. I'll use `browser_expect_visible_text` to verify the text \"0 items left\" is visible on the page."- }- ]- },- "The counter uses singular 'item' when count is 1": {- "timestamp": 1767669599405,- "actions": []- },- "Delete 'Walk the dog' using the delete button (×)": {- "timestamp": 1767669674902,- "actions": [- {- "method": "click",- "selector": "div >> internal:has-text=/^Walk the dog$/",- "options": {},- "code": "await page.locator('div').filter({ hasText: /^Walk the dog$/ }).click();",- "intent": "I need to delete 'Walk the dog' using the delete button (×). Looking at the page snapshot, I can see that 'Walk the dog' is in a listitem with ref=e33, and it has a text element \"×\" that serves as the delete button. I need to click on that delete button.\n\nLet me examine the structure more carefully. The listitem [ref=e33] contains a generic [ref=e34] which has:\n- checkbox \"Toggle Todo\" [ref=e35]\n- generic [ref=e36]: Walk the dog\n- text: ×\n\nThe delete button (×) appears to be a text element within the listitem. Based on typical TodoMVC implementations, the delete button would be a clickable element. Let me look for the correct reference to click.\n\nSince the × symbol is shown as \"text: ×\" within the listitem structure at ref=e33, I should click on the parent generic container that contains this delete button. However, I need to identify the exact clickable element. In the structure, the × appears to be at the same level as the other elements within the generic [ref=e34].\n\nLet me click on the listitem or the container that has the delete functionality. I'll try clicking on the generic container [ref=e34] where the delete button should be, or I need to find if there's a button element for the ×.\n\nActually, looking at the structure more carefully, each todo item follows the same pattern. The × text appears within each listitem. I should click on the area where the × is located for the \"Walk the dog\" item."- }- ]- },- "The counter decreases when an active todo is deleted": {- "timestamp": 1767669686097,- "actions": []- },- "Add two todos: 'Buy groceries', 'Walk the dog'": {- "timestamp": 1767669717210,- "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 two todos to the list. Let me start by taking a snapshot to see the current state of the page, then add the todos one by one."- },- {- "method": "fill",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "text": "Walk the dog",- "submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Walk the dog');\nawait page.keyboard.press('Enter');",- "intent": "Great! The first todo \"Buy groceries\" has been added successfully. Now I'll add the second todo \"Walk the dog\"."- }- ]- },- "Delete 'Buy groceries' using the delete button": {- "timestamp": 1767669768139,- "actions": [- {- "method": "click",- "selector": "internal:role=button[name=\"Delete\"i]",- "options": {},- "code": "await page.getByRole('button', { name: 'Delete' }).click();",- "intent": "I'll help you delete 'Buy groceries' using the delete button. Let me click on the delete button for that item."- }- ]- },- "Deleting completed todos doesn't affect the counter": {- "timestamp": 1767669805331,- "actions": [- {- "method": "expectVisible",- "selector": "internal:text=\"1\"i",- "code": "await expect(page.getByText('1')).toBeVisible();",- "intent": "I need to verify that deleting completed todos doesn't affect the counter. Looking at the page snapshot, I can see:\n\n1. There's a counter showing \"1 item left\" (in the strong element with ref=e25)\n2. There's one visible todo \"Walk the dog\" which appears to be active (unchecked)\n3. The counter is currently at 1\n\nThe expectation is that when completed todos are deleted, this counter should remain unchanged because it only counts active (incomplete) todos. Since the counter shows \"1\" and there's one active todo visible, I should verify that this counter value is correct and stable.\n\nLet me assert that the counter shows \"1\":"- }- ]- },- "The counter only counts active (uncompleted) todos": {- "timestamp": 1767669792366,- "actions": [- {- "method": "expectVisible",- "selector": "internal:text=\"1\"i",- "code": "await expect(page.getByText('1')).toBeVisible();",- "intent": "I need to verify that the counter only counts active (uncompleted) todos. Looking at the page snapshot, I can see:\n\n- There is 1 todo item: \"Walk the dog\" which is uncompleted (checkbox is not checked)\n- The counter shows \"1 item left\" (in the strong element with ref=e25)\n\nThis suggests the counter is working correctly - it's showing 1 for the 1 active todo. To properly verify this expectation, I should check that the counter displays \"1\" which represents the count of active todos."- }- ]- },- "The counter still shows '1 item left'": {- "timestamp": 1767669780441,- "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 the generic element [ref=e24], there is:\n - A strong element [ref=e25] containing \"1\"\n - Text: \"item left\"\n\nThis forms the counter text \"1 item left\". I'll use `browser_expect_visible_text` to verify this text is visible on the page."- }- ]- },- "Click 'Active' filter": {- "timestamp": 1767669892203,- "actions": [- {- "method": "click",- "selector": "internal:role=link[name=\"Active\"i]",- "options": {},- "code": "await page.getByRole('link', { name: 'Active' }).click();",- "intent": "I'll click on the 'Active' filter link to show only active todo items."- }- ]- },- "Click 'Completed' filter": {- "timestamp": 1767669910910,- "actions": [- {- "method": "click",- "selector": "internal:role=link[name=\"Completed\"i]",- "options": {},- "code": "await page.getByRole('link', { name: 'Completed' }).click();",- "intent": "I'll click on the 'Completed' filter link to show only completed todos."- }- ]- },- "The counter always shows the count of active todos regardless of the current filter view": {- "timestamp": 1767669928344,- "actions": []- },- "The counter still shows '2 items left'": {- "timestamp": 1767669920939,- "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\nI'll use `browser_expect_visible_text` to verify that \"2 items left\" is visible on the page."- }- ]- }-}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/todo-creation.spec.ts b/examples/todomvc/tests/perform/todo-creation.spec.tsdeleted file mode 100644index 302bcd7970..0000000000--- a/examples/todomvc/tests/perform/todo-creation.spec.ts+++ /dev/null@@ -1,79 +0,0 @@-import { test } from '../fixtures';--test.use({- agent: {- api: 'anthropic',- apiKey: process.env.AZURE_SONNET_API_KEY!,- apiEndpoint: process.env.AZURE_SONNET_ENDPOINT!,- model: 'claude-sonnet-4-5',- }-});--test.describe('Todo Creation', () => {-- test('Add a single todo', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list and input field 'What needs to be done?' is visible`);-- await page.agent.perform(`Type 'Buy groceries' into the input field`);- await page.agent.expect(`The text appears in the input field`);-- await page.agent.perform(`Press Enter to submit the todo`);- await page.agent.expect(`The todo 'Buy groceries' appears in the list and the input field is cleared`);-- // Post Conditions- await page.agent.expect(`The todo counter shows '1 item left'`);- await page.agent.expect(`The new todo is unchecked (active state)`);- });-- test('Add multiple todos', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add first todo 'Buy groceries' by typing and pressing Enter`);- await page.agent.expect(`The first todo appears in the list`);-- await page.agent.perform(`Add second todo 'Walk the dog' by typing and pressing Enter`);- await page.agent.expect(`The second todo appears in the list below the first`);-- await page.agent.perform(`Add third todo 'Read a book' by typing and pressing Enter`);- await page.agent.expect(`The third todo appears in the list below the second`);-- // Post Conditions- await page.agent.expect(`All three todos are visible in the list`);- await page.agent.expect(`The todo counter shows '3 items left'`);- await page.agent.expect(`All todos are in active (unchecked) state`);- });-- test('Prevent adding empty todo', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Click into the input field without typing anything and press Enter`);- await page.agent.expect(`No todo is added to the list`);-- // Post Conditions- await page.agent.expect(`The todo list remains empty`);- await page.agent.expect(`The input field is still focused and empty`);- });-- test('Prevent adding whitespace-only todo', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Type only spaces ' ' into the input field and press Enter`);- await page.agent.expect(`No todo is added to the list`);-- // Post Conditions- await page.agent.expect(`The todo list remains empty`);- await page.agent.expect(`The input field is cleared or shows the spaces`);- });-- test('Add todo with special characters', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Type 'Buy @groceries & supplies (urgent!)' into the input field and press Enter`);- await page.agent.expect(`The todo appears in the list with all special characters preserved`);-- // Post Conditions- await page.agent.expect(`The todo displays exactly as entered with special characters`);- await page.agent.expect(`The todo counter shows '1 item left'`);- });--});diff --git a/examples/todomvc/tests/perform/todo-creation.spec.ts-cache.json b/examples/todomvc/tests/perform/todo-creation.spec.ts-cache.jsondeleted file mode 100644index 5e1846878b..0000000000--- a/examples/todomvc/tests/perform/todo-creation.spec.ts-cache.json+++ /dev/null@@ -1,309 +0,0 @@-{- "Press Enter to submit the todo": {- "timestamp": 1767669412869,- "actions": [- {- "method": "pressKey",- "key": "Enter",- "code": "await page.keyboard.press('Enter');",- "intent": "I need to press Enter to submit the todo item \"Buy groceries\" that is currently in the textbox. The active textbox has the ref \"e8\"."- }- ]- },- "The new todo is unchecked (active state)": {- "timestamp": 1767669447209,- "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 new todo \"Buy groceries\" is unchecked (in active state). Looking at the page snapshot, I can see there's a checkbox with the accessible name \"Toggle Todo\" at ref=e21, which corresponds to the todo item \"Buy groceries\". \n\nTo verify it's unchecked, I'll use the browser_expect_value tool to assert that this checkbox has a value of \"false\" (unchecked)."- }- ]- },- "The page loads with an empty todo list and input field 'What needs to be done?' is visible": {- "timestamp": 1767669381800,- "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 input field 'What needs to be done?' is visible on the page. Looking at the page snapshot, I can see there is a textbox with the accessible name \"What needs to be done?\" with ref=e8."- }- ]- },- "The text appears in the input field": {- "timestamp": 1767669403048,- "actions": [- {- "method": "expectValue",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "type": "textbox",- "value": "Buy groceries",- "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toHaveValue('Buy groceries');",- "intent": "I need to verify that the text \"Buy groceries\" appears in the input field. Looking at the page snapshot, I can see a textbox with the accessible name \"What needs to be done?\" that contains the text \"Buy groceries\"."- }- ]- },- "The todo 'Buy groceries' appears in the list and the input field is cleared": {- "timestamp": 1767669425057,- "actions": [- {- "method": "expectVisible",- "selector": "internal:text=\"Buy groceries\"i",- "code": "await expect(page.getByText('Buy groceries')).toBeVisible();",- "intent": "I need to verify two conditions:\n1. The todo 'Buy groceries' appears in the list\n2. The input field is cleared\n\nFrom the snapshot, I can see:\n- The todo \"Buy groceries\" is visible in the list (ref=e22)\n- The textbox \"What needs to be done?\" (ref=e8) is active but I need to check if it's empty\n\nSince I can only call one assertion tool, I'll prioritize verifying that \"Buy groceries\" appears in the list, as that's the primary expectation. The text \"Buy groceries\" is visible within the todo list structure."- }- ]- },- "The todo counter shows '1 item left'": {- "timestamp": 1767669733373,- "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 todo counter shows '1 item left'. Looking at the page snapshot, I can see:\n\n- A strong element with \"1\" (ref=e25)\n- Followed by text \"item left\"\n\nThese are within a generic element (ref=e24) in the footer section. I'll use `browser_expect_visible_text` to assert that the text \"1 item left\" is visible on the page."- }- ]- },- "Type 'Buy groceries' into the input field": {- "timestamp": 1767669392475,- "actions": [- {- "method": "fill",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "text": "Buy groceries",- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy groceries');",- "intent": "I'll help you type 'Buy groceries' into the input field. Let me interact with the textbox that says \"What needs to be done?\""- }- ]- },- "Add first todo 'Buy groceries' by typing and pressing Enter": {- "timestamp": 1767669473356,- "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 the first todo 'Buy groceries' by typing it into the textbox and pressing Enter."- }- ]- },- "Add second todo 'Walk the dog' by typing and pressing Enter": {- "timestamp": 1767669493228,- "actions": [- {- "method": "fill",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "text": "Walk the dog",- "submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Walk the dog');\nawait page.keyboard.press('Enter');",- "intent": "I'll help you add a second todo 'Walk the dog' by typing in the textbox and pressing Enter."- }- ]- },- "Add third todo 'Read a book' by typing and pressing Enter": {- "timestamp": 1767669514317,- "actions": [- {- "method": "fill",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "text": "Read a book",- "submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Read a book');\nawait page.keyboard.press('Enter');",- "intent": "I'll help you add a third todo item 'Read a book' by typing it in the textbox and pressing Enter."- }- ]- },- "All three todos are visible in the list": {- "timestamp": 1767669535558,- "actions": [- {- "method": "expectAria",- "template": "- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n - listitem: Read a book",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n - listitem: Read a book\n`);",- "intent": "I need to verify that all three todos are visible in the list. Looking at the page snapshot, I can see there's a list element with ref=e18 that contains three listitems with the todos:\n1. \"Buy groceries\"\n2. \"Walk the dog\"\n3. \"Read a book\"\n\nI'll use the `browser_expect_list_visible` tool to verify that all three todos are present in the correct order."- }- ]- },- "All todos are in active (unchecked) state": {- "timestamp": 1767669577386,- "actions": [- {- "method": "expectValue",- "selector": "internal:role=listitem >> internal:has-text=\"Buy groceries\"i >> internal:label=\"Toggle Todo\"i",- "type": "checkbox",- "value": "false",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Buy groceries' }).getByLabel('Toggle Todo')).toBeChecked({ checked: false });",- "intent": "I need to verify that all todos are in an active (unchecked) state. Looking at the page snapshot, I can see there are 3 todo items, each with a \"Toggle Todo\" checkbox. I need to check that all these checkboxes are unchecked.\n\nLet me verify the first checkbox is unchecked:"- },- {- "method": "expectValue",- "selector": "internal:role=listitem >> internal:has-text=\"Walk the dog\"i >> internal:label=\"Toggle Todo\"i",- "type": "checkbox",- "value": "false",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Walk the dog' }).getByLabel('Toggle Todo')).toBeChecked({ checked: false });",- "intent": "Good! The first checkbox is unchecked. Now let me verify the second checkbox:"- },- {- "method": "expectValue",- "selector": "internal:role=listitem >> internal:has-text=\"Read a book\"i >> internal:label=\"Toggle Todo\"i",- "type": "checkbox",- "value": "false",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Read a book' }).getByLabel('Toggle Todo')).toBeChecked({ checked: false });",- "intent": "Perfect! The second checkbox is also unchecked. Now let me verify the third and final checkbox:"- }- ]- },- "The first todo appears in the list": {- "timestamp": 1767669483829,- "actions": [- {- "method": "expectVisible",- "selector": "internal:text=\"Buy groceries\"i",- "code": "await expect(page.getByText('Buy groceries')).toBeVisible();",- "intent": "I need to verify that the first todo appears in the list. Looking at the page snapshot, I can see there is a list with one todo item that says \"Buy groceries\"."- }- ]- },- "The page loads with an empty todo list": {- "timestamp": 1767669691855,- "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 items in the snapshot indicates the list is empty. I should verify that a typical todo list element or todo items are NOT visible on the page.\n\nLet me check that there are no visible todo items by looking for common todo list patterns. Since there's no list structure visible in the snapshot that would contain todo items, I'll verify that the textbox is present (which confirms the app loaded) and that would indicate the list is empty.\n\nActually, the best approach is to verify that a todo item or todo list is not present. Let me look for what would typically be visible if there were todos - usually a list with role \"list\" containing items, or specific todo item elements.\n\nSince I need to assert the todo list is empty, I'll verify that the page has loaded properly by checking for the presence of the input textbox, which confirms the app is ready and in its initial empty state."- }- ]- },- "The second todo appears in the list below the first": {- "timestamp": 1767669503771,- "actions": [- {- "method": "expectAria",- "template": "- list:\n - listitem: Buy groceries\n - listitem: Walk the dog",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n`);",- "intent": "I need to verify that the second todo appears below the first in the list. Looking at the page snapshot, I can see a list with two todo items:\n\n1. First listitem (ref=e19) contains \"Buy groceries\"\n2. Second listitem (ref=e33) contains \"Walk the dog\"\n\nI'll use the `browser_expect_list_visible` tool to verify that these items appear in the correct order in the list."- }- ]- },- "The third todo appears in the list below the second": {- "timestamp": 1767669524523,- "actions": [- {- "method": "expectAria",- "template": "- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n - listitem: Read a book",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n - listitem: Read a book\n`);",- "intent": "I need to verify that the third todo appears in the list below the second todo. Looking at the page snapshot, I can see a list with three todo items:\n\n1. \"Buy groceries\"\n2. \"Walk the dog\"\n3. \"Read a book\"\n\nI'll use the `browser_expect_list_visible` tool to verify that these items appear in the correct order within the list."- }- ]- },- "The todo counter shows '3 items left'": {- "timestamp": 1767669545877,- "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 todo counter shows '3 items left'. Looking at the page snapshot, I can see in the generic element with ref=e24, there's a strong element with ref=e25 containing \"3\" followed by text \"items left\".\n\nI'll use the browser_expect_visible_text tool to assert that the text \"3 items left\" is visible on the page."- }- ]- },- "Click into the input field without typing anything and press Enter": {- "timestamp": 1767669608834,- "actions": [- {- "method": "click",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "options": {},- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).click();",- "intent": "I'll click on the input field and press Enter without typing anything."- },- {- "method": "pressKey",- "key": "Enter",- "code": "await page.keyboard.press('Enter');",- "intent": "Now I'll press Enter to complete the task."- }- ]- },- "No todo is added to the list": {- "timestamp": 1767669664555,- "actions": []- },- "The input field is still focused and empty": {- "timestamp": 1767669632532,- "actions": [- {- "method": "expectValue",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "type": "textbox",- "value": "",- "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toHaveValue('');",- "intent": "I need to verify that the input field is focused and empty. Looking at the page snapshot, I can see:\n\n- There's a textbox with accessible name \"What needs to be done?\" [ref=e8]\n- It has the `[active]` attribute, which indicates it's focused\n- There's no value shown in the snapshot, suggesting it's empty\n\nI'll use the `browser_expect_value` tool to assert that this textbox is empty (has an empty string value)."- }- ]- },- "The todo list remains empty": {- "timestamp": 1767669669880,- "actions": []- },- "The input field is cleared or shows the spaces": {- "timestamp": 1767669674697,- "actions": []- },- "Type only spaces ' ' into the input field and press Enter": {- "timestamp": 1767669656405,- "actions": [- {- "method": "fill",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "text": " ",- "submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill(' ');\nawait page.keyboard.press('Enter');",- "intent": "I'll type only spaces into the input field and press Enter."- }- ]- },- "The todo appears in the list with all special characters preserved": {- "timestamp": 1767669712006,- "actions": [- {- "method": "expectVisible",- "selector": "internal:text=\"Buy @groceries & supplies (urgent!)\"i",- "code": "await expect(page.getByText('Buy @groceries & supplies (urgent!)')).toBeVisible();",- "intent": "I need to verify that the todo item appears in the list with all special characters preserved. Looking at the snapshot, I can see a listitem containing the text \"Buy @groceries & supplies (urgent!)\" which includes special characters like @, &, parentheses, and an exclamation mark.\n\nI'll use the browser_expect_visible_text tool to verify this exact text is visible on the page."- }- ]- },- "The todo displays exactly as entered with special characters": {- "timestamp": 1767669722514,- "actions": [- {- "method": "expectVisible",- "selector": "internal:text=\"Buy @groceries & supplies (urgent!)\"i",- "code": "await expect(page.getByText('Buy @groceries & supplies (urgent!)')).toBeVisible();",- "intent": "I need to verify that the todo item displays exactly as entered with special characters. Looking at the page snapshot, I can see a todo item with the text \"Buy @groceries & supplies (urgent!)\" which contains special characters like @, &, and parentheses.\n\nI'll use the browser_expect_visible_text tool to assert that this exact text is visible on the page."- }- ]- },- "Type 'Buy @groceries & supplies (urgent!)' into the input field and press Enter": {- "timestamp": 1767669701522,- "actions": [- {- "method": "fill",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "text": "Buy @groceries & supplies (urgent!)",- "submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Buy @groceries & supplies (urgent!)');\nawait page.keyboard.press('Enter');",- "intent": "I'll type the text into the input field and press Enter to complete this task."- }- ]- }-}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/todo-deletion.spec.ts b/examples/todomvc/tests/perform/todo-deletion.spec.tsdeleted file mode 100644index 3cb5621a43..0000000000--- a/examples/todomvc/tests/perform/todo-deletion.spec.ts+++ /dev/null@@ -1,101 +0,0 @@-import { test } from '../fixtures';--test.use({- agent: {- api: 'anthropic',- apiKey: process.env.AZURE_SONNET_API_KEY!,- apiEndpoint: process.env.AZURE_SONNET_ENDPOINT!,- model: 'claude-sonnet-4-5',- }-});--test.describe('Todo Deletion', () => {-- test('Delete a single todo', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add a todo 'Buy groceries'`);- await page.agent.expect(`The todo appears in the list`);-- await page.agent.perform(`Hover over the todo to reveal the delete button (×)`);- await page.agent.expect(`The delete button becomes visible`);-- await page.agent.perform(`Click the delete button (×)`);- await page.agent.expect(`The todo is removed from the list`);-- // Post Conditions- await page.agent.expect(`The todo list is empty`);- await page.agent.expect(`The footer and counter are hidden`);- });-- test('Delete todo from multiple todos', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'`);- await page.agent.expect(`All three todos appear in the list`);-- await page.agent.perform(`Hover over 'Walk the dog' to reveal the delete button`);- await page.agent.expect(`The delete button becomes visible for 'Walk the dog'`);-- await page.agent.perform(`Click the delete button for 'Walk the dog'`);- await page.agent.expect(`The 'Walk the dog' todo is removed`);-- // Post Conditions- await page.agent.expect(`Only 'Buy groceries' and 'Read a book' remain in the list`);- await page.agent.expect(`The todo counter shows '2 items left'`);- });-- test('Clear all completed todos', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'`);- await page.agent.expect(`All three todos appear in the list`);-- await page.agent.perform(`Mark 'Buy groceries' and 'Read a book' as complete`);- await page.agent.expect(`Two todos are checked`);-- await page.agent.perform(`Click the 'Clear completed' button in the footer`);- await page.agent.expect(`The completed todos are removed from the list`);-- // Post Conditions- await page.agent.expect(`Only 'Walk the dog' remains in the list`);- await page.agent.expect(`The todo counter shows '1 item left'`);- await page.agent.expect(`The 'Clear completed' button is no longer visible`);- });-- test('Clear completed when all are completed', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add two todos: 'Buy groceries', 'Walk the dog'`);- await page.agent.expect(`Both todos appear in the list`);-- await page.agent.perform(`Mark both todos as complete`);- await page.agent.expect(`Both todos are checked`);-- await page.agent.perform(`Click the 'Clear completed' button`);- await page.agent.expect(`All todos are removed`);-- // Post Conditions- await page.agent.expect(`The todo list is empty`);- await page.agent.expect(`The footer and counter are hidden`);- await page.agent.expect(`Only the input field remains visible`);- });-- test('Delete completed todo individually', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add a todo 'Buy groceries'`);- await page.agent.expect(`The todo appears in the list`);-- await page.agent.perform(`Mark the todo as complete`);- await page.agent.expect(`The todo is checked`);-- await page.agent.perform(`Hover over the completed todo and click the delete button (×)`);- await page.agent.expect(`The completed todo is removed`);-- // Post Conditions- await page.agent.expect(`The todo list is empty`);- await page.agent.expect(`The footer is hidden`);- });--});diff --git a/examples/todomvc/tests/perform/todo-deletion.spec.ts-cache.json b/examples/todomvc/tests/perform/todo-deletion.spec.ts-cache.jsondeleted file mode 100644index a325b70b61..0000000000--- a/examples/todomvc/tests/perform/todo-deletion.spec.ts-cache.json+++ /dev/null@@ -1,426 +0,0 @@-{- "Add a todo 'Buy groceries'": {- "timestamp": 1767669878838,- "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 list. I can see there's a textbox with the placeholder \"What needs to be done?\" that I need to interact with."- }- ]- },- "Click the delete button (×)": {- "timestamp": 1767669436371,- "actions": []- },- "Hover over the todo to reveal the delete button (×)": {- "timestamp": 1767669417197,- "actions": [- {- "method": "hover",- "selector": "internal:testid=[data-testid=\"todo-item\"s] >> div",- "options": {},- "code": "await page.getByTestId('todo-item').locator('div').hover();",- "intent": "I need to hover over the todo item to reveal the delete button. Looking at the page snapshot, I can see there's a todo item \"Buy groceries\" in the list. The delete button (×) is mentioned in the structure. I'll hover over the todo item container."- }- ]- },- "The delete button becomes visible": {- "timestamp": 1767669427212,- "actions": [- {- "method": "expectVisible",- "selector": "internal:role=button[name=\"Delete\"i]",- "code": "await expect(page.getByRole('button', { name: 'Delete' })).toBeVisible();",- "intent": "I can see from the page snapshot that there is a delete button that is already visible in the list item. Let me verify that the delete button with the \"×\" symbol is visible."- }- ]- },- "The footer and counter are hidden": {- "timestamp": 1767669846457,- "actions": [- {- "method": "expectVisible",- "selector": "internal:role=contentinfo[name=\"\"i]",- "isNot": true,- "code": "await expect(page.getByRole('contentinfo', { name: '' })).toBeVisible();",- "intent": "I need to verify that the footer and counter are hidden. Looking at the page snapshot, I can see a `contentinfo` element (which is the semantic footer) with ref=e9. This element appears to be present in the DOM. However, the task states that the footer and counter should be hidden, which typically means they should not be visible to the user.\n\nLet me check if the footer (contentinfo) element is NOT visible:"- }- ]- },- "The page loads with an empty todo list": {- "timestamp": 1767669868471,- "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 for the absence of any todo items."- }- ]- },- "The todo appears in the list": {- "timestamp": 1767669883362,- "actions": []- },- "The todo is removed from the list": {- "timestamp": 1767669442917,- "actions": []- },- "The todo list is empty": {- "timestamp": 1767669937696,- "actions": []- },- "Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'": {- "timestamp": 1767669611449,- "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 to the TodoMVC app. Let me start by adding the first todo \"Buy groceries\" to the textbox."- },- {- "method": "fill",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "text": "Walk the dog",- "submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Walk the dog');\nawait page.keyboard.press('Enter');",- "intent": "Good! The first todo \"Buy groceries\" has been added. Now I'll add the second todo \"Walk the dog\"."- },- {- "method": "fill",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "text": "Read a book",- "submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Read a book');\nawait page.keyboard.press('Enter');",- "intent": "Perfect! Two todos have been added successfully. Now I'll add the final todo \"Read a book\"."- }- ]- },- "All three todos appear in the list": {- "timestamp": 1767669621823,- "actions": [- {- "method": "expectAria",- "template": "- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n - listitem: Read a book",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n - listitem: Read a book\n`);",- "intent": "I need to verify that all three todos appear in the list. Looking at the page snapshot, I can see a list with three items:\n1. \"Buy groceries\"\n2. \"Walk the dog\"\n3. \"Read a book\"\n\nI'll use the `browser_expect_list_visible` tool to assert that all three todos are present in the correct order."- }- ]- },- "Click the delete button for 'Walk the dog'": {- "timestamp": 1767669543910,- "actions": [- {- "method": "click",- "selector": "internal:role=button[name=\"Delete\"i]",- "options": {},- "code": "await page.getByRole('button', { name: 'Delete' }).click();",- "intent": "I need to click the delete button for 'Walk the dog'. Looking at the page snapshot, I can see that \"Walk the dog\" is in a listitem with ref=e33, and it has a button \"Delete\" with ref=e41."- }- ]- },- "Hover over 'Walk the dog' to reveal the delete button": {- "timestamp": 1767669523906,- "actions": [- {- "method": "hover",- "selector": "internal:text=\"Walk the dog\"i",- "options": {},- "code": "await page.getByText('Walk the dog').hover();",- "intent": "I'll hover over the 'Walk the dog' todo item to reveal the delete button."- }- ]- },- "Only 'Buy groceries' and 'Read a book' remain in the list": {- "timestamp": 1767669560716,- "actions": [- {- "method": "expectAria",- "template": "- list:\n - listitem: Buy groceries\n - listitem: Read a book",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy groceries\n - listitem: Read a book\n`);",- "intent": "I need to verify that only 'Buy groceries' and 'Read a book' remain in the todo list. Looking at the page snapshot, I can see there's a list element (ref=e18) containing two listitems with these exact items.\n\nI'll use the `browser_expect_list_visible` tool to assert that the list contains exactly these two items in order."- }- ]- },- "The 'Walk the dog' todo is removed": {- "timestamp": 1767669548950,- "actions": []- },- "The delete button becomes visible for 'Walk the dog'": {- "timestamp": 1767669533807,- "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 the delete button is visible for 'Walk the dog'. Looking at the page snapshot, I can see that under the 'Walk the dog' list item (ref=e33), there is a button with the label \"Delete\" (ref=e41) that displays \"×\"."- }- ]- },- "The todo counter shows '2 items left'": {- "timestamp": 1767669571464,- "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 todo counter shows '2 items 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 \"2\"\n- Followed by text \"items left\"\n\nThis matches the expectation that the counter should show '2 items left'. I'll use the `browser_expect_visible_text` tool to verify this text is visible on the page."- }- ]- },- "Click the 'Clear completed' button in the footer": {- "timestamp": 1767669674016,- "actions": [- {- "method": "click",- "selector": "internal:role=button[name=\"Clear completed\"i]",- "options": {},- "code": "await page.getByRole('button', { name: 'Clear completed' }).click();",- "intent": "I need to click the 'Clear completed' button in the footer. Looking at the page snapshot, I can see the button with ref=e42 labeled \"Clear completed\" in the footer section."- }- ]- },- "Mark 'Buy groceries' and 'Read a book' as complete": {- "timestamp": 1767669643237,- "actions": [- {- "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": "I need to mark 'Buy groceries' and 'Read a book' as complete. Looking at the page snapshot, I can see:\n\n1. 'Buy groceries' is a listitem with a checkbox at ref=e21\n2. 'Read a book' is a listitem with a checkbox at ref=e39\n\nBoth checkboxes are currently unchecked (they're labeled as \"Toggle Todo\" checkboxes). I need to click both of these checkboxes to mark them as complete."- },- {- "method": "click",- "selector": "internal:role=listitem >> internal:has-text=\"Read a book\"i >> internal:label=\"Toggle Todo\"i",- "options": {},- "code": "await page.getByRole('listitem').filter({ hasText: 'Read a book' }).getByLabel('Toggle Todo').click();",- "intent": "Good! I've successfully marked 'Buy groceries' as complete (the checkbox at ref=e21 is now checked). The item count has changed from \"3 items left\" to \"2 items left\". Now I need to click the checkbox for 'Read a book' at ref=e39."- }- ]- },- "Only 'Walk the dog' remains in the list": {- "timestamp": 1767669697140,- "actions": [- {- "method": "expectAria",- "template": "- list:\n - listitem: Walk the dog",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Walk the dog\n`);",- "intent": "I need to verify that only 'Walk the dog' remains in the todo list. Looking at the page snapshot, I can see there's a list (ref=e18) containing a single listitem (ref=e33) with the text \"Walk the dog\". \n\nI'll use the browser_expect_list_visible tool to assert that the list contains exactly one item: \"Walk the dog\"."- }- ]- },- "The 'Clear completed' button is no longer visible": {- "timestamp": 1767669712619,- "actions": []- },- "The completed todos are removed from the list": {- "timestamp": 1767669686594,- "actions": [- {- "method": "expectVisible",- "selector": "internal:text=\"1\"i",- "code": "await expect(page.getByText('1')).toBeVisible();",- "intent": "I need to verify that completed todos are removed from the list. Looking at the page snapshot, I can see:\n\n- There is 1 todo item remaining: \"Walk the dog\" (which is unchecked)\n- The counter shows \"1 item left\"\n- There is only one listitem in the todo list\n\nThis suggests that any completed todos have been removed from the list. To assert this expectation, I should verify that the list only contains active (uncompleted) todos and no completed ones are visible.\n\nLet me check that the todo list contains only the active todo \"Walk the dog\" and verify the item count is 1:"- }- ]- },- "The todo counter shows '1 item left'": {- "timestamp": 1767669707960,- "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 todo counter shows '1 item left'. Looking at the page snapshot, I can see:\n\n- There's a generic element [ref=e24] that contains:\n - A strong element [ref=e25] with text \"1\"\n - Text: \"item left\"\n\nThis forms the complete text \"1 item left\". I'll use `browser_expect_visible_text` to verify this text is visible on the page."- }- ]- },- "Two todos are checked": {- "timestamp": 1767669663815,- "actions": [- {- "method": "expectValue",- "selector": "internal:role=listitem >> internal:has-text=\"Buy groceries\"i >> internal:label=\"Toggle Todo\"i",- "type": "checkbox",- "value": "true",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Buy groceries' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });",- "intent": "I need to verify that two todos are checked. Looking at the page snapshot, I can see there are three todo items:\n\n1. \"Buy groceries\" - has a checkbox that is **checked** (ref=e21)\n2. \"Walk the dog\" - has a checkbox that is **not checked** (ref=e35)\n3. \"Read a book\" - has a checkbox that is **checked** (ref=e39)\n\nSo there are indeed 2 todos that are checked. I'll use the browser_expect_value tool to verify that the two checkboxes are checked."- },- {- "method": "expectValue",- "selector": "internal:role=listitem >> internal:has-text=\"Read a book\"i >> internal:label=\"Toggle Todo\"i",- "type": "checkbox",- "value": "true",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Read a book' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });",- "intent": "Now I'll verify the second checked todo:"- }- ]- },- "Add two todos: 'Buy groceries', 'Walk the dog'": {- "timestamp": 1767669745424,- "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 two todos to the list. Let me start by typing the first todo \"Buy groceries\" and then add the second one \"Walk the dog\"."- },- {- "method": "fill",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "text": "Walk the dog",- "submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Walk the dog');\nawait page.keyboard.press('Enter');",- "intent": "Great! The first todo \"Buy groceries\" has been added successfully. Now I'll add the second todo \"Walk the dog\"."- }- ]- },- "All todos are removed": {- "timestamp": 1767669821219,- "actions": []- },- "Both todos appear in the list": {- "timestamp": 1767669757834,- "actions": [- {- "method": "expectAria",- "template": "- list:\n - listitem: Buy groceries\n - listitem: Walk the dog",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n`);",- "intent": "I need to verify that both todos appear in the list. Looking at the page snapshot, I can see a list with two listitems containing \"Buy groceries\" and \"Walk the dog\"."- }- ]- },- "Both todos are checked": {- "timestamp": 1767669801880,- "actions": [- {- "method": "expectValue",- "selector": "internal:role=listitem >> internal:has-text=\"Buy groceries\"i >> internal:label=\"Toggle Todo\"i",- "type": "checkbox",- "value": "true",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Buy groceries' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });",- "intent": "I need to verify that both todos are checked. Looking at the page snapshot, I can see two todo items:\n\n1. \"Buy groceries\" - has a checkbox with `[checked]` attribute (ref=e21)\n2. \"Walk the dog\" - has a checkbox with `[checked]` attribute (ref=e35)\n\nBoth checkboxes show the `[checked]` state, confirming both todos are checked. I'll use the browser_expect_value tool to assert that both checkboxes are in the checked state."- },- {- "method": "expectValue",- "selector": "internal:role=listitem >> internal:has-text=\"Walk the dog\"i >> internal:label=\"Toggle Todo\"i",- "type": "checkbox",- "value": "true",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Walk the dog' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });",- "intent": "I've verified the first todo checkbox is checked. Now I need to verify the second todo checkbox as well to complete the assertion that both todos are checked."- }- ]- },- "Click the 'Clear completed' button": {- "timestamp": 1767669811523,- "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."- }- ]- },- "Mark both todos as complete": {- "timestamp": 1767669779613,- "actions": [- {- "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": "I need to mark both todos as complete. I can see there are two todo items:\n1. \"Buy groceries\" - with checkbox ref=e21\n2. \"Walk the dog\" - with checkbox ref=e35\n\nI'll click both checkboxes to mark them as complete."- },- {- "method": "click",- "selector": "internal:role=listitem >> internal:has-text=\"Walk the dog\"i >> internal:label=\"Toggle Todo\"i",- "options": {},- "code": "await page.getByRole('listitem').filter({ hasText: 'Walk the dog' }).getByLabel('Toggle Todo').click();",- "intent": "Good! The first todo \"Buy groceries\" is now marked as complete (checkbox is checked). The count changed from \"2 items left\" to \"1 item left\". Now I need to click the second checkbox to mark \"Walk the dog\" as complete."- }- ]- },- "Only the input field remains visible": {- "timestamp": 1767669858075,- "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 only the input field remains visible. Based on the page snapshot, I can see several elements are currently visible including:\n- The demo text and link\n- The \"todos\" heading\n- The textbox \"What needs to be done?\"\n- The footer with multiple paragraphs and links\n\nThe expectation states that \"only the input field remains visible\", which means the textbox should be visible while other elements should not be. Let me verify that the input field (textbox) is visible."- }- ]- },- "Hover over the completed todo and click the delete button (×)": {- "timestamp": 1767669925224,- "actions": [- {- "method": "hover",- "selector": "internal:testid=[data-testid=\"todo-item\"s] >> div",- "options": {},- "code": "await page.getByTestId('todo-item').locator('div').hover();",- "intent": "I need to hover over the completed todo item and then click the delete button (×).\n\nLooking at the page snapshot, I can see:\n- There's a todo item \"Buy groceries\" that is checked (completed) - ref=e20 for the container\n- The delete button with \"×\" has ref=e33\n\nLet me first hover over the completed todo item, then click the delete button."- },- {- "method": "click",- "selector": "internal:role=button[name=\"Delete\"i]",- "options": {},- "code": "await page.getByRole('button', { name: 'Delete' }).click();",- "intent": "Now I'll click the delete button (×):"- }- ]- },- "Mark the todo as complete": {- "timestamp": 1767669893757,- "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 mark the todo item as complete. I can see there's a checkbox for \"Toggle Todo\" that corresponds to the \"Buy groceries\" todo item. I'll click on that checkbox to mark it as complete."- }- ]- },- "The completed todo is removed": {- "timestamp": 1767669930890,- "actions": []- },- "The footer is hidden": {- "timestamp": 1767669948076,- "actions": [- {- "method": "expectVisible",- "selector": "internal:role=contentinfo[name=\"\"i]",- "isNot": true,- "code": "await expect(page.getByRole('contentinfo', { name: '' })).not.toBeVisible();",- "intent": "I need to verify that the footer is hidden. Looking at the page snapshot, I can see a `contentinfo` element (which is the semantic footer) with ref=e9. To assert that it's hidden, I should use the `browser_expect_visible` tool with `isNot: true`."- }- ]- },- "The todo is checked": {- "timestamp": 1767669905043,- "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 is checked. Looking at the page snapshot, I can see there's a checkbox labeled \"Toggle Todo\" with reference `e21` that is marked as `[checked]`. This checkbox controls the todo item \"Buy groceries\"."- }- ]- }-}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/todo-editing.spec.ts b/examples/todomvc/tests/perform/todo-editing.spec.tsdeleted file mode 100644index cf437c8094..0000000000--- a/examples/todomvc/tests/perform/todo-editing.spec.ts+++ /dev/null@@ -1,94 +0,0 @@-import { test } from '../fixtures';--test.use({- agent: {- api: 'anthropic',- apiKey: process.env.AZURE_SONNET_API_KEY!,- apiEndpoint: process.env.AZURE_SONNET_ENDPOINT!,- model: 'claude-sonnet-4-5',- }-});--test.describe('Todo Editing', () => {-- test('Edit todo text', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add a todo 'Buy groceries'`);- await page.agent.expect(`The todo appears in the list`);-- await page.agent.perform(`Double-click on the todo text 'Buy groceries'`);- await page.agent.expect(`The todo enters edit mode with a text input showing 'Buy groceries'`);-- await page.agent.perform(`Clear the text and type 'Buy groceries and milk'`);- await page.agent.expect(`The new text appears in the edit field`);-- await page.agent.perform(`Press Enter to save the changes`);- await page.agent.expect(`The todo exits edit mode and displays 'Buy groceries and milk'`);-- // Post Conditions- await page.agent.expect(`The todo shows the updated text`);- await page.agent.expect(`The todo remains in its original completion state`);- });-- test('Cancel editing with Escape', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add a todo 'Buy groceries'`);- await page.agent.expect(`The todo appears in the list`);-- await page.agent.perform(`Double-click on the todo text to enter edit mode`);- await page.agent.expect(`The edit input appears with 'Buy groceries'`);-- await page.agent.perform(`Change the text to 'Something else'`);- await page.agent.expect(`The new text appears in the edit field`);-- await page.agent.perform(`Press Escape key`);- await page.agent.expect(`The edit is cancelled and the original text 'Buy groceries' is preserved`);-- // Post Conditions- await page.agent.expect(`The todo shows the original text 'Buy groceries'`);- await page.agent.expect(`The todo is no longer in edit mode`);- });-- test('Delete todo by clearing text', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add a todo 'Buy groceries'`);- await page.agent.expect(`The todo appears in the list`);-- await page.agent.perform(`Double-click on the todo text to enter edit mode`);- await page.agent.expect(`The edit input appears`);-- await page.agent.perform(`Clear all the text in the edit field`);- await page.agent.expect(`The edit field is empty`);-- await page.agent.perform(`Press Enter to save`);- await page.agent.expect(`The todo is removed from the list`);-- // Post Conditions- await page.agent.expect(`The todo list is empty`);- await page.agent.expect(`The todo counter and footer controls are hidden`);- });-- test('Edit completed todo', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add a todo 'Buy groceries'`);- await page.agent.expect(`The todo appears in the list`);-- await page.agent.perform(`Mark the todo as complete by clicking its checkbox`);- await page.agent.expect(`The todo is marked as complete`);-- await page.agent.perform(`Double-click on the completed todo text`);- await page.agent.expect(`The todo enters edit mode`);-- await page.agent.perform(`Change the text to 'Buy groceries and milk' and press Enter`);- await page.agent.expect(`The todo text is updated`);-- // Post Conditions- await page.agent.expect(`The todo shows the updated text 'Buy groceries and milk'`);- await page.agent.expect(`The todo remains in completed state (checked)`);- });--});diff --git a/examples/todomvc/tests/perform/todo-editing.spec.ts-cache.json b/examples/todomvc/tests/perform/todo-editing.spec.ts-cache.jsondeleted file mode 100644index 5961f457c2..0000000000--- a/examples/todomvc/tests/perform/todo-editing.spec.ts-cache.json+++ /dev/null@@ -1,264 +0,0 @@-{- "Add a todo 'Buy groceries'": {- "timestamp": 1767669617787,- "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 todo list. I can see there's a textbox with the placeholder \"What needs to be done?\" that I need to type into."- }- ]- },- "Clear the text and type 'Buy groceries and milk'": {- "timestamp": 1767669434757,- "actions": [- {- "method": "fill",- "selector": "internal:role=textbox[name=\"Edit\"i]",- "text": "Buy groceries and milk",- "code": "await page.getByRole('textbox', { name: 'Edit' }).fill('Buy groceries and milk');",- "intent": "I need to clear the text in the active textbox and type 'Buy groceries and milk'. The textbox with ref=e33 currently contains \"Buy groceries\" and is in edit mode."- }- ]- },- "Double-click on the todo text 'Buy groceries'": {- "timestamp": 1767669413704,- "actions": [- {- "method": "click",- "selector": "internal:testid=[data-testid=\"todo-title\"s]",- "options": {- "clickCount": 2- },- "code": "await page.getByTestId('todo-title').click({\nclickCount: 2\n});",- "intent": "I need to double-click on the todo text 'Buy groceries'. Looking at the page snapshot, I can see that the text \"Buy groceries\" is in a generic element with ref=e22."- }- ]- },- "Press Enter to save the changes": {- "timestamp": 1767669456011,- "actions": [- {- "method": "pressKey",- "key": "Enter",- "code": "await page.keyboard.press('Enter');",- "intent": "I can see that there's an active textbox with \"Buy groceries and milk\" that is currently being edited. To save the changes, I need to press Enter on this active field."- }- ]- },- "The new text appears in the edit field": {- "timestamp": 1767669569746,- "actions": [- {- "method": "expectValue",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "type": "textbox",- "value": "",- "isNot": true,- "code": "await expect(page.getByRole('textbox', { name: 'What needs to be done?' })).toHaveValue('');",- "intent": "I need to verify that new text appears in the edit field. Looking at the page snapshot, I can see there's a textbox with the label \"What needs to be done?\" at ref=e8. \n\nHowever, I notice that the current snapshot shows this textbox without any visible value specified. The expectation states \"The new text appears in the edit field,\" which suggests I should verify that some text has been entered into this textbox.\n\nLet me use the browser_expect_value tool to check if the textbox contains a value (non-empty text):"- }- ]- },- "The page loads with an empty todo list": {- "timestamp": 1767669606846,- "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 app has loaded and is ready for input."- }- ]- },- "The todo appears in the list": {- "timestamp": 1767669622638,- "actions": []- },- "The todo enters edit mode with a text input showing 'Buy groceries'": {- "timestamp": 1767669424622,- "actions": [- {- "method": "expectValue",- "selector": "internal:role=textbox[name=\"Edit\"i]",- "type": "textbox",- "value": "Buy groceries",- "code": "await expect(page.getByRole('textbox', { name: 'Edit' })).toHaveValue('Buy groceries');",- "intent": "I'll verify that the todo enters edit mode with a text input showing 'Buy groceries'. Looking at the page snapshot, I can see there's an active textbox with the label \"Edit\" that contains the value \"Buy groceries\"."- }- ]- },- "The todo exits edit mode and displays 'Buy groceries and milk'": {- "timestamp": 1767669467670,- "actions": [- {- "method": "expectVisible",- "selector": "internal:text=\"Buy groceries and milk\"i",- "code": "await expect(page.getByText('Buy groceries and milk')).toBeVisible();",- "intent": "I need to verify that the todo item has exited edit mode and now displays 'Buy groceries and milk'. \n\nLooking at the page snapshot, I can see:\n- There's a listitem (ref=e19) that contains a generic element (ref=e22) with the text \"Buy groceries and milk\"\n- This appears to be in display mode (not edit mode) as it's showing as a generic element with text, not as a textbox\n\nI'll use `browser_expect_visible_text` to verify that the text 'Buy groceries and milk' is visible on the page, which confirms the todo has exited edit mode and is displaying the expected text."- }- ]- },- "The todo remains in its original completion state": {- "timestamp": 1767669489200,- "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 item \"Buy groceries and milk\" remains in its original completion state. Looking at the page snapshot, I can see there's a checkbox with the label \"Toggle Todo\" (ref=e21) that represents the completion state of the todo item \"Buy groceries and milk\".\n\nFrom the snapshot, the checkbox appears to be unchecked (not marked as complete), as there's no indication it's checked and the item count shows \"1 item left\", suggesting this todo is still active/incomplete.\n\nLet me verify that this checkbox remains unchecked:"- }- ]- },- "The todo shows the updated text": {- "timestamp": 1767669477153,- "actions": [- {- "method": "expectVisible",- "selector": "internal:text=\"Buy groceries and milk\"i",- "code": "await expect(page.getByText('Buy groceries and milk')).toBeVisible();",- "intent": "I need to verify that the todo item shows updated text. Looking at the page snapshot, I can see there is a todo item with the text \"Buy groceries and milk\" in the list."- }- ]- },- "Change the text to 'Something else'": {- "timestamp": 1767669557510,- "actions": [- {- "method": "fill",- "selector": "internal:role=textbox[name=\"Edit\"i]",- "text": "Something else",- "code": "await page.getByRole('textbox', { name: 'Edit' }).fill('Something else');",- "intent": "I need to change the text in the textbox that currently shows \"Buy groceries\" to \"Something else\". The textbox is currently active and has the ref=e33."- },- {- "method": "pressKey",- "key": "Enter",- "code": "await page.keyboard.press('Enter');",- "intent": "Perfect! The text has been successfully changed to \"Something else\". Now I need to confirm the edit by pressing Enter to save the change."- }- ]- },- "Double-click on the todo text to enter edit mode": {- "timestamp": 1767669632084,- "actions": [- {- "method": "click",- "selector": "internal:testid=[data-testid=\"todo-title\"s]",- "options": {- "clickCount": 2- },- "code": "await page.getByTestId('todo-title').click({\nclickCount: 2\n});",- "intent": "I need to double-click on the todo text \"Buy groceries\" to enter edit mode."- }- ]- },- "Press Escape key": {- "timestamp": 1767669578700,- "actions": [- {- "method": "pressKey",- "key": "Escape",- "code": "await page.keyboard.press('Escape');",- "intent": "I'll press the Escape key as requested."- }- ]- },- "The edit input appears with 'Buy groceries'": {- "timestamp": 1767669537692,- "actions": [- {- "method": "expectValue",- "selector": "internal:role=textbox[name=\"Edit\"i]",- "type": "textbox",- "value": "Buy groceries",- "code": "await expect(page.getByRole('textbox', { name: 'Edit' })).toHaveValue('Buy groceries');",- "intent": "I need to verify that the edit input appears with 'Buy groceries'. Looking at the page snapshot, I can see there's a textbox with the label \"Edit\" that is active and contains the value \"Buy groceries\":\n\n- textbox \"Edit\" [active] [ref=e33]: Buy groceries\n\nI'll use the browser_expect_value tool to assert that this textbox has the expected value."- }- ]- },- "The edit is cancelled and the original text 'Buy groceries' is preserved": {- "timestamp": 1767669585294,- "actions": []- },- "The todo is no longer in edit mode": {- "timestamp": 1767669596499,- "actions": []- },- "The todo shows the original text 'Buy groceries'": {- "timestamp": 1767669590454,- "actions": []- },- "Clear all the text in the edit field": {- "timestamp": 1767669656151,- "actions": [- {- "method": "fill",- "selector": "internal:role=textbox[name=\"Edit\"i]",- "text": "",- "code": "await page.getByRole('textbox', { name: 'Edit' }).fill('');",- "intent": "I need to clear the text in the edit field. I can see there's a textbox with ref=e33 that contains \"Buy groceries\" and is currently active. I'll select all the text and delete it."- }- ]- },- "Press Enter to save": {- "timestamp": 1767669676463,- "actions": [- {- "method": "pressKey",- "key": "Enter",- "code": "await page.keyboard.press('Enter');",- "intent": "I can see there's a textbox with \"Edit\" that is currently active (focused). To save the changes, I need to press Enter."- }- ]- },- "The edit field is empty": {- "timestamp": 1767669666071,- "actions": [- {- "method": "expectValue",- "selector": "internal:role=textbox[name=\"Edit\"i]",- "type": "textbox",- "value": "",- "code": "await expect(page.getByRole('textbox', { name: 'Edit' })).toHaveValue('');",- "intent": "I need to verify that the edit field is empty. Looking at the page snapshot, I can see there's a textbox with the label \"Edit\" that is currently active (ref=e33). I'll use the browser_expect_value tool to assert that this textbox has an empty value."- }- ]- },- "The edit input appears": {- "timestamp": 1767669642083,- "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 edit input appears. Looking at the page snapshot, I can see there is a textbox with the label \"Edit\" that is currently active and contains the text \"Buy groceries\" (ref=e33)."- }- ]- },- "The todo counter and footer controls are hidden": {- "timestamp": 1767669705277,- "actions": [- {- "method": "expectVisible",- "selector": "internal:role=contentinfo[name=\"\"i]",- "isNot": true,- "code": "await expect(page.getByRole('contentinfo', { name: '' })).not.toBeVisible();",- "intent": "I need to verify that the todo counter and footer controls are hidden. Looking at the page snapshot, I can see there's a contentinfo section (ref=e9) which typically contains footer elements, but I don't see any todo counter or footer controls like \"All/Active/Completed\" filters or \"Clear completed\" button that are typical in TodoMVC applications.\n\nThe contentinfo shown contains only informational paragraphs about the app (Double-click instructions, creator, and TodoMVC link), not the interactive footer controls that would normally appear when todos exist.\n\nTo verify these elements are hidden, I should check that specific footer control elements are NOT visible. Let me check for the typical TodoMVC footer controls element that shows the todo count and filters."- }- ]- },- "The todo is removed from the list": {- "timestamp": 1767669683977,- "actions": []- },- "The todo list is empty": {- "timestamp": 1767669691491,- "actions": []- }-}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/todo-filtering.spec.ts b/examples/todomvc/tests/perform/todo-filtering.spec.tsdeleted file mode 100644index 3c7808de64..0000000000--- a/examples/todomvc/tests/perform/todo-filtering.spec.ts+++ /dev/null@@ -1,127 +0,0 @@-import { test } from '../fixtures';--test.use({- agent: {- api: 'anthropic',- apiKey: process.env.AZURE_SONNET_API_KEY!,- apiEndpoint: process.env.AZURE_SONNET_ENDPOINT!,- model: 'claude-sonnet-4-5',- }-});--test.describe('Todo Filtering', () => {-- test('View all todos', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'`);- await page.agent.expect(`All three todos appear in the list`);-- await page.agent.perform(`Mark 'Buy groceries' as complete`);- await page.agent.expect(`First todo is checked`);-- await page.agent.perform(`Click the 'All' filter link`);- await page.agent.expect(`All three todos (both active and completed) are visible`);-- // Post Conditions- await page.agent.expect(`All three todos are visible in the list`);- await page.agent.expect(`The 'All' filter link is highlighted/active`);- await page.agent.expect(`The URL hash is '#/' or empty`);- });-- test('View active todos only', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'`);- await page.agent.expect(`All three todos appear in the list`);-- await page.agent.perform(`Mark 'Buy groceries' as complete`);- await page.agent.expect(`First todo is checked`);-- await page.agent.perform(`Click the 'Active' filter link`);- await page.agent.expect(`Only 'Walk the dog' and 'Read a book' are visible`);-- // Post Conditions- await page.agent.expect(`Only unchecked todos are visible`);- await page.agent.expect(`The 'Active' filter link is highlighted/active`);- await page.agent.expect(`The URL hash is '#/active'`);- await page.agent.expect(`The todo counter still shows the correct count of active items`);- });-- test('View completed todos only', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'`);- await page.agent.expect(`All three todos appear in the list`);-- await page.agent.perform(`Mark 'Buy groceries' and 'Read a book' as complete`);- await page.agent.expect(`Two todos are checked`);-- await page.agent.perform(`Click the 'Completed' filter link`);- await page.agent.expect(`Only 'Buy groceries' and 'Read a book' are visible`);-- // Post Conditions- await page.agent.expect(`Only checked todos are visible`);- await page.agent.expect(`The 'Completed' filter link is highlighted/active`);- await page.agent.expect(`The URL hash is '#/completed'`);- await page.agent.expect(`The 'Clear completed' button is visible`);- });-- test('Switch between filters', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'`);- await page.agent.expect(`All three todos appear`);-- await page.agent.perform(`Mark 'Buy groceries' as complete`);- await page.agent.expect(`First todo is checked`);-- await page.agent.perform(`Click 'Active' filter`);- await page.agent.expect(`Only active todos are shown (2 todos)`);-- await page.agent.perform(`Click 'Completed' filter`);- await page.agent.expect(`Only completed todos are shown (1 todo)`);-- await page.agent.perform(`Click 'All' filter`);- await page.agent.expect(`All todos are shown again (3 todos)`);-- // Post Conditions- await page.agent.expect(`The filter switches correctly each time`);- await page.agent.expect(`The appropriate filter link is highlighted`);- await page.agent.expect(`The URL hash updates accordingly`);- });-- test('Filter with no matching todos', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add two todos: 'Buy groceries', 'Walk the dog'`);- await page.agent.expect(`Both todos appear in the list unchecked`);-- await page.agent.perform(`Click the 'Completed' filter link`);- await page.agent.expect(`No todos are visible (empty list area)`);-- // Post Conditions- await page.agent.expect(`The main todo list area is empty or shows no items`);- await page.agent.expect(`The footer with filters is still visible`);- await page.agent.expect(`The 'Completed' filter link is highlighted`);- });-- test('Complete todo while viewing active filter', async ({ page }) => {- await page.agent.expect(`The page loads with an empty todo list`);-- await page.agent.perform(`Add two todos: 'Buy groceries', 'Walk the dog'`);- await page.agent.expect(`Both todos appear in the list`);-- await page.agent.perform(`Click the 'Active' filter link`);- await page.agent.expect(`Both todos are visible`);-- await page.agent.perform(`Mark 'Buy groceries' as complete`);- await page.agent.expect(`The 'Buy groceries' todo disappears from the active view`);-- // Post Conditions- await page.agent.expect(`Only 'Walk the dog' is visible in the active view`);- await page.agent.expect(`The todo counter shows '1 item left'`);- await page.agent.expect(`Switching to 'All' or 'Completed' shows 'Buy groceries' is still there and checked`);- });--});diff --git a/examples/todomvc/tests/perform/todo-filtering.spec.ts-cache.json b/examples/todomvc/tests/perform/todo-filtering.spec.ts-cache.jsondeleted file mode 100644index 598f9506bd..0000000000--- a/examples/todomvc/tests/perform/todo-filtering.spec.ts-cache.json+++ /dev/null@@ -1,528 +0,0 @@-{- "Add three todos: 'Buy groceries', 'Walk the dog', 'Read a book'": {- "timestamp": 1767669837210,- "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 to the list. Let me start by taking a snapshot of the page to see the current state, then add each todo one by one."- },- {- "method": "fill",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "text": "Walk the dog",- "submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Walk the dog');\nawait page.keyboard.press('Enter');",- "intent": "Great! The first todo \"Buy groceries\" has been added successfully. Now let me add the second todo \"Walk the dog\"."- },- {- "method": "fill",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "text": "Read a book",- "submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Read a book');\nawait page.keyboard.press('Enter');",- "intent": "Perfect! Two todos have been added. Now let me add the third and final todo \"Read a book\"."- }- ]- },- "All three todos (both active and completed) are visible": {- "timestamp": 1767669464077,- "actions": [- {- "method": "expectAria",- "template": "- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n - listitem: Read a book",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n - listitem: Read a book\n`);",- "intent": "I need to verify that all three todos are visible on the page. Looking at the snapshot, I can see a list with three listitem elements containing:\n1. \"Buy groceries\" (checked/completed)\n2. \"Walk the dog\" (active)\n3. \"Read a book\" (active)\n\nI'll use the `browser_expect_list_visible` tool to assert that all three todos are present in the correct order."- }- ]- },- "All three todos appear in the list": {- "timestamp": 1767669686801,- "actions": [- {- "method": "expectAria",- "template": "- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n - listitem: Read a book",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n - listitem: Read a book\n`);",- "intent": "I need to verify that all three todos appear in the list. Looking at the page snapshot, I can see a list with three listitems containing:\n1. \"Buy groceries\"\n2. \"Walk the dog\"\n3. \"Read a book\"\n\nI'll use the `browser_expect_list_visible` tool to assert that these three items appear in the correct order."- }- ]- },- "All three todos are visible in the list": {- "timestamp": 1767669475164,- "actions": [- {- "method": "expectAria",- "template": "- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n - listitem: Read a book",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n - listitem: Read a book\n`);",- "intent": "I need to verify that all three todos are visible in the list. Looking at the page snapshot, I can see a list (ref=e18) containing three listitem elements with the todos:\n1. \"Buy groceries\"\n2. \"Walk the dog\"\n3. \"Read a book\"\n\nI'll use the `browser_expect_list_visible` tool to assert that all three todos are present in the correct order."- }- ]- },- "Click the 'All' filter link": {- "timestamp": 1767669453045,- "actions": [- {- "method": "click",- "selector": "internal:role=link[name=\"All\"i]",- "options": {},- "code": "await page.getByRole('link', { name: 'All' }).click();",- "intent": "I'll click the 'All' filter link for you."- }- ]- },- "First todo is checked": {- "timestamp": 1767669871182,- "actions": [- {- "method": "expectValue",- "selector": "internal:role=listitem >> internal:has-text=\"Buy groceries\"i >> internal:label=\"Toggle Todo\"i",- "type": "checkbox",- "value": "true",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Buy groceries' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });",- "intent": "I need to verify that the first todo item is checked. Looking at the page snapshot, I can see there are three todo items:\n\n1. \"Buy groceries\" - has a checkbox with `[checked]` attribute (ref=e21)\n2. \"Walk the dog\" - checkbox without checked attribute (ref=e35)\n3. \"Read a book\" - checkbox without checked attribute (ref=e39)\n\nThe first todo \"Buy groceries\" is indeed checked. I'll use the `browser_expect_value` tool to assert this condition."- }- ]- },- "Mark 'Buy groceries' as complete": {- "timestamp": 1767670130174,- "actions": [- {- "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": "I need to mark 'Buy groceries' as complete. Looking at the page snapshot, I can see that 'Buy groceries' is the first item in the todo list, and it has an unchecked checkbox with ref=e21. I'll click on that checkbox to mark it as complete."- }- ]- },- "The 'All' filter link is highlighted/active": {- "timestamp": 1767669485560,- "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/active. Looking at the page snapshot, I can see:\n\n```\n- link \"All\" [active] [ref=e28] [cursor=pointer]:\n```\n\nThe link has the `[active]` attribute, which indicates it is currently highlighted/active. I'll use the browser_expect_visible tool to assert this condition."- }- ]- },- "The page loads with an empty todo list": {- "timestamp": 1767670068909,- "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 textbox \"What needs to be done?\" which is the input field for adding todos\n2. No visible list elements containing todo items\n3. The basic structure of a TodoMVC app is present\n\nTo assert that the todo list is empty, I should verify that there are no todo items visible on the page. The most appropriate way to do this is to check that no todo list or todo items are present. However, since I need to use one of the browser_expect_* tools, I'll verify that the empty state is correctly displayed by confirming that only the input field is visible and no todo items exist.\n\nLet me use `browser_expect_visible` to confirm that the input textbox is visible (which indicates the app loaded), and since there are no list elements or todo items in the snapshot, this confirms the list is empty."- }- ]- },- "The URL hash is '#/' or empty": {- "timestamp": 1767669497600,- "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 hash is '#/' or empty. Looking at the page snapshot, I can see that the \"All\" link is marked as `[active]` and has a URL of `\"#/\"`, which suggests the current URL hash is likely '#/'.\n\nHowever, I cannot directly verify the URL hash from the page snapshot alone. The best approach is to check for a visible element that indicates the current state. The \"All\" link being active (indicated by `[active]`) is a strong indicator that we're at the '#/' hash.\n\nLet me verify that the \"All\" link is visible and marked as active:"- }- ]- },- "Click the 'Active' filter link": {- "timestamp": 1767670109489,- "actions": [- {- "method": "click",- "selector": "internal:role=link[name=\"Active\"i]",- "options": {},- "code": "await page.getByRole('link', { name: 'Active' }).click();",- "intent": "I'll click the 'Active' filter link to show only active todos."- }- ]- },- "Only 'Walk the dog' and 'Read a book' are visible": {- "timestamp": 1767669590688,- "actions": [- {- "method": "expectAria",- "template": "- list:\n - listitem: Walk the dog\n - listitem: Read a book",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Walk the dog\n - listitem: Read a book\n`);",- "intent": "I need to verify that only 'Walk the dog' and 'Read a book' are visible as todo items. Looking at the page snapshot, I can see there's a list with two listitems containing these exact texts.\n\nI'll use the `browser_expect_list_visible` tool to assert that the list contains exactly these two items in order."- }- ]- },- "Only unchecked todos are visible": {- "timestamp": 1767669603495,- "actions": [- {- "method": "expectAria",- "template": "- list:\n - listitem: Walk the dog\n - listitem: Read a book",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Walk the dog\n - listitem: Read a book\n`);",- "intent": "I need to verify that only unchecked todos are visible. Looking at the page snapshot, I can see there's a list with 2 todo items:\n\n1. \"Walk the dog\" - with an unchecked checkbox (ref=e35)\n2. \"Read a book\" - with an unchecked checkbox (ref=e39)\n\nThe page is currently showing the \"Active\" filter (indicated by `[active]` on ref=e30), and it shows \"2 items left\", which means there are 2 unchecked todos visible.\n\nTo verify that only unchecked todos are visible, I'll check that the visible list contains exactly these two items with their checkboxes unchecked."- }- ]- },- "The 'Active' filter link is highlighted/active": {- "timestamp": 1767669613586,- "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/active. Looking at the page snapshot, I can see the 'Active' link with `[active]` attribute at ref=e30, which indicates it is currently active/highlighted."- }- ]- },- "The todo counter still shows the correct count of active items": {- "timestamp": 1767669634404,- "actions": [- {- "method": "expectVisible",- "selector": "internal:text=\"2\"i",- "code": "await expect(page.getByText('2')).toBeVisible();",- "intent": "I need to verify that the todo counter shows the correct count of active items. From the page snapshot, I can see there's a strong element with \"2\" followed by \"items left\" text, which indicates there are 2 active todo items. This matches the two unchecked items visible in the list (\"Walk the dog\" and \"Read a book\").\n\nI'll use the browser_expect_visible tool to verify the counter shows \"2\":"- }- ]- },- "The URL hash is '#/active'": {- "timestamp": 1767669623838,- "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 hash is '#/active'. Looking at the page snapshot, I can see that the \"Active\" link has the `[active]` attribute and its URL is \"#/active\", which indicates this is the current active state. I'll verify this by checking that the \"Active\" link element is visible on the page."- }- ]- },- "Click the 'Completed' filter link": {- "timestamp": 1767670025857,- "actions": [- {- "method": "click",- "selector": "internal:role=link[name=\"Completed\"i]",- "options": {},- "code": "await page.getByRole('link', { name: 'Completed' }).click();",- "intent": "I need to click the 'Completed' filter link. According to the page snapshot, this link is located at ref=e32."- }- ]- },- "Mark 'Buy groceries' and 'Read a book' as complete": {- "timestamp": 1767669707046,- "actions": [- {- "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": "I need to mark 'Buy groceries' and 'Read a book' as complete by checking their respective checkboxes.\n\nLooking at the page snapshot, I can see:\n- 'Buy groceries' has a checkbox with ref=e21\n- 'Read a book' has a checkbox with ref=e39\n\nI'll click both checkboxes to mark these todos as complete."- },- {- "method": "click",- "selector": "internal:role=listitem >> internal:has-text=\"Read a book\"i >> internal:label=\"Toggle Todo\"i",- "options": {},- "code": "await page.getByRole('listitem').filter({ hasText: 'Read a book' }).getByLabel('Toggle Todo').click();",- "intent": "Good! I've successfully marked 'Buy groceries' as complete (the checkbox now shows [checked]). Now I need to mark 'Read a book' as complete as well by clicking its checkbox."- }- ]- },- "Only 'Buy groceries' and 'Read a book' are visible": {- "timestamp": 1767669749750,- "actions": [- {- "method": "expectAria",- "template": "- list:\n - listitem: Buy groceries\n - listitem: Read a book",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy groceries\n - listitem: Read a book\n`);",- "intent": "I need to verify that only 'Buy groceries' and 'Read a book' are visible in the todo list. Looking at the page snapshot, I can see there's a list with these two items as listitems. I'll use the browser_expect_list_visible tool to assert that the list contains exactly these two items in order."- }- ]- },- "Only checked todos are visible": {- "timestamp": 1767669763288,- "actions": [- {- "method": "expectAria",- "template": "- list:\n - listitem: Buy groceries\n - listitem: Read a book",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy groceries\n - listitem: Read a book\n`);",- "intent": "I need to verify that only checked todos are visible on the page. Looking at the snapshot, I can see:\n\n1. There's a list of todos (ref=e18) with 2 items\n2. Both visible todos have checkboxes that are marked as [checked]:\n - \"Buy groceries\" (ref=e21) - checked\n - \"Read a book\" (ref=e39) - checked\n3. The \"Completed\" filter link is marked as [active], which explains why only checked/completed todos are shown\n4. The count shows \"1 item left\", suggesting there's at least one unchecked item that is NOT currently visible\n\nThis confirms that only checked (completed) todos are visible. I'll verify this by checking that the list contains exactly these two checked items."- }- ]- },- "The 'Clear completed' button is visible": {- "timestamp": 1767669795594,- "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 is visible on the page. Looking at the page snapshot, I can see there is a button with the accessible name \"Clear completed\" and ref=e42."- }- ]- },- "The 'Completed' filter link is highlighted/active": {- "timestamp": 1767669773341,- "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/active. Looking at the page snapshot, I can see that the \"Completed\" link has the `[active]` attribute, which indicates it is currently highlighted/active."- }- ]- },- "The URL hash is '#/completed'": {- "timestamp": 1767669785418,- "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 hash is '#/completed'. Looking at the page snapshot, I can see that there's a \"Completed\" link with `[active]` status and the URL \"#/completed\" (ref=e32). This indicates that the current page is on the completed filter view.\n\nTo verify this condition, I'll check that the \"Completed\" link element is visible, as this link being active suggests the URL hash matches '#/completed'."- }- ]- },- "Two todos are checked": {- "timestamp": 1767669729414,- "actions": [- {- "method": "expectValue",- "selector": "internal:role=listitem >> internal:has-text=\"Buy groceries\"i >> internal:label=\"Toggle Todo\"i",- "type": "checkbox",- "value": "true",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Buy groceries' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });",- "intent": "I need to verify that two todos are checked. Looking at the page snapshot, I can see there are three todo items in the list:\n\n1. \"Buy groceries\" - has a checkbox that is [checked]\n2. \"Walk the dog\" - has a checkbox that is NOT checked\n3. \"Read a book\" - has a checkbox that is [checked] and [active]\n\nSo there are indeed two todos that are checked. I'll use the browser_expect_value tool to verify that exactly two checkboxes in the todo list are checked.\n\nActually, looking more carefully at the available tools, I should verify the state of the checkboxes. Let me use browser_expect_value to check that the two specific todo checkboxes are checked."- },- {- "method": "expectValue",- "selector": "internal:role=listitem >> internal:has-text=\"Read a book\"i >> internal:label=\"Toggle Todo\"i",- "type": "checkbox",- "value": "true",- "code": "await expect(page.getByRole('listitem').filter({ hasText: 'Read a book' }).getByLabel('Toggle Todo')).toBeChecked({ checked: true });",- "intent": "Now I need to verify the second checked checkbox to complete the assertion that two todos are checked."- }- ]- },- "All three todos appear": {- "timestamp": 1767669848245,- "actions": [- {- "method": "expectAria",- "template": "- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n - listitem: Read a book",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n - listitem: Read a book\n`);",- "intent": "I need to verify that all three todos appear on the page. Looking at the page snapshot, I can see a list with three listitem elements containing:\n1. \"Buy groceries\"\n2. \"Walk the dog\"\n3. \"Read a book\"\n\nI'll use the `browser_expect_list_visible` tool to assert that all three todos are present in the correct order."- }- ]- },- "All todos are shown again (3 todos)": {- "timestamp": 1767669937799,- "actions": [- {- "method": "expectAria",- "template": "- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n - listitem: Read a book",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n - listitem: Read a book\n`);",- "intent": "I need to verify that all 3 todos are shown. Looking at the page snapshot, I can see a list element with ref=e18 that contains 3 listitem elements representing the todos:\n\n1. \"Buy groceries\" (checked)\n2. \"Walk the dog\" (unchecked)\n3. \"Read a book\" (unchecked)\n\nI'll use the `browser_expect_list_visible` tool to verify that all 3 todos are present in the correct order."- }- ]- },- "Click 'Active' filter": {- "timestamp": 1767669880714,- "actions": [- {- "method": "click",- "selector": "internal:role=link[name=\"Active\"i]",- "options": {},- "code": "await page.getByRole('link', { name: 'Active' }).click();",- "intent": "I'll click on the 'Active' filter link to show only active todos."- }- ]- },- "Click 'All' filter": {- "timestamp": 1767669926984,- "actions": [- {- "method": "click",- "selector": "internal:role=link[name=\"All\"i]",- "options": {},- "code": "await page.getByRole('link', { name: 'All' }).click();",- "intent": "I'll click on the 'All' filter link for you."- }- ]- },- "Click 'Completed' filter": {- "timestamp": 1767669904622,- "actions": [- {- "method": "click",- "selector": "internal:role=link[name=\"Completed\"i]",- "options": {},- "code": "await page.getByRole('link', { name: 'Completed' }).click();",- "intent": "I need to click the 'Completed' filter link on the page. Looking at the snapshot, I can see the filter options under the list with reference e26, and the \"Completed\" link has reference e32."- }- ]- },- "Only active todos are shown (2 todos)": {- "timestamp": 1767669894016,- "actions": [- {- "method": "expectAria",- "template": "- list:\n - listitem: Walk the dog\n - listitem: Read a book",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Walk the dog\n - listitem: Read a book\n`);",- "intent": "I need to verify that only active todos are shown and there are 2 todos visible.\n\nLooking at the page snapshot, I can see:\n- A list with ref=e18 containing 2 listitem elements\n- The first todo is \"Walk the dog\" (ref=e33)\n- The second todo is \"Read a book\" (ref=e37)\n- Both have unchecked \"Toggle Todo\" checkboxes, indicating they are active (not completed)\n- The footer shows \"2 items left\"\n- The \"Active\" filter is currently selected (marked as [active])\n\nI'll verify that the list contains exactly these 2 active todos in order."- }- ]- },- "Only completed todos are shown (1 todo)": {- "timestamp": 1767669916797,- "actions": [- {- "method": "expectAria",- "template": "- list:\n - listitem: Buy groceries",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy groceries\n`);",- "intent": "I need to verify that only completed todos are shown and there is exactly 1 todo visible.\n\nLooking at the page snapshot, I can see:\n- There is a list with ref=e18 that contains the todos\n- There is 1 listitem (ref=e43) in that list\n- This todo has a checked checkbox (ref=e45) and the text \"Buy groceries\"\n- The \"Completed\" filter link is active (ref=e32)\n\nI'll verify that this single todo item is visible in the list."- }- ]- },- "The appropriate filter link is highlighted": {- "timestamp": 1767669959979,- "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 appropriate filter link is highlighted. Looking at the page snapshot, I can see there are three filter links: \"All\", \"Active\", and \"Completed\". The \"All\" link has an `[active]` attribute, indicating it is the currently highlighted/active filter.\n\nI'll use the browser_expect_visible tool to verify that the \"All\" link is visible and active (highlighted)."- }- ]- },- "The filter switches correctly each time": {- "timestamp": 1767669949556,- "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 filter switches correctly. Looking at the page snapshot, I can see there are three filter links: \"All\", \"Active\", and \"Completed\". The \"All\" link is currently marked as `[active]`, which indicates the current filter state.\n\nTo verify that the filter switches correctly, I should check that the \"All\" filter is currently active/visible, which would confirm the filter is in the expected state."- }- ]- },- "The URL hash updates accordingly": {- "timestamp": 1767669971559,- "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 hash updates accordingly. Looking at the page snapshot, I can see there are three filter links with different hash URLs:\n- \"All\" with hash \"#/\" (currently active)\n- \"Active\" with hash \"#/active\"\n- \"Completed\" with hash \"#/completed\"\n\nSince the \"All\" link is marked as [active], this suggests the current URL hash should be \"#/\". I'll verify that the \"All\" link is visible and marked as active, which indicates the URL hash is correctly set to \"#/\"."- }- ]- },- "Add two todos: 'Buy groceries', 'Walk the dog'": {- "timestamp": 1767670089087,- "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 those two todos. Let me start by taking a snapshot to see the current state of the page, then add the todos one by one."- },- {- "method": "fill",- "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",- "text": "Walk the dog",- "submit": true,- "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Walk the dog');\nawait page.keyboard.press('Enter');",- "intent": "Great! The first todo \"Buy groceries\" has been added successfully. Now I'll add the second todo \"Walk the dog\"."- }- ]- },- "Both todos appear in the list unchecked": {- "timestamp": 1767670015752,- "actions": [- {- "method": "expectAria",- "template": "- list:\n - listitem: Buy groceries\n - listitem: Walk the dog",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n`);",- "intent": "I need to verify that both todos (\"Buy groceries\" and \"Walk the dog\") appear in the list unchecked. Looking at the page snapshot, I can see:\n\n1. A list with ref=e18 containing two listitem elements\n2. First listitem (ref=e19) contains \"Buy groceries\" with an unchecked checkbox (ref=e21)\n3. Second listitem (ref=e33) contains \"Walk the dog\" with an unchecked checkbox (ref=e35)\n\nI'll use the browser_expect_list_visible tool to verify both items are present in the correct order in the list."- }- ]- },- "No todos are visible (empty list area)": {- "timestamp": 1767670032543,- "actions": []- },- "The 'Completed' filter link is highlighted": {- "timestamp": 1767670053783,- "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."- }- ]- },- "The footer with filters is still visible": {- "timestamp": 1767670044329,- "actions": []- },- "The main todo list area is empty or shows no items": {- "timestamp": 1767670039569,- "actions": []- },- "Both todos appear in the list": {- "timestamp": 1767670099243,- "actions": [- {- "method": "expectAria",- "template": "- list:\n - listitem: Buy groceries\n - listitem: Walk the dog",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n`);",- "intent": "I need to verify that both todos (\"Buy groceries\" and \"Walk the dog\") appear in the list. Looking at the page snapshot, I can see there's a list with two listitem elements containing these todos.\n\nI'll use the `browser_expect_list_visible` tool to assert that both todos are present in the correct order."- }- ]- },- "Both todos are visible": {- "timestamp": 1767670119854,- "actions": [- {- "method": "expectAria",- "template": "- list:\n - listitem: Buy groceries\n - listitem: Walk the dog",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy groceries\n - listitem: Walk the dog\n`);",- "intent": "I need to verify that both todos are visible on the page. Looking at the page snapshot, I can see a list with two todo items:\n1. \"Buy groceries\" \n2. \"Walk the dog\"\n\nI'll use the `browser_expect_list_visible` tool to assert that both todos are present in the list in the correct order."- }- ]- },- "Only 'Walk the dog' is visible in the active view": {- "timestamp": 1767670145806,- "actions": [- {- "method": "expectAria",- "template": "- list:\n - listitem: Walk the dog",- "code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Walk the dog\n`);",- "intent": "I need to verify that only 'Walk the dog' is visible in the active view. Looking at the page snapshot, I can see there's a list with one item that contains the text \"Walk the dog\". I'll use the browser_expect_list_visible tool to assert that the list contains exactly this one item."- }- ]- },- "Switching to 'All' or 'Completed' shows 'Buy groceries' is still there and checked": {- "timestamp": 1767670164519,- "actions": []- },- "The 'Buy groceries' todo disappears from the active view": {- "timestamp": 1767670135387,- "actions": []- },- "The todo counter shows '1 item left'": {- "timestamp": 1767670156705,- "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 todo counter shows '1 item left'. Looking at the page snapshot, I can see:\n\n- A `strong` element with text \"1\" (ref=e25)\n- Followed by text \"item left\"\n\nThese are within a generic container (ref=e24) that displays the todo counter. I'll use `browser_expect_visible_text` to verify that \"1 item left\" is visible on the page."- }- ]- }-}\ No newline at end of filediff --git a/examples/todomvc/tests/perform/ui-state/should-hide-footer-when-no-todos.spec.ts b/examples/todomvc/tests/perform/ui-state/should-hide-footer-when-no-todos.spec.tsnew file mode 100644index 0000000000..c0dc31df32--- /dev/null+++ b/examples/todomvc/tests/perform/ui-state/should-hide-footer-when-no-todos.spec.ts@@ -0,0 +1,22 @@+import { test } from '../../fixtures';++test.use({+ agent: {+ api: 'anthropic',+ apiKey: process.env.AZURE_SONNET_API_KEY!,+ apiEndpoint: process.env.AZURE_SONNET_ENDPOINT!,+ model: 'claude-sonnet-4-5',+ }+});++test('should hide footer when no todos', async ({ page }) => {+ await page.agent.expect(`The page loads with an empty todo list`);+ await page.agent.expect(`The footer with counter and filters is not visible`);+ await page.agent.expect(`Only the input field and heading are visible`);++ await page.agent.perform(`Add a todo 'First task'`);+ await page.agent.expect(`The footer appears with counter '1 item left' and filter links`);++ await page.agent.perform(`Delete the todo by hovering over it and clicking the delete button`);+ await page.agent.expect(`The footer is hidden again`);+});diff --git a/examples/todomvc/tests/perform/ui-state/should-hide-footer-when-no-todos.spec.ts-cache.json b/examples/todomvc/tests/perform/ui-state/should-hide-footer-when-no-todos.spec.ts-cache.jsonnew file mode 100644index 0000000000..128cc0b8e5--- /dev/null+++ b/examples/todomvc/tests/perform/ui-state/should-hide-footer-when-no-todos.spec.ts-cache.json@@ -0,0 +1,85 @@+{+ "Add a todo 'First task'": {+ "timestamp": 1767733696461,+ "actions": [+ {+ "method": "fill",+ "selector": "internal:role=textbox[name=\"What needs to be done?\"i]",+ "text": "First task",+ "submit": true,+ "code": "await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('First task');\nawait page.keyboard.press('Enter');",+ "intent": "I need to add a todo with the text 'First task'. I can see there's a textbox with the placeholder \"What needs to be done?\" that I can type into."+ }+ ]+ },+ "Delete the todo by hovering over it and clicking the delete button": {+ "timestamp": 1767733726006,+ "actions": [+ {+ "method": "hover",+ "selector": "internal:testid=[data-testid=\"todo-item\"s] >> div",+ "options": {},+ "code": "await page.getByTestId('todo-item').locator('div').hover();",+ "intent": "I can see there's a todo item with \"First task\" text. I can see there's a \"×\" text which appears to be the delete button. According to TodoMVC conventions, the delete button typically appears when you hover over the todo item. Let me hover over the todo item (the listitem or the generic container) to reveal the delete button."+ },+ {+ "method": "click",+ "selector": "internal:role=button[name=\"Delete\"i]",+ "options": {},+ "code": "await page.getByRole('button', { name: 'Delete' }).click();",+ "intent": "Perfect! After hovering over the todo item, the delete button is now visible. I can see it's a button labeled \"Delete\" with the \"×\" symbol (ref=e33). Now I'll click on it to delete the todo."+ }+ ]+ },+ "Only the input field and heading are visible": {+ "timestamp": 1767733686256,+ "actions": [+ {+ "method": "expectVisible",+ "selector": "internal:role=contentinfo[name=\"\"i]",+ "isNot": true,+ "code": "await expect(page.getByRole('contentinfo', { name: '' })).not.toBeVisible();",+ "intent": "I need to verify that only the input field and heading are visible on the page. Looking at the snapshot, I can see:\n\n1. A heading \"todos\" (ref=e7)\n2. A textbox \"What needs to be done?\" (ref=e8)\n3. Other elements like links, paragraphs in the contentinfo section\n\nThe expectation states that ONLY the input field and heading should be visible, which means other elements like the contentinfo section should not be visible. I'll verify that the contentinfo element is not visible."+ }+ ]+ },+ "The footer appears with counter '1 item left' and filter links": {+ "timestamp": 1767733702303,+ "actions": []+ },+ "The footer is hidden again": {+ "timestamp": 1767733740504,+ "actions": [+ {+ "method": "expectVisible",+ "selector": "internal:role=contentinfo[name=\"\"i]",+ "isNot": true,+ "code": "await expect(page.getByRole('contentinfo', { name: '' })).not.toBeVisible();",+ "intent": "I need to verify that the footer is hidden. Looking at the page snapshot, I can see a `contentinfo` element (which is the semantic footer element) with ref=e9. The expectation is that this footer should be hidden.\n\nI'll use the `browser_expect_visible` tool with the `isNot` parameter set to true to assert that the footer is NOT visible (i.e., hidden)."+ }+ ]+ },+ "The footer with counter and filters is not visible": {+ "timestamp": 1767733675122,+ "actions": [+ {+ "method": "expectVisible",+ "selector": "internal:role=contentinfo[name=\"\"i]",+ "isNot": true,+ "code": "await expect(page.getByRole('contentinfo', { name: '' })).not.toBeVisible();",+ "intent": "I need to verify that the footer with counter and filters is not visible. Looking at the page snapshot, I can see there is a `contentinfo` element (ref=e9) which appears to be a footer, but it contains information about the app (instructions, creator, and TodoMVC link) rather than a counter and filters for todos.\n\nThe footer with counter and filters that would typically appear in a TodoMVC app (showing item count and All/Active/Completed filters) is not present in this snapshot. I'll assert that such an element is not visible by checking for a common pattern - the contentinfo that would contain todo-related controls."+ }+ ]+ },+ "The page loads with an empty todo list": {+ "timestamp": 1767733662280,+ "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 I don't see any todo items listed on the page. This indicates the todo list is indeed empty.\n\nTo assert this condition, I should verify that the textbox for adding todos is visible, which confirms the page has loaded properly with the todo functionality, and the absence of any todo items in the snapshot confirms the list is empty."+ }+ ]+ }+}\ No newline at end of filediff --git a/package-lock.json b/package-lock.jsonindex c07b2d5bcd..828a03cdba 100644--- a/package-lock.json+++ b/package-lock.json@@ -18,7 +18,7 @@"@eslint/compat": "^1.3.2","@eslint/eslintrc": "^3.3.1","@eslint/js": "^9.34.0",- "@lowire/loop": "^0.0.14",+ "@lowire/loop": "^0.0.15","@modelcontextprotocol/sdk": "^1.17.5","@octokit/graphql-schema": "^15.26.0","@stylistic/eslint-plugin": "^5.2.3",@@ -1064,9 +1064,9 @@}},"node_modules/@lowire/loop": {- "version": "0.0.14",- "resolved": "https://registry.npmjs.org/@lowire/loop/-/loop-0.0.14.tgz",- "integrity": "sha512-nidxMUAlmZs9b3SgPLgzaAp3tB6djwxpCVrFJdX2Tm5T10+3S/Jgjn2MWxkKnkAklAB1gHGoDbyb/gEtbnXPxQ==",+ "version": "0.0.15",+ "resolved": "https://registry.npmjs.org/@lowire/loop/-/loop-0.0.15.tgz",+ "integrity": "sha512-XycNy4hSRgfb54NHPf/TIRTC+UGpvZMg6z3T3IRgTprj/nUoW5/XKCR3a3dCO4RC88n8ARiTjgEtFfoJfH9S8w==","dev": true,"license": "Apache-2.0","engines": {diff --git a/package.json b/package.jsonindex 61f80821db..f4fa02b71f 100644--- a/package.json+++ b/package.json@@ -55,7 +55,7 @@"@eslint/compat": "^1.3.2","@eslint/eslintrc": "^3.3.1","@eslint/js": "^9.34.0",- "@lowire/loop": "^0.0.14",+ "@lowire/loop": "^0.0.15","@modelcontextprotocol/sdk": "^1.17.5","@octokit/graphql-schema": "^15.26.0","@stylistic/eslint-plugin": "^5.2.3",diff --git a/packages/playwright-client/types/types.d.ts b/packages/playwright-client/types/types.d.tsindex 6bce31667f..644abf75bb 100644--- a/packages/playwright-client/types/types.d.ts+++ b/packages/playwright-client/types/types.d.ts@@ -5382,13 +5382,10 @@ export interface PageAgent {/*** API key for the LLM provider.- */- apiKey?: string;-- /**+ ** API version if relevant.*/- apiVersion?: string;+ apiKey?: string;/*** All the agentic actions are converted to the Playwright calls and are cached. By default, they are cached globally@@ -5433,13 +5430,10 @@ export interface PageAgent {/*** API key for the LLM provider.- */- apiKey?: string;-- /**+ ** API version if relevant.*/- apiVersion?: string;+ apiKey?: string;/*** All the agentic actions are converted to the Playwright calls and are cached. By default, they are cached globally@@ -22329,11 +22323,6 @@ export interface BrowserContextOptions {*/apiKey?: string;- /**- * API version if relevant.- */- apiVersion?: string;-/*** Model identifier within the provider. Required in non-cache mode.*/diff --git a/packages/playwright-core/ThirdPartyNotices.txt b/packages/playwright-core/ThirdPartyNotices.txtindex c4cdcba715..132673492a 100644--- a/packages/playwright-core/ThirdPartyNotices.txt+++ b/packages/playwright-core/ThirdPartyNotices.txt@@ -4,7 +4,7 @@ THIRD-PARTY SOFTWARE NOTICES AND INFORMATIONThis project incorporates components from the projects listed below. The original copyright notices and the licenses under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise.-- @lowire/[email protected] (https://github.com/pavelfeldman/lowire)+- @lowire/[email protected] (https://github.com/pavelfeldman/lowire)- @modelcontextprotocol/[email protected] (https://github.com/modelcontextprotocol/typescript-sdk)- [email protected] (https://github.com/jshttp/accepts)- [email protected] (https://github.com/TooTallNate/proxy-agents)@@ -135,7 +135,7 @@ This project incorporates components from the projects listed below. The origina- [email protected] (https://github.com/StefanTerdell/zod-to-json-schema)- [email protected] (https://github.com/colinhacks/zod)-%% @lowire/[email protected] NOTICES AND INFORMATION BEGIN HERE+%% @lowire/[email protected] NOTICES AND INFORMATION BEGIN HERE=========================================Apache LicenseVersion 2.0, January 2004@@ -339,7 +339,7 @@ Apache LicenseSee the License for the specific language governing permissions andlimitations under the License.=========================================-END OF @lowire/[email protected] AND INFORMATION+END OF @lowire/[email protected] AND INFORMATION%% @modelcontextprotocol/[email protected] NOTICES AND INFORMATION BEGIN HERE=========================================diff --git a/packages/playwright-core/bundles/mcp/package-lock.json b/packages/playwright-core/bundles/mcp/package-lock.jsonindex 6b11f56c55..10c5a8d6b6 100644--- a/packages/playwright-core/bundles/mcp/package-lock.json+++ b/packages/playwright-core/bundles/mcp/package-lock.json@@ -8,16 +8,16 @@"name": "mcp-bundle","version": "0.0.1","dependencies": {- "@lowire/loop": "^0.0.14",+ "@lowire/loop": "^0.0.15","@modelcontextprotocol/sdk": "^1.24.0","zod": "^3.25.76","zod-to-json-schema": "^3.24.6"}},"node_modules/@lowire/loop": {- "version": "0.0.14",- "resolved": "https://registry.npmjs.org/@lowire/loop/-/loop-0.0.14.tgz",- "integrity": "sha512-nidxMUAlmZs9b3SgPLgzaAp3tB6djwxpCVrFJdX2Tm5T10+3S/Jgjn2MWxkKnkAklAB1gHGoDbyb/gEtbnXPxQ==",+ "version": "0.0.15",+ "resolved": "https://registry.npmjs.org/@lowire/loop/-/loop-0.0.15.tgz",+ "integrity": "sha512-XycNy4hSRgfb54NHPf/TIRTC+UGpvZMg6z3T3IRgTprj/nUoW5/XKCR3a3dCO4RC88n8ARiTjgEtFfoJfH9S8w==","license": "Apache-2.0","engines": {"node": ">=20"diff --git a/packages/playwright-core/bundles/mcp/package.json b/packages/playwright-core/bundles/mcp/package.jsonindex 8a56651c3e..b386ca3240 100644--- a/packages/playwright-core/bundles/mcp/package.json+++ b/packages/playwright-core/bundles/mcp/package.json@@ -3,7 +3,7 @@"version": "0.0.1","private": true,"dependencies": {- "@lowire/loop": "^0.0.14",+ "@lowire/loop": "^0.0.15","@modelcontextprotocol/sdk": "^1.24.0","zod": "^3.25.76","zod-to-json-schema": "^3.24.6"diff --git a/packages/playwright-core/src/client/pageAgent.ts b/packages/playwright-core/src/client/pageAgent.tsindex bcc3d29608..aea06c91bc 100644--- a/packages/playwright-core/src/client/pageAgent.ts+++ b/packages/playwright-core/src/client/pageAgent.ts@@ -23,7 +23,6 @@ type PageAgentOptions = {api?: string;apiEndpoint?: string;apiKey?: string;- apiVersion?: string;model?: string;maxTokens?: number;maxTurns?: number;diff --git a/packages/playwright-core/src/protocol/validator.ts b/packages/playwright-core/src/protocol/validator.tsindex abfd6d1cac..cf8128afd9 100644--- a/packages/playwright-core/src/protocol/validator.ts+++ b/packages/playwright-core/src/protocol/validator.ts@@ -606,7 +606,6 @@ scheme.BrowserTypeLaunchPersistentContextParams = tObject({api: tOptional(tString),apiKey: tOptional(tString),apiEndpoint: tOptional(tString),- apiVersion: tOptional(tString),model: tOptional(tString),cacheFile: tOptional(tString),cacheOutFile: tOptional(tString),@@ -711,7 +710,6 @@ scheme.BrowserNewContextParams = tObject({api: tOptional(tString),apiKey: tOptional(tString),apiEndpoint: tOptional(tString),- apiVersion: tOptional(tString),model: tOptional(tString),cacheFile: tOptional(tString),cacheOutFile: tOptional(tString),@@ -794,7 +792,6 @@ scheme.BrowserNewContextForReuseParams = tObject({api: tOptional(tString),apiKey: tOptional(tString),apiEndpoint: tOptional(tString),- apiVersion: tOptional(tString),model: tOptional(tString),cacheFile: tOptional(tString),cacheOutFile: tOptional(tString),@@ -922,7 +919,6 @@ scheme.BrowserContextInitializer = tObject({api: tOptional(tString),apiKey: tOptional(tString),apiEndpoint: tOptional(tString),- apiVersion: tOptional(tString),model: tOptional(tString),cacheFile: tOptional(tString),cacheOutFile: tOptional(tString),@@ -1544,7 +1540,6 @@ scheme.PageAgentPerformParams = tObject({api: tOptional(tString),apiEndpoint: tOptional(tString),apiKey: tOptional(tString),- apiVersion: tOptional(tString),maxTurns: tOptional(tInt),maxTokens: tOptional(tInt),cacheKey: tOptional(tString),@@ -1557,7 +1552,6 @@ scheme.PageAgentExpectParams = tObject({api: tOptional(tString),apiEndpoint: tOptional(tString),apiKey: tOptional(tString),- apiVersion: tOptional(tString),maxTurns: tOptional(tInt),maxTokens: tOptional(tInt),cacheKey: tOptional(tString),@@ -1571,7 +1565,6 @@ scheme.PageAgentExtractParams = tObject({api: tOptional(tString),apiEndpoint: tOptional(tString),apiKey: tOptional(tString),- apiVersion: tOptional(tString),maxTurns: tOptional(tInt),maxTokens: tOptional(tInt),cacheKey: tOptional(tString),@@ -2872,7 +2865,6 @@ scheme.AndroidDeviceLaunchBrowserParams = tObject({api: tOptional(tString),apiKey: tOptional(tString),apiEndpoint: tOptional(tString),- apiVersion: tOptional(tString),model: tOptional(tString),cacheFile: tOptional(tString),cacheOutFile: tOptional(tString),diff --git a/packages/playwright-core/src/server/agent/actionRunner.ts b/packages/playwright-core/src/server/agent/actionRunner.tsindex 4636be15c2..106f121520 100644--- a/packages/playwright-core/src/server/agent/actionRunner.ts+++ b/packages/playwright-core/src/server/agent/actionRunner.ts@@ -77,7 +77,7 @@ async function innerRunAction(progress: Progress, page: Page, action: actions.Acbreak;case 'expectVisible': {const result = await frame.expect(progress, action.selector, { expression: 'to.be.visible', isNot: !!action.isNot });- if (!result.matches)+ if (result.matches === !!action.isNot)throw new Error(result.errorMessage);break;}@@ -92,14 +92,14 @@ async function innerRunAction(progress: Progress, page: Page, action: actions.Ac} else {throw new Error(`Unsupported element type: ${action.type}`);}- if (!result.matches)+ if (result.matches === !!action.isNot)throw new Error(result.errorMessage);break;}case 'expectAria': {const expectedValue = parseAriaSnapshotUnsafe(yaml, action.template);const result = await frame.expect(progress, 'body', { expression: 'to.match.aria', expectedValue, isNot: !!action.isNot });- if (!result.matches)+ if (result.matches === !!action.isNot)throw new Error(result.errorMessage);break;}diff --git a/packages/playwright-core/src/server/agent/pageAgent.ts b/packages/playwright-core/src/server/agent/pageAgent.tsindex 2365441443..fbad40bf73 100644--- a/packages/playwright-core/src/server/agent/pageAgent.ts+++ b/packages/playwright-core/src/server/agent/pageAgent.ts@@ -133,7 +133,6 @@ async function runLoop(context: Context, toolDefinitions: ToolDefinition[], userapi?: string,apiEndpoint?: string,apiKey?: string,- apiVersion?: string,model?: string,maxTurns?: number;maxTokens?: number;@@ -146,7 +145,6 @@ async function runLoop(context: Context, toolDefinitions: ToolDefinition[], userconst api = options.api ?? browserContext._options.agent?.api;const apiEndpoint = options.apiEndpoint ?? browserContext._options.agent?.apiEndpoint;const apiKey = options.apiKey ?? browserContext._options.agent?.apiKey;- const apiVersion = options.apiVersion ?? browserContext._options.agent?.apiVersion;const model = options.model ?? browserContext._options.agent?.model;if (!api || !apiKey || !model)@@ -160,7 +158,6 @@ async function runLoop(context: Context, toolDefinitions: ToolDefinition[], userapi: api as any,apiEndpoint,apiKey,- apiVersion,model,summarize: true,debug,diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.tsindex 6bce31667f..644abf75bb 100644--- a/packages/playwright-core/types/types.d.ts+++ b/packages/playwright-core/types/types.d.ts@@ -5382,13 +5382,10 @@ export interface PageAgent {/*** API key for the LLM provider.- */- apiKey?: string;-- /**+ ** API version if relevant.*/- apiVersion?: string;+ apiKey?: string;/*** All the agentic actions are converted to the Playwright calls and are cached. By default, they are cached globally@@ -5433,13 +5430,10 @@ export interface PageAgent {/*** API key for the LLM provider.- */- apiKey?: string;-- /**+ ** API version if relevant.*/- apiVersion?: string;+ apiKey?: string;/*** All the agentic actions are converted to the Playwright calls and are cached. By default, they are cached globally@@ -22329,11 +22323,6 @@ export interface BrowserContextOptions {*/apiKey?: string;- /**- * API version if relevant.- */- apiVersion?: string;-/*** Model identifier within the provider. Required in non-cache mode.*/diff --git a/packages/playwright/src/index.ts b/packages/playwright/src/index.tsindex 8d907f1d8d..004d6625ee 100644--- a/packages/playwright/src/index.ts+++ b/packages/playwright/src/index.ts@@ -721,9 +721,13 @@ class ArtifactsRecorder {api: this._agent.api,apiEndpoint: this._agent.apiEndpoint,apiKey: this._agent.apiKey,- apiVersion: this._agent.apiVersion,model: this._agent.model,- } : undefined;+ } : {+ api: undefined,+ apiEndpoint: undefined,+ apiKey: undefined,+ model: undefined,+ };options.agent = {...this._agent,...apiProps,diff --git a/packages/playwright/src/mcp/test/plannerTools.ts b/packages/playwright/src/mcp/test/plannerTools.tsindex 9e2dc90e89..1dad8af004 100644--- a/packages/playwright/src/mcp/test/plannerTools.ts+++ b/packages/playwright/src/mcp/test/plannerTools.ts@@ -48,10 +48,9 @@ const planSchema = z.object({name: z.string().describe('The name of the test'),file: z.string().describe('The file the test should be saved to, for example: "tests/<suite-name>/<test-name>.spec.ts".'),steps: z.array(z.object({- perform: z.string().describe(`Action to perform. For example: 'Click on the "Submit" button'.`),- expect: z.string().optional().describe(`Expected result of the action where appropriate. For example: 'The page should show the "Thank you for your submission" message'`),+ perform: z.string().optional().describe(`Action to perform. For example: 'Click on the "Submit" button'.`),+ expect: z.string().array().describe(`Expected result of the action where appropriate. For example: 'The page should show the "Thank you for your submission" message'`),})),- postConditions: z.array(z.string().describe(`Post conditions to verify that are not covered by the steps. Can be empty`)),})),})),});@@ -111,15 +110,9 @@ export const saveTestPlan = defineTestTool({lines.push(``);lines.push(`**Steps:**`);for (let k = 0; k < test.steps.length; k++) {- lines.push(` ${k + 1}. ${test.steps[k].perform}`);- if (test.steps[k].expect?.trim())- lines.push(` ${' '.repeat(String(k + 1).length)} Expect: ${test.steps[k].expect}`);- }- if (test.postConditions.length) {- lines.push(``);- lines.push(`**Post Conditions:**`);- for (const postCondition of test.postConditions)- lines.push(` - ${postCondition}`);+ lines.push(` ${k + 1}. ${test.steps[k].perform ?? '-'}`);+ for (const expect of test.steps[k].expect)+ lines.push(` - expect: ${expect}`);}}}diff --git a/packages/playwright/types/test.d.ts b/packages/playwright/types/test.d.tsindex 9c38d721d6..5bd9894c4b 100644--- a/packages/playwright/types/test.d.ts+++ b/packages/playwright/types/test.d.ts@@ -6954,7 +6954,6 @@ export type Agent = {api: string;apiKey: string;apiEndpoint?: string;- apiVersion?: string;model: string;cachePathTemplate?: string;maxTurns?: number;diff --git a/packages/protocol/src/channels.d.ts b/packages/protocol/src/channels.d.tsindex e96f220ce1..a782f6dbcb 100644--- a/packages/protocol/src/channels.d.ts+++ b/packages/protocol/src/channels.d.ts@@ -1012,7 +1012,6 @@ export type BrowserTypeLaunchPersistentContextParams = {api?: string,apiKey?: string,apiEndpoint?: string,- apiVersion?: string,model?: string,cacheFile?: string,cacheOutFile?: string,@@ -1106,7 +1105,6 @@ export type BrowserTypeLaunchPersistentContextOptions = {api?: string,apiKey?: string,apiEndpoint?: string,- apiVersion?: string,model?: string,cacheFile?: string,cacheOutFile?: string,@@ -1241,7 +1239,6 @@ export type BrowserNewContextParams = {api?: string,apiKey?: string,apiEndpoint?: string,- apiVersion?: string,model?: string,cacheFile?: string,cacheOutFile?: string,@@ -1321,7 +1318,6 @@ export type BrowserNewContextOptions = {api?: string,apiKey?: string,apiEndpoint?: string,- apiVersion?: string,model?: string,cacheFile?: string,cacheOutFile?: string,@@ -1404,7 +1400,6 @@ export type BrowserNewContextForReuseParams = {api?: string,apiKey?: string,apiEndpoint?: string,- apiVersion?: string,model?: string,cacheFile?: string,cacheOutFile?: string,@@ -1484,7 +1479,6 @@ export type BrowserNewContextForReuseOptions = {api?: string,apiKey?: string,apiEndpoint?: string,- apiVersion?: string,model?: string,cacheFile?: string,cacheOutFile?: string,@@ -1631,7 +1625,6 @@ export type BrowserContextInitializer = {api?: string,apiKey?: string,apiEndpoint?: string,- apiVersion?: string,model?: string,cacheFile?: string,cacheOutFile?: string,@@ -2675,7 +2668,6 @@ export type PageAgentPerformParams = {api?: string,apiEndpoint?: string,apiKey?: string,- apiVersion?: string,maxTurns?: number,maxTokens?: number,cacheKey?: string,@@ -2684,7 +2676,6 @@ export type PageAgentPerformOptions = {api?: string,apiEndpoint?: string,apiKey?: string,- apiVersion?: string,maxTurns?: number,maxTokens?: number,cacheKey?: string,@@ -2697,7 +2688,6 @@ export type PageAgentExpectParams = {api?: string,apiEndpoint?: string,apiKey?: string,- apiVersion?: string,maxTurns?: number,maxTokens?: number,cacheKey?: string,@@ -2706,7 +2696,6 @@ export type PageAgentExpectOptions = {api?: string,apiEndpoint?: string,apiKey?: string,- apiVersion?: string,maxTurns?: number,maxTokens?: number,cacheKey?: string,@@ -2720,7 +2709,6 @@ export type PageAgentExtractParams = {api?: string,apiEndpoint?: string,apiKey?: string,- apiVersion?: string,maxTurns?: number,maxTokens?: number,cacheKey?: string,@@ -2729,7 +2717,6 @@ export type PageAgentExtractOptions = {api?: string,apiEndpoint?: string,apiKey?: string,- apiVersion?: string,maxTurns?: number,maxTokens?: number,cacheKey?: string,@@ -5007,7 +4994,6 @@ export type AndroidDeviceLaunchBrowserParams = {api?: string,apiKey?: string,apiEndpoint?: string,- apiVersion?: string,model?: string,cacheFile?: string,cacheOutFile?: string,@@ -5085,7 +5071,6 @@ export type AndroidDeviceLaunchBrowserOptions = {api?: string,apiKey?: string,apiEndpoint?: string,- apiVersion?: string,model?: string,cacheFile?: string,cacheOutFile?: string,diff --git a/packages/protocol/src/protocol.yml b/packages/protocol/src/protocol.ymlindex 1bd1e671c6..c7e90ff521 100644--- a/packages/protocol/src/protocol.yml+++ b/packages/protocol/src/protocol.yml@@ -595,7 +595,6 @@ ContextOptions:api: string?apiKey: string?apiEndpoint: string?- apiVersion: string?model: string?cacheFile: string?cacheOutFile: string?@@ -4349,7 +4348,6 @@ PageAgentOptions:api: string?apiEndpoint: string?apiKey: string?- apiVersion: string?maxTurns: int?maxTokens: int?cacheKey: string?diff --git a/utils/generate_types/overrides-test.d.ts b/utils/generate_types/overrides-test.d.tsindex 122878ebb1..c57847a311 100644--- a/utils/generate_types/overrides-test.d.ts+++ b/utils/generate_types/overrides-test.d.ts@@ -269,7 +269,6 @@ export type Agent = {api: string;apiKey: string;apiEndpoint?: string;- apiVersion?: string;model: string;cachePathTemplate?: string;maxTurns?: number;