35
iOS Parallel Automation: Run faster than fast! Viktar Karanevich

iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

  • Upload
    badoo

  • View
    620

  • Download
    2

Embed Size (px)

Citation preview

Page 1: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

iOS Parallel Automation:Run faster than fast!

Viktar Karanevich

Page 2: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

self.introduce =>

{ name: "Viktar Karanevich", title: ["SSTAE", "SSDET", "SQAAE"], languages: ["Java", "Ruby"], experience: "iOS Automation 7+ years" }

Page 3: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

History Context

Jun 2010UI Automation

Apple

Page 4: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

History Context

Jun 2010UI Automation

Sep 2014UI Automationxcrun simctl

Apple

"xcrun simctl" is introduced in xCode 6

It is command line utility to control the Simulator (create, delete, erase, install, uninstall, ...).

Page 5: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

History Context

Jun 2010UI Automation

Sep 2015UI Automationxcrun simctlUI Testing

Apple

UI Testing in xCode 7 is introduced as replacementfor UIAutomation

Sep 2014UI Automationxcrun simctl

Page 6: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

History Context

Jun 2010UI Automation

Sep 2016UI Testing

xcrun simctl

Apple

Sep 2015UI Automationxcrun simctlUI Testing

Sep 2014UI Automationxcrun simctl

UI Automation removed in xCode 8

Page 7: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

History Context: Calabash

Jun 2010UI Automation

Sep 2014xcrun simctl

Sep 2016UI Testing

Sep 2016UI Testing

Apple

Calabash

Nov 2009UI Spec

Page 8: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

Calabash

Nov 2009UI Spec

Feb 2011Frank

History Context: Calabash

Page 9: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

Calabash

Nov 2009UI Spec

Feb 2011Frank

Jan 2012Calabash

Step DefinitionsRuby Client Library

Features

Developer host

Calabash server

Simulator

Your app

UIQuery

Touch Actions

History Context: Calabash

Page 10: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

Calabash

Apr 2013Calabash +

UIAutomationLink: https://github.com/calabash/run_loop

Step DefinitionsRuby Client Library

Features

Developer host

Calabash server

Simulator

Your app

UIQueryRun loop:

UIAutomation

History Context: Calabash

Page 11: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

Calabash

Sep 2016Calabash +

DeviceAgentLink: https://github.com/calabash/run_loop/tree/develop/lib/run_loop/device_agent

Developer host Simulator

Step DefinitionsRuby Client Library

XCTest Runner

Features

Calabash server

Your app

UIQuery

Device Agent

History Context: Calabash

Page 12: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

iOS Automation at Badoo

Approach

~80flaky tests

80data ~50

fail tests

Page 13: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

Before Parallel RunTest Suite RunNightly Cucumber ReportNightmare!

~80flaky tests

80data

15htotal time

~50fail tests

1simulator

129data

80data

~500tests

Page 14: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

Before Parallel RunTest Suite RunNightly Cucumber ReportNightmare!

~80flaky tests

80data

15htotal time

~50fail tests

1simulator

129data

80data

~500testsKey Issue: How to speed up Test Run?

Page 15: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

Let's Parallel!

Page 16: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

Let's Parallel!

Blocker Issue: - Calabash does not support Parallel run on 1 desktop

Page 17: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

Let's Parallel with multi-desktops!

Page 18: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

iOS Parallel Automation: multi-desktops

https://techblog.badoo.com

Tim's talk at Badoo: "Parallel Calabash Testing on iOS"

Page 19: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

Test Result: multi-desktops

5 Desktops: test suite ~4h on Mac Mini

Page 20: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

Test Result: multi-desktops

5 Desktops: test suite ~4h on Mac Mini

10 Desktops: test suite ~2h on Mac PRO (24-core)

Page 21: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

Test Result: multi-desktops

5 Desktops: test suite ~4h on Mac Mini

10 Desktops: test suite ~2h on Mac PRO (24-core)

X Desktops: host limit reached (can not increase number of desktops)

Page 22: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

Clustering Hosts

✦ Parallel run on multi (virtual) hosts

✦ Mac Pro and hosts: test suite - ~1h 30 min

Page 23: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

Clustering Hosts

Issues:- multi-desktops start up is Flaky- simulators can stuck

Page 24: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

Clustering Hosts

Is it possible to automate on multi-simulators?

Page 25: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

Facebook: Web Driver Agent

Developer host Simulator

Selenium DriverWDA Runner Your app

FB UIA WDA

Key Change: Reimplemented UIAutomation dependencyLink: https://github.com/facebook/WebDriverAgent

Page 26: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

iOS Parallel Automation: FB UIA WDA

Profit:- 7 simulators on single desktop- More stable! more efficient!

Page 27: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

Full Migration to FB UIA WDA

Issues:- all tests have calabash code

Page 28: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

Full Migration to FB UIA WDA

Issues:- all tests have calabash code- custom app backdoors

Page 29: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

Full Migration to FB UIA WDA

Issues:- all tests have calabash code- custom app backdoors- workarounds and other

Page 30: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

Full Migration to FB UIA WDA

Full Migration Costs: ~x hours

Is it possible to do Fast Migration?

Page 31: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

Calabash + FacebookFast migration: Facebash!

Step DefinitionsRuby Client Library

Features

Developer host

Calabash server

Simulator

Your app

UIQueryRun loop:

UIAutomation

Developer host Simulator

Step DefinitionsRuby Client Library

WDA Runner

Features

Calabash server

Your app

UIQuery

FB UIA WDA

Page 32: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

iOS 10 Update:from UIAutomation WDA to XCTest WDA

Link: https://github.com/facebook/WebDriverAgent

Developer host Simulator

Selenium DriverYour app

FB UIA WDA

Developer host Simulator

Your app

FB XCTest WDA

WDA Runner

Selenium Driver

FB simctl

Page 33: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

iOS Hybrid 2.0iOS 10 update

Developer host Simulator

Step DefinitionsRuby Client Library

WDA Runner

Features

Calabash server

Your app

UIQuery

FB UIA WDA

Developer host Simulator

Step DefinitionsRuby Client Library

FB simctl

Features

Calabash server

Your app

UIQuery

FB XCTest WDA

Page 34: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

Parallel Run: multi-desktops vs multi-simulators

Test Suite: 500 testsNightly Cucumber ReportHappy morning!

80data

Mac PRO

Test Suite Run Time

0 min

225 min

450 min

675 min

900 min

1 sim 10 sims 16 sims

75 min120 min

900 min

MultiDesktops

MultiSimulators

Page 35: iOS Parallel Automation - Viktar Karanevich - Mobile Test Automation Meetup (Badoo)

Thank You!

Questions?