I have an website which need to be need to be tested after every deployment. To smoke test the application automatically, i thought of using casperjs.But the difficulty is that it only runs on top IE.By default casperjs only supports PhantomJS in built browser. Is there any plugin exists for casperjs as similar to DalekJS(dalek-browser-chrome) or something similar to this?
Enclosed below the complete code snippet.
Casper Code:
var LOGIN_URL, LOGIN_USERNAME, LOGIN_PASSWORD, casper;
var fs = require('fs');
casper = require('casper').create({
waitTimeout: 20000,
viewportSize: {
width: 1024,
height: 768
},
verbose: true,
logLevel: 'debug'
});
if (!casper.cli.has('url') && !casper.cli.has('username') && !casper.cli.has('password')) {
casper.echo('Usage: $ casperjs test.js --url=URL --username=USERNAME --password=PASSWORD').exit(-1);
}
LOGIN_URL = casper.cli.get('url');
LOGIN_USERNAME = casper.cli.get('username');
LOGIN_PASSWORD = casper.cli.get('password');
phantom.cookiesEnabled = true;
casper.start(LOGIN_URL, function () {
this.log('Logging in', 'debug');
this.fillSelectors('#login_form', {
'#temp_username': LOGIN_USERNAME,
'#temp_password': LOGIN_PASSWORD
}, true);
})
.wait(20000,function(){
fs.write("content.html",casper.getPageContent(), 'w');
})
.then(function(){
this.click('#some-id');
})
.wait(20000,function(){
})
.then(function(){
this.capture("application.png");
this.exit();
})
.run();
References: