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
77f99b04
...
77f99b0440fb1c4bb2e93737f4ed91c3f3533ff9
authored
2012-06-23 20:26:19 +0200
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
ensured travis-ci is able to run the tests using phantomjs 1.5
1 parent
35533322
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
21 deletions
tests/suites/casper/confirm.js
tests/suites/casper/prompt.js
tests/suites/casper/confirm.js
View file @
77f99b0
var
received
;
// skip this test for phantom versions < 1.5
if
(
phantom
.
version
.
major
===
1
&&
phantom
.
version
.
minor
<
6
)
{
casper
.
test
.
comment
(
'Skipped tests, PhantomJS 1.6 required'
);
casper
.
test
.
done
();
}
else
{
var
received
;
casper
.
setFilter
(
'page.confirm'
,
function
(
message
)
{
received
=
message
;
return
true
;
});
casper
.
setFilter
(
'page.confirm'
,
function
(
message
)
{
received
=
message
;
return
true
;
});
casper
.
start
(
'tests/site/confirm.html'
,
function
()
{
this
.
test
.
assert
(
this
.
getGlobal
(
'confirmed'
),
'confirmation received'
);
});
casper
.
start
(
'tests/site/confirm.html'
,
function
()
{
this
.
test
.
assert
(
this
.
getGlobal
(
'confirmed'
),
'confirmation received'
);
});
casper
.
run
(
function
()
{
this
.
test
.
assertEquals
(
received
,
'are you sure?'
,
'confirmation message is ok'
);
this
.
test
.
done
();
});
casper
.
run
(
function
()
{
this
.
test
.
assertEquals
(
received
,
'are you sure?'
,
'confirmation message is ok'
);
this
.
test
.
done
();
});
}
...
...
tests/suites/casper/prompt.js
View file @
77f99b0
casper
.
setFilter
(
'page.prompt'
,
function
(
message
,
value
)
{
return
'Chuck '
+
value
;
});
// skip this test for phantom versions < 1.5
if
(
phantom
.
version
.
major
===
1
&&
phantom
.
version
.
minor
<
6
)
{
casper
.
test
.
comment
(
'Skipped tests, PhantomJS 1.6 required'
);
casper
.
test
.
done
();
}
else
{
casper
.
setFilter
(
'page.prompt'
,
function
(
message
,
value
)
{
return
'Chuck '
+
value
;
});
casper
.
start
(
'tests/site/prompt.html'
,
function
()
{
this
.
test
.
assertEquals
(
this
.
getGlobal
(
'name'
),
'Chuck Norris'
,
'prompted value has been received'
);
});
casper
.
start
(
'tests/site/prompt.html'
,
function
()
{
this
.
test
.
assertEquals
(
this
.
getGlobal
(
'name'
),
'Chuck Norris'
,
'prompted value has been received'
);
});
casper
.
run
(
function
()
{
this
.
test
.
done
();
});
casper
.
run
(
function
()
{
this
.
test
.
done
();
});
}
...
...
Please
register
or
sign in
to post a comment