SlideShare a Scribd company logo
1 of 20
VISUAL TESTING OF
WEB APPS IN A
HEADLESS
ENVIRONMENT
Manish Katoch, Software Developer
1
THE PREMISES
Team Alpha wants to build a perfect web
application.
“ We want to it be robust, bug free, stellar! The best of
the best. We will provide an unparalleled user
experience!”
2
THE STRATEGY
3
all is good until..
“How do we ensure we don’t break
the UI of our product?”
“We have GUI tests, it will ensure all
our functionality is flawless!”
“But what about aesthetics, the look
and feel?”
“Err…”
UI Tests
API/Integration
Tests
Unit Tests
VISUAL TESTS SAVES THE DAY
4
1
2
Go to
screen
Take a
snapshot
While there
are more
screens
Save images
1
2
Go to
screen
Take a
snapshot
While there
are more
screens
Compare
images
Identical Differences
First Pass Successive Passes
THE SETUP
5
Code
committed
Build
Created
Unit/Integration
tests
Git
CI-CD system
Functional
Tests
Visual
Tests
No display Agents (virtualized or physical)
(Build and Unit tests)
Test agents with displays
(Functional and visual tests)
BUT…
6
“The tests are flaky they thought, the tools insufficient!
the identical images won’t match. ”
WHY MY TESTS ARE FLAKY?
Pixel Differences
■ pixel per inch (PPI).
■ PPI is defined as number of pixel that a display can project.
● PPI is calculated as
𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑝𝑖𝑥𝑒𝑙 𝑜𝑛 𝑎 𝑑𝑖𝑎𝑔𝑜𝑛𝑎𝑙
𝑑𝑖𝑎𝑔𝑜𝑛𝑎𝑙 𝑠𝑖𝑧𝑒 𝑜𝑓 𝑑𝑖𝑠𝑝𝑙𝑎𝑦 𝑖𝑛 𝑖𝑛𝑐ℎ
7
WHY MY TESTS ARE FLAKY? - II
8
For 1024x768 resolution
98.4 PPI
85.33 PPI
75.29 PPI
The floating point arithmetic is
hardware dependent.
It can differ for same
manufacturer too.
WHY MY TESTS ARE FLAKY? - III
What if we could make PPI a constant whole
number?
Good idea. Problem: PPI is determined by hardware
display.
Can we program hardware displays?
9
WHY MY TESTS ARE FLAKY? - IV
10
Graphics
Processing Unit
• Processes
data
• Determines
what to
display
• Puts on its
RAM called
Frame Buffer.
Frame Buffer
• Part of
modern
GPUs.
• Is essentially
a bitmap of
image to be
displayed.
• Evolved to
also denote
colors via
lookup
tables.
• Creates video
signals using
DACs
Display
• Displays the
video signal
recieved
WHY MY TESTS ARE FLAKY? - V
11
The virtual frame buffer: Xvfb
Graphics
Processing Unit
• Processes
data
• Determines
what to
display
• Puts on its
RAM called
Frame Buffer.
Virtual Frame
Buffer
• Lives in
RAM.
• Implements
entire
framebuffer
protocol
• End point to
GPU
Display
THE IMPROVED SETUP FOR VISUAL TESTS
12
Start Xvfb with
1024x768
resolution and
100 PPI
Launch
application
(Browser)
Execute your
visual
tests
Report
“Fixed PPI and resolution guarantees that the image comparison will be truthful“
A good test suite must be
repeatable and should give the
same result every single time
13
TAKING IT A STEP FURTHER
 Snowflake agents.
 repeatability vs flakiness.
“Containerize the test suite!”
14
CONTAINERS: DOCKER
Docker: OS level virtualization ( no virtual machines )
 Think of it as layers of different files, unified together into a single
file system view
 This OS like abstraction gives you ability to run your tests in a
sandbox environment.
15
Image courtesy devopscube.com
USING DOCKER
 Create your Docker image with all the dependency packages
added to the image
 Share this image on a location accessible to your CI/CD system.
 Run this image, mount your test files into a folder and
execute tests from there.
16
Image courtesy devopscube.com
THE FINAL SETUP
17
Fetch Docker
image if not
already present
Checkout code/
Download Build
Start Docker
image
Run Visual TestsReport To CI
Stop Docker
image
WHAT DID
TEAM ALPHA
ACHIEVE?
A consistent and headless environment to
run builds and all tests.
They moved to totally virtualized
environment
No more flaky visual tests, very high
repeatability
Full reusability of infrastructure
Savings on specialized test tools
Early feedbacks even on UI specifications
Rave reviews of their product!
18
WHO IS TEAM ALPHA?
19
Image courtesy devopscube.com
Team Alpha is not a team of developers or
a team of QAs.
THANK YOU

