Vai al contenuto principale

deepLink

Apri un URL di deep link nell'app mobile basato sull'url e sul nome del pacchetto dell'app (Android) o sull'ID del bundle (iOS).

Utilizzo
browser.deepLink(link, appIdentifier)
Parametri
NomeTipoDettagli
linkstringL'URL del deep link che dovrebbe essere aperto nell'app mobile. Dovrebbe essere un URL di deep link valido (es. myapp://path). Se si tratta di un deep link universale, che può essere utilizzato per iOS, usa il metodo browser.url("your-url").
appIdentifierstringIl valore del package (Android) o bundleId (iOS) dell'app che il deep link dovrebbe aprire.
Esempio
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