Reference

Testing

We use Playwright to test our components and verify workflows on the UI. To learn more, see the official website documentation (opens in a new tab).

To run the UI tests locally:

  1. Set up the environment variable required to point the tests to either a hosted or local Catalyst instance.
PLAYWRIGHT_TEST_BASE_URL='https://catalyst-demo.site' || 'http://localhost:3000'
# Optional: Some tests will fail without these credentials.
# The environment variables allow automatic creation of customer accounts. These will cleanup themselves after the tests are done.
BIGCOMMERCE_ACCESS_TOKEN="<access-token>"
BIGCOMMERCE_STORE_HASH="<store-hash>"
  1. Navigate to the test directory:
cd core/
  1. Run all UI tests in Chromium:
pnpm exec playwright test tests/ui/ --project=tests-chromium
  1. Run a specific test in Chromium:
pnpm exec playwright tests/visual-regression/components/badge.spec.ts --project=tests-chromium