Slides from my talk in Selenium Conference 2016 about "Sharing the pain with Protractor & Selenium WebDriver"
See blog for more information - http://essenceoftesting.blogspot.com/2016/06/sharing-pain-using-protractor.html
My blog: http://essenceoftesting.blogspot.com
12. Unit (xUnit / JavaScript)
Component
Integration
View
Web Service
UI
Manual / Exploratory
P
e
r
f
o
r
m
a
n
c
e
S
e
c
u
r
i
t
y
Accessibility
TEST PYRAMID
16. CHALLENGES - JAVASCRIPT
What is Test Automation?
Synchronous,
Step-by-Step execution
ASynchronous
Callbacks & Promises!
Power of JavaScript?
17. CHALLENGES – BROWSER (& OS) SUPPORT
Browser / Driver Why? Challenges
phantomJS Headless execution
- easier for developers
- Seamless CI
integration
- Officially not
recommended by
Protractor
Chrome - End-user
requirement
- Excellent for
development &
testing
- Certain elements
“not visible” – though
worked with Firefox
Firefox - End-user
requirement
- Worked locally
- Worked in CI – in
headless (xvfb), but
NOT for maps
- Worked in headless
mode (xvfb) in
vagrant
19. CHALLENGES - ANGULAR
Type Example
Angular Directives Ex: ng-repeat, ng-model
Custom Directives Ex: third party libraries providing
multi-column select, Sliders for
range, Charts
Working with non-Angular Ex: Login, Admin
24. SOLUTIONS – DETERMINISTIC TEST DATA
q Same Test Data in all environments / tenants
q Minimal Environment specific configuration
q Intelligent ‘before’ & ‘after’ setups
27. DID WE SOLVE ALL THE PROBLEMS?
JUST KIDDING!!!
Of course, NO!!
- Maps
- Reports
- How many and where to put “assertions”?
- Use Soft-asserts
YES!!!
28. OUR TAKEAWAYS FROM THIS PAIN & GAIN!
q Choose tech-stack based on context
q Experiment & Fail-Fast!
q Proper Cost-Value evaluation
q Manage Risk (what to automate – now / later, and what NOT
to automate)
q Keep learning & sharing – new and better solutions
28
29. REFERENCES
Page Objects – Google - https://code.google.com/p/selenium/wiki/PageObjects
Page Objects – Martin Fowler - http://martinfowler.com/bliki/PageObject.html
Perils of Page-Object Pattern – Anand Bagmar -
http://essenceoftesting.blogspot.in/2014/09/perils-of-page-object-pattern.html
Protractor – https://docs.angularjs.org/guide/e2e-testing,
http://www.protractortest.org/#/
Learn Protractor for Angular – https://docs.angularjs.org/tutorial
Sample project – https://github.com/NikithaIyer/angular-phonecat-e2e