Created
January 28, 2013 19:20
-
-
Save albburtsev/4658234 to your computer and use it in GitHub Desktop.
Casperjs test for URL with auth basic
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(); | |
var argDomain = casper.cli.get("domain"), | |
argLogin = casper.cli.get("login"), | |
argPassword = casper.cli.get("password"); | |
if ( !argDomain ) { | |
casper.echo('USAGE: casperjs login.js --domain=DOMAIN --login=AUTH_LOGIN --password=AUTH_PASSWORD'); | |
casper.exit(); | |
} | |
if ( argLogin && argPassword ) | |
casper = require("casper").create({ | |
pageSettings: { | |
userName: argLogin, | |
password: argPassword | |
} | |
}); | |
casper.start('http://' + argDomain + '/admin/', function() { | |
this.test.assertTitle('CMS Correct: Admin zone', 'Title correct!'); | |
}); | |
casper.run(function() { | |
this.test.done(1); | |
this.test.renderResults(true); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I need to get the Information like "url,username and password" from the user. How i can pass the arguments for the all three ?
Thanks,
Sanjeevi M