chore: include recent console logs in results (#689)

This commit is contained in:
Pavel Feldman
2025-07-17 14:58:44 -07:00
committed by GitHub
parent c97bc6e2ae
commit 5bfff0a059
9 changed files with 103 additions and 51 deletions

View File

@@ -21,15 +21,16 @@ test('browser_navigate', async ({ client, server }) => {
name: 'browser_navigate',
arguments: { url: server.HELLO_WORLD },
})).toHaveTextContent(`
- Ran Playwright code:
### Ran Playwright code
\`\`\`js
// Navigate to ${server.HELLO_WORLD}
await page.goto('${server.HELLO_WORLD}');
\`\`\`
### Page state
- Page URL: ${server.HELLO_WORLD}
- Page Title: Title
- Page Snapshot
- Page Snapshot:
\`\`\`yaml
- generic [active] [ref=e1]: Hello, world!
\`\`\`
@@ -59,15 +60,16 @@ test('browser_select_option', async ({ client, server }) => {
values: ['bar'],
},
})).toHaveTextContent(`
- Ran Playwright code:
### Ran Playwright code
\`\`\`js
// Select options [bar] in Select
await page.getByRole('combobox').selectOption(['bar']);
\`\`\`
### Page state
- Page URL: ${server.PREFIX}
- Page Title: Title
- Page Snapshot
- Page Snapshot:
\`\`\`yaml
- combobox [ref=e2]:
- option "Foo"
@@ -99,15 +101,16 @@ test('browser_select_option (multiple)', async ({ client, server }) => {
values: ['bar', 'baz'],
},
})).toHaveTextContent(`
- Ran Playwright code:
### Ran Playwright code
\`\`\`js
// Select options [bar, baz] in Select
await page.getByRole('listbox').selectOption(['bar', 'baz']);
\`\`\`
### Page state
- Page URL: ${server.PREFIX}
- Page Title: Title
- Page Snapshot
- Page Snapshot:
\`\`\`yaml
- listbox [ref=e2]:
- option "Foo" [ref=e3]
@@ -196,7 +199,7 @@ test('browser_resize', async ({ client, server }) => {
height: 780,
},
});
expect(response).toContainTextContent(`- Ran Playwright code:
expect(response).toContainTextContent(`### Ran Playwright code
\`\`\`js
// Resize browser window to 390x780
await page.setViewportSize({ width: 390, height: 780 });