Top Banner
Mobile Web: to the Desktop! Alexander Bayandin
95

Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Apr 16, 2017

Download

Technology

Badoo
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Mobile Web: to the Desktop!Alexander Bayandin

Page 2: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Fun fact

Page 3: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Fun fact

✦ I’m Russian

Page 4: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Fun fact

✦ I’m Russian

✦ My name is “Alexander”

Page 5: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Fun fact

✦ I’m Russian

✦ My name is “Alexander”

✦ My name in passport is spelled as “Aleksandr”

Page 6: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Fun fact

✦ I’m Russian

✦ My name is “Alexander”

✦ My name in passport is spelled as “Aleksandr”

✦ You can call me “Sasha”

Page 7: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

We’re

5Platforms

3TC agents

329mUsers

47Languages

350kMessages / day

10mPhoto / day

Page 8: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

We’re

5Platforms

3TC agents

329mUsers

47Languages

350kMessages / day

10mPhoto / day

Page 9: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Platforms

✦ Desktop Web

✦ iOS

✦ Android

✦ Windows Phone

✦ Mobile Web

Page 10: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Platforms

✦ Desktop Web

✦ iOS

✦ Android

✦ Windows Phone

✦ Mobile Web

Mobile Test Automation

Page 11: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Platforms

✦ Desktop Web

✦ iOS

✦ Android

✦ Windows Phone

✦ Mobile Web

Mobile Test Automation

Page 12: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Platforms

✦ Desktop Web

✦ iOS

✦ Android

✦ Windows Phone

✦ Mobile Web

Mobile Test Automation

Me

Page 13: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Platforms

✦ Desktop Web

✦ iOS

✦ Android

✦ Windows Phone

✦ Mobile Web

Mobile Test Automation

Me

Viktar

Page 14: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Basic overviewof Mobile Test Automation

The Grand Badoo Hotel Party

Page 15: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Basic overview

✦ We do cross-platform test automation (Android, iOS, Mobile Web & Windows Phone)

Page 16: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Basic overview

✦ We do cross-platform test automation (Android, iOS, Mobile Web & Windows Phone)

✦ We use Ruby and Cucumber

Page 17: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Basic overview

✦ We do cross-platform test automation (Android, iOS, Mobile Web & Windows Phone)

✦ We use Ruby and Cucumber

✦ We use Calabash, Appium, Selenium & Winium.Mobile

Page 18: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Basic overview

✦ We do cross-platform test automation (Android, iOS, Mobile Web & Windows Phone)

✦ We use Ruby and Cucumber

✦ We use Calabash, Appium, Selenium & Winium.Mobile

✦ And TeamCity

Page 19: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Basic overview

✦ We do cross-platform test automation (Android, iOS, Mobile Web & Windows Phone)

✦ We use Ruby and Cucumber

✦ We use Calabash, Appium, Selenium & Winium.Mobile

✦ And TeamCity

✦ We’re cool 😎

Page 20: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

A long time agoin a galaxy far, far away....

Star Wars Badoo Party

Page 21: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

A long time ago

✦ Mobile Web — 3rd platform covered by automation

Page 22: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

A long time ago

✦ Mobile Web — 3rd platform covered by automation

✦ Running tests on real Android devices

Page 23: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

A long time ago

✦ Mobile Web — 3rd platform covered by automation

✦ Running tests on real Android devices

✦ Use ChromeDriver through Appium

Page 24: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

A long time ago

✦ Mobile Web — 3rd platform covered by automation

✦ Running tests on real Android devices

✦ Use ChromeDriver through Appium

✦ All 300 tests take about 5 hours (parallel run on 4 devices)

Page 25: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

A long time ago

✦ Mobile Web — 3rd platform covered by automation

✦ Running tests on real Android devices

✦ Use ChromeDriver through Appium

✦ All 300 tests take about 5 hours (parallel run on 4 devices)

Page 26: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

A long time ago

✦ Mobile Web — 3rd platform covered by automation

✦ Running tests on real Android devices

✦ Use ChromeDriver through Appium

✦ All 300 tests take about 5 hours (parallel run on 4 devices)

Page 27: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Tests speed upSupport desktop Chrome

St. Patrick’s Day at Badoo

Page 28: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)
Page 29: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

chromeOptions: { mobileEmulation: { deviceName: "Google Nexus 5" } }

Page 30: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Tests speed up (part 1)

