|
|
|
|
@@ -33,7 +33,7 @@ test('list initial tabs', async ({ client }) => {
|
|
|
|
|
expect(await client.callTool({
|
|
|
|
|
name: 'browser_tab_list',
|
|
|
|
|
})).toHaveTextContent(`### Open tabs
|
|
|
|
|
- 1: (current) [] (about:blank)`);
|
|
|
|
|
- 0: (current) [] (about:blank)`);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('list first tab', async ({ client }) => {
|
|
|
|
|
@@ -41,8 +41,8 @@ test('list first tab', async ({ client }) => {
|
|
|
|
|
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>)`);
|
|
|
|
|
- 0: [] (about:blank)
|
|
|
|
|
- 1: (current) [Tab one] (data:text/html,<title>Tab one</title><body>Body one</body>)`);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('create new tab', async ({ client }) => {
|
|
|
|
|
@@ -53,8 +53,8 @@ test('create new tab', async ({ client }) => {
|
|
|
|
|
\`\`\`
|
|
|
|
|
|
|
|
|
|
### Open tabs
|
|
|
|
|
- 1: [] (about:blank)
|
|
|
|
|
- 2: (current) [Tab one] (data:text/html,<title>Tab one</title><body>Body one</body>)
|
|
|
|
|
- 0: [] (about:blank)
|
|
|
|
|
- 1: (current) [Tab one] (data:text/html,<title>Tab one</title><body>Body one</body>)
|
|
|
|
|
|
|
|
|
|
### Current tab
|
|
|
|
|
- Page URL: data:text/html,<title>Tab one</title><body>Body one</body>
|
|
|
|
|
@@ -71,9 +71,9 @@ test('create new tab', async ({ client }) => {
|
|
|
|
|
\`\`\`
|
|
|
|
|
|
|
|
|
|
### Open tabs
|
|
|
|
|
- 1: [] (about:blank)
|
|
|
|
|
- 2: [Tab one] (data:text/html,<title>Tab one</title><body>Body one</body>)
|
|
|
|
|
- 3: (current) [Tab two] (data:text/html,<title>Tab two</title><body>Body two</body>)
|
|
|
|
|
- 0: [] (about:blank)
|
|
|
|
|
- 1: [Tab one] (data:text/html,<title>Tab one</title><body>Body one</body>)
|
|
|
|
|
- 2: (current) [Tab two] (data:text/html,<title>Tab two</title><body>Body two</body>)
|
|
|
|
|
|
|
|
|
|
### Current tab
|
|
|
|
|
- Page URL: data:text/html,<title>Tab two</title><body>Body two</body>
|
|
|
|
|
@@ -90,18 +90,18 @@ test('select tab', async ({ client }) => {
|
|
|
|
|
expect(await client.callTool({
|
|
|
|
|
name: 'browser_tab_select',
|
|
|
|
|
arguments: {
|
|
|
|
|
index: 2,
|
|
|
|
|
index: 1,
|
|
|
|
|
},
|
|
|
|
|
})).toHaveTextContent(`
|
|
|
|
|
- Ran Playwright code:
|
|
|
|
|
\`\`\`js
|
|
|
|
|
// <internal code to select tab 2>
|
|
|
|
|
// <internal code to select tab 1>
|
|
|
|
|
\`\`\`
|
|
|
|
|
|
|
|
|
|
### Open tabs
|
|
|
|
|
- 1: [] (about:blank)
|
|
|
|
|
- 2: (current) [Tab one] (data:text/html,<title>Tab one</title><body>Body one</body>)
|
|
|
|
|
- 3: [Tab two] (data:text/html,<title>Tab two</title><body>Body two</body>)
|
|
|
|
|
- 0: [] (about:blank)
|
|
|
|
|
- 1: (current) [Tab one] (data:text/html,<title>Tab one</title><body>Body one</body>)
|
|
|
|
|
- 2: [Tab two] (data:text/html,<title>Tab two</title><body>Body two</body>)
|
|
|
|
|
|
|
|
|
|
### Current tab
|
|
|
|
|
- Page URL: data:text/html,<title>Tab one</title><body>Body one</body>
|
|
|
|
|
@@ -118,17 +118,17 @@ test('close tab', async ({ client }) => {
|
|
|
|
|
expect(await client.callTool({
|
|
|
|
|
name: 'browser_tab_close',
|
|
|
|
|
arguments: {
|
|
|
|
|
index: 3,
|
|
|
|
|
index: 2,
|
|
|
|
|
},
|
|
|
|
|
})).toHaveTextContent(`
|
|
|
|
|
- Ran Playwright code:
|
|
|
|
|
\`\`\`js
|
|
|
|
|
// <internal code to close tab 3>
|
|
|
|
|
// <internal code to close tab 2>
|
|
|
|
|
\`\`\`
|
|
|
|
|
|
|
|
|
|
### Open tabs
|
|
|
|
|
- 1: [] (about:blank)
|
|
|
|
|
- 2: (current) [Tab one] (data:text/html,<title>Tab one</title><body>Body one</body>)
|
|
|
|
|
- 0: [] (about:blank)
|
|
|
|
|
- 1: (current) [Tab one] (data:text/html,<title>Tab one</title><body>Body one</body>)
|
|
|
|
|
|
|
|
|
|
### Current tab
|
|
|
|
|
- Page URL: data:text/html,<title>Tab one</title><body>Body one</body>
|
|
|
|
|
|