mobile web test automation: to the desktop! - alexander bayandin - mobile test automation meetup...
TRANSCRIPT
Fun fact
✦ I’m Russian
✦ My name is “Alexander”
✦ My name in passport is spelled as “Aleksandr”
✦ You can call me “Sasha”
Platforms
✦ Desktop Web
✦ iOS
✦ Android
✦ Windows Phone
✦ Mobile Web
Mobile Test Automation
Me
Viktar
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 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)
… 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)
Tests speed up (part 2)
✦ Move Selenium to Docker containers
✦ Run more Selenium Grid nodes
✦ Parallelise in more threads
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)
✦ 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
------ 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 undefineddocker-compose run -e BMA_SERVER=DEV test own_profile.feature:24
Results
✦ No manual regression testing (No boring stuff)
✦ Developers & QA run tests locally
✦ Everyday releases
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