Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/release-notes-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ If you include a named capture group into the expression, then Playwright will p
```js
import { test, expect } from '@playwright/test';

test.use({ baseUrl: `http://localhost:${process.env.MY_SERVER_PORT ?? 3000}` });
test.use({ baseURL: `http://localhost:${process.env.MY_SERVER_PORT ?? 3000}` });

test('homepage', async ({ page }) => {
await page.goto('/');
Expand Down
32 changes: 32 additions & 0 deletions examples/todomvc/tests/md/adding-todos.spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## Adding Todos

- seed: ./seed.spec.md

### should add single todo

- tag: @one @two
- tag: @three
- annotation: link=https://playwright.dev
- annotation: link2=https://demo.playwright.dev

* Type 'Buy groceries' into the input field
* expect: The text appears in the input field
- Press Enter to submit the todo
- group: Verify todo is added to the list
- 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'

### should add multiple todos

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. // this is a comment
4. Add third todo 'Finish report'
- expect: All three todos appear in the list
- // this is a comment
- expect: Counter shows '3 items left'
160 changes: 160 additions & 0 deletions examples/todomvc/tests/md/adding-todos.spec.md-cache.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
{
"page title contains \"TodoMVC\"": {
"actions": []
},
"Press Enter to submit the todo": {
"actions": [
{
"method": "pressKey",
"key": "Enter",
"code": "await page.keyboard.press('Enter');"
}
]
},
"The input field 'What needs to be done?' is visible": {
"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();"
}
]
},
"The input field is cleared": {
"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('');"
}
]
},
"The new todo 'Buy groceries' appears in the todo list": {
"actions": [
{
"method": "expectVisible",
"selector": "internal:text=\"Buy groceries\"i",
"code": "await expect(page.getByText('Buy groceries')).toBeVisible();"
}
]
},
"The text appears in the input field": {
"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');"
}
]
},
"The todo counter shows '1 item left'": {
"actions": [
{
"method": "expectVisible",
"selector": "internal:text=\"1 item left\"i",
"code": "await expect(page.getByText('1 item left')).toBeVisible();"
}
]
},
"Type 'Buy groceries' into the input field": {
"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');"
}
]
},
"Add first todo 'Buy milk'": {
"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');"
}
]
},
"Add second todo 'Walk the dog'": {
"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');"
}
]
},
"Add third todo 'Finish report'": {
"actions": [
{
"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');"
}
]
},
"All three todos appear in the list": {
"actions": [
{
"method": "expectAria",
"template": "- list:\n - listitem: Buy milk\n - listitem: Walk the dog\n - listitem: Finish report",
"code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy milk\n - listitem: Walk the dog\n - listitem: Finish report\n`);"
}
]
},
"Both todos appear in the list": {
"actions": [
{
"method": "expectAria",
"template": "- list:\n - listitem: Buy milk\n - listitem: Walk the dog",
"code": "await expect(page.locator('body')).toMatchAria(`\n- list:\n - listitem: Buy milk\n - listitem: Walk the dog\n`);"
}
]
},
"Counter shows '1 item left'": {
"actions": [
{
"method": "expectVisible",
"selector": "internal:text=\"1 item left\"i",
"code": "await expect(page.getByText('1 item left')).toBeVisible();"
}
]
},
"Counter shows '2 items left'": {
"actions": [
{
"method": "expectVisible",
"selector": "internal:text=\"2 items left\"i",
"code": "await expect(page.getByText('2 items left')).toBeVisible();"
}
]
},
"Counter shows '3 items left'": {
"actions": [
{
"method": "expectVisible",
"selector": "internal:text=\"3 items left\"i",
"code": "await expect(page.getByText('3 items left')).toBeVisible();"
}
]
},
"The todo appears in the list": {
"actions": [
{
"method": "expectVisible",
"selector": "internal:text=\"Buy milk\"i",
"code": "await expect(page.getByText('Buy milk')).toBeVisible();"
}
]
}
}
14 changes: 14 additions & 0 deletions examples/todomvc/tests/md/seed.spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Seed

- fixtures: ../fixtures

### seed test

- Navigate to 'https://demo.playwright.dev/todomvc'
```ts
await page.goto('https://demo.playwright.dev/todomvc');
```

- expect: page title contains "TodoMVC"

- expect: The input field 'What needs to be done?' is visible
14 changes: 14 additions & 0 deletions examples/todomvc/tests/md/seed.spec.md-cache.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"page title contains \"TodoMVC\"": {
"actions": []
},
"The input field 'What needs to be done?' is visible": {
"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();"
}
]
}
}
26 changes: 22 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@
"@eslint/compat": "^1.3.2",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.34.0",
"@lowire/loop": "^0.0.15",
"@lowire/loop": "^0.0.18",
"@modelcontextprotocol/sdk": "^1.17.5",
"@octokit/graphql-schema": "^15.26.0",
"@stylistic/eslint-plugin": "^5.2.3",
"@types/codemirror": "^5.60.7",
"@types/formidable": "^2.0.4",
"@types/mdast": "^4.0.4",
"@types/node": "18.19.76",
"@types/react": "^19.2.1",
"@types/react-dom": "^19.2.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/playwright-core/ThirdPartyNotices.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ THIRD-PARTY SOFTWARE NOTICES AND INFORMATION

This 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].15 (https://github.com/pavelfeldman/lowire)
- @lowire/[email protected].18 (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)
Expand Down Expand Up @@ -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].15 NOTICES AND INFORMATION BEGIN HERE
%% @lowire/[email protected].18 NOTICES AND INFORMATION BEGIN HERE
=========================================
Apache License
Version 2.0, January 2004
Expand Down Expand Up @@ -339,7 +339,7 @@ Apache License
See the License for the specific language governing permissions and
limitations under the License.
=========================================
END OF @lowire/[email protected].15 AND INFORMATION
END OF @lowire/[email protected].18 AND INFORMATION

%% @modelcontextprotocol/[email protected] NOTICES AND INFORMATION BEGIN HERE
=========================================
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-core/browsers.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
},
{
"name": "webkit",
"revision": "2242",
"revision": "2245",
"installByDefault": true,
"revisionOverrides": {
"debian11-x64": "2105",
Expand Down
8 changes: 4 additions & 4 deletions packages/playwright-core/bundles/mcp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/playwright-core/bundles/mcp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.1",
"private": true,
"dependencies": {
"@lowire/loop": "^0.0.15",
"@lowire/loop": "^0.0.18",
"@modelcontextprotocol/sdk": "^1.24.0",
"zod": "^3.25.76",
"zod-to-json-schema": "^3.24.6"
Expand Down
Loading
Loading