Created
August 2, 2013 15:39
-
-
Save iperdomo/6140900 to your computer and use it in GitHub Desktop.
ds-stats.js
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 casper = require('casper').create({ | |
verbose: true, | |
logLevel: 'info' | |
}); | |
var instance_id = 'akvoflow-1'; | |
var url = 'https://appengine.google.com/datastore/statistics?app_id=s~' + instance_id + '&kind=SurveyInstance'; | |
casper.start(url, function() { | |
this.fill('form[action="https://accounts.google.com/ServiceLoginAuth"]', { | |
Email: 'xxxxx@gmail.com', | |
Passwd: 'pa$$w0Rd' | |
}, true); | |
}); | |
casper.then(function() { | |
var dsSumary = 'table[id="ae-datastore-stats-top-level"]'; | |
this.test.assertExists(dsSumary, 'table exists'); | |
this.test.assertTrue(casper.evaluate(function() { | |
return document.getElementById('ae-datastore-stats-top-level').children[1].children[1].children[0].innerText; | |
}).indexOf('Entry count') === 0); | |
this.log(instance_id + " Survey Instance count: " + casper.evaluate(function() { | |
return document.getElementById('ae-datastore-stats-top-level').children[1].children[1].children[1].innerText; | |
}), "info"); | |
}); | |
casper.run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment