BrowserStack Integration

Run tests on BrowserStack.

How to use it

Claude Code
  1. Run the line below. It pulls the whole folder into ~/.claude/skills/browserstack.
  2. Describe your job in plain words. Claude Code follows the skill from there.
Claude Code — installs the whole folder, not just SKILL.md
npx degit alirezarezvani/claude-skills/engineering-team/playwright-pro/skills/browserstack#main ~/.claude/skills/browserstack

For one project only, change the path to .claude/skills/browserstack.

Claude (web or desktop app)
  1. On this page open ⋯ → Download .md.
  2. Save it as SKILL.md in a folder, zip the folder, then Customize → Skills → + → Create skill → Upload a skill.
  3. Pick the file and Save. Claude shows the name and description and runs a security scan.
  4. Check the skill is switched on.
  5. Start a new chat and describe your job in plain words. The AI follows the skill from there.
ChatGPT or another app
  1. ChatGPT: make a Project and paste it into Instructions.
  2. Neither? Paste it at the top of a new chat — it works for that chat.
Not working?
  • Check which app you pasted it into — the steps above name the right one.
  • Some skills need the paid tier of Claude or ChatGPT.
Step-by-step guide with screenshots · Ask in the forum

Paste into Claude, ChatGPT or Cursor.

Source of BrowserStack Integration

Show the full text178 lines
namedescription
browserstack>- Run tests on BrowserStack. Use when user mentions "browserstack", cross-browser", "cloud testing", "browser matrix", "test on safari", test on firefox", or "browser compatibility".

BrowserStack Integration

Run Playwright tests on BrowserStack's cloud grid for cross-browser and cross-device testing.

Prerequisites

Environment variables must be set:

  • BROWSERSTACK_USERNAME — your BrowserStack username
  • BROWSERSTACK_ACCESS_KEY — your access key

If not set, inform the user how to get them from browserstack.com/accounts/settings and stop.

