Permalink
Browse files

migrated casper/auth tests to new testing format

  • Loading branch information...
1 parent c127d19 commit 0e70c19d5b2200a56d7785210f812b7e3316ea79 @n1k0 n1k0 committed Dec 28, 2012
Showing with 17 additions and 15 deletions.
  1. +17 −15 tests/suites/casper/auth.js
@@ -1,24 +1,26 @@
/*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();
+ });
});

0 comments on commit 0e70c19

Please sign in to comment.