Playwright Integration with BrowserStack.
- Clone the repo and run
cd playwright-java
- To run parallel tests, run
mvn -Dexec.mainClass="com.browserstack.PlaywrightParallelTest" -Dexec.classpathScope=test test-compile exec:java - To run sessions on emulated devices,
or
mvn -Dexec.mainClass="com.browserstack.PlaywrightIPhoneTest" -Dexec.classpathScope=test test-compile exec:javamvn -Dexec.mainClass="com.browserstack.PlaywrightPixelTest" -Dexec.classpathScope=test test-compile exec:java
You can specify contextOptions() from the below list: https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/server/deviceDescriptorsSource.json
-
Run
mvn -Dexec.mainClass="com.browserstack.PlaywrightSessionDetailsTest" -Dexec.classpathScope=test test-compile exec:javato check how to get session details.Using Language Bindings
- Run
mvn -Dexec.mainClass="com.browserstack.PlaywrightLocalUsingBindingsTest" -Dexec.classpathScope=test test-compile exec:java
Using Command-line Interface
- You have to download the BrowserStack Local binary from the links below (depending on your environment):
- Once you have downloaded and unzipped the file, you can initiate the binary by running the command:
./BrowserStackLocal --key YOUR_ACCESS_KEY - Once you see the terminal say "[SUCCESS]" You can now access your local server(s) in our remote browser”, your local testing connection is considered established.
- You can then run the sample Local test using
mvn -Dexec.mainClass="com.browserstack.PlaywrightLocalTest" -Dexec.classpathScope=test test-compile exec:java
- Run
Understand how many parallel sessions you need by using our Parallel Test Calculator
- You can view your test results on the BrowserStack Automate dashboard
