Files
Detox/docs/APIRef.MockingOpenWithURL.md
T
fcc7bc7c3e build: deploy static website (#3075)
* Website: initial commit.

Clean install of Docusaurus website, following the
instructions from https://docusaurus.io/docs/installation.

* Website: update docusaurus configurations.

* Website: remove blog section.

* Website: replace docusaurus logos with Detox logos.

* Website: use Detox docs.

* Website: add content and change style.

* website.yml: add github action for website-deployment.

* Docs: fix links.

* Remove redundant label fields.

* Website: remove redundant markdown page.

* website/README.md: remove redundant file.

* website.yml: increase node version.

* fix: base url issue

* Website: replace icons.

Co-authored-by: Yaroslav Serhieiev <[email protected]>
2021-11-16 17:12:24 +02:00

951 B

id, slug, title, sidebar_label
id slug title sidebar_label
mocking-open-with-url api/mocking-open-with-url Mocking Open With URL (Deep Links) Mocking Open With URL (Deep Links)

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

Mocking App Launch With a URL

await device.launchApp({newInstance: true, url, sourceApp: bundleId}); // sourceApp is an optional iOS-only argument

Example

describe('launch app from URL', () => {
    it('should handle URL successfully', async () => {
      await device.launchApp({
        newInstance: true,
        url: 'scheme://some.url',
        sourceApp: 'com.apple.mobilesafari'
      });
      await expect(element(by.text('a label'))).toBeVisible();
    });
  });

Mocking Opening With a URL On a Launched App

iOS-only

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