Run Playwright tests on iOS devices
Learn how to run your Playwright tests on iOS devices with BrowserStack Automate.
Prerequisites
- BrowserStack Username and Access key, which you can find in your account settings. If you have not created an account yet, you can sign up for a Free Trial or purchase a plan.
- NodeJS version 14 or higher is installed.
- Latest Playwright iOS compatible version is installed.
Playwright for iOS is currently in beta and supported only for NodeJS. Reach out to support to enable this feature.
Quickstart
To run your Playwright test suite with iOS devices on BrowserStack, perform the following steps:
Set access credentials
Set the environment variables BROWSERSTACK_USERNAME
and BROWSERSTACK_ACCESS_KEY
with your credentials as follows:
Alternatively, your can add your credentials to the browserstack.username
and browserstack.accessKey
capabilities in the fixtures.js
file.
Execute build on BrowserStack
You are now ready to run your build on BrowserStack. From the root directory of the project, run the following command:
View test results
View your tests on the BrowserStack Automate dashboard. To learn more about the dashboard, check the view test results document.
Understanding the test configurations
Set Browser-OS combination
You can set the iOS Browser-OS combination in the playwright.config.js
as shown:
Patching the capabilities dynamically
The patchIosCaps
function within the fixture.js
file facilitates dynamic patching of the capabilities according to the project name.
The following capabilities are not supported when running Playwright tests on iOS devices:
playwrightLogs
consoleLogs
resolution
geoLocation
Playwright on iOS devices supports limited Playwright commands. Reach out to support to know more about the supported commands.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
- RESOURCES
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!