Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
0e70c19d
...
0e70c19d5b2200a56d7785210f812b7e3316ea79
authored
2012-12-28 13:56:38 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
migrated casper/auth tests to new testing format
1 parent
c127d19e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
tests/suites/casper/auth.js
tests/suites/casper/auth.js
View file @
0e70c19
/*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
();
});
});
...
...
Please
register
or
sign in
to post a comment