You can mock opening the app from URL to test your app's deep link handling mechanism.
await device.launchApp({newInstance: true, url: url, sourceApp: bundleId}); //sourceApp is optionalExample:
describe('launch app from URL', () => {
before(async () => {
await device.launchApp({
newInstance: true,
url: 'scheme://some.url',
sourceApp: 'com.apple.mobilesafari'
});
});
it('should tap successfully', async () => {
await expect(element(by.text('a label'))).toBeVisible();
});
});await device.openURL({url: 'scheme://some.url', sourceApp: 'com.apple.mobilesafari'});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.