npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ash-mallick/browserstack-sync

v1.5.0

Published

Sync Playwright & Cypress e2e specs to CSV and BrowserStack Test Management with FREE AI-powered test step extraction using Ollama (local)

Readme

@ash-mallick/browserstack-sync

Sync Playwright and Cypress e2e specs to CSV (TC-001, TC-002, …) and optionally to BrowserStack Test Management (one folder per spec, create/update test cases).

🦙 FREE AI-powered test step extraction using Ollama — runs 100% locally, no data sent to cloud!

By Ashutosh Mallick


Install

npm install @ash-mallick/browserstack-sync

Or run without installing: npx @ash-mallick/browserstack-sync --csv-only


Run

From your project root (where your e2e specs live):

# Generate CSVs only
npx am-browserstack-sync --csv-only

# Sync all specs, no prompt (e.g. CI)
npx am-browserstack-sync --all

# Sync only certain specs
npx am-browserstack-sync --spec=login.spec,checkout.spec

# Disable AI analysis (use regex extraction only)
npx am-browserstack-sync --no-ai

# Use a specific Ollama model
npx am-browserstack-sync --model=llama3.2

Scripts in package.json:

{
  "scripts": {
    "sync:e2e": "am-browserstack-sync",
    "sync:e2e-csv": "am-browserstack-sync --csv-only"
  }
}

🦙 AI-Powered Step Analysis (FREE with Ollama)

The tool uses Ollama to analyze your test code and generate human-readable test steps. Ollama runs 100% locally on your machine — no data sent to cloud, completely free, no API key needed!

Example transformation:

// Your test code:
test('should log in successfully', async ({ page }) => {
  await page.goto('/login');
  await page.getByLabel(/email/i).fill('[email protected]');
  await page.getByLabel(/password/i).fill('validpassword');
  await page.getByRole('button', { name: /sign in/i }).click();
  await expect(page).toHaveURL(/\/dashboard/);
});

Generated steps:

| Step | Expected Result | |------|-----------------| | Navigate to /login page | Login page loads successfully | | Enter '[email protected]' in the Email field | Email is entered | | Enter 'validpassword' in the Password field | Password is masked and entered | | Click the 'Sign In' button | Form is submitted | | Verify URL | URL matches /dashboard |

Setup Ollama

  1. Download and install Ollama from ollama.ai

  2. Pull a model (llama3.2 recommended):

    ollama pull llama3.2
  3. Start Ollama (runs automatically on macOS, or run manually):

    ollama serve
  4. Run the sync — AI analysis is automatic when Ollama is running!

    npx am-browserstack-sync --csv-only

Options

  • --no-ai — Disable AI, use regex-based extraction instead
  • --model=llama3.2 — Use a different Ollama model
  • OLLAMA_MODEL=llama3.2 — Set default model via env variable
  • OLLAMA_HOST=http://localhost:11434 — Custom Ollama host

Recommended Models

| Model | Size | Best for | |-------|------|----------| | llama3.2 | 2GB | General purpose, fast (default) | | codellama | 4GB | Better code understanding | | llama3.2:1b | 1GB | Fastest, lower quality | | mistral | 4GB | Good balance |

Fallback: If Ollama is not running, the tool automatically uses regex-based step extraction, which still provides meaningful steps.


Config (optional)

Defaults: e2e dir playwright/e2e, CSV dir playwright/e2e-csv. For Cypress use e.g. cypress/e2e.

Override via .am-browserstack-sync.json in project root:

{
  "e2eDir": "playwright/e2e",
  "csvOutputDir": "playwright/e2e-csv"
}

Or package.json: "amBrowserstackSync": { "e2eDir": "...", "csvOutputDir": "..." }
Or env: PLAYWRIGHT_BROWSERSTACK_E2E_DIR, PLAYWRIGHT_BROWSERSTACK_CSV_DIR.


BrowserStack sync

Sync pushes your e2e tests into BrowserStack Test Management so you can track test cases, link runs, and keep specs in sync with one source of truth. Under your chosen project it creates one folder per spec file (e.g. login.spec, checkout.spec) and one test case per test, with title, description, steps, state (Active), type (Functional), automation status, and tags. Existing test cases are matched by title or TC-id and updated; new ones are created. No duplicates.

Setup:

  1. In project root, create .env (do not commit):

    BROWSERSTACK_USERNAME=your_username
    BROWSERSTACK_ACCESS_KEY=your_access_key
    BROWSERSTACK_PROJECT_ID=PR-XXXX

    Or use a single token: BROWSERSTACK_API_TOKEN=your_token

  2. Get credentials and project ID from Test Management → API keys. The project ID is in the project URL (e.g. PR-1234).

  3. Install Ollama for AI-powered step analysis (optional but recommended).

  4. Run npx am-browserstack-sync (without --csv-only). You'll be prompted to sync all specs or pick specific ones (unless you use --all or --spec=...). After sync, open your project in BrowserStack to see the new folders and test cases.


What it does

  • Finds Playwright (*.spec.*, *.test.*) and Cypress (*.cy.*) spec files in your e2e dir.
  • Extracts test titles from test('...') / it('...'), assigns TC-001, TC-002, …
  • Analyzes test code with Ollama AI (local, free) or regex to generate human-readable steps and expected results.
  • Enriches with state (Active), type (Functional), automation (automated), tags (from spec + title).
  • Writes one CSV per spec (test_case_id, title, state, case_type, steps, expected_results, jira_issues, automation_status, tags, description, spec_file).
  • Optionally syncs to BrowserStack with description, steps, and tags.

Author: Ashutosh Mallick