Hoppa till huvudinnehåll

deepLink

Öppna en deep link URL i mobilappen baserat på url och appens paketnamn (Android) eller bundle ID (iOS).

Användning
browser.deepLink(link, appIdentifier)
Parametrar
NamnTypDetaljer
linkstringDen deep link URL som ska öppnas i mobilappen. Det bör vara en giltig deep link URL (t.ex. myapp://path). Om det är en universell deep link, som kan användas för iOS, använd metoden browser.url("your-url").
appIdentifierstringVärdet av package (Android) eller bundleId (iOS) för appen som deep link ska öppna.
Exempel
deeplink.js
it('should open a deep link for the WDIO native demo app', async () => {
// open the Drag tab with a deep link (this the bundleId for the iOS Demo App)
await browser.deepLink('wdio://drag', 'org.reactjs.native.example.wdiodemoapp');

// Or open the Drag tab with a deep link (this the package name for the Android Demo App)
await browser.deepLink('wdio://drag', 'com.wdiodemoapp');

// Or if you want to have it "cross-platform" you can use it like this
await browser.deepLink('wdio://drag', browser.isIOS ? 'org.reactjs.native.example.wdiodemoapp' : 'com.wdiodemoapp');
})

Welcome! How can I help?

WebdriverIO AI Copilot