Skip to main content
Be the first to run Playwright tests on real iOS browsers exclusively on BrowserStack. Try it now
No Result Found

Run Playwright tests on real iOS devices

Learn how to run your Playwright tests on real iOS devices with BrowserStack Automate.

Playwright test automation on real iOS devices is now supported on BrowserStack Automate. Test on 100+ iPhone and iPad device-browser combinations to catch Safari-specific issues that mobile emulation may miss. Integrate with your existing CI pipeline, and access logs and debugging artifacts for each test run.

The following video explains the challenges of iOS browser testing, introduces real iOS Safari support for Playwright on BrowserStack, and demonstrates how to get started.


Prerequisites

Currently supports Safari and Node.js. Support for additional browsers and languages will be available soon.

Quickstart

To run your Playwright test suite with iOS devices on BrowserStack, perform the following steps:

Clone sample repository

Clone our sample Git repository using the following commands:

Copy icon Copy

Set up the dependencies

Install the required dependencies by running the following command:

npm i

While configuring your browserstack.yml file, use the deviceName parameter and specify the devices parameters as shown below:

browserstack.yml
Copy icon Copy

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.

Copy icon Copy

Playwright for iOS supports all devices supported by Selenium.

Clone sample repository

Clone our sample Git repository using the following commands:

Copy icon Copy

Install dependencies

Install the required dependencies by running the following command:

Copy icon Copy

Set access credentials

Set the environment variables BROWSERSTACK_USERNAME and BROWSERSTACK_ACCESS_KEY with your credentials as follows:

Copy icon Copy

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:

Copy icon Copy

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 Android Browser-OS combination in the playwright.config.js as shown:

playwright.config.js
Copy icon Copy

Patching the capabilities dynamically

The patchMobileCaps function within the fixture.js file facilitates dynamic patching of the capabilities according to the project name.

fixture.js
Copy icon Copy

The following capabilities are not supported when running Playwright tests on iOS devices:
playwrightLogs
consoleLogs
resolution
geoLocation

Have any queries? Contact our support team.

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

Is this page helping you?

Yes
No

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!

Talk to an Expert
Download Copy Check Circle