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

Mobile automation state 2019

dmle
February 23, 2019

Mobile automation state 2019

dmle

February 23, 2019
Tweet

More Decks by dmle

Other Decks in Technology

Transcript

  1. Agenda ▣ Available testing tools ▣ New driver and plugin

    from Appium ▣ AndroidX reboots native testing ▣ Tests distribution and RDC in Native iOS ▣ Blitz: Appium vs Native tools ▣ Points to consider on tool selection 3
  2. Platform Application type Language Require source Dev Appium Android,iOS Native,

    Web, Hybrid Any* No OSS Espresso Android Native,Hybrid Kotlin,Java Yes OSS* XCUITest iOS Native Swift,ObjC Yes Closed Detox Android,iOS Native Javascript No OSS UI Test Android,iOS Native,Hybrid C# No Closed
  3. Android drivers history 9 ▣ February 2013 □ Appium-android-driver ▣

    April 2013 □ Appium-selendroid-driver ▣ July 2013 □ Appium-chromedriver ▣ November 2016 □ Appium-uiautomator2-driver ▣ October 2018 □ Appium-espresso-driver
  4. How it works? 11 settings Espresso server AUT NanoHttpD Still

    the same black-box tool automationName: espresso
  5. Features & improvements ▣ Check Idle state 12 ▣ New

    locator strategy □ AndroidViewTag ▣ New mobile commands □ backdoor {target, methods, elementId} □ scrollToPage {element, scrollToPage, smoothScroll} □ uiautomator {strategy, locator, action} ▣ 20% faster vs UiAutomator2
  6. Adding your plugin 1. Install plugin as Node module npm

    i -g my-chart-test-plugin 15 2. Start session driver = wd.promiseChainRemote({ ... customFindModules: {my-plugin: my-chart-test-plugin} }); 3. Find element driver.findElement('-custom', 'my-plugin:barChart');
  7. 23 @RunWith(AndroidJUnit4::class) class LoginTest { @Test fun loginWithValidCredentials() { val

    scenario = ActivityScenario.launch(LoginActivity::class.java) scenario.onActivity { activity -> onView(withId(R.id.email)).perform(typeText(email)) onView(withId(R.id.password)).perform(typeText(password)) onView(withId(R.id.login)).perform(click()) } assertThat(getIntents().first()) .hasComponentClass(HomeActivity::class.java) } }
  8. 27 Real device How it works? Each test runner creates

    a clone of the original simulator
  9. XCUITest is finally on RDC 2. Build ipa files: main

    app and tests 28 4. Download cloud test runner (JAR file) 3. Upload files to cloud provider 5. Run JAR to start testing java -jar runner.jar --apikey 123ABC --device iPhoneXS 1. Decide on iOS version to test
  10. 29 class RecipesListTest { private lazy var cells = XCUIApplication().cells

    func testRecipesList() { for i in 0..<cells.count { let cell = cells.element(boundBy: i) let texts = cell.staticTexts XCTAssertEqual(texts.element(boundBy: 0).label, exp[i].title) XCTAssertEqual(texts.element(boundBy: 1).label, exp[i].desc) if i % 2 != 0 { cell.swipeUp() } ...
  11. Blitz: Tool Advantages ▣ Any language ▣ Speed 31 ▣

    Flexibility ▣ Community ▣ Selenoid ▣ Extensibility ▣ Easy start ▣ Stability ▣ Documentation ▣ Mocking back-end ▣ Platform standard ▣ Easy integration Appium Espresso/XCUITest
  12. Clear points for your choice ▣ Single platform ▣ 2

    Platforms + Web 32 ▣ Component testing ▣ Dev team does QA ▣ Part of CD pipeline ▣ Visual Testing ▣ Source restriction ▣ Several AUTs Appium Espresso/XCUITest
  13. Appium weakness shows up in 33 ▣ Custom UI components

    ▣ Views with heavy structure ▣ Animations ▣ Scaling / Resources usage
  14. Native tools still not good at ▣ Runners/Matchers customization ▣

    34 ▣ New release frequency ▣ Community ▣ Integrations (e.g. XCode server)
  15. ‘’ 35 No winner because there is no competition. Both

    easy to start and integrate, you need to think about which tool fits better your app, process and testing goals.
  16. Create POC Define goals and work on pilot project Make

    decision Build automation project on top of your POC Pros vs Cons Stability, Limitations, Integration, Support 36