✦ Make Appium Ruby library compatible with Selenium

Page 31: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

… config_file = if desktop? 'desktop/appium.txt' else 'android/appium.txt' end …

Page 32: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

… config_file = if desktop? 'desktop/appium.txt' else 'android/appium.txt' end

opts = Appium.load_appium_txt(file: config_file) …

Page 33: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

… opts = Appium.load_appium_txt(file: config_file)

if desktop? opts[:caps] = WebDriver::Remote::Capabilities.chrome end …

Page 34: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

… opts = Appium.load_appium_txt(file: config_file)

if desktop? opts[:caps] = WebDriver::Remote::Capabilities.chrome end

Appium::Driver.new(opts) …

Page 35: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Tests speed up (part 1)

✦ Make Appium Ruby library compatible with Selenium

✦ Fix tests (keyboard / photo upload / desktop Chrome is fast / animations)

Page 36: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Tests speed up (part 1)

✦ Make Appium Ruby library compatible with Selenium

✦ Fix tests (keyboard / photo upload / desktop Chrome is fast / animations)

Page 37: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Tests speed up (part 1)

Custom JS script

✦ Make Appium Ruby library compatible with Selenium

✦ Fix tests (keyboard / photo upload / desktop Chrome is fast / animations)

Page 38: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Tests speed up (part 1)

✦ Make Appium Ruby library compatible with Selenium

✦ Fix tests (keyboard / photo upload / desktop Chrome is fast / animations)

Page 39: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Tests speed up (part 1)

Use standard Selenium method

✦ Make Appium Ruby library compatible with Selenium

✦ Fix tests (keyboard / photo upload / desktop Chrome is fast / animations)

Page 40: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Tests speed up (part 1)

✦ Make Appium Ruby library compatible with Selenium

✦ Fix tests (keyboard / photo upload / desktop Chrome is fast / animations)

Page 41: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Tests speed up (part 1)

More waits

✦ Make Appium Ruby library compatible with Selenium

✦ Fix tests (keyboard / photo upload / desktop Chrome is fast / animations)

Page 42: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Tests speed up (part 1)

✦ Make Appium Ruby library compatible with Selenium

✦ Fix tests (keyboard / photo upload / desktop Chrome is fast / animations)

Page 43: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Tests speed up (part 1)

✦ Make Appium Ruby library compatible with Selenium

✦ Fix tests (keyboard / photo upload / desktop Chrome is fast / animations)

Use setTimeout instead of requestAnimationFrame

Page 44: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Tests speed up (part 1)

✦ Make Appium Ruby library compatible with Selenium

✦ Fix tests (keyboard / photo upload / desktop Chrome is fast / animations)

✦ Launch Selenium Grid on each TeamCity agent before tests (10 Chromes)

Page 45: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

30 minutesPer tests run (300 tests)

Page 46: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Salvador Dalí. La persistencia de la memoria

Page 47: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

60 minutesPer tests run (700 tests)

Page 48: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Tests speed up (part 2)

✦ Move Selenium to Docker containers

Page 49: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Tests speed up (part 2)

✦ Move Selenium to Docker containers

✦ Run more Selenium Grid nodes

Page 50: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Tests speed up (part 2)

✦ Move Selenium to Docker containers

✦ Run more Selenium Grid nodes

✦ Parallelise in more threads

Page 51: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

30 minutesPer tests run (700 tests)

Page 52: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Run tests locally

Halloween Party at Badoo

Page 53: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Run tests locally (Android)

Page 54: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Run tests locally (Android)

✦ Install Ruby Version Manager (RVM)

Page 55: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Run tests locally (Android)

✦ Install Ruby Version Manager (RVM)

✦ Install Bundler

Page 56: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Run tests locally (Android)

✦ Install Ruby Version Manager (RVM)

✦ Install Bundler

✦ `bundle install`

Page 57: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Run tests locally (Android)

✦ Install Ruby Version Manager (RVM)

✦ Install Bundler

✦ `bundle install`

✦ Install Node.js

Page 58: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Run tests locally (Android)

✦ Install Ruby Version Manager (RVM)

✦ Install Bundler

✦ `bundle install`

✦ Install Node.js

✦ `npm install`

Page 59: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Run tests locally (Android)

✦ Install Ruby Version Manager (RVM)

✦ Install Bundler

✦ `bundle install`

✦ Install Node.js

✦ `npm install`