More Related Content

What's hot

Genymotion with Jenkins
Genymotion with JenkinsGenymotion with Jenkins
Genymotion with JenkinsVishal Nayak
 
Continuous Integration for your Android projects
Continuous Integration for your Android projectsContinuous Integration for your Android projects
Continuous Integration for your Android projectsSergii Zhuk
 
Cross browser Testing JavaScript
Cross browser Testing JavaScriptCross browser Testing JavaScript
Cross browser Testing JavaScriptAlan Parkinson
 
Using CI for continuous delivery Part 1
Using CI for continuous delivery Part 1Using CI for continuous delivery Part 1
Using CI for continuous delivery Part 1Vishal Biyani
 
Modern devOps with Docker
Modern devOps with DockerModern devOps with Docker
Modern devOps with DockerAvi Cavale
 
No more waiting for API - Android Stub Server
No more waiting for API - Android Stub ServerNo more waiting for API - Android Stub Server
No more waiting for API - Android Stub ServerSylwester Madej
 
Production ready word press
Production ready word pressProduction ready word press
Production ready word pressEdmund Turbin
 
Android + jenkins
Android + jenkinsAndroid + jenkins
Android + jenkinsFred Lin
 
Continuous Delivery su progetti Java: cosa abbiamo imparato facendoci del male
Continuous Delivery su progetti Java: cosa abbiamo imparato facendoci del maleContinuous Delivery su progetti Java: cosa abbiamo imparato facendoci del male
Continuous Delivery su progetti Java: cosa abbiamo imparato facendoci del malePietro Di Bello
 
Continous UI testing with Espresso and Jenkins
Continous UI testing with Espresso and JenkinsContinous UI testing with Espresso and Jenkins
Continous UI testing with Espresso and JenkinsSylwester Madej
 
Building the Test Automation Framework - Jenkins for Testers
Building the Test Automation Framework - Jenkins for TestersBuilding the Test Automation Framework - Jenkins for Testers
Building the Test Automation Framework - Jenkins for TestersWilliam Echlin
 
Testing with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous DeploymentTesting with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous DeploymentMax Klymyshyn
 
Seattle Docker meetup March 13th 2014
Seattle Docker meetup March 13th 2014Seattle Docker meetup March 13th 2014
Seattle Docker meetup March 13th 2014Avi Cavale
 
Automate your build on Android with Jenkins
Automate your build on Android with JenkinsAutomate your build on Android with Jenkins
Automate your build on Android with JenkinsBeMyApp
 
Jenkins introduction
Jenkins introductionJenkins introduction
Jenkins introductionGourav Varma
 
Continuous Testing using Shippable and Docker
Continuous Testing using Shippable and DockerContinuous Testing using Shippable and Docker
Continuous Testing using Shippable and DockerMukta Aphale
 

What's hot (20)

Genymotion with Jenkins
Genymotion with JenkinsGenymotion with Jenkins
Genymotion with Jenkins
 
Continuous Integration for your Android projects
Continuous Integration for your Android projectsContinuous Integration for your Android projects
Continuous Integration for your Android projects
 
Cross browser Testing JavaScript
Cross browser Testing JavaScriptCross browser Testing JavaScript
Cross browser Testing JavaScript
 
Using CI for continuous delivery Part 1
Using CI for continuous delivery Part 1Using CI for continuous delivery Part 1
Using CI for continuous delivery Part 1
 
Modern devOps with Docker
Modern devOps with DockerModern devOps with Docker
Modern devOps with Docker
 
No more waiting for API - Android Stub Server
No more waiting for API - Android Stub ServerNo more waiting for API - Android Stub Server
No more waiting for API - Android Stub Server
 
Production ready word press
Production ready word pressProduction ready word press
Production ready word press
 
Android + jenkins
Android + jenkinsAndroid + jenkins
Android + jenkins
 
Continuous Delivery su progetti Java: cosa abbiamo imparato facendoci del male
Continuous Delivery su progetti Java: cosa abbiamo imparato facendoci del maleContinuous Delivery su progetti Java: cosa abbiamo imparato facendoci del male
Continuous Delivery su progetti Java: cosa abbiamo imparato facendoci del male
 
Ci for-android-apps
Ci for-android-appsCi for-android-apps
Ci for-android-apps
 
