Execute Tests - Local Lab
Now that we have our tests written, lets execute it (It is assumed that you have connected your devices through USB or Wi-Fi by this time)
Start appium server
- Identify the device using adb devices (you should have connected the device either through usb or wifi by this time. See instructions on how to in this section
- start appium server on the port (same port that was defined for the device in devices.yaml file) and also specify the bootstrap port (at least 10 ports apart)
Anyones-Mac-mini:~ pmacharl$ adb devices
List of devices attached
ZX1B222FCD device
Anyones-Mac-mini:~ pmacharl$ appium -p 4778 -bp 4789 -U ZX1B222FCD
info: Welcome to Appium v1.4.11 (REV 8cf8311f00e59a2b10fde1834fcf6d5ace6fbcd0)
info: Appium REST http interface listener started on 0.0.0.0:4778
info: [debug] Non-default server args: {"udid":"ZX1B222FCD","port":4778,"bootstrapPort":4789}
info: Console LogLevel: debug
Execute
The parameter DEVICE or EMULATOR is mandatory since a target is required to run the test. If none is specified, validation error is raised. The permissible values are the keys inside the files devices.yaml/emulators.yaml
Example 1: DEVICE=motorola-google-ZX1B222FCD
Example 2: EMULATOR=Nexus_4_API_23_x86
Execute Settings scenario on device
bundle exec cucumber features/ci_android.feature:5 DEVICE=motorola-google-ZX1B222FCD
Execute open login screen
bundle exec cucumber features/ci_android.feature:9 DEVICE=motorola-google-ZX1B222FCD
Add Contact scenario
bundle exec cucumber features/ci_android.feature:15 DEVICE=motorola-google-ZX1B222FCD
Take screenshot scenario
bundle exec cucumber features/ci_android.feature:21 DEVICE=motorola-google-ZX1B222FCD
Video of execution
The full video of execution is here.
The device screen is exported and hence you can see both the server and target execution in one screen. That is one of the challenges demonstrating the automation value on the mobile side. For web, since the browser launches on the machine itself, it is relatively easier.
I need more explanation
Please write to [email protected]