Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Acceptance Testing
/ Automatisierte _ Web _ App _ Tests _ mit _ CasperJS /

- Björn Wilmsmann -
CasperJS
•
•
•

Frontend Testing für Web Applikationen

•

HTML5 und JavaScript

Automatisierte Acceptance Tests
Headless ...
Test-Driven
Development
Unit Tests
•
•
•

Individuelle Source Code Einheiten
Kleinste testbare Einheit
Isoliertes Testen kleiner Einheiten
Integration Tests
•
•

Testen von Modulen

•

Zwischen Unit Tests und Acceptance Tests

Test der Zusammenarbeit einzelner
...
Acceptance Tests
•

Sind die funktionalen Anforderungen an
eine Software erfüllt?

•
•

User Stories
High Level Tests
Continuous Integration
PhantomJS
•
•
•
•
•

Headless WebKit Browser
JavaScript Umgebung ähnlich Node.js
Voller HTML5 Funktionsumfang
Scripting in...
WebKit
•
•
•

Konqueror
Safari
Chrome
Anwendungsfälle
Screenshots
•
•
•

Rendering von Websites
Export als PNG, JPEG, GIF oder PDF
Unterstützt SVG und Canvas
Automatisierung
•
•

Makros

•
•

Cronjob für Websites

Automatisierung von wiederkehrenden
Aufgaben

Unterstützt JavaScri...
Monitoring
•
•

Untersuchung von Datenverkehr

•

Export in HAR (HTTP Archive) Format

onResourceRequested,
onResourceRece...
Code Beispiele
PhantomJS ist kein Test
Framework
Testing
•
•

Headless Testing von Websites
Test Frameworks

•
•
•
•

Capybara (via Poltergeist)
Mocha
…
CasperJS
CasperJS
•
•
•
•

Nutzt PhantomJS als Grundlage
Testing Framework
Scripting in JavaScript und CoffeeScript
http://casperjs....
Funktionsumfang
•
•
•
•

Navigation Scripting
Formulare ausfüllen & abschicken
DOM Manipulation
Asserts & xUnit Ergebnisse
Test Suites
•
•
•

Vollständige Testabläufe
Strukturierte Tests
Set up and tear down
DOM Manipulation
•
•
•

DOM Selectors
CSS3
XPath
Events
•
•
•

Event Handler ähnlich Node.js
Filter
http://casperjs.org/events-filters.html
Hilfsfunktionen
•

Utils: Hilfsfunktionen / JavaScript
Erweiterungen

•
•
•
•

Client Side Utils
Logging
Debugging
Vererbu...
Down to business
Und cross-browser
Kompatibilität?
Slimer.js
•
•

Nutzt Gecko (Mozilla) statt WebKit

•

http://slimerjs.org/

Wird von CasperJS seit 1.1-beta1 ebenfalls
unt...
TrifleJS
•
•
•

Headless Internet Explorer (via .NET API)
API analog PhantomJS
http://triflejs.org/
Tools
Resurrectio
•
•
•

Chrome Erweiterung
Aufnahme von Scripts und Abläufen

https://github.com/ebrehault/resurrectio
SpookyJS
•
•

CasperJS aus Node.js fernsteuern

https://github.com/WaterfallEngineering/
SpookyJS
PhantomFlow

•
•

Visualisierung von Nutzerführung
https://github.com/Huddle/PhantomFlow
PhantomCSS

•
•

Visual diff für CSS
https://github.com/Huddle/PhantomCSS
Weitere Links
•

https://github.com/BjoernKW/
CasperJS_presentation

•

http://blog.codeship.io/2013/03/07/
Smoke-Testing-...
Björn Wilmsmann

Stefan-George-Str. 15a

46117 Oberhausen
!

Website: http://wilmsmann.de 

eMail: bjoern@wilmsmann.de

Te...
Upcoming SlideShare
Loading in …5
×

Acceptance Testing - Automatisierte Web App Tests mit CasperJS

2,030 views

Published on

PhantomJS und das darauf basierende CasperJS sind WebKit-basierte Lösungen, mit denen Web Anwendungen automatisiert getestet werden können. Über JavaScript können damit Navigationsabläufe und Anwendungsfälle aus Nutzersicht abgebildet werden. Acceptance Tests werden so zu einer wertvollen Ergänzung des Testablaufs.

