Skip to content

riteshj-byte/run-test-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BrowserStack SDK — Selenium + GitHub Actions

A minimal Selenium test that runs on BrowserStack Automate via the BrowserStack Node SDK, wired to run in GitHub Actions.

What's here

File Purpose
browserstack.yml Where tests run — browser/OS matrix, parallelism, credentials, reporting.
test/bstack_sample.test.js The actual Selenium test (plain code — no hub URL or capabilities).
package.json Deps (browserstack-node-sdk, mocha, selenium-webdriver) and the npm test script.
.github/workflows/browserstack.yml CI pipeline that installs deps and runs the suite.

How it works

The SDK wraps the test runner: browserstack-node-sdk mocha .... At runtime it intercepts WebDriver creation and redirects your sessions to BrowserStack using the platforms in browserstack.yml. Your test code stays clean and portable — the same file runs locally against a real browser if you drop the SDK wrapper.

Run locally

  1. Install dependencies:
    npm install
  2. Export your BrowserStack credentials (find them in Account → Settings):
    export BROWSERSTACK_USERNAME="your-username"
    export BROWSERSTACK_ACCESS_KEY="your-access-key"
  3. Run the tests:
    npm test
  4. Watch the sessions live on the Automate dashboard.

Run in GitHub Actions

  1. Push this repo to GitHub.
  2. Add two repository secrets under Settings → Secrets and variables → Actions:
    • BROWSERSTACK_USERNAME
    • BROWSERSTACK_ACCESS_KEY
  3. The workflow runs automatically on pushes/PRs to main, or trigger it manually from the Actions tab (Run workflow).

Customize the browser matrix

Edit the platforms: list in browserstack.yml. Add or remove OS/browser combinations — each entry is one session. Use the Capabilities Generator to find valid os / osVersion / browserName / browserVersion values.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors