mobile web test automation: to the desktop! - alexander bayandin - mobile test automation meetup...

95
Mobile Web: to the Desktop! Alexander Bayandin

Upload: badoo

Post on 16-Apr-2017

153 views

Category:

Technology


0 download

TRANSCRIPT

Mobile Web: to the Desktop!Alexander Bayandin

Fun fact

Fun fact

✦ I’m Russian

Fun fact

✦ I’m Russian

✦ My name is “Alexander”

Fun fact

✦ I’m Russian

✦ My name is “Alexander”

✦ My name in passport is spelled as “Aleksandr”

Fun fact

✦ I’m Russian

✦ My name is “Alexander”

✦ My name in passport is spelled as “Aleksandr”

✦ You can call me “Sasha”

We’re

5Platforms

3TC agents

329mUsers

47Languages

350kMessages / day

10mPhoto / day

We’re

5Platforms

3TC agents

329mUsers

47Languages

350kMessages / day

10mPhoto / day

Platforms

✦ Desktop Web

✦ iOS

✦ Android

✦ Windows Phone

✦ Mobile Web

Platforms

✦ Desktop Web

✦ iOS

✦ Android

✦ Windows Phone

✦ Mobile Web

Mobile Test Automation

Platforms

✦ Desktop Web

✦ iOS

✦ Android

✦ Windows Phone

✦ Mobile Web

Mobile Test Automation

Platforms

✦ Desktop Web

✦ iOS

✦ Android

✦ Windows Phone

✦ Mobile Web

Mobile Test Automation

Me

Platforms

✦ Desktop Web

✦ iOS

✦ Android

✦ Windows Phone

✦ Mobile Web

Mobile Test Automation

Me

Viktar

Basic overviewof Mobile Test Automation

The Grand Badoo Hotel Party

Basic overview

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

Basic overview

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

✦ We use Ruby and Cucumber

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

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

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 😎

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

Star Wars Badoo Party

A long time ago

✦ Mobile Web — 3rd platform covered by automation

A long time ago

✦ Mobile Web — 3rd platform covered by automation

✦ Running tests on real Android devices

A long time ago

✦ Mobile Web — 3rd platform covered by automation

✦ Running tests on real Android devices

✦ Use ChromeDriver through Appium

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)

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)

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)

Tests speed upSupport desktop Chrome

St. Patrick’s Day at Badoo

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

Tests speed up (part 1)

✦ Make Appium Ruby library compatible with Selenium

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

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

opts = Appium.load_appium_txt(file: config_file) …

… opts = Appium.load_appium_txt(file: config_file)

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

… opts = Appium.load_appium_txt(file: config_file)

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

Appium::Driver.new(opts) …

Tests speed up (part 1)

✦ Make Appium Ruby library compatible with Selenium

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

Tests speed up (part 1)

✦ Make Appium Ruby library compatible with Selenium

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

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)

Tests speed up (part 1)

✦ Make Appium Ruby library compatible with Selenium

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

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)

Tests speed up (part 1)

✦ Make Appium Ruby library compatible with Selenium

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

Tests speed up (part 1)

More waits

✦ Make Appium Ruby library compatible with Selenium

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

Tests speed up (part 1)

✦ Make Appium Ruby library compatible with Selenium

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

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

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)

30 minutesPer tests run (300 tests)

Salvador Dalí. La persistencia de la memoria

60 minutesPer tests run (700 tests)

Tests speed up (part 2)

✦ Move Selenium to Docker containers

Tests speed up (part 2)

✦ Move Selenium to Docker containers

✦ Run more Selenium Grid nodes

Tests speed up (part 2)

✦ Move Selenium to Docker containers

✦ Run more Selenium Grid nodes

✦ Parallelise in more threads

30 minutesPer tests run (700 tests)

Run tests locally

Halloween Party at Badoo

Run tests locally (Android)

Run tests locally (Android)

✦ Install Ruby Version Manager (RVM)

Run tests locally (Android)

✦ Install Ruby Version Manager (RVM)

✦ Install Bundler

Run tests locally (Android)

✦ Install Ruby Version Manager (RVM)

✦ Install Bundler

✦ `bundle install`

Run tests locally (Android)

✦ Install Ruby Version Manager (RVM)

✦ Install Bundler

✦ `bundle install`

✦ Install Node.js

Run tests locally (Android)

✦ Install Ruby Version Manager (RVM)

✦ Install Bundler

✦ `bundle install`

✦ Install Node.js

✦ `npm install`

Run tests locally (Android)

✦ Install Ruby Version Manager (RVM)

✦ Install Bundler

✦ `bundle install`

✦ Install Node.js

✦ `npm install`

✦ Install Java

Run tests locally (Android)

✦ Install Ruby Version Manager (RVM)

✦ Install Bundler

✦ `bundle install`

✦ Install Node.js

✦ `npm install`

✦ Install Java

✦ Install Android SDK

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

Run tests locally (Selenium)

Run tests locally (Selenium)

✦ Install Ruby Version Manager (RVM)

✦ Install Bundler

✦ `bundle install`

✦ Install Java

Run tests locally (Selenium)

✦ Install Ruby Version Manager (RVM)

✦ Install Bundler

✦ `bundle install`

✦ Install Java

✦ Download Selenium and ChromeDriver

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`

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

Easy to install Easy to run

Docker

Run tests locally (Docker)

Tests

Run tests locally (Docker)

SeleniumTests

Run tests locally (Docker)

Selenium

Containers

Tests

Run tests locally (Docker)

Selenium

Containers

Tests

docker-compose

Run tests locally (Docker)

Selenium

Containers

Tests

to rule them alldocker-compose

Run tests locally (Docker)

Run tests locally (Docker)

✦ Install Docker & docker-compose

Run tests locally (Docker)

✦ Install Docker & docker-compose

✦ docker-compose run test …

Run tests locally (Docker)

✦ Install Docker & docker-compose

✦ docker-compose run test …

Make TeamCity Friendly

LET THEM EAT CAKE!!!!!

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

TypeError: Cannot read property 'getId' of undefined

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

Results

Midsummer Madness Party at Badoo

Results

3TC agents

3TC agents

700+tests

30runs / day

100+Selenium nodes

TC agents

30min / run

Results

✦ No manual regression testing

Results

✦ No manual regression testing (No boring stuff)

Results

✦ No manual regression testing (No boring stuff)

✦ Developers & QA run tests locally

Results

✦ No manual regression testing (No boring stuff)

✦ Developers & QA run tests locally

✦ Everyday releases

Some Future Plans

Back to the Future Day

Some future plans

✦ Run tests on iOS Safari / Windows Phone Browser

Some future plans

✦ Run tests on iOS Safari / Windows Phone Browser

✦ Truly headless Chrome

Some future plans

✦ Run tests on iOS Safari / Windows Phone Browser

✦ Truly headless Chrome

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

Thank you!BadooTech

Badoo

techblog.badoo.com

Спасибо!abayandin

bayandin

alexander.bayand.in

The original, largest and leading dating network