Continous UI testing with Espresso and Jenkins
Continous UI testing with Espresso and JenkinsContinous UI testing with Espresso and Jenkins
Continous UI testing with Espresso and Jenkins
 
Jenkins
JenkinsJenkins
Jenkins
 
Async webdriverjs
Async webdriverjsAsync webdriverjs
Async webdriverjs
 
Building the Test Automation Framework - Jenkins for Testers
Building the Test Automation Framework - Jenkins for TestersBuilding the Test Automation Framework - Jenkins for Testers
Building the Test Automation Framework - Jenkins for Testers
 
Testing with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous DeploymentTesting with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous Deployment
 
Seattle Docker meetup March 13th 2014
Seattle Docker meetup March 13th 2014Seattle Docker meetup March 13th 2014
Seattle Docker meetup March 13th 2014
 
Automate your build on Android with Jenkins
Automate your build on Android with JenkinsAutomate your build on Android with Jenkins
Automate your build on Android with Jenkins
 
Jenkins CI
Jenkins CIJenkins CI
Jenkins CI
 
Jenkins introduction
Jenkins introductionJenkins introduction
Jenkins introduction
 
Continuous Testing using Shippable and Docker
Continuous Testing using Shippable and DockerContinuous Testing using Shippable and Docker
Continuous Testing using Shippable and Docker
 

Similar to Visual Testing Of Web Apps in a Headless Environment

vodQA(Pune) 2018 - Visual testing of web apps in headless environment manis...
vodQA(Pune) 2018 - Visual testing of web apps in headless environment   manis...vodQA(Pune) 2018 - Visual testing of web apps in headless environment   manis...
vodQA(Pune) 2018 - Visual testing of web apps in headless environment manis...vodQA
 
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the serverArquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the serverLukáš Fryč
 
Designing Top-Class Test Suites for Web Applications
Designing Top-Class Test Suites for Web ApplicationsDesigning Top-Class Test Suites for Web Applications
Designing Top-Class Test Suites for Web ApplicationsLukáš Fryč
 
Colorful world-of-visual-automation-testing-latest
Colorful world-of-visual-automation-testing-latestColorful world-of-visual-automation-testing-latest
Colorful world-of-visual-automation-testing-latestOnur Baskirt
 
Advanced automated visual testing with Selenium
Advanced automated visual testing with SeleniumAdvanced automated visual testing with Selenium
Advanced automated visual testing with Seleniumadamcarmi
 
Advanced Automated Visual Testing
Advanced Automated Visual TestingAdvanced Automated Visual Testing
Advanced Automated Visual Testingadamcarmi
 
Visual Regression Testing: In search of an Ember solution
Visual Regression Testing: In search of an Ember solutionVisual Regression Testing: In search of an Ember solution
Visual Regression Testing: In search of an Ember solutionLisa Backer
 
Continuous integration using jenkins
Continuous integration using jenkinsContinuous integration using jenkins
Continuous integration using jenkinsVinay H G
 
Introduction to automated visual testing
Introduction to automated visual testingIntroduction to automated visual testing
Introduction to automated visual testingadamcarmi
 
SeConf2015: Advanced Automated Visual Testing With Selenium
SeConf2015: Advanced Automated Visual Testing With SeleniumSeConf2015: Advanced Automated Visual Testing With Selenium
SeConf2015: Advanced Automated Visual Testing With Seleniumadamcarmi
 
Adam carmi
Adam carmiAdam carmi
Adam carmiCodeFest
 
Advanced Visual Test Automation with Selenium
Advanced Visual Test Automation with SeleniumAdvanced Visual Test Automation with Selenium
Advanced Visual Test Automation with Seleniumadamcarmi
 
Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)danielputerman
 
Automated Visual Testing That Does Not Suck
Automated Visual Testing That Does Not SuckAutomated Visual Testing That Does Not Suck
Automated Visual Testing That Does Not Suckadamcarmi
 
Automated Visual Testing That Doesn't Suck!
Automated Visual Testing That Doesn't Suck!Automated Visual Testing That Doesn't Suck!
Automated Visual Testing That Doesn't Suck!Applitools
 
Selenium Camp 2016 - Kiev, Ukraine
Selenium Camp 2016 -  Kiev, UkraineSelenium Camp 2016 -  Kiev, Ukraine
Selenium Camp 2016 - Kiev, UkraineJustin Ison
 
Selenium Based Visual Test Automation
Selenium Based Visual Test AutomationSelenium Based Visual Test Automation
Selenium Based Visual Test Automationadamcarmi
 
