Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Mobile Testing in the cloud

Mobile Testing in the cloud

Android has a fragmented ecosystem. There are devices out there with square screens or even no 3G antenna. It’s impossible to test on all of them. But if we write automated tests, then maybe we could run these tests on hundreds of real devices in the cloud. Let’s compare Espresso to Appium and Amazon Device Farm to Firebase Device Lab and see which of these we like more.

Presented at:
- Codecamp Iasi Autumn 2016
- MBLTdev Moscow 2016
- Codecamp Cluj Autumn 2016
- DevFest Romania 2016

Andrei Diaconu

November 25, 2016
Tweet

More Decks by Andrei Diaconu

Other Decks in Programming

Transcript

  1. 2 Options Simple Java Unit Tests UI tests Test components

    in isolation Super fast Simulate user interaction Slow and need Android
  2. +

  3. Inside man Outside man • Access to code • Can

    change anything • Can simulate situations • Uses accessibility • Simulates a user • Can run on any app
  4. driver .findElement(containsText("Favorites"))
 .click(); 
 driver.swipe(300, 300, 300, 600, 1500);
 


    assertTrue( driver .findElement(containsText("There are no Sessions"))
 .isDisplayed()); ... private By containsText(String text){
 return By.xpath("//*[contains(@text,'"+text+"')]");
 }
  5. driver .findElement(containsText("Favorites"))
 .click(); 
 driver.swipe(300, 300, 300, 600, 1500);
 


    assertTrue( driver .findElement(containsText("There are no Sessions"))
 .isDisplayed()); ... private By containsText(String text){
 return By.xpath("//*[contains(@text,'"+text+"')]");
 }
  6. driver .findElement(containsText("Favorites"))
 .click(); 
 driver.swipe(300, 300, 300, 600, 1500);
 


    assertTrue( driver .findElement(containsText("There are no Sessions"))
 .isDisplayed()); ... private By containsText(String text){
 return By.xpath("//*[contains(@text,'"+text+"')]");
 }
  7. driver .findElement(containsText("Favorites"))
 .click(); 
 driver.swipe(300, 300, 300, 600, 1500);
 


    assertTrue( driver .findElement(containsText("There are no Sessions"))
 .isDisplayed()); ... private By containsText(String text){
 return By.xpath("//*[contains(@text,'"+text+"')]");
 }
  8. Firebase codelab (including Jenkins integration): https://codelabs.developers.google.com/codelabs/firebase-test-lab/index.html Testing codelab (including Espresso):

    https://codelabs.developers.google.com/codelabs/android-testing/#0 Codecamp App: https://play.google.com/store/apps/details?id=ro.androidiasi.codecamp.iasi.live Android Iasi: http://androidiasi.ro Android Iasi Discussion Group: http://bit.ly/android-iasi Resources