Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Insights on Protractor testing
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Deyan Totev
September 13, 2015
Programming
100
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Insights on Protractor testing
Learn some basic recommendations about the e2e testing framework - Protractor
Deyan Totev
September 13, 2015
More Decks by Deyan Totev
See All by Deyan Totev
Welcome to NPM Search 2.0
peeping4dsun
0
58
Other Decks in Programming
See All in Programming
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
220
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.2k
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.7k
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
430
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
140
dotNET_vulnclicker_intro.pdf
deka_morita
0
140
気持ちぃ〜角丸 Squircle
ryu1013
0
310
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
0
490
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
600
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
750
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
930
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
1k
Featured
See All Featured
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
330
Ethics towards AI in product and experience design
skipperchong
2
430
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
800
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Embracing the Ebb and Flow
colly
88
5.2k
Google's AI Overviews - The New Search
badams
0
1.6k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
GitHub's CSS Performance
jonrohan
1033
470k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
58k
Transcript
by Dejan Toteff How to build faster e2e tests with
Protractor
• E2E testing framework • Developed by Google • Created
especially for Angular applications • Can be used with non Angular sites as well What is Protractor?
None
• Continuous integration • Integration tests • Test Driven Development
Why we need E2E tests?
• They are slow to write • Debugging is not
a straightforward process • Short life cycle without update What are the main issues with writing e2e tests?
• Well-documented • Integrated with headless and regular browsers •
Easy to set up • Very powerful API What are the pros of Protractor?
• It is not build for complex user interactions •
Works at its best only with Chrome • It doesn’t work well with nested promises What are the cons of Protractor?
Time for some example code
• Make a habit to use element.all(by...). count() to be
sure that you create most suitable element selector. Protractor tips
• Expect false errors. To confirm an error, run the
tests under alternative OS Protractor tips
• Beware of the async nature of Protractor. • If
something doesn't work as expected go Protractor native, i.e. using .then() Protractor tips
• Don't abstract the code directly to the PageObject. Often
this abstraction lead to errors. Protractor tips
• Other possible issue is when the element is not
in the visible part of the browser’s screen. Protractor tips
• Avoid use of browser.sleep() right after browser.waitForAngular() Protractor tips
• If you stumble on an error, that the element
you are clicking on is not attached to the document, that means that this is not a testable scenario Protractor tips
• Once you set the browser size, it persist in
your tests until the next browser. setSize() declaration Protractor tips
• Popups and animation can temporary disable Protractor. Protractor tips
• The behaviour of .then() method of Protractor’s .map(), .each(),
.filter() can be weird. Protractor tips
• One falsy selection can ruin all the tests. Protractor
is hard to debug mainly because in such occasions Protractor tips
• To make scroll down work, first you need to
focus the to the "window" by clicking on any element within the window. Protractor tips
• Make all your clicks statement either inside the tests,
or in the PageObject. Protractor tips
• https://github.com/lkrnac/primediser/tree/blog-2014-04-05- measuring-code-coverage-by-protractor • https://github.com/bennyhat/protractor-istanbul-plugin • http://lkrnac.net/blog/2014/04/measuring-code-coverage-by- protractor/ Walk the
extra mile
https://github. com/selfrefactor/Protractor-testing- patterns Shortlink: j.mp/endToEnd Most of slides of this
presentation are based on:
Thank you for your attention Protractor testing is actually easy