Designing an effective hybrid apps automation framework
Designing an effective hybrid apps automation frameworkDesigning an effective hybrid apps automation framework
Designing an effective hybrid apps automation frameworkAndrea Tino
 
Web Test Automation Framework - IndicThreads Conference
Web Test Automation Framework  - IndicThreads ConferenceWeb Test Automation Framework  - IndicThreads Conference
Web Test Automation Framework - IndicThreads ConferenceIndicThreads
 
Selenium-based Visual Test Automation
Selenium-based Visual Test AutomationSelenium-based Visual Test Automation
Selenium-based Visual Test AutomationApplitools
 

Similar to Visual Testing Of Web Apps in a Headless Environment (20)

vodQA(Pune) 2018 - Visual testing of web apps in headless environment manis...
vodQA(Pune) 2018 - Visual testing of web apps in headless environment   manis...vodQA(Pune) 2018 - Visual testing of web apps in headless environment   manis...
vodQA(Pune) 2018 - Visual testing of web apps in headless environment manis...
 
Arquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the serverArquillian: Effective tests from the client to the server
Arquillian: Effective tests from the client to the server
 
Designing Top-Class Test Suites for Web Applications
Designing Top-Class Test Suites for Web ApplicationsDesigning Top-Class Test Suites for Web Applications
Designing Top-Class Test Suites for Web Applications
 
Colorful world-of-visual-automation-testing-latest
Colorful world-of-visual-automation-testing-latestColorful world-of-visual-automation-testing-latest
Colorful world-of-visual-automation-testing-latest
 
Advanced automated visual testing with Selenium
Advanced automated visual testing with SeleniumAdvanced automated visual testing with Selenium
Advanced automated visual testing with Selenium
 
Advanced Automated Visual Testing
Advanced Automated Visual TestingAdvanced Automated Visual Testing
Advanced Automated Visual Testing
 
Visual Regression Testing: In search of an Ember solution
Visual Regression Testing: In search of an Ember solutionVisual Regression Testing: In search of an Ember solution
Visual Regression Testing: In search of an Ember solution
 
Continuous integration using jenkins
Continuous integration using jenkinsContinuous integration using jenkins
Continuous integration using jenkins
 
Introduction to automated visual testing
Introduction to automated visual testingIntroduction to automated visual testing
Introduction to automated visual testing
 
SeConf2015: Advanced Automated Visual Testing With Selenium
SeConf2015: Advanced Automated Visual Testing With SeleniumSeConf2015: Advanced Automated Visual Testing With Selenium
SeConf2015: Advanced Automated Visual Testing With Selenium
 
Adam carmi
Adam carmiAdam carmi
Adam carmi
 
