Responsive Design Testing across Devices
- Bharathan/Mari
Responsive Web Design
?
Responsive Web Design…
Means that a web site works optimally well for
users regardless of the device they are using.
Responsive Web Design Testing
Viewports
Testing Responsive Web Design
● Basic Rules
– Pages should be readable/user interactable on all
resolutions.
– Never visualize the horizontal scroll bar in the page.
– Text and images that fit proportionately in relation to
the width of the page
– Use of less image and more design structure
– At the end of the day its all about utilizing the user
view port for best user experience
Content
Menu bar
Listing
Listing
Carousel
Why we need Visual Testing
1.CSS unit testing is not possible
2.Slight change in values affect the DOM
randomly
3.Refactoring/Cleaning up of CSS code might
break at various level,After all, the C in CSS
does stand for cascading... order absolutely
matters.
What are the visual testing tools
available for automation?
1.PhantomCSS
2.Galen
3.Wraith
4.Backstopjs
Galen is a open source layout testing tool
created by Ivan Shubin developer at ebay,
Netherland
1. Easy to learn
2. Readable and Understandable syntax definition - Galen Spec
3. No need to verify entire page, Supports component level
validation
4. Style and font validation is also supported
5. Inbuilt test framework with good reporting options
6. Easy to integrate with selenium
7. Good Documentation
Why Galen
Galen Specs
Language
1. *.spec
2. Page object definition
3. @tags (desktop, mobile)
4. Spec instructions
Object definition
======================
header id header
logo-box css .logo-box
logo id title
menu css .primary-nav
mobile-menu id mobile-
menu
facebook css .facebook_url
======================
@@ Parameterized
|device |size |tags|
|desktop |1600x800 |all,desktop|
|tablet |768x1024 |all,tablet|
|mobile |350x568 |all,mobile|
Homepage in ${device} device
http://localhost:4000 ${size}
check spec/responsive.spec --include "${tags}"
Run tests
galen test test-suite.test --htmlreport reports
References
https://github.com/devishree90/
Galen_demo
http://galenframework.com/
Thanks
https://github.com/reachbharathan/Sample-Galen-Test

Responsive Web Design Automation using Galen