Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Make your Browsers work for You
Search
Jev Zelenkov
May 14, 2014
Programming
0
74
Make your Browsers work for You
Learn about Selenium WebDriver and get excited by beautiful & concise E2E tests
Jev Zelenkov
May 14, 2014
Tweet
Share
More Decks by Jev Zelenkov
See All by Jev Zelenkov
Prototypical inheritance in ECMAScript 6
jevzee
0
87
Other Decks in Programming
See All in Programming
Effective Signals in Angular 19+: Rules and Helpers
manfredsteyer
PRO
0
100
Security_for_introducing_eBPF
kentatada
0
110
HTTP compression in PHP and Symfony apps
dunglas
2
1.7k
create_tableをしただけなのに〜囚われのuuid編〜
daisukeshinoku
0
240
php-conference-japan-2024
tasuku43
0
270
Go の GC の不得意な部分を克服したい
taiyow
3
780
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
250
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
4
260
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
180
バグを見つけた?それAppleに直してもらおう!
uetyo
0
180
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
250
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
290
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
Side Projects
sachag
452
42k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
Transcript
E2E testing with WebDriver API @jzelenkov FrankfurtJS #2 14 May
2014 Make your Browsers work for You
Do you write any front end tests?
complexity
changes
unit testing
(another) end from (one) end 2 http://david.heinemeierhansson.com/2014/tdd-is-dead-long-live-testing.html
Browsers
real
SlimerJS* PhantomJS headless * SlimerJS is not a fully headless
browser yet
ZombieJS unreal
or WebDriver ? Selenium
Selenium WebDriver* * Selenium RC
Selenium WebDriver* * Selenium RC epic naming #1
e2e test browser(s) selenium server API 1 1 WebDriver JSON
Wire Protocol Selenium WebDriver 2 Standalone Driver 3 Extension Driver 2 3 2
Selenium WebDriver JS Wrapper npm: selenium-webdriver
driver.get(‘http://...’); driver.findElement(webdriver.By.name('whoami')) .sendKeys('FrankfurtJS!'); driver.findElement(webdriver.By.id('greet')) .click(); driver.findElement(webdriver.By.id('message')) .getText() .then(function(val) { assert.equal(val,
'FrankfurtJS!'); }); SWD WebDriverJS
Alternatives
WebDriverJS http://webdriver.io @webdriverjs npm: webdriverjs
WebDriverJS http://webdriver.io @webdriverjs npm: webdriverjs epic naming #2
client .init() .url(‘http://...’) .addValue('[name="whoami"]', 'FrankfurtJS!') .buttonClick('#greet') .getText('#message', function(err, text) {
assert.equal(text, 'FrankfurtJS!'); }) WebDriverJS
DalekJS http://dalekjs.com @dalekjs npm: dalekjs
test .open('http://...') .type('[name="whoami"]', 'FrankfurtJS!') .click('#greet') .assert.text('#message').is('FrankfurtJS!') .done(); DalekJS
Protractor https://github.com/angular/protractor @ ProtractorTest npm: protractor
browser.ignoreSynchronization = true; ! browser.get(‘http://...'); element(by.name('whoami')).sendKeys('FrankfurtJS!'); element(by.id('greet')).click(); element(by.id(‘message')) .getText() .then(function(val){
assert.equal(val, 'FrankfurtJS!'); }); Protractor
others npm: selenium-test-runner npm: wd . . . npm: wd-sync
npm: yiewd . . . . . .
Selenium WebDriver Issues browser support frontend code
end 2 end for the win recap
thank you!
this presentation: https://speakerdeck.com/jzelenkov source code: http://bit.ly/1sNtUVL