Skip to content

Commit 0b84979

Browse files
authored
Merge pull request #1 from MihirR-BS/main
Adding Playwright-Config for sample test
2 parents 59a53c8 + 28fb9d0 commit 0b84979

File tree

8 files changed

+9633
-2
lines changed

8 files changed

+9633
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
log

README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
1-
# browserstack-playwright-load-testing-sample
2-
Sample repository for Playwright load-testing test
1+
# node-js-playwright-browserstack
2+
This repo contains samples for running [Playwright](https://playwright.dev/docs/intro) tests on BrowserStack using the browserstack-node-sdk.
3+
4+
![BrowserStack Logo](https://d98b8t1nnulk5.cloudfront.net/production/images/layout/logo-header.png?1469004780)
5+
6+
## Setup
7+
8+
* 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
9+
* Set `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` as environment variables with your [BrowserStack Username and Access Key](https://www.browserstack.com/accounts/settings)
10+
* Run `npm i` to install the dependencies.
11+
* Update the same in `browserstack-load.yaml` file.
12+
13+
## Running your tests
14+
15+
- To run the sample tests in parallel across the platforms specified in the `browserstack-load.yaml`, run `npx browserstack-cli load run`.
16+
17+
## Notes
18+
* You can view your test results on the [BrowserStack Load-Testing dashboard](https://load.browserstack.com/projects)

browserstack-load.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# =============================
2+
# Set BrowserStack Credentials
3+
# =============================
4+
# Add your BrowserStack userName and accessKey here or set BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY as env variables.
5+
userName: BROWSERSTACK_USERNAME
6+
accessKey: BROWSERSTACK_ACCESS_KEY
7+
8+
# ======================
9+
# BrowserStack Reporting
10+
# ======================
11+
# The following parameters are used to set up reporting on BrowserStack Load Testing:
12+
# Set 'projectName' to the name of your project. Example: 'Product ABC'. Tests under the same projectName will be grouped together.
13+
projectName: Default Project
14+
15+
# Set 'testName' to the name of your test. Example: 'First Load Test'. Test runs with the same testName will be grouped together.
16+
testName: Default Test
17+
18+
# ======================
19+
# Set Load Configuration
20+
# ======================
21+
# The following parameters are used to set load configuration for your test:
22+
# Set 'testType' to the type of load test that you want to execute. Example:'Playwright', 'Selenium'. This is a required parameter.
23+
testType: Playwright
24+
25+
# Set 'vus' to the maximum number of virtual users to simulate during the test.
26+
vus: 1
27+
28+
# Set multiple regions from which you would want to generate the load (percent should total 100 across all loadzones).
29+
regions:
30+
- loadzone: us-east-1
31+
percent: 100
32+
33+
# Set language to the programming language used in your project. Example: 'java', 'nodejs'.
34+
language: nodejs
35+
36+
# Set framework to the test framework used in your Selenium project. Example: 'testng'.
37+
# framework: testng
38+
39+
# 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.
40+
# 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).
41+
files:
42+
dependencies:
43+
- ./package.json
44+
testConfigs:
45+
- ./playwright.config.js

0 commit comments

Comments
 (0)