Published in: Technology
  • Unlock Her Legs is your passage way to a life full of loving and sex... read more ... ●●● http://scamcb.com/unlockher/pdf
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Acceptance Testing - Automatisierte Web App Tests mit CasperJS

  1. 1. Acceptance Testing / Automatisierte _ Web _ App _ Tests _ mit _ CasperJS / - Björn Wilmsmann -
  2. 2. CasperJS • • • Frontend Testing für Web Applikationen • HTML5 und JavaScript Automatisierte Acceptance Tests Headless Browser Testing für die Kommandozeile
  3. 3. Test-Driven Development
  4. 4. Unit Tests • • • Individuelle Source Code Einheiten Kleinste testbare Einheit Isoliertes Testen kleiner Einheiten
  5. 5. Integration Tests • • Testen von Modulen • Zwischen Unit Tests und Acceptance Tests Test der Zusammenarbeit einzelner Komponenten
  6. 6. Acceptance Tests • Sind die funktionalen Anforderungen an eine Software erfüllt? • • User Stories High Level Tests
  7. 7. Continuous Integration
  8. 8. PhantomJS • • • • • Headless WebKit Browser JavaScript Umgebung ähnlich Node.js Voller HTML5 Funktionsumfang Scripting in JavaScript und CoffeeScript http://phantomjs.org
  9. 9. WebKit • • • Konqueror Safari Chrome
  10. 10. Anwendungsfälle
  11. 11. Screenshots • • • Rendering von Websites Export als PNG, JPEG, GIF oder PDF Unterstützt SVG und Canvas
  12. 12. Automatisierung • • Makros • • Cronjob für Websites Automatisierung von wiederkehrenden Aufgaben Unterstützt JavaScript
  13. 13. Monitoring • • Untersuchung von Datenverkehr • Export in HAR (HTTP Archive) Format onResourceRequested, onResourceReceived
  14. 14. Code Beispiele
  15. 15. PhantomJS ist kein Test Framework
  16. 16. Testing • • Headless Testing von Websites Test Frameworks • • • • Capybara (via Poltergeist) Mocha … CasperJS
  17. 17. CasperJS • • • • Nutzt PhantomJS als Grundlage Testing Framework Scripting in JavaScript und CoffeeScript http://casperjs.org
  18. 18. Funktionsumfang • • • • Navigation Scripting Formulare ausfüllen & abschicken DOM Manipulation Asserts & xUnit Ergebnisse
  19. 19. Test Suites • • • Vollständige Testabläufe Strukturierte Tests Set up and tear down
  20. 20. DOM Manipulation • • • DOM Selectors CSS3 XPath
  21. 21. Events • • • Event Handler ähnlich Node.js Filter http://casperjs.org/events-filters.html
  22. 22. Hilfsfunktionen • Utils: Hilfsfunktionen / JavaScript Erweiterungen • • • • Client Side Utils Logging Debugging Vererbung (via Prototypes)
  23. 23. Down to business
  24. 24. Und cross-browser Kompatibilität?
  25. 25. Slimer.js • • Nutzt Gecko (Mozilla) statt WebKit • http://slimerjs.org/ Wird von CasperJS seit 1.1-beta1 ebenfalls unterstützt
  26. 26. TrifleJS • • • Headless Internet Explorer (via .NET API) API analog PhantomJS http://triflejs.org/
  27. 27. Tools
  28. 28. Resurrectio • • • Chrome Erweiterung Aufnahme von Scripts und Abläufen https://github.com/ebrehault/resurrectio
  29. 29. SpookyJS • • CasperJS aus Node.js fernsteuern https://github.com/WaterfallEngineering/ SpookyJS
  30. 30. PhantomFlow • • Visualisierung von Nutzerführung https://github.com/Huddle/PhantomFlow
  31. 31. PhantomCSS • • Visual diff für CSS https://github.com/Huddle/PhantomCSS
  32. 32. Weitere Links • https://github.com/BjoernKW/ CasperJS_presentation • http://blog.codeship.io/2013/03/07/ Smoke-Testing-with-Casperjs.html
  33. 33. Björn Wilmsmann
 Stefan-George-Str. 15a
 46117 Oberhausen ! Website: http://wilmsmann.de 
 eMail: bjoern@wilmsmann.de
 Tel.: +49-151-25209060

×