Skip to main content
There are two ways to run your Stably-powered Playwright tests:

Running Specific Test Groups

If you’ve organized your tests using Playwright projects, you can run specific groups:
# Run smoke tests only
npx stably test --project=smoke

# Run multiple test groups
npx stably test --project=smoke --project=release

# Combine with grep for fine-grained control
npx stably test --project=critical --grep @p0

Environment Variables

There are several ways to pass environment variables to your tests:
# Inline variables
BASE_URL=http://localhost:3000 npx stably test

# Load from a named environment on Stably
npx stably test --env Staging

# Load from a local .env file
npx stably test --env-file .env.staging

# Combine sources
npx stably test --env-file .env --env Production
When using multiple sources, variables are resolved in this order (highest priority wins):
  1. Stably internals (STABLY_API_KEY, STABLY_PROJECT_ID)
  2. --env (remote environment from Stably)
  3. --env-file (local .env files)
  4. process.env (system/shell environment)
See Environments for managing named environments on the dashboard.

Advanced Options

Run tests in debug mode with Playwright Inspector:
npx stably test --debug
Control the number of parallel workers:
# Run with 4 workers
npx stably test --workers=4

# Run serially (one test at a time)
npx stably test --workers=1
Configure test retries:
# Retry failed tests twice
npx stably test --retries=2
Run with a visible browser or Playwright’s interactive UI:
# See the browser as tests run
npx stably test --headed

# Open Playwright's interactive UI
npx stably test --ui

Next Steps