The beat ride of mobile automation @#4 MoT Meetup, Athens
1. The Beat Ride
Of
Mobile Automation
Vaso Giamarelou
Software Engineer In Test @BEAT
v.giamarelou@thebeat.co
2. MOBILE TEST AUTOMATION
ASPECTS
● Screen sizes
● Device Settings
● Connection types
● Power Consumption/Battery Life
● OS Version Fragmentation
3. THE BEAT CHALLENGE
● Two different applications
○ Driver & Passenger
● Mobile Automated suite should
include scenarios where both
apps are expected to interact
with each other
4. THE OPTIONS
1. SELENIUM GRID FOR APPIUM
● A central ‘hub’ receives test
requests and distributes them to the
nodes
● Reduce execution time on
single-device tests using multiple
devices with different hardware
capabilities or OS versions,
executing in parallel
5. THE OPTIONS
2. DOCKER CONTAINER FOR EACH DEVICE
● Create additional docker containers
for each device
● The two devices (one for each app)
need to be ‘synchronised’
● complex, error prone and definitely
not scalable.
6. DYNAMIC APPIUM SERVERS
● Spawn an Appium Server per app (driver or
passenger)
● Assign the required ‘DeviceCapabilities’,
which specify whether an object is
supposed to be used by Driver or Passenger
application.
7. WHAT WE HAVE
● A Single unified Cucumber scenario
● Sequentially flow on both applications
● An Appium driver object for each step definition
● Prefixed Gherkin Steps depending on the
device/role (e.g “Passenger enters a valid
Phone” or “Driver enters a valid Phone”)
8. ● Appium port
● Device Id
● Client (the application you want
to start)
1.START MULTIPLE APPIUM SERVERS
2.ASSIGN CAPABILITIES
● Android Capabilities (e.g udid, appPackage, appActivity)
● iOS Capabilities(e.g udid, xcodeOrgId, xcodeSigningId)
9. ● Cucumber, for BDD-styled scenarios
● Java, for implementing Gherkin Steps
● Appium, for Automating mobile
devices/emulators/simulators
● TestNG, as a Test Runner
● Maven, as a Build Tool
THE TECHNOLOGIES WE USE
10. CUCUMBER FILE
Scenario: Passenger searches for Driver, then cancels
Given Driver is at the Status Online Screen
And Passenger is at Pick Up Screen
When Passenger taps Set Pickup Button
And Passenger types a valid Dropoff address "Mar Pacifico Sur 404"
And Passenger taps Search for the Address
Then Passenger Address Results are displayed
And Passenger taps Find a Beat
And Driver is at the Request Screen
When Passenger swipes to cancel AD
Then Driver is at the Status Online Screen
And Passenger is at Start Ride Screen
11. STEP DEFINITIONS FOR DRIVER
@AndroidFindBy(accessibility = "goOfflineTopBtn")
@iOSFindBy(accessibility = "goOfflineTopBtn")
public RemoteWebElement goOffline;
@When("^Driver is at the Status Online Screen$")
public void driverIsAtTheStatusOnlineScreen() {
waitFor(dDriver, 5, goOffline);
}
STEP DEFINITIONS FOR PASSENGER
@AndroidFindBy(id = "pickUpButton")
@iOSFindBy(accessibility = "setPickupBtn")
public RemoteWebElement pickUpButton;
@Then("^Passenger is at Pick Up Screen$")
public void passengerIsAtPickUpScreen() {
waitFor(pDriver, 5, pickUpButton);
}