Advanced Visual Test Automation with Selenium
Advanced Visual Test Automation with SeleniumAdvanced Visual Test Automation with Selenium
Advanced Visual Test Automation with Selenium
 
Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)Appium overview (Selenium Israel #2, Feb. 2014)
Appium overview (Selenium Israel #2, Feb. 2014)
 
Automated Visual Testing That Does Not Suck
Automated Visual Testing That Does Not SuckAutomated Visual Testing That Does Not Suck
Automated Visual Testing That Does Not Suck
 
Automated Visual Testing That Doesn't Suck!
Automated Visual Testing That Doesn't Suck!Automated Visual Testing That Doesn't Suck!
Automated Visual Testing That Doesn't Suck!
 
Selenium Camp 2016 - Kiev, Ukraine
Selenium Camp 2016 -  Kiev, UkraineSelenium Camp 2016 -  Kiev, Ukraine
Selenium Camp 2016 - Kiev, Ukraine
 
Selenium Based Visual Test Automation
Selenium Based Visual Test AutomationSelenium Based Visual Test Automation
Selenium Based Visual Test Automation
 
Designing an effective hybrid apps automation framework
Designing an effective hybrid apps automation frameworkDesigning an effective hybrid apps automation framework
Designing an effective hybrid apps automation framework
 
Web Test Automation Framework - IndicThreads Conference
Web Test Automation Framework  - IndicThreads ConferenceWeb Test Automation Framework  - IndicThreads Conference
Web Test Automation Framework - IndicThreads Conference
 
Selenium-based Visual Test Automation
Selenium-based Visual Test AutomationSelenium-based Visual Test Automation
Selenium-based Visual Test Automation
 

Recently uploaded

(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 

Recently uploaded (20)

(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 

Visual Testing Of Web Apps in a Headless Environment

  • 1. VISUAL TESTING OF WEB APPS IN A HEADLESS ENVIRONMENT Manish Katoch, Software Developer 1
  • 2. THE PREMISES Team Alpha wants to build a perfect web application. “ We want to it be robust, bug free, stellar! The best of the best. We will provide an unparalleled user experience!” 2
  • 3. THE STRATEGY 3 all is good until.. “How do we ensure we don’t break the UI of our product?” “We have GUI tests, it will ensure all our functionality is flawless!” “But what about aesthetics, the look and feel?” “Err…” UI Tests API/Integration Tests Unit Tests
  • 4. VISUAL TESTS SAVES THE DAY 4 1 2 Go to screen Take a snapshot While there are more screens Save images 1 2 Go to screen Take a snapshot While there are more screens Compare images Identical Differences First Pass Successive Passes
  • 5. THE SETUP 5 Code committed Build Created Unit/Integration tests Git CI-CD system Functional Tests Visual Tests No display Agents (virtualized or physical) (Build and Unit tests) Test agents with displays (Functional and visual tests)
  • 6. BUT… 6 “The tests are flaky they thought, the tools insufficient! the identical images won’t match. ”
  • 7. WHY MY TESTS ARE FLAKY? Pixel Differences ■ pixel per inch (PPI). ■ PPI is defined as number of pixel that a display can project. ● PPI is calculated as 𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑝𝑖𝑥𝑒𝑙 𝑜𝑛 𝑎 𝑑𝑖𝑎𝑔𝑜𝑛𝑎𝑙 𝑑𝑖𝑎𝑔𝑜𝑛𝑎𝑙 𝑠𝑖𝑧𝑒 𝑜𝑓 𝑑𝑖𝑠𝑝𝑙𝑎𝑦 𝑖𝑛 𝑖𝑛𝑐ℎ 7
  • 8. WHY MY TESTS ARE FLAKY? - II 8 For 1024x768 resolution 98.4 PPI 85.33 PPI 75.29 PPI The floating point arithmetic is hardware dependent. It can differ for same manufacturer too.
  • 9. WHY MY TESTS ARE FLAKY? - III What if we could make PPI a constant whole number? Good idea. Problem: PPI is determined by hardware display. Can we program hardware displays? 9
  • 10. WHY MY TESTS ARE FLAKY? - IV 10 Graphics Processing Unit • Processes data • Determines what to display • Puts on its RAM called Frame Buffer. Frame Buffer • Part of modern GPUs. • Is essentially a bitmap of image to be displayed. • Evolved to also denote colors via lookup tables. • Creates video signals using DACs Display • Displays the video signal recieved
  • 11. WHY MY TESTS ARE FLAKY? - V 11 The virtual frame buffer: Xvfb Graphics Processing Unit • Processes data • Determines what to display • Puts on its RAM called Frame Buffer. Virtual Frame Buffer • Lives in RAM. • Implements entire framebuffer protocol • End point to GPU Display
  • 12. THE IMPROVED SETUP FOR VISUAL TESTS 12 Start Xvfb with 1024x768 resolution and 100 PPI Launch application (Browser) Execute your visual tests Report “Fixed PPI and resolution guarantees that the image comparison will be truthful“
  • 13. A good test suite must be repeatable and should give the same result every single time 13
  • 14. TAKING IT A STEP FURTHER  Snowflake agents.  repeatability vs flakiness. “Containerize the test suite!” 14
  • 15. CONTAINERS: DOCKER Docker: OS level virtualization ( no virtual machines )  Think of it as layers of different files, unified together into a single file system view  This OS like abstraction gives you ability to run your tests in a sandbox environment. 15 Image courtesy devopscube.com
  • 16. USING DOCKER  Create your Docker image with all the dependency packages added to the image  Share this image on a location accessible to your CI/CD system.  Run this image, mount your test files into a folder and execute tests from there. 16 Image courtesy devopscube.com
  • 17. THE FINAL SETUP 17 Fetch Docker image if not already present Checkout code/ Download Build Start Docker image Run Visual TestsReport To CI Stop Docker image
  • 18. WHAT DID TEAM ALPHA ACHIEVE? A consistent and headless environment to run builds and all tests. They moved to totally virtualized environment No more flaky visual tests, very high repeatability Full reusability of infrastructure Savings on specialized test tools Early feedbacks even on UI specifications Rave reviews of their product! 18
  • 19. WHO IS TEAM ALPHA? 19 Image courtesy devopscube.com Team Alpha is not a team of developers or a team of QAs.