Skip to content

Adding Playwright-Config for sample test #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
log
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
# browserstack-playwright-load-testing-sample
Sample repository for Playwright load-testing test
# node-js-playwright-browserstack
This repo contains samples for running [Playwright](https://playwright.dev/docs/intro) tests on BrowserStack using the browserstack-node-sdk.

![BrowserStack Logo](https://d98b8t1nnulk5.cloudfront.net/production/images/layout/logo-header.png?1469004780)

## Setup

* Clone the repo `git clone -b sdk https://github.com/browserstack/node-js-playwright-browserstack.git` and run `cd node-js-playwright-browserstack`. //insert ours here
* Set `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` as environment variables with your [BrowserStack Username and Access Key](https://www.browserstack.com/accounts/settings)
* Run `npm i` to install the dependencies.
* Update the same in `browserstack-load.yaml` file.

## Running your tests

- To run the sample tests in parallel across the platforms specified in the `browserstack-load.yaml`, run `npx browserstack-cli load run`.

## Notes
* You can view your test results on the [BrowserStack Load-Testing dashboard](https://load.browserstack.com/projects)
45 changes: 45 additions & 0 deletions browserstack-load.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# =============================
# Set BrowserStack Credentials
# =============================
# Add your BrowserStack userName and accessKey here or set BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY as env variables.
userName: BROWSERSTACK_USERNAME
accessKey: BROWSERSTACK_ACCESS_KEY

# ======================
# BrowserStack Reporting
# ======================
# The following parameters are used to set up reporting on BrowserStack Load Testing:
# Set 'projectName' to the name of your project. Example: 'Product ABC'. Tests under the same projectName will be grouped together.
projectName: Default Project

# Set 'testName' to the name of your test. Example: 'First Load Test'. Test runs with the same testName will be grouped together.
testName: Default Test

# ======================
# Set Load Configuration
# ======================
# The following parameters are used to set load configuration for your test:
# Set 'testType' to the type of load test that you want to execute. Example:'Playwright', 'Selenium'. This is a required parameter.
testType: Playwright

# Set 'vus' to the maximum number of virtual users to simulate during the test.
vus: 1

# Set multiple regions from which you would want to generate the load (percent should total 100 across all loadzones).
regions:
- loadzone: us-east-1
percent: 100

# Set language to the programming language used in your project. Example: 'java', 'nodejs'.
language: nodejs

# Set framework to the test framework used in your Selenium project. Example: 'testng'.
# framework: testng

# Add list of file paths under 'dependencies' to help set up the test environment by installing required packages. Example: path to 'pom.xml' for Java projects using Maven, path to 'package.json' for Node.js projects.
# Add list of file paths under 'testConfigs' to define which configuration files should be used to run tests. Example: path to 'playwright.config.ts' for Playwright (Node.js), path to 'testng.xml' for Selenium (TestNG).
files:
dependencies:
- ./package.json
testConfigs:
- ./playwright.config.js
Loading