chore: test list tabs (#208)

This commit is contained in:
Pavel Feldman
2025-04-17 00:58:02 -07:00
committed by GitHub
parent 7e4a964b0a
commit 4b261286bf
14 changed files with 66 additions and 58 deletions

View File

@@ -29,6 +29,22 @@ async function createTab(client: Client, title: string, body: string) {
});
}
test('list initial tabs', async ({ client }) => {
expect(await client.callTool({
name: 'browser_tab_list',
})).toHaveTextContent(`### Open tabs
- 1: (current) [] (about:blank)`);
});
test('list first tab', async ({ client }) => {
await createTab(client, 'Tab one', 'Body one');
expect(await client.callTool({
name: 'browser_tab_list',
})).toHaveTextContent(`### Open tabs
- 1: [] (about:blank)
- 2: (current) [Tab one] (data:text/html,<title>Tab one</title><body>Body one</body>)`);
});
test('create new tab', async ({ client }) => {
expect(await createTab(client, 'Tab one', 'Body one')).toHaveTextContent(`
- Ran Playwright code: