Skip to content

Instantly share code, notes, and snippets.

@jsgao0
Last active June 16, 2016 09:02
Show Gist options
  • Save jsgao0/4a8dbbd75cfd1cb6372e752aaa510c4e to your computer and use it in GitHub Desktop.
Save jsgao0/4a8dbbd75cfd1cb6372e752aaa510c4e to your computer and use it in GitHub Desktop.
User submits form and redirect instead of clicking then redirect.
casper.test.begin('Test page.', 2, function suite(test) {
casper.start(
'https://cib.icicibank.com/corp/BANKAWAY?Action.CorpUser.Init1.001=Y&AppSignonBankId=ICI&AppType=corporate',
function() {
this.echo(this.getTitle());
test.assertUrlMatch(/BANKAWAY?/, 'Current location is ' + this.getCurrentUrl());
});
casper.then(function(){
this.fill('#rt', {}, true);
this.wait(2000, function() {
test.assertUrlMatch(/BANKAWAY;/, 'New location is ' + this.getCurrentUrl());
});
});
casper.run(function() {
test.done();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment