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.
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();
});
});
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.