DCAST Meetup - Washington, DC Feb 2016

16
Mobile Grid - Getting Starte d DCAST Meetup - Washington, DC February 10, 2016

Transcript of DCAST Meetup - Washington, DC Feb 2016

Mobile Grid - Getting Started

DCAST Meetup - Washington, DC February 10, 2016

The Mobile Grid• Get test results as quickly as possible by parallelizing

your tests.

• Validate different os versions, manufacturers, locales & screen sizes simultaneously.

• Capture critical metadata for reporting.

• Flexibility of accessing your devices locally via adb or instruments.

• You don’t expose your app or sensitive data to the cloud.

What I’ll demo…• Getting your connected devices programmatically.

• Launching Grid hub & Appium nodes programmatically.

• Capturing screenshots, hub log, appium log, video and logcat data for reporting.

• Running tests distributed.

• Running tests in parallel.

• Leveraging your test runs with cloud test services. e.g. Sauce Labs.

• Reduce your runtime costs by only executing selected scenarios.

• Generating the Allure report.

• Lets briefly look at the code…

Appium Server & Nodes Methods

ADB Methods (Video and Logcat)

Rake Task

Spec Helper

Spec Example

• Run the examples:

• Distributed: rake android[dist]

• https://www.dropbox.com/s/8md7ihp2i6pc5pw/distributed.mov?dl=0

• Parallel: rake android[parallel]

• https://www.dropbox.com/s/o7f6gb7chq51xya/parallel.mov?dl=0

• Distributed: rake android[dist,sauce] * run tests tagged :sauce in Sauce Labs.

• Generate the Allure report.

• allure generate report output/allure/*

• allure report open

• https://www.dropbox.com/s/a8g0erkabpa5zny/signup_failure.mov?dl=0

• Wunderlist Mobile Grid

• https://www.dropbox.com/s/y5xsmnxfldguzr0/grid-trimmed.mov?dl=0

• https://www.dropbox.com/s/675nonhixzq0ct7/emulators.mov?dl=0

Demo Time

Wunderlist Mobile Grid

• Mac Pro - 3.5 GHz 6-Core - 32 GB Ram.

• OSX Server with performance mode enabled.

• Two Anker 9 Port USB Hubs.

• Energenie programmable power strip. (Reboots hubs, router, Mac)

• Blink(1) programmable usb light to display CI status.

• Jenkins - builds and runs smoke tests on every commit.

CI Machine Specs

That is great & all but reporting is key!

Challenges• Adb disconnects.

• I solved this by programmatically rebooting USB hubs before every test run.

• WiFi disconnects.

• I solved this by toggling airplane mode on/off prior to every test run.

• Other Solutions:

• Reverse USB tethering. (requires rooting.)

• WiFi connection apps.

• Using multiple routers on different broadcasting channels.

• Spreading the devices apart.

• Alternatives to real devices:

• Android Studio emulators.

• Cannot video record. * I have a solution for this and will open source it.

• Emulators with VNC clients to record test sessions. (Facebook does this.)

• A big plus IMO is that you have access your apps local files (database) without rooting.

• Can use up a significant amount of memory depending on specs and the number running.

• Using Genymotion emulators. It’s the closest vm software to a real device.

• Has video recording but no API or CLI to start the recording. :/

• Using multiple Docker containers running emulator nodes. (Similar setup to the selenium web Docker containers)

• Some devices just behave erratically. (random reboots, cannot connect to adb, wonky text output, battery issues)

Thank You!

• email: [email protected]

• twitter: @isonic1

• https://github.com/isonic1/appium-mobile-grid