|
1 | 1 | # ionic-e2e-react-webdriverio-appium |
2 | 2 | Example ReactJS App for Ionic v6 E2E Testing using WebdriverIO and Appium to Test On Device |
3 | 3 |
|
4 | | -### Overview |
| 4 | +## Overview |
5 | 5 | Looking to integrate e2e testing a an ionic-framework application and the [sample provided by Ionic](https://github.com/ionic-team/ionic-e2e-example) in written in Angular and it is based on cordova and not capacitor so I have started this project to figure things out |
6 | 6 |
|
7 | 7 | - sample based on the list template provided by ionic |
8 | 8 | - source code is in react js |
9 | 9 | - tests currently work in android emulator and in the webbrowser |
10 | 10 | - This still a work in progress but it is based on latest versions on Ionic and Capacitor so it shoul get on started better than the other sample |
11 | 11 | - The project hasn't been cleaned up, there are still some artifacts from the original Ionic Project |
12 | | -### IOS Quirk |
| 12 | + |
| 13 | +## IOS Quirk |
13 | 14 | For the application path for the IOS application, you will need to manually set that based on the specific device/emulator that are deploying to. unlike android it appears that the IOS build is directly to the device. |
14 | 15 |
|
15 | 16 | if you look at line 32 in the `wdio.ios.config.ts` you will see the path that you will need to change. To get the specific path i have run the build command with the `--verbose` flag to output the appropriate information |
16 | 17 | ``` |
17 | 18 | ionic capacitor run ios --target 1DB27F13-4EF3-4D45-A67B-88C69B53EF84 --verbose |
18 | 19 | ``` |
19 | 20 |
|
20 | | -### References |
| 21 | +## Android setup |
| 22 | + |
| 23 | +If you're starting from scratch, you'll need to set appium up on your system. |
| 24 | + |
| 25 | +Generally, you should follow the appium docs, but here's the short version. |
| 26 | + |
| 27 | +Install appium globally: |
| 28 | + |
| 29 | +`npm i --location=global appium` |
| 30 | + |
| 31 | +Install the Android driver: |
| 32 | + |
| 33 | +`appium driver install uiautomator2` |
| 34 | + |
| 35 | +Make sure you have a device created in Android Studio's Device Manager. |
| 36 | + |
| 37 | +Build the app as an APK and launch it on the device in the simulator. |
| 38 | + |
| 39 | +In `wdio.android.config.ts`, modify `appium:deviceName` to be your device's exact name, and change `appium:platformVersion` to your device's Android version. |
| 40 | + |
| 41 | +Also ensure the `appium:app` path is correct for your system. |
| 42 | + |
| 43 | +You can now run the tests: |
| 44 | + |
| 45 | +'npm run ionic-e2e:run:android` |
| 46 | + |
| 47 | +## References |
21 | 48 | - [WebdriverIO](https://webdriver.io/) |
22 | 49 | - [Appium](https://appium.io/) |
0 commit comments