all repos — caroster @ 7ce6d4879bd581f8a7a3ab70053eff5ee9bdeffe

[Octree] Group carpool to your event https://caroster.io

backend/e2e/docs/mobile-chrome.md (view raw)

 1### Mobile Chrome
 2
 3To run the tests with Mobile Chrome on Android Simulator, follow these steps:
 4
 51. Download [Android Studio](https://developer.android.com/studio/) and on first
 6   start, follow the instructions to install the Android SDK and Emulator.
 7
 8   **Please Note:**  
 9   To be able to use a custom `/etc/hosts` file requires mounting the root file
10   system as writable, which requires a supported system image for the Android
11   Virtual Device (AVD), e.g.:
12
13   > Android 9 "Pie" (Google APIs)
14
15   System images for Android 10 "Q" or system images including the Google Play
16   store do not support mounting the root file system as writable.  
17   See also John Wu's
18   [Twitter post](https://twitter.com/topjohnwu/status/1170404631865778177) on
19   Android 10's file system format.
20
212. Add the following lines to your `~/.profile` to make the JDK included in
22   Android Studio and the installed Android SDK available to
23   [Appium](https://appium.io/):
24
25   ```sh
26   export JAVA_HOME='/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home'
27   export PATH="$JAVA_HOME/bin:$PATH"
28   export ANDROID_HOME=~/Library/Android/sdk
29   ```
30
313. Install [Node.JS](https://nodejs.org/) via [Homebrew](https://brew.sh/):
32
33   ```sh
34   brew install node
35   ```
36
374. Make sure the necessary [Appium](https://appium.io/) dependencies for Android
38   testing are installed:
39
40   ```sh
41   npx appium-doctor --android
42   ```
43
445. Install [Appium](https://appium.io/) as global NPM package:
45
46   ```sh
47   npm install -g appium
48   ```
49
506. Start `appium` with the provided helper script:
51
52   ```sh
53   bin/appium.sh
54   ```
55
56   This script is configured for
57   [Automatic discovery of compatible Chromedriver](https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/web/chromedriver.md/#automatic-discovery-of-compatible-chromedriver)
58   and will download a `chromedriver` version compatible with the version of
59   Chrome running on the Android device.
60
617. Start the Android Virtual Device with a custom `/etc/hosts` file:
62
63   ```sh
64   bin/android-emulator.sh -hosts etc/android.hosts
65   ```
66
67   **How to update the installed Google Chrome version:**
68
69   - Download a Google Chrome APK (Android Application Package) for the
70     architecture of your emulated device (e.g. `x86`), e.g. from
71     [APK Mirror](https://www.apkmirror.com/apk/google-inc/chrome/).
72   - Drag&drop the APK file into the emulator window to install it or
73     alternatively, install it via command-line:
74     ```sh
75     adb install com.android.chrome_*.apk
76     ```
77
788. Run the tests with Mobile Chrome:
79
80   ```sh
81   docker-compose run --rm wdio conf/mobile-chrome.js
82   ```
83
84   To run the tests in landscape orientation, provide the `ORIENTATION`
85   environment variable:
86
87   ```sh
88   ORIENTATION=LANDSCAPE docker-compose run --rm wdio conf/mobile-chrome.js
89   ```