Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #29 from saucelabs/feat/add-deeplinking
Browse files Browse the repository at this point in the history
Add Deep linking
  • Loading branch information
wswebcreation authored Aug 18, 2019
2 parents 1b06e2a + c4fdfac commit 78cc30b
Show file tree
Hide file tree
Showing 45 changed files with 845 additions and 599 deletions.
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ The latest version of the iOS and Android app can be found [here](https://github
1. [Touch / Face ID](#touch--face-id)
1. [Enabling Touch / Face ID on Android emulators](#enabling-touch--face-id-on-android-emulators)
1. [Enabling Touch / Face ID on iOS simulators](#enabling-touch--face-id-on-ios-simulators)
1. [Deep linking](#deep-linking)
1. [Use with Android](#use-with-android)
1. [Use with iOS](#use-with-ios)
1. [Terminal](#terminal)
1. [With Safari](#with-safari)
1. [Testautomation](#testautomation)
1. [Building the app for the Sauce Labs Real Device Cloud (RDC)](#building-the-app-for-the-sauce-labs-real-device-cloud-rdc)
1. [Versioning the app](#versioning-the-app)
Expand Down Expand Up @@ -198,6 +203,53 @@ To enable this on iOS simulators you need to do the following (when you have a s

In the previous mentioned menu you can also select a (non)matching Touch / Face ID when the phone is asking for it.

## Deep linking
This app supports deep linking for iOS and for Android, this means that screens can directly be opened with a deep link.

The prefix deep link is `swaglabs://` and the following screens (with their arguments) can be used:

- **Swag overview screen:** `swag-overview/ids` where `ids` is a string of numbers from 0-5 separated with a `,`. For example `swag-overview/0,2`. The number represents a product.
- **Swag details screen:** `swag-item/id` where `id` is a number from 0-5. For example `swag-item/0`
- **Cart screen:** `cart/ids` where `ids` is a string of numbers from 0-5 separated with a `,`. For example `cart/0,2`. The number represents a product.
- **Personal info screen:** `personal-info/ids` where `ids` is a string of numbers from 0-5 separated with a `,`. For example `cart/0,2`. The number represents a product.
- **Checkout overview screen:** `checkout-overview/ids` where `ids` is a string of numbers from 0-5 separated with a `,`. For example `cart/0,2`. The number represents a product.
- **Complete screen:** `complete`
- **Webview screen:** `webview`

> **NOTE <br>**
> The *Swag overview | Details | Cart | Personal info | Checkout overview*-screens all need id(s). The id(s) are the numbers of the products of the `InventoryData.ITEMS` in [this](src/js/data/inventory-data.js) file.
> The files are in an `array` and an `array` starts counting from `0`. This means that if you need the first product, you need to provide the id `0` and if you need to the last product you need to provide the id `5`.

For how to run the deep link automation script see [Deep Linking](./docs/AUTOMATION.md#deep-linking).

### Use with Android
Open a terminal and add the following

```bash
# This will open the Checkout overview screen with 2 products in it
adb shell am start -W -a android.intent.action.VIEW -d "swaglabs://checkout-overview/1,2"
```

### Use with iOS
There are 2 ways of using deep links with iOS, through a terminal or through Safari

### Terminal
Open a terminal and add the following

```bash
# This will open the Swag overview screen with 2 products in it
xcrun simctl openurl booted swaglabs://swag-overview/0,1
```

#### With Safari
Open Safari and type the following

```bash
swaglabs://swag-overview/0,1
```

It will prompt a dialog asking you to open the app, select *Yes* and it will open the screen you selected.

## Testautomation
More information about:

Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ android {
applicationId "com.swaglabsmobileapp"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 2
versionName "2.0.0"
versionCode 3
versionName "2.1.0"
}
splits {
abi {
Expand Down
10 changes: 9 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize"
android:exported="true"/>
android:exported="true"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="swaglabs" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
</application>

Expand Down
18 changes: 18 additions & 0 deletions docs/AUTOMATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
1. [Using Touch / Face ID during automation](#using-touch--face-id-during-automation)
1. [Run on Android](#run-on-android)
1. [Run on iOS](#run-on-ios)
1. [Deep linking](#deep-linking)
1. [FAQ](#faq)

# Intro
Expand Down Expand Up @@ -214,6 +215,23 @@ Running a test on an iOS simulator can be done with this command
npm run ios.local -- --spec=tests/e2e/spec/biometric/touch.face.id.spec.js
```
## Deep linking
To run the deep link automation script do the following:
```bash
# For Android emulator
npm run android.local -- --spec=tests/e2e/spec/extra/deep.link.spec.js
# For Android real device
npm run android.rdc -- --spec=tests/e2e/spec/extra/deep.link.spec.js
# For iOS simulator
npm run ios.local -- --spec=tests/e2e/spec/extra/deep.link.spec.js
# For iOS real device
npm run ios.rdc -- --spec=tests/e2e/spec/extra/deep.link.spec.js
```
## FAQ
### `An unknown server-side error occurred while processing the command` while sending text to an iOS simulator
Check [this](https://gist.github.com/wswebcreation/6ac27598718eb001cd208dd691db2a84) article on how to fix it.
Expand Down
1 change: 0 additions & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ target 'SwagLabsMobileApp' do
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/React'
pod 'React-DevSupport', :path => '../node_modules/react-native/React'
pod 'React-fishhook', :path => '../node_modules/react-native/Libraries/fishhook'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
Expand Down
150 changes: 72 additions & 78 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,82 +11,80 @@ PODS:
- DoubleConversion
- glog
- glog (0.3.5)
- React (0.60.4):
- React-Core (= 0.60.4)
- React-DevSupport (= 0.60.4)
- React-RCTActionSheet (= 0.60.4)
- React-RCTAnimation (= 0.60.4)
- React-RCTBlob (= 0.60.4)
- React-RCTImage (= 0.60.4)
- React-RCTLinking (= 0.60.4)
- React-RCTNetwork (= 0.60.4)
- React-RCTSettings (= 0.60.4)
- React-RCTText (= 0.60.4)
- React-RCTVibration (= 0.60.4)
- React-RCTWebSocket (= 0.60.4)
- React-Core (0.60.4):
- React (0.60.5):
- React-Core (= 0.60.5)
- React-DevSupport (= 0.60.5)
- React-RCTActionSheet (= 0.60.5)
- React-RCTAnimation (= 0.60.5)
- React-RCTBlob (= 0.60.5)
- React-RCTImage (= 0.60.5)
- React-RCTLinking (= 0.60.5)
- React-RCTNetwork (= 0.60.5)
- React-RCTSettings (= 0.60.5)
- React-RCTText (= 0.60.5)
- React-RCTVibration (= 0.60.5)
- React-RCTWebSocket (= 0.60.5)
- React-Core (0.60.5):
- Folly (= 2018.10.22.00)
- React-cxxreact (= 0.60.4)
- React-jsiexecutor (= 0.60.4)
- yoga (= 0.60.4.React)
- React-cxxreact (0.60.4):
- React-cxxreact (= 0.60.5)
- React-jsiexecutor (= 0.60.5)
- yoga (= 0.60.5.React)
- React-cxxreact (0.60.5):
- boost-for-react-native (= 1.63.0)
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- React-jsinspector (= 0.60.4)
- React-DevSupport (0.60.4):
- React-Core (= 0.60.4)
- React-RCTWebSocket (= 0.60.4)
- React-fishhook (0.60.4)
- React-jsi (0.60.4):
- React-jsinspector (= 0.60.5)
- React-DevSupport (0.60.5):
- React-Core (= 0.60.5)
- React-RCTWebSocket (= 0.60.5)
- React-jsi (0.60.5):
- boost-for-react-native (= 1.63.0)
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- React-jsi/Default (= 0.60.4)
- React-jsi/Default (0.60.4):
- React-jsi/Default (= 0.60.5)
- React-jsi/Default (0.60.5):
- boost-for-react-native (= 1.63.0)
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- React-jsiexecutor (0.60.4):
- React-jsiexecutor (0.60.5):
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- React-cxxreact (= 0.60.4)
- React-jsi (= 0.60.4)
- React-jsinspector (0.60.4)
- React-cxxreact (= 0.60.5)
- React-jsi (= 0.60.5)
- React-jsinspector (0.60.5)
- react-native-biometrics (1.6.0):
- React
- react-native-splash-screen (3.2.0):
- React
- react-native-webview (5.12.1):
- React
- React-RCTActionSheet (0.60.4):
- React-Core (= 0.60.4)
- React-RCTAnimation (0.60.4):
- React-Core (= 0.60.4)
- React-RCTBlob (0.60.4):
- React-Core (= 0.60.4)
- React-RCTNetwork (= 0.60.4)
- React-RCTWebSocket (= 0.60.4)
- React-RCTImage (0.60.4):
- React-Core (= 0.60.4)
- React-RCTNetwork (= 0.60.4)
- React-RCTLinking (0.60.4):
- React-Core (= 0.60.4)
- React-RCTNetwork (0.60.4):
- React-Core (= 0.60.4)
- React-RCTSettings (0.60.4):
- React-Core (= 0.60.4)
- React-RCTText (0.60.4):
- React-Core (= 0.60.4)
- React-RCTVibration (0.60.4):
- React-Core (= 0.60.4)
- React-RCTWebSocket (0.60.4):
- React-Core (= 0.60.4)
- React-fishhook (= 0.60.4)
- React-RCTActionSheet (0.60.5):
- React-Core (= 0.60.5)
- React-RCTAnimation (0.60.5):
- React-Core (= 0.60.5)
- React-RCTBlob (0.60.5):
- React-Core (= 0.60.5)
- React-RCTNetwork (= 0.60.5)
- React-RCTWebSocket (= 0.60.5)
- React-RCTImage (0.60.5):
- React-Core (= 0.60.5)
- React-RCTNetwork (= 0.60.5)
- React-RCTLinking (0.60.5):
- React-Core (= 0.60.5)
- React-RCTNetwork (0.60.5):
- React-Core (= 0.60.5)
- React-RCTSettings (0.60.5):
- React-Core (= 0.60.5)
- React-RCTText (0.60.5):
- React-Core (= 0.60.5)
- React-RCTVibration (0.60.5):
- React-Core (= 0.60.5)
- React-RCTWebSocket (0.60.5):
- React-Core (= 0.60.5)
- RNCAsyncStorage (1.6.1):
- React
- RNGestureHandler (1.3.0):
Expand All @@ -95,7 +93,7 @@ PODS:
- React
- RNVectorIcons (6.6.0):
- React
- yoga (0.60.4.React)
- yoga (0.60.5.React)

DEPENDENCIES:
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
Expand All @@ -105,7 +103,6 @@ DEPENDENCIES:
- React-Core (from `../node_modules/react-native/React`)
- React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
- React-DevSupport (from `../node_modules/react-native/React`)
- React-fishhook (from `../node_modules/react-native/Libraries/fishhook`)
- React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
Expand Down Expand Up @@ -147,8 +144,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/cxxreact"
React-DevSupport:
:path: "../node_modules/react-native/React"
React-fishhook:
:path: "../node_modules/react-native/Libraries/fishhook"
React-jsi:
:path: "../node_modules/react-native/ReactCommon/jsi"
React-jsiexecutor:
Expand Down Expand Up @@ -197,33 +192,32 @@ SPEC CHECKSUMS:
DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2
Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
glog: 1f3da668190260b06b429bb211bfbee5cd790c28
React: ff7ee2ae5ee1c1d9ae2183b4111045b25294bb01
React-Core: 8e0ea421cae5609d2562850f98421b15030476fa
React-cxxreact: 326880209990151a7182a813311054e9772ba510
React-DevSupport: e9f10e6721e78e87622fc985db695c0c0168db8a
React-fishhook: 1f0e5b08449403fa75c3fb3881a0beefbada14af
React-jsi: 21d3153b1153fbf6510a92b6b11e33e725cb7432
React-jsiexecutor: 7549641e48bafae7bfee3f3ea19bf4901639c5de
React-jsinspector: 73f24a02fa684ed6a2b828ba116874a2191ded88
React: 53c53c4d99097af47cf60594b8706b4e3321e722
React-Core: ba421f6b4f4cbe2fb17c0b6fc675f87622e78a64
React-cxxreact: 8384287780c4999351ad9b6e7a149d9ed10a2395
React-DevSupport: 197fb409737cff2c4f9986e77c220d7452cb9f9f
React-jsi: 4d8c9efb6312a9725b18d6fc818ffc103f60fec2
React-jsiexecutor: 90ad2f9db09513fc763bc757fdc3c4ff8bde2a30
React-jsinspector: e08662d1bf5b129a3d556eb9ea343a3f40353ae4
react-native-biometrics: 88283317475c8269cd21cea24a9a734555d61f4c
react-native-splash-screen: 200d11d188e2e78cea3ad319964f6142b6384865
react-native-webview: 5036ed4a973ad1deeeff118262d2df7b60b3419d
React-RCTActionSheet: 9f71d7ae3e8fb10e08d162cbf14c621349dbfab3
React-RCTAnimation: 981d8c95b0e30918a9832ccac32af83562a27fae
React-RCTBlob: 21e73d1020a302a75fed30dbaee9f15287b80baa
React-RCTImage: c0bc6ac0926517b6fb7e4c279b04843113e99d1d
React-RCTLinking: 1af3f3c59114bed3deec0107c62e7efad0932ee5
React-RCTNetwork: 35df9de46e19cda5c56380be1a7759b9b8cb2fcd
React-RCTSettings: f580504c2cd1f44e25add10fb9ed3954f67f8ac5
React-RCTText: e0f224898b13af9aa036ea7cb3d438daa68c1044
React-RCTVibration: 0bea40cd51bd089bd591a8f74c86e91fdf2666c5
React-RCTWebSocket: 163873f4cdd5f1058a9483443404fc3801581cb6
React-RCTActionSheet: b0f1ea83f4bf75fb966eae9bfc47b78c8d3efd90
React-RCTAnimation: 359ba1b5690b1e87cc173558a78e82d35919333e
React-RCTBlob: 5e2b55f76e9a1c7ae52b826923502ddc3238df24
React-RCTImage: f5f1c50922164e89bdda67bcd0153952a5cfe719
React-RCTLinking: d0ecbd791e9ddddc41fa1f66b0255de90e8ee1e9
React-RCTNetwork: e26946300b0ab7bb6c4a6348090e93fa21f33a9d
React-RCTSettings: d0d37cb521b7470c998595a44f05847777cc3f42
React-RCTText: b074d89033583d4f2eb5faf7ea2db3a13c7553a2
React-RCTVibration: 2105b2e0e2b66a6408fc69a46c8a7fb5b2fdade0
React-RCTWebSocket: cd932a16b7214898b6b7f788c8bddb3637246ac4
RNCAsyncStorage: 2e2e3feb9bdadc752a026703d8c4065ca912e75a
RNGestureHandler: 5329a942fce3d41c68b84c2c2276ce06a696d8b0
RNLocalize: 62a949d2ec5bee0eb8f39a80a48f01e2f4f67080
RNVectorIcons: 0bb4def82230be1333ddaeee9fcba45f0b288ed4
yoga: c2c050f6ae6e222534760cc82f559b89214b67e2
yoga: 312528f5bbbba37b4dcea5ef00e8b4033fdd9411

PODFILE CHECKSUM: 99ee5ad04eea98bac0ea8ad5fa550ca3e926c607
PODFILE CHECKSUM: 7f8731f09421fdb6f1a8ead28cf507c1b57488e9

COCOAPODS: 1.7.5
Loading

0 comments on commit 78cc30b

Please sign in to comment.