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.
CasperJs
Enjoy Functional Testing
CasperJs
Navigation scripting
Testing Utility
Written in Javascript
Open source
Based on PhantomJS
Headless Webkit browser
Full Javascript API
DOM Handling
CSS Selector
Canvas, SVG, Screen Capture
AND SINCE 1.1 Beta
SlimerJS
Gecko Scriptable Browser
Not yet truly headless (but works with xvfb)
PhantomJS
//clermontech.js
var page = new WebPage();
var result;
page.open('http://clermontech.org/', function (status) {
...
PhantomJS
fabien@fabien:~/clermontech$ phantomjs clermontech.js
Organiser son Application Backbone.js
Mobilité et NFC dans...
CasperJs
High Level API
Browsing navigation steps
Manage forms filling & submission
Test remote DOM
Logging events
Downloa...
Functional Testing ?
Functional tests check the integration of the different layers of an
application (from the routing to...
Example
//clermontech_casper.js
var casper = require('casper').create();
casper.start('http://clermontech.org', function()...
Execution
Selectors
CSS3
Xpath
casper.start('http://clermontech.org', function() {
this.test.assertExists({
type: 'xpath',
path: '//...
Beautifull Screenshot
casper.start('http://clermontech.org/', function() {
this.captureSelector('clermontech.png', 'body')...
Tools
Resurrectio
Chrome extension
Record navigation and generate casperjs test suites
GNU/Parallel
Parallelize test suites
@fabienpomerol
Thank you
Questions ?
Upcoming SlideShare
Loading in …5
×

CasperJs Enjoy Functional Testing

3,640 views

Published on

15'min Talk about CasperJS @ Clermont'ech

Published in: Technology
  • We called it "operation mind control" - as we discovered a simple mind game that makes a girl become obsessed with you. (Aand it works even if you're not her type or she's already dating someone else) Here's how we figured it out... ●●● http://ishbv.com/unlockher/pdf
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD FULL. BOOKS INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y8nn3gmc } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • ★★ How Long Does She Want You to Last? ★★ A recent study proved that the average man lasts just 2-5 minutes in bed (during intercourse). The study also showed that many women need at least 7-10 minutes of intercourse to reach "The Big O" - and, worse still... 30% of women never get there during intercourse. Clearly, most men are NOT fulfilling there women's needs in bed. Now, as I've said many times - how long you can last is no guarantee of being a GREAT LOVER. But, not being able to last 20, 30 minutes or more, is definitely a sign that you're not going to "set your woman's world on fire" between the sheets. Question is: "What can you do to last longer?" Well, one of the best recommendations I can give you today is to read THIS report. In it, you'll discover a detailed guide to an Ancient Taoist Thrusting Technique that can help any man to last much longer in bed. I can vouch 100% for the technique because my husband has been using it for years :) Here's the link to the report ◆◆◆ https://tinyurl.com/rockhardxx
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

CasperJs Enjoy Functional Testing

  1. 1. CasperJs Enjoy Functional Testing
  2. 2. CasperJs Navigation scripting Testing Utility Written in Javascript Open source
  3. 3. Based on PhantomJS Headless Webkit browser Full Javascript API DOM Handling CSS Selector Canvas, SVG, Screen Capture
  4. 4. AND SINCE 1.1 Beta
  5. 5. SlimerJS Gecko Scriptable Browser Not yet truly headless (but works with xvfb)
  6. 6. PhantomJS //clermontech.js var page = new WebPage(); var result; page.open('http://clermontech.org/', function (status) { if ('success' !== status) { console.log("Error"); } else { result = page.evaluate(function () { var titles = $('.latest .talks a'); var out = []; titles.each(function () { out.push($(this).text()); }); return out.join("n"); }); console.log(result); phantom.exit(); } });
  7. 7. PhantomJS fabien@fabien:~/clermontech$ phantomjs clermontech.js Organiser son Application Backbone.js Mobilité et NFC dans les Transports Introduction à Composer Ergonomie Web : Les Formulaires Back From Devoxx France 2013 Object Calisthenics Tasteful Private Cloud OVH Relax! Intro Aux Licences Libres
  8. 8. CasperJs High Level API Browsing navigation steps Manage forms filling & submission Test remote DOM Logging events Downloading resources Make some screenshot Write functional tests suites
  9. 9. Functional Testing ? Functional tests check the integration of the different layers of an application (from the routing to the views). Test your business rules Test the integration of your pages
  10. 10. Example //clermontech_casper.js var casper = require('casper').create(); casper.start('http://clermontech.org', function() { this.test.assertHttpStatus(200, 'Homepage is UP !'); this.echo('We click on Link Association'); this.click('a[title="A propos de Clermont'ech"]'); }); casper.wait('2000', function(){ this.test.assertHttpStatus(200, 'Association page is UP !'); this.test.assertUrlMatch(/association/, 'Url is well formed'); var members = this.evaluate(function() { return __utils__.findAll('.row .container ul li').length; }); this.test.assertEquals(6, members, '6 members in the association'); this.test.assertTextExists('Julien Maupetit', 'We found Mr President'); }); casper.run(function(){ this.test.done(); });
  11. 11. Execution
  12. 12. Selectors CSS3 Xpath casper.start('http://clermontech.org', function() { this.test.assertExists({ type: 'xpath', path: '//*[@id="logo"]' }, 'the logo exists'); });
  13. 13. Beautifull Screenshot casper.start('http://clermontech.org/', function() { this.captureSelector('clermontech.png', 'body'); }); casper.run();
  14. 14. Tools Resurrectio Chrome extension Record navigation and generate casperjs test suites GNU/Parallel Parallelize test suites
  15. 15. @fabienpomerol Thank you Questions ?

×