SlideShare a Scribd company logo
Behaviour Driven
Development
Javascript testing should
be awesome
[ ]
SFEIR BOF 4/19/2013
Agenda
● A little story
● A definition of acceptance tests
● Some history
● "Awesome" Tools matter
● tested frameworks
● demos
● Q & A
Disclaimer
All what I'll say is correct and could eventually
be totally wrong and idiot.
me
Abderrazak BOUADMA
Web Developer
Work at SFEIR
Actually at CDC-FAST to do awesome stuff on a workflow
driven encrypted document signature product.
Current interests
#DIY #**/*.js #CLOUD
Keep in touch
Poll
● Who ever did acceptance tests ?
● Who used HttpUnit, HtmlUnit, Selenium, ...etc ?
● Was it fun :P
● How much would you get paid to maintain a
selenium test suite ?
a little story ...
Your BOSS sent you a mail at 5:45pm on a
friday evening asking you to add two
acceptance tests for the last build as it's a
last minute customer request before you go
out for your 1 year previously scheduled
vacancy to Hawaï #nightmare
How do you feel in that moment ?
Photo Credit : Jill Greenberg
Let's solve it with java !
HttpUnit
Euh ... we're in 2013
HtmlUnit
but it still something you've to integrate with your project
write java to test html/js !
Not that awesome yet !
Selenium
maven plugin configuration
Javascript testing should be awesome
Javascript testing should be awesome
Javascript testing should be awesome
Javascript testing should be awesome
Javascript testing should be awesome
Rock star tools matter
Marketplace
Zombie.js
karma
Our tools
Zombie.js
Practical part starts now
zombie.js
Headless browser
Mocha
Test runner
Jasmine syntax
describe('Test SuiteCase', function() {
it('Test description',function(){
// code to test
})
})
var Browser = require("zombie")
var assert = require("assert")
browser = new Browser()
describe('Zombie Test SuiteCase', function() {
it('User test@sfeir.com should login correctely',function(){
browser.visit(baseUrl, function() {
browser.
fill("uEmail", 'test@sfeir.com').
fill("uPassword", 'test').
pressButton("Sign in", function() {
assert.ok(browser.success)
assert.ok(browser.query("conferenceTable"))
})
})
})
})
zombie.js : example
Pros & Cons
PROs CONs
Headless Browser It's not a real Browser (emulates)
Full HTML5 compliant doesn't really work under windows (who
cares ?)
Generates XUnit no page screenshot
Complete Browsing API , CSS selectors
Insanely simple to get started with
npm install zombie
npm install mocha
Installing nodejs modules
Test Suite Case
Testing Context : login page
Login test case
As a non connected user
I insert test@sfeir.com as email
I insert test as password
I click on [login] button
I expect a 200 Http response,
I expect a cookie username=abderrazak
Testing Context : talks page
Talks test case
As test@sfeir.com
I insert a track name, time slot, speaker email
I click on [add] button
I expect there's a new row within the tracks table
I expect that track counter raised up
I expect that the rank of the latest track is 0
Demo
Thank you !
Q&A

More Related Content

PPTX
Browser Automated Testing Frameworks - Nightwatch.js
PDF
Front-end Automated Testing
PPTX
Angular UI Testing with Protractor
ZIP
Automated Frontend Testing
PDF
Join the darkside: Selenium testing with Nightwatch.js
PPTX
Automate testing with behat, selenium, phantom js and nightwatch.js (5)
PDF
Getting By Without "QA"
PDF
20160905 - BrisJS - nightwatch testing
Browser Automated Testing Frameworks - Nightwatch.js
Front-end Automated Testing
Angular UI Testing with Protractor
Automated Frontend Testing
Join the darkside: Selenium testing with Nightwatch.js
Automate testing with behat, selenium, phantom js and nightwatch.js (5)
Getting By Without "QA"
20160905 - BrisJS - nightwatch testing

What's hot (20)

