Commit 0e70c19d 0e70c19d5b2200a56d7785210f812b7e3316ea79 by Nicolas Perriault

migrated casper/auth tests to new testing format

1 parent c127d19e
/*global casper*/
/*jshint strict:false maxstatements:99*/
casper.start('tests/site/index.html');
casper.test.begin('HTTP authentication tests', 8, function(test) {
casper.start('tests/site/index.html');
casper.configureHttpAuth('http://localhost/');
casper.test.assertEquals(casper.page.settings.userName, undefined);
casper.test.assertEquals(casper.page.settings.password, undefined);
casper.configureHttpAuth('http://localhost/');
test.assertEquals(casper.page.settings.userName, undefined);
test.assertEquals(casper.page.settings.password, undefined);
casper.configureHttpAuth('http://niko:plop@localhost/');
casper.test.assertEquals(casper.page.settings.userName, 'niko');
casper.test.assertEquals(casper.page.settings.password, 'plop');
casper.configureHttpAuth('http://niko:plop@localhost/');
test.assertEquals(casper.page.settings.userName, 'niko');
test.assertEquals(casper.page.settings.password, 'plop');
casper.configureHttpAuth('http://localhost/', {username: 'john', password: 'doe'});
casper.test.assertEquals(casper.page.settings.userName, 'john');
casper.test.assertEquals(casper.page.settings.password, 'doe');
casper.configureHttpAuth('http://localhost/', {username: 'john', password: 'doe'});
test.assertEquals(casper.page.settings.userName, 'john');
test.assertEquals(casper.page.settings.password, 'doe');
casper.configureHttpAuth('http://niko:plop@localhost/', {username: 'john', password: 'doe'});
casper.test.assertEquals(casper.page.settings.userName, 'niko');
casper.test.assertEquals(casper.page.settings.password, 'plop');
casper.configureHttpAuth('http://niko:plop@localhost/', {username: 'john', password: 'doe'});
test.assertEquals(casper.page.settings.userName, 'niko');
test.assertEquals(casper.page.settings.password, 'plop');
casper.run(function() {
this.test.done(8);
casper.run(function() {
test.done();
});
});
......