-
Notifications
You must be signed in to change notification settings - Fork 5.1k
chore: move to page.agent({ params }) api #38735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 12 additions & 21 deletions
33
examples/todomvc/tests/perform/completing-todos/should-complete-multiple-todos.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,18 @@ | ||
| 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`); | ||
| test('should complete multiple todos', async ({ agent }) => { | ||
| await 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 agent.perform(`Add three todos: 'Buy milk', 'Walk dog', 'Finish report'`); | ||
| await agent.expect(`All three todos are visible`); | ||
| await 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 agent.perform(`Complete the first todo by clicking its checkbox`); | ||
| await agent.expect(`First todo is marked as complete`); | ||
| await 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`); | ||
| await agent.perform(`Complete the third todo by clicking its checkbox`); | ||
| await agent.expect(`Third todo is marked as complete`); | ||
| await agent.expect(`Counter shows '1 item left'`); | ||
| await agent.expect(`The 'Clear completed' button appears`); | ||
| }); |
27 changes: 9 additions & 18 deletions
27
examples/todomvc/tests/perform/completing-todos/should-complete-single-todo.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,14 @@ | ||
| 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`); | ||
| test('should complete single todo', async ({ agent }) => { | ||
| await 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 agent.perform(`Add a todo 'Buy groceries'`); | ||
| await agent.expect(`The todo appears as active`); | ||
| await 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`); | ||
| await agent.perform(`Click the checkbox next to the todo`); | ||
| await agent.expect(`The checkbox is checked`); | ||
| await agent.expect(`Counter shows '0 items left'`); | ||
| await agent.expect(`The 'Clear completed' button appears in the footer`); | ||
| }); |
33 changes: 12 additions & 21 deletions
33
examples/todomvc/tests/perform/completing-todos/should-toggle-all-todos-complete.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,15 @@ | ||
| 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`); | ||
| test('should toggle all todos complete', async ({ agent }) => { | ||
| await agent.expect(`The page loads with an empty todo list`); | ||
|
|
||
| await agent.perform(`Add three todos: 'Task 1', 'Task 2', 'Task 3'`); | ||
| await agent.expect(`All three todos are visible and active`); | ||
| await agent.expect(`Counter shows '3 items left'`); | ||
|
|
||
| await agent.perform(`Click the 'Mark all as complete' checkbox`); | ||
| await agent.expect(`All three todos are marked as complete`); | ||
| await agent.expect(`All checkboxes are checked`); | ||
| await agent.expect(`Counter shows '0 items left'`); | ||
| await agent.expect(`The 'Clear completed' button appears`); | ||
| }); |
33 changes: 12 additions & 21 deletions
33
examples/todomvc/tests/perform/completing-todos/should-toggle-all-todos-incomplete.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,15 @@ | ||
| 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`); | ||
| test('should toggle all todos incomplete', async ({ agent }) => { | ||
| await agent.expect(`The page loads with an empty todo list`); | ||
|
|
||
| await agent.perform(`Add three todos: 'Task 1', 'Task 2', 'Task 3' and mark all as complete using the toggle all checkbox`); | ||
| await agent.expect(`All todos are marked as complete`); | ||
| await agent.expect(`Counter shows '0 items left'`); | ||
|
|
||
| await agent.perform(`Click the 'Mark all as complete' checkbox again`); | ||
| await agent.expect(`All todos are marked as active`); | ||
| await agent.expect(`All checkboxes are unchecked`); | ||
| await agent.expect(`Counter shows '3 items left'`); | ||
| await agent.expect(`The 'Clear completed' button disappears`); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider naming it
newAgentfor consistency with other API methods that create stuff.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll claim browserType.launch exception :-)