Skip to content

Sdk #5

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 9 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from 5 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: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @browserstack/asi-devs
* @browserstack/automate-public-repos
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
# node-js-playwright-browserstack

[Playwright](https://playwright.dev/docs/intro) Integration with 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 and run `cd node-js-playwright-browserstack`
* 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`
* Clone the repo `git clone -b sdk https://github.com/browserstack/node-js-playwright-browserstack.git` and run `cd node-js-playwright-browserstack`.
* Set `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` as environment variables with your [BrowserStack Username and Access Key](https://www.browserstack.com/accounts/settings) or update the same in `browserstack.yml` file.
* Run `npm i` to install the dependencies.

## Running your tests

- To run a sample test, run `npm run sample-test`

## Run tests on locally hosted websites
* Run `npm run sample-local-test`

Understand how many parallel sessions you need by using our [Parallel Test Calculator](https://www.browserstack.com/automate/parallel-calculator?ref=github)
- To run the sample tests in parallel across the platforms specified in the `browserstack.yml`, run `npm run sample-test`.

## Notes
* You can view your test results on the [BrowserStack Automate dashboard](https://www.browserstack.com/automate)
* Understand how many parallel sessions you need by using our [Parallel Test Calculator](https://www.browserstack.com/automate/parallel-calculator?ref=github)
3 changes: 3 additions & 0 deletions browserstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ browserstackLocal: true # <boolean> (Default false)
# forceLocal: true # <boolean> (Default: false) Set to true if you need to resolve all your traffic via BrowserStack Local tunnel.
# Entire list of arguments available here -> https://www.browserstack.com/docs/automate/selenium/manage-incoming-connections

framework: playwright
source: node-js-playwright-sample-sdk:v1

# ===================
# Debugging features
# ===================
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "v1.28_playwright_test",
"name": "node-js-playwright-browserstack",
"version": "1.0.0",
"description": "",
"main": "index.js",
Expand Down
2 changes: 1 addition & 1 deletion tests/bstack_test_add_to_cart.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { expect, test } = require('@playwright/test');

test('BStackDemo sample test 2', async ({ page }) => {
test('BStackDemo test add to cart', async ({ page }) => {
// visit the site
await page.goto('https://bstackdemo.com/');

Expand Down