Sample Playwright tests to run on BrowserStack
You can now run your Playwright tests on the BrowserStack infrastructure. Porting your existing Playwright tests to run on BrowserStack, can be done in a matter of minutes.
This guide walks you through running a sample Playwright test on BrowserStack and then goes on to run tests on privately hosted websites and also shows cross-browser tests run in parallel to speed up the build execution.
You need BrowserStack credentials to be able to run Playwright tests. You have to replace YOUR_USERNAME and YOUR_ACCESS_KEY in the sample scripts in this repository with your BrowserStack credentials which can be found in your Account Settings page.
Alternatively, you can set the environment variables BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY with your credentials and all the scripts in this repository should work fine
- Clone this repository
- Install the dependencies using
npm install - Run the
npm run bTestthis will execute the Test in BrowserStack - Run the
npm run testthis will execute the Test in local Chrome browser in Headed mode