Skip to content

Commit

Permalink
fix: url option for iOS, add docs (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
sammoore authored Aug 14, 2024
1 parent 59e5c5d commit 73f41a1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Detox.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ let waitFor;
* * `reloadReactNative` - should be enabled for React Native applications.
* * `reuse` - reuse application for tests. By default, Detox reinstalls and relaunches app.
* * `registerGlobals` - (default: true) Register Detox helper functions `by`, `element`, `expect`, `waitFor` globally.
* * `url` - URL to open via deep-link each time the app is launched (android) or immediately afterwards (iOS). Useful for opening a bundle URL at the beginning of tests when working with Expo.
*
*/
class Detox extends Helper {
Expand Down Expand Up @@ -190,6 +191,10 @@ class Detox extends Helper {
await this.device.reloadReactNative();
} else {
await this.device.launchApp({ newInstance: true, url: this.options.url });

if (this.device.getPlatform() === 'ios' && this.options.url) {
await this.device.openURL({ url: this.options.url });
}
}
}

Expand Down

0 comments on commit 73f41a1

Please sign in to comment.