[Appium] Progressive Web Apps on iOS

Progressive Web Apps (PWA) works as an app on iOS while the base is Web Site.

Appium allows you to automate, but it needs a few tricks.

  1. Establish a session with 1) autoLaunch: false and bundleId: 'com.apple.mobilesafari', or 2) without app and bundleId but with includeSafariInWebviews: true
  2. Launch the home screen with activating com.apple.springboard
  3. Click the PWA icon on the home screen
    • The PWA app cannot start via activation command by Appium since the app is safari browser. The bundle id is mobile safari.
  4. Change the context to WebView (if needed)
  5. Run scenario

Note: Appium 2.0 will drop the autoLaunch capabilities. So, to start an appium session without launching any apps, it needs to create a session without app and bundleId capabilities in iOS.

Native safaridriver launches Safari browser by default, so I guess only Appium can automate PWA apps as these steps so far.

Happy testing!

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.