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
a4945827
...
a4945827d42ca51d3292d4adaa546162790e1a59
authored
2012-12-19 11:39:38 -0800
by
Tyler Ritchie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
added a test for the page.confirm event handler returning false
1 parent
0bd73931
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
tests/suites/casper/confirm.js
tests/suites/casper/confirm.js
View file @
a494582
...
...
@@ -8,10 +8,22 @@ casper.setFilter('page.confirm', function(message) {
});
casper
.
start
(
'tests/site/confirm.html'
,
function
()
{
this
.
test
.
assert
(
this
.
getGlobal
(
'confirmed'
),
'confirmation received'
);
this
.
test
.
assert
(
this
.
getGlobal
(
'confirmed'
),
'confirmation dialog accepted'
);
});
casper
.
then
(
function
()
{
//remove the page.confirm event filter so we can add a new one
delete
casper
.
_filters
[
'page.confirm'
];
casper
.
setFilter
(
'page.confirm'
,
function
(
message
)
{
return
false
;
});
});
casper
.
thenOpen
(
'/tests/site/confirm.html'
,
function
()
{
this
.
test
.
assertNot
(
this
.
getGlobal
(
'confirmed'
),
'confirmation dialog canceled'
);
});
casper
.
run
(
function
()
{
this
.
test
.
assertEquals
(
received
,
'are you sure?'
,
'confirmation message is ok'
);
this
.
test
.
done
(
2
);
this
.
test
.
done
(
3
);
});
...
...
Please
register
or
sign in
to post a comment