PDF
Real World Selenium Testing
PDF
Testing Web Applications
PPTX
Autotests introduction - Codeception + PHP Basics
PDF
Nightwatch at Tilt
PDF
Night Watch with QA
PDF
Building testable chrome extensions
PDF
High Performance JavaScript 2011
KEY
JavaScript Testing VIA Selenium
PDF
Test your Javascript! v1.1
PDF
Test automation & Seleniun by oren rubin
PDF
Automation Abstraction Layers: Page Objects and Beyond
PPT
Js unit testing
PDF
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
PPTX
Marcin Wasilczyk - Page objects with selenium
PDF
Webdriver io presentation
PDF
Сергей Больщиков "Protractor Tips & Tricks"
PDF
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
PPTX
WebdriverIO: the Swiss Army Knife of testing
PDF
Introduction To Web Application Testing
PDF
Statistical Element Locator by Oren Rubin - SeleniumConf UK 2016
Real World Selenium Testing
Testing Web Applications
Autotests introduction - Codeception + PHP Basics
Nightwatch at Tilt
Night Watch with QA
Building testable chrome extensions
High Performance JavaScript 2011
JavaScript Testing VIA Selenium
Test your Javascript! v1.1
Test automation & Seleniun by oren rubin
Automation Abstraction Layers: Page Objects and Beyond
Js unit testing
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
Marcin Wasilczyk - Page objects with selenium
Webdriver io presentation
Сергей Больщиков "Protractor Tips & Tricks"
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
WebdriverIO: the Swiss Army Knife of testing
Introduction To Web Application Testing
Statistical Element Locator by Oren Rubin - SeleniumConf UK 2016
Ad

Similar to Javascript testing should be awesome (20)

PPTX
Java script unit testing
PDF
Testing in JavaScript - August 2018 - WebElement Bardejov
PPTX
Knowledge of web ui for automation testing
PDF
Testing mit Codeception: Full-stack testing PHP framework
PDF
DrupalCon Dublin 2016 - Automated browser testing with Nightwatch.js
PDF
Detecting headless browsers
PPTX
Testing ASP.NET - Progressive.NET
PPTX
Testing Ext JS and Sencha Touch
KEY
jQuery Bay Area Conference 2010
PPTX
Михаил Боднарчук "Acceptance Testing in NodeJS: Tools & Approaches"
PPTX
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
PDF
Top100summit 谷歌-scott-improve your automated web application testing
PPT
Code Quality Practice and Tools
PDF
Node.js and Selenium Webdriver, a journey from the Java side
PPTX
Protractor Tutorial Quality in Agile 2015
PPTX
DDT Testing Library for Android
PPT
By combining Selenium for frontend testing and tools
PDF
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
PPT
Testing in AngularJS
PPT
Pragmatic Parallels: Java and JavaScript
Java script unit testing
Testing in JavaScript - August 2018 - WebElement Bardejov
Knowledge of web ui for automation testing
Testing mit Codeception: Full-stack testing PHP framework
DrupalCon Dublin 2016 - Automated browser testing with Nightwatch.js
Detecting headless browsers
Testing ASP.NET - Progressive.NET
Testing Ext JS and Sencha Touch
jQuery Bay Area Conference 2010
Михаил Боднарчук "Acceptance Testing in NodeJS: Tools & Approaches"
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
Top100summit 谷歌-scott-improve your automated web application testing
Code Quality Practice and Tools
Node.js and Selenium Webdriver, a journey from the Java side
Protractor Tutorial Quality in Agile 2015
DDT Testing Library for Android
By combining Selenium for frontend testing and tools
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Testing in AngularJS
Pragmatic Parallels: Java and JavaScript
Ad

Recently uploaded (20)

PDF
Machine learning based COVID-19 study performance prediction
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Encapsulation theory and applications.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Cloud computing and distributed systems.
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Machine learning based COVID-19 study performance prediction
Programs and apps: productivity, graphics, security and other tools
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Unlocking AI with Model Context Protocol (MCP)
Chapter 3 Spatial Domain Image Processing.pdf
A Presentation on Artificial Intelligence
Encapsulation theory and applications.pdf
Big Data Technologies - Introduction.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
“AI and Expert System Decision Support & Business Intelligence Systems”
The AUB Centre for AI in Media Proposal.docx
20250228 LYD VKU AI Blended-Learning.pptx
Cloud computing and distributed systems.
Diabetes mellitus diagnosis method based random forest with bat algorithm
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Encapsulation_ Review paper, used for researhc scholars
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
MIND Revenue Release Quarter 2 2025 Press Release
Agricultural_Statistics_at_a_Glance_2022_0.pdf

Javascript testing should be awesome