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

Maestro - UI testing framework

Maestro - UI testing framework

The talk was discussing the implementation of Maestro UI testing framework to address the challenge of time-consuming regression testing in the context of Android and iOS platforms.

This talk showcased how Maestro streamlined the regression testing process, enhancing efficiency and test coverage across platforms.

Zhanibek Marshal

October 11, 2023
Tweet

More Decks by Zhanibek Marshal

Other Decks in Programming

Transcript

  1. Topic Zhanibek Marshal Senior Engineer at Trade Republic © TRADE

    REPUBLIC BANK 2023 | Paparazzi: Snapshot testing made easy Hello again 👋 • Twitter: @megasuperhero • Mastodon: @[email protected] • TR engineering blog: https://engineering.traderepublic.com/ 2
  2. © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework

    01. How we ended up to Maestro? Brief overview of the investigation objectives. 02. Integration of Maestro Explanation of the steps taken to integrate Maestro into Android project and iOS 03. Writing Test Case Flows Overview of the approach to writing test case flows using Maestro 04. Maestro Studio An overview of Maestro Studio, the integrated development environment (IDE) for creating Maestro test cases. 05. Maestro Cloud Introduction to Maestro Cloud, a platform for test execution and collaboration. 06. Learnings All views mine, no one else’s. 07. Q&A 3
  3. How we ended up to Maestro? Brief overview of the

    investigation objectives. © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework 4
  4. Our regression testing* started to take a lot of time

    on each release train *manual That's why we proposed Maestro as one of the options. “ © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework 5
  5. Topic We have over 100 test cases to verify before

    we deploy a new version © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework 6
  6. Then I heard* that Maestro is very simple and effective

    solution for writing UI tests *from colleagues and at Droidcon Berlin 23 “ © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework 7
  7. Integration of Maestro Explanation of the steps taken to integrate

    Maestro into Android project © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework 9
  8. Topic Run the following command to install Maestro on Mac

    OS, Linux or Windows (WSL) Install Maestro © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework 10
  9. Topic Will automatically detect and use any local emulator or

    physical* device. *USB connection has an issue[829] Run Maestro test © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework 11
  10. Topic Had to find a solution to resolve an One

    Time Password(OTP) on test environment Automatic OTP retriever © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework 12
  11. Topic Before running Flows on iOS Simulator*, install Facebook IDB

    tool *At the moment, Maestro does not support real iOS devices 🍎 iOS © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework 13
  12. Writing Test Case Flows Overview of the approach to writing

    test case flows using Maestro © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework 14
  13. Topic • launchApp • tapOn - tap on anything that

    visible on screen • inputText • runFlow - run commands from another file • takeScreenshot - saves a screenshot in a PNG file • assertVisible Common commands © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework 15
  14. © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework

    appId: specify the application id to launch the application 17
  15. © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework

    appId: specify the application id to launchApp 18
  16. © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework

    inputText: regardless of whether any text field is currently focused or not 20
  17. © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework

    env: 1. Supply env variable to test: $maestro test -e ... 2. Consume: —> 21
  18. © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework

    tapOn: id of the view* *not preferred option to consider a11y 22
  19. © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework

    assertVisible: same parameters as tapOn 23
  20. © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework

    runFlow: to avoid duplication of code and thereby modularize your Flow files 24
  21. © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework

    Then tried to check our new product Bond instrument “ 25
  22. Topic Now you can write a test cases © TRADE

    REPUBLIC BANK 2023 |Maestro - UI testing framework 26
  23. Maestro Studio An overview of Maestro Studio, the integrated development

    environment (IDE) for creating Maestro test cases. © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework 28
  24. Topic Run $maestro studio on command line © TRADE REPUBLIC

    BANK 2023 |Maestro - UI testing framework 29
  25. Maestro Cloud Introduction to Maestro Cloud, a platform for test

    execution and collaboration. © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework 31
  26. Has Github Actions integration *need to grant an access to

    pull requests “ © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework 32
  27. Cloud console Free $10.00 credit for each month to experiment

    the usage. “ © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework 34
  28. Cloud console Free $10.00 credit for each month to experiment

    the usage. “ © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework 35
  29. Topic Monthly Cost = (# of Uploads per Month) x

    (# of Flows) x ($0.10 USD) Monthly Cost = (2 + 30) x 100 x ($0.10 USD) Monthly Cost = $320 Pricing model © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework 37
  30. Learnings *All views mine, no one else’s © TRADE REPUBLIC

    BANK 2023 |Maestro - UI testing framework 38
  31. © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework

    1: If we don’t rely on id and instead access by text Then we can run regression testing on both Android and iOS 39
  32. © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework

    2: If we don’t rely on id and instead access by text Then we can find many issues with a11y and improve them 40
  33. © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework

    3: It’s really easy to write a regression test No extra setup required on a platform and everybody without knowledge of the platform can write them. 42
  34. Q&A What do you think about it? © TRADE REPUBLIC

    BANK 2023 |Maestro - UI testing framework 43
  35. Topic • Maestro documentation: https://maestro.mobile.dev/ • Maestro Cloud: https://cloud.mobile.dev/ •

    Pricing calculator: https://console.mobile.dev/pricing-calculator Related links 44 © TRADE REPUBLIC BANK 2023 |Maestro - UI testing framework
  36. Topic Zhanibek Marshal Senior Engineer at Trade Republic © TRADE

    REPUBLIC BANK 2023 | Paparazzi: Snapshot testing made easy Hello again 👋 • Twitter: @megasuperhero • Mastodon: @[email protected] • TR engineering blog: https://engineering.traderepublic.com/ 45