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

Continuous mobile automation in Android build p...

dmle
July 22, 2018

Continuous mobile automation in Android build pipeline

Slides from my talk @ Automation Day Berlin 2018
It can be interesting if you wonder "How To":
• better organize Android functional tests
• configure environment deployment from tests
• run functional tests on each merge request
• have all the tests in the same pipeline with the Android build
• make a scalable solution with testing on the real devices
Technical stack: Appium, node.js, Gitlab CI and Sauce Labs

dmle

July 22, 2018
Tweet

More Decks by dmle

Other Decks in Programming

Transcript

  1. Hello! I am Dmitry Lemeshko Mobile QA Automation @ FrontierCarGroup,

    Berlin 6+ years in Test Automation AutomateMeNow dmle 2
  2. Frontier Car Group • 6 markets • 3 web apps

    • mobile apps • ~20 microservices 3
  3. Feature testing process 6 1 Build APK From feature branch

    and point to Staging environment Feature testing Manual testing of new functionality 2 Merge to master When passed QA Automated tests on latest master branch 3 Regression testing 4
  4. 7 1 Build APK Pointing to Staging environment & upload

    to Google Storage Run tests Download & install apk, run tests, analyse results and report to developers 2 Gitlab CI Android pipeline Test automation pipeline
  5. First result • Android/iOS tests in same repo • Regression

    testing on master • Staging environment • Local emulators 8
  6. Feature testing process 17 1 Build APK From feature branch

    and point to isolated environment Regression testing Automated tests 2 Feature testing Manual testing of new functionality When passed QA 3 Merge to master 4 Build APK From master branch and point to Staging environment Extended regression Automated tests on latest master branch 1 2
  7. 1 pipeline instead of 2 18 1 Build APK Pointing

    to isolated environment & uploaded to Google Storage Deploy services Specified branch for each service, services are up-and-running 2 Run tests Take recent APK and run tests on random device from market pool Upload artifacts to gitlab CI job 3 Attach artifacts 4
  8. Steps to do • Move tests to Android/iOS project repos

    • Configure env deployment from tests • Manage API endpoints in mobile app • Scale mobile devices & Appium tools • Build in single android pipeline 19
  9. Split & move: 20 Mobile tools iOS tests Android tests

    • page objects • tests & hooks • wd.js wrapper • setup, logging • cloud utils
  10. 21 Admin Web tests Projects in AUT source code Dealer

    Web tests Customer Web tests Dealer iOS tests Dealer Android tests Web tools Tools (API/deploy) Mobile tools Frameworks dependencies
  11. Configure deployment from tests • List services and branches "services":

    [ {"name": "serviceA", "branch": "master"}, {"name": "serviceB", "branch": "B-270"} ] • Specify env prefix "prefix": "automation10" 23
  12. Integrate cloud service • Upload new builds from Google Storage

    • Manage available devices • Run tests in a single session* • Handle cloud session time limit • Set results and pull artifacts 26
  13. Update pipeline • Update existing docker image • Add new

    gitlab CI runner • Add new job for tests • Configure trigger for job 28
  14. Update .gitlab-ci.yml: deployAndUItests: stage: build script: - export branch=$(echo $CI_BUILD_REF_NAME)

    - bash /buildAndroid.sh ... - npm run deploy - export appiumService=testobject env=automation - npm run regression 30
  15. Trigger conditions • Target branch is master • No WIP

    in title • Marked with `Reviewed` label 32
  16. 34

  17. 35

  18. Before • Regression after merge • Shared unreliable test env

    • Self support for appium & devices • Tests maintenance is on QA • Proxying test results What do we get? Now • Regression before merge • Isolated configurable test env • Cloud service • Tests maintenance is on QA/Dev • Results in build pipeline 36
  19. Flexibility Any environment, any version of services Shared maintenance Developers

    are fixing tests :) Fast feedback Developers get results faster & directly 37