✦ Install Java

Page 60: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Run tests locally (Android)

✦ Install Ruby Version Manager (RVM)

✦ Install Bundler

✦ `bundle install`

✦ Install Node.js

✦ `npm install`

✦ Install Java

✦ Install Android SDK

Page 61: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Run tests locally (Android)

✦ Install Ruby Version Manager (RVM)

✦ Install Bundler

✦ `bundle install`

✦ Install Node.js

✦ `npm install`

✦ Install Java

✦ Install Android SDK

✦ INSTALL ONE MORE STRANGE TOOL

Page 62: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Run tests locally (Selenium)

Page 63: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Run tests locally (Selenium)

✦ Install Ruby Version Manager (RVM)

✦ Install Bundler

✦ `bundle install`

✦ Install Java

Page 64: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Run tests locally (Selenium)

✦ Install Ruby Version Manager (RVM)

✦ Install Bundler

✦ `bundle install`

✦ Install Java

✦ Download Selenium and ChromeDriver

Page 65: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Run tests locally (Selenium)

✦ Install Ruby Version Manager (RVM)

✦ Install Bundler

✦ `bundle install`

✦ Install Java

✦ Download Selenium and ChromeDriver

✦ `java -jar selenium.jar -Dwebdriver.chrome.driver=./chromedriver`

Page 66: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Run tests locally (Selenium)

✦ Install Ruby Version Manager (RVM)

✦ Install Bundler

✦ `bundle install`

✦ Install Java

✦ Download Selenium and ChromeDriver

✦ `java -jar selenium.jar -Dwebdriver.chrome.driver=./chromedriver`

✦ `cucumber -p web_badoo …` # Run test itself

Page 67: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Easy to install Easy to run

Page 68: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Docker

Page 69: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Run tests locally (Docker)

Tests

Page 70: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Run tests locally (Docker)

SeleniumTests

Page 71: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Run tests locally (Docker)

Selenium

Containers

Tests

Page 72: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Run tests locally (Docker)

Selenium

Containers

Tests

docker-compose

Page 73: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Run tests locally (Docker)

Selenium

Containers

Tests

to rule them alldocker-compose

Page 74: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Run tests locally (Docker)

Page 75: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Run tests locally (Docker)

✦ Install Docker & docker-compose

Page 76: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Run tests locally (Docker)

✦ Install Docker & docker-compose

✦ docker-compose run test …

Page 77: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Run tests locally (Docker)

✦ Install Docker & docker-compose

✦ docker-compose run test …

Page 78: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Make TeamCity Friendly

LET THEM EAT CAKE!!!!!

Page 79: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

------ LOCAL RUN: ------ docker-compose run -e APP=badoo -e BMA_SERVER=QA -e WEB_URL=MW-3287 test own_profile.feature:24 ------------------------

Page 80: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)
Page 81: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

TypeError: Cannot read property 'getId' of undefined

Page 82: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

TypeError: Cannot read property 'getId' of undefineddocker-compose run -e BMA_SERVER=DEV test own_profile.feature:24

Page 83: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Results

Midsummer Madness Party at Badoo

Page 84: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Results

3TC agents

3TC agents

700+tests

30runs / day

100+Selenium nodes

TC agents

30min / run

Page 85: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Results

✦ No manual regression testing

Page 86: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Results

✦ No manual regression testing (No boring stuff)

Page 87: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Results

✦ No manual regression testing (No boring stuff)

✦ Developers & QA run tests locally

Page 88: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Results

✦ No manual regression testing (No boring stuff)

✦ Developers & QA run tests locally

✦ Everyday releases

Page 89: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Some Future Plans

Back to the Future Day

Page 90: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Some future plans

✦ Run tests on iOS Safari / Windows Phone Browser

Page 91: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Some future plans

✦ Run tests on iOS Safari / Windows Phone Browser

✦ Truly headless Chrome

Page 92: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Some future plans

✦ Run tests on iOS Safari / Windows Phone Browser

✦ Truly headless Chrome

✦ Better app debugging with tests (taking HAR, for example)

Page 93: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Thank you!BadooTech

Badoo

techblog.badoo.com

Page 94: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

Спасибо!abayandin

bayandin

alexander.bayand.in

Page 95: Mobile Web Test Automation: to the Desktop! - Alexander Bayandin - Mobile Test Automation Meetup (Badoo)

The original, largest and leading dating network