New to Claude Skills? Learn how to install them →

alirezarezvani on GitHub

BrowserStack Integration

Free

Run Playwright tests on BrowserStack's cloud grid.

Get this skill

Free · Opens the source repo

What BrowserStack Integration does

The BrowserStack Integration skill allows developers to run Playwright tests directly on BrowserStack's cloud grid, facilitating cross-browser and cross-device testing. This integration is essential for teams looking to ensure their web applications function seamlessly across various browsers and operating systems. By leveraging BrowserStack, developers can test their applications in real-world environments without the need for extensive local setups.

To get started, users must configure their environment by setting the necessary BrowserStack credentials. The skill provides a straightforward setup command that checks the existing Playwright configuration and appends the required BrowserStack options. Once configured, users can run their tests across multiple browsers with a simple command, streamlining the testing process and improving efficiency.

The skill also includes features for monitoring test execution and retrieving build results, which helps teams quickly identify issues and understand the performance of their applications across different environments. Users can check available browser options and even set up local testing for applications behind firewalls, ensuring comprehensive coverage of their testing needs.

Overall, this skill is designed for developers and QA engineers who want to integrate BrowserStack into their testing workflows, ensuring their applications are compatible across a wide range of browsers and devices. By automating the testing process with this skill, teams can focus on development while maintaining high-quality standards in their applications.

When to use it

Use this skill when you need to run automated tests on multiple browsers and devices via BrowserStack.

When not to use it

This skill may not be suitable for projects that do not require cross-browser testing or for those that prefer local testing environments without cloud integration.

What you can build with it

Automated Cross-Browser Testing

Run your Playwright tests on BrowserStack to ensure your web application works across different browsers and devices.

Local Testing Setup

Use the local testing feature to test applications hosted on localhost or behind a firewall, ensuring full coverage.

Monitor Test Results

Quickly access build results and session details to analyze the performance of your tests across various environments.

How to install BrowserStack Integration

View source

1. Install with the skills CLI

npx skills add alirezarezvani/claude-skills/browserstack --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by alirezarezvani

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.

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

ToolWhen
browserstack_get_planCheck account limits
browserstack_get_browsersList available browsers
browserstack_get_buildsList recent builds
browserstack_get_sessionsGet sessions in a build
browserstack_get_sessionGet session details (video, logs)
browserstack_update_sessionMark pass/fail
browserstack_get_logsGet 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

Frequently asked questions about BrowserStack Integration

Similar skills