The BrowserStack MCP server is not auto-registered (issue #978). pw-browserstack was removed from the plugin's .mcp.json because it failed to connect for every user (the plugin ships no node_modules). The browserstack_* MCP tools used below, and the /pw:browserstack command, will fail with "tool not found" until it is enabled manually — see the Integrations section of the plugin's CLAUDE.md (cd integrations/browserstack-mcp && npm install, then register the server in your own user/project MCP config). Setting the env vars alone is not sufficient.

Capabilities

1. Configure for BrowserStack
/pw:browserstack setup

Steps:

  1. Check current playwright.config.ts
  2. Add BrowserStack connect options:
// Add to playwright.config.ts
import { defineConfig } from '@playwright/test';

const isBS = !!process.env.BROWSERSTACK_USERNAME;

export default defineConfig({
  // ... existing config
  projects: isBS ? [
    {
      name: "chromelatestwindows-11",
      use: {
        connectOptions: {
          wsEndpoint: `wss://cdp.browserstack.com/playwright?caps=${encodeURIComponent(JSON.stringify({
            'browser': 'chrome',
            'browser_version': 'latest',
            'os': 'Windows',
            'os_version': '11',
            'browserstack.username': process.env.BROWSERSTACK_USERNAME,
            'browserstack.accessKey': process.env.BROWSERSTACK_ACCESS_KEY,
          }))}`,
        },
      },
    },
    {
      name: "firefoxlatestwindows-11",
      use: {
        connectOptions: {
          wsEndpoint: `wss://cdp.browserstack.com/playwright?caps=${encodeURIComponent(JSON.stringify({
            'browser': 'playwright-firefox',
            'browser_version': 'latest',
            'os': 'Windows',
            'os_version': '11',
            'browserstack.username': process.env.BROWSERSTACK_USERNAME,
            'browserstack.accessKey': process.env.BROWSERSTACK_ACCESS_KEY,
          }))}`,
        },
      },
    },
    {
      name: "webkitlatestos-x-ventura",
      use: {
        connectOptions: {
          wsEndpoint: `wss://cdp.browserstack.com/playwright?caps=${encodeURIComponent(JSON.stringify({
            'browser': 'playwright-webkit',
            'browser_version': 'latest',
            'os': 'OS X',
            'os_version': 'Ventura',
            'browserstack.username': process.env.BROWSERSTACK_USERNAME,
            'browserstack.accessKey': process.env.BROWSERSTACK_ACCESS_KEY,
          }))}`,
        },
      },
    },
  ] : [
    // ... local projects fallback
  ],
});
  1. Add npm script: "test:e2e:cloud": "npx playwright test --project='chrome@*' --project='firefox@*' --project='webkit@*'"
2. Run Tests on BrowserStack
/pw:browserstack run

Steps:

  1. Verify credentials are set
  2. Run tests with BrowserStack projects:
    BROWSERSTACK_USERNAME=$BROWSERSTACK_USERNAME \
    BROWSERSTACK_ACCESS_KEY=$BROWSERSTACK_ACCESS_KEY \
    npx playwright test --project='chrome@*' --project='firefox@*'
    
  3. Monitor execution
  4. Report results per browser
3. Get Build Results
/pw:browserstack results

Steps:

  1. Call browserstack_get_builds MCP tool
  2. Get latest build's sessions
  3. For each session:
    • Status (pass/fail)
    • Browser and OS
    • Duration
    • Video URL
    • Log URLs
  4. Format as summary table
4. Check Available Browsers
/pw:browserstack browsers

Steps:

  1. Call browserstack_get_browsers MCP tool
  2. Filter for Playwright-compatible browsers
  3. Display available browser/OS combinations
5. Local Testing
/pw:browserstack local

For testing localhost or staging behind firewall:

  1. Install BrowserStack Local: npm install -D browserstack-local
  2. Add local tunnel to config
  3. Provide setup instructions

MCP Tools Used

Tool When
browserstack_get_plan Check account limits
browserstack_get_browsers List available browsers
browserstack_get_builds List recent builds
browserstack_get_sessions Get sessions in a build
browserstack_get_session Get session details (video, logs)
browserstack_update_session Mark pass/fail
browserstack_get_logs Get text/network logs

Output

  • Cross-browser test results table
  • Per-browser pass/fail status
  • Links to BrowserStack dashboard for video/screenshots
  • Any browser-specific failures highlighted
1---
2name: "browserstack"
3description: >-
4 Run tests on BrowserStack. Use when user mentions "browserstack",
5 "cross-browser", "cloud testing", "browser matrix", "test on safari",
6 "test on firefox", or "browser compatibility".
7---
8 
9# BrowserStack Integration
10 
11Run Playwright tests on BrowserStack's cloud grid for cross-browser and cross-device testing.
12 
13## Prerequisites
14 
15Environment variables must be set:
16- `BROWSERSTACK_USERNAME` — your BrowserStack username
17- `BROWSERSTACK_ACCESS_KEY` — your access key
18 
19If not set, inform the user how to get them from [browserstack.com/accounts/settings](https://www.browserstack.com/accounts/settings) and stop.
20 
21> **The BrowserStack MCP server is not auto-registered (issue #978).**
22> `pw-browserstack` was removed from the plugin's `.mcp.json` because it failed to
23> connect for every user (the plugin ships no `node_modules`). The `browserstack_*`
24> MCP tools used below, and the `/pw:browserstack` command, will fail with "tool
25> not found" until it is enabled manually — see the **Integrations** section of the
26> plugin's `CLAUDE.md` (`cd integrations/browserstack-mcp && npm install`, then
27> register the server in your own user/project MCP config). Setting the env vars
28> alone is not sufficient.
29 
30## Capabilities
31 
32### 1. Configure for BrowserStack
33 
34```
35/pw:browserstack setup
36```
37 
38Steps:
391. Check current `playwright.config.ts`
402. Add BrowserStack connect options:
41 
42```typescript
43// Add to playwright.config.ts
44import { defineConfig } from '@playwright/test';
45 
46const isBS = !!process.env.BROWSERSTACK_USERNAME;
47 
48export default defineConfig({
49 // ... existing config
50 projects: isBS ? [
51 {
52 name: "chromelatestwindows-11",
53 use: {
54 connectOptions: {
55 wsEndpoint: `wss://cdp.browserstack.com/playwright?caps=${encodeURIComponent(JSON.stringify({
56 'browser': 'chrome',
57 'browser_version': 'latest',
58 'os': 'Windows',
59 'os_version': '11',
60 'browserstack.username': process.env.BROWSERSTACK_USERNAME,
61 'browserstack.accessKey': process.env.BROWSERSTACK_ACCESS_KEY,
62 }))}`,
63 },
64 },
65 },
66 {
67 name: "firefoxlatestwindows-11",
68 use: {
69 connectOptions: {
70 wsEndpoint: `wss://cdp.browserstack.com/playwright?caps=${encodeURIComponent(JSON.stringify({
71 'browser': 'playwright-firefox',
72 'browser_version': 'latest',
73 'os': 'Windows',
74 'os_version': '11',
75 'browserstack.username': process.env.BROWSERSTACK_USERNAME,
76 'browserstack.accessKey': process.env.BROWSERSTACK_ACCESS_KEY,
77 }))}`,
78 },
79 },
80 },
81 {
82 name: "webkitlatestos-x-ventura",
83 use: {
84 connectOptions: {
85 wsEndpoint: `wss://cdp.browserstack.com/playwright?caps=${encodeURIComponent(JSON.stringify({
86 'browser': 'playwright-webkit',
87 'browser_version': 'latest',
88 'os': 'OS X',
89 'os_version': 'Ventura',
90 'browserstack.username': process.env.BROWSERSTACK_USERNAME,
91 'browserstack.accessKey': process.env.BROWSERSTACK_ACCESS_KEY,
92 }))}`,
93 },
94 },
95 },
96 ] : [
97 // ... local projects fallback
98 ],
99});
100```
101 
1023. Add npm script: `"test:e2e:cloud": "npx playwright test --project='chrome@*' --project='firefox@*' --project='webkit@*'"`
103 
104### 2. Run Tests on BrowserStack
105 
106```
107/pw:browserstack run
108```
109 
110Steps:
1111. Verify credentials are set
1122. Run tests with BrowserStack projects:
113 ```bash
114 BROWSERSTACK_USERNAME=$BROWSERSTACK_USERNAME \
115 BROWSERSTACK_ACCESS_KEY=$BROWSERSTACK_ACCESS_KEY \
116 npx playwright test --project='chrome@*' --project='firefox@*'
117 ```
1183. Monitor execution
1194. Report results per browser
120 
121### 3. Get Build Results
122 
123```
124/pw:browserstack results
125```
126 
127Steps:
1281. Call `browserstack_get_builds` MCP tool
1292. Get latest build's sessions
1303. For each session:
131 - Status (pass/fail)
132 - Browser and OS
133 - Duration
134 - Video URL
135 - Log URLs
1364. Format as summary table
137 
138### 4. Check Available Browsers
139 
140```
141/pw:browserstack browsers
142```
143 
144Steps:
1451. Call `browserstack_get_browsers` MCP tool
1462. Filter for Playwright-compatible browsers
1473. Display available browser/OS combinations
148 
149### 5. Local Testing
150 
151```
152/pw:browserstack local
153```
154 
155For testing localhost or staging behind firewall:
1561. Install BrowserStack Local: `npm install -D browserstack-local`
1572. Add local tunnel to config
1583. Provide setup instructions
159 
160## MCP Tools Used
161 
162| Tool | When |
163|---|---|
164| `browserstack_get_plan` | Check account limits |
165| `browserstack_get_browsers` | List available browsers |
166| `browserstack_get_builds` | List recent builds |
167| `browserstack_get_sessions` | Get sessions in a build |
168| `browserstack_get_session` | Get session details (video, logs) |
169| `browserstack_update_session` | Mark pass/fail |
170| `browserstack_get_logs` | Get text/network logs |
171 
172## Output
173 
174- Cross-browser test results table
175- Per-browser pass/fail status
176- Links to BrowserStack dashboard for video/screenshots
177- Any browser-specific failures highlighted
178 

Discussion