Skip to content

Latest commit

 

History

History
35 lines (26 loc) · 1.17 KB

APIRef.MockingOpenFromURL.md

File metadata and controls

35 lines (26 loc) · 1.17 KB
id title
APIRef.MockingOpenFromURL
Mocking Open from URL (Deep Links)

You can mock opening the app from URL to test your app's deep link handling mechanism.

Mocking App Launch from a URL

await device.relaunchApp({url: url, sourceApp: bundleId}); //sourceApp is optional

Example:

describe('relaunchApp', () => {
    before(async () => {
      await device.relaunchApp({url: 'scheme://some.url', sourceApp: 'com.apple.mobilesafari'});
    });

    it('should tap successfully', async () => {
      await expect(element(by.text('a label'))).toBeVisible();
    });
  });

Mocking Opening URL on a Launched App

await device.openURL({url: 'scheme://some.url', sourceApp: 'com.apple.mobilesafari'});

iOS Requirements

This API requires that the application:openURL:options: method is implemented in the application delegate. The legacy deprecated application:openURL:sourceApplication:annotation: method is not supported.