Created
February 14, 2014 08:43
-
-
Save Grahack/8997750 to your computer and use it in GitHub Desktop.
Why doesn't CasperJS see the changes made by Brython?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var utils = require('utils'); | |
var casper = require('casper').create(); | |
casper.start('http://profgra.org/lycee/squelettes/html_css_js1.html', function() { | |
// was 'avant', JS put 'apres' instead | |
utils.dump(this.getElementsInfo('#ici')[0].html); | |
this.captureSelector('apres.png', 'body'); | |
}); | |
casper.thenOpen('http://brython.info/', function() { | |
// was empty, brython should have filled it | |
var please_wait = 10000; | |
this.wait(please_wait, function() { | |
this.echo("I've waited " + please_wait); | |
utils.dump(this.getElementsInfo('#content')[0].html); | |
utils.dump(this.getElementsInfo('#content')); | |
this.captureSelector('content.png', 'body'); | |
}); | |
}); | |
casper.options.waitTimeout = 60000; | |
casper.waitForSelectorTextChange('#content', function() { | |
utils.dump(this.getElementsInfo('#content')[0].html); | |
utils.dump(this.getElementsInfo('#content')); | |
this.captureSelector('contentwait.png', 'body'); | |
}); | |
casper.run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment