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
3aebbea6
...
3aebbea6b29f64a7008658780001c8677eea25e0
authored
2012-07-19 14:31:00 +0200
by
oncletom
Committed by
Nicolas Perriault
2012-10-18 09:43:58 +0200
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Testing response as argument of step function
1 parent
7958d51d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
tests/suites/casper/headers.js
tests/suites/casper/steps.js
tests/suites/casper/headers.js
View file @
3aebbea
...
...
@@ -20,12 +20,12 @@ function dumpHeaders () {
});
}
casper
.
start
(
'tests/site/index.html'
,
function
thenLocalPage
()
{
this
.
test
.
assertEquals
(
casper
.
currentR
esponse
,
undefined
,
'No response available on local page'
);
casper
.
start
(
'tests/site/index.html'
,
function
thenLocalPage
(
response
)
{
this
.
test
.
assertEquals
(
r
esponse
,
undefined
,
'No response available on local page'
);
});
casper
.
thenOpen
(
'http://localhost:8090/'
,
function
thenLocalhost
()
{
var
headers
=
casper
.
currentR
esponse
.
headers
;
casper
.
thenOpen
(
'http://localhost:8090/'
,
function
thenLocalhost
(
response
)
{
var
headers
=
r
esponse
.
headers
;
this
.
test
.
assertEquals
(
headers
.
get
(
'Content-Language'
),
'en'
,
'Checking existing header (case sensitive)'
);
this
.
test
.
assertEquals
(
headers
.
get
(
'content-language'
),
'en'
,
'Checking existing header (case insensitive)'
);
...
...
tests/suites/casper/steps.js
View file @
3aebbea
...
...
@@ -4,8 +4,9 @@ casper.start('tests/site/index.html');
var
nsteps
=
casper
.
steps
.
length
;
casper
.
then
(
function
(
self
)
{
casper
.
then
(
function
(
response
)
{
this
.
test
.
assertTitle
(
'CasperJS test index'
,
'Casper.then() added a new step'
);
this
.
test
.
assert
(
response
===
undefined
,
'Casper.then() response is undefined in local mode'
);
});
casper
.
test
.
assertEquals
(
casper
.
steps
.
length
,
nsteps
+
1
,
'Casper.then() can add a new step'
);
...
...
Please
register
or
sign in
to post a comment