Testing MeteorJS using CasperJS
Upcoming SlideShare
Loading in...5
×
 

Testing MeteorJS using CasperJS

on

  • 2,066 views

A presentation on how to use Casper.js to test dynamic web applications build with Meteor.js. ...

A presentation on how to use Casper.js to test dynamic web applications build with Meteor.js.
Original presentation created with reveal.js, find the code here: https://github.com/perlmonkey/caspermeetsmeteor

Statistics

Views

Total Views
2,066
Views on SlideShare
2,049
Embed Views
17

Actions

Likes
0
Downloads
9
Comments
0

1 Embed 17

https://twitter.com 17

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Testing MeteorJS using CasperJS Testing MeteorJS using CasperJS Presentation Transcript

  • TESTING METEOR USING CASPER.JS A presentation by Stephan Hochhaus ( @yauh ) on Dec, 16th 2013.
  • PUT YOUR APP TO THE TEST Functional tests focus on user experience and ensure features are working as expected (i.e. find bugs). Also they reveal problems with your requirements.
  • CHALLENGES IN TESTING DYNAMIC WEB APPS DOM is not ready on initial load site elements are constantly changing elements without proper IDs are hard to address and make testing less robust timing of steps is critical to successful testing
  • WHAT IS IT? Casper is both a testing & navigation framework It is based on PhantomJS You can easily create Jenkins Compatible JUnit XML
  • CASPER CAN BE USED TO 1. automate your browser to scrape stuff 2. test sites and apps (which is what we're talking about here)
  • (It just does, but that's not the topic of this presentation.)
  • HOW TO USE CASPER Grab PhantomJS Grab Casper version 1.1 (devel) Find a running Meteor app Write some tests
  • IF YOU ARE ON OS X INSTALL CASPERJS + PHANTOMJS USING HOMEBREW $ brew install casperjs --devel RUNNING A TEST $ casperjs test mytest.js
  • REMEMBER THESE? In order to have a consistent basis for testing we'll make use of some example apps provided by Meteor: Todos Parties
  • CHEAT SHEETS Some ressources to help you understand Infos about XPath
  • A CASPER SKELETON var meteorUrl = 'http://localhost:3000/'; // Start your testing casper.start(meteorUrl, function() { this.test.assertTitle('Todos', 'App title is as expected'); this.test.comment('Taking a picture to document our success'); this.capture('captures/a-website.png'); casper.then(function() { // do something else }); }); // don't forget to run your tests casper.run();
  • LOOK AT OUR CAPTURE
  • HANDS ON LET'S TEST THE EXAMPLES Gentle introduction - simpletest.js Basic functionality - todotest.js Logging in and setting up a party - partiestest.js
  • CONSIDER YOUR CHOICES Dalek.js 0.0.8 Zombie.js 2.0.0-alpha24 Selenium 2.4.0 Laika 0.3.1 Mocha 1.15.1 RTD - The Meteor Test Runner
  • THANK YOU! I blog at yauh.de , tweet as @yauh , and +1 as StephanHochhaus . Feel free to fork this .