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
27398293
...
27398293d589208f94101c9fa94ad8dfd5fc214a
authored
2012-01-16 16:33:21 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixed failing test
1 parent
c0d6ee10
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
modules/casper.js
tests/suites/casper/hooks.js
modules/casper.js
View file @
2739829
...
...
@@ -247,14 +247,14 @@ Casper.prototype.click = function click(selector, fallbackToHref) {
throw
new
CasperError
(
"Cannot click on unexistent selector: "
+
selector
);
}
var
clicked
=
this
.
evaluate
(
function
(
selector
)
{
__utils__
.
click
(
selector
);
return
__utils__
.
click
(
selector
);
},
{
selector
:
selector
});
if
(
!
clicked
)
{
// fallback onto native QtWebKit mouse events
try
{
this
.
mouse
.
click
(
selector
);
}
catch
(
e
)
{
this
.
log
(
f
(
"Error while trying to click on selector %s: %s"
,
selector
,
e
));
this
.
log
(
f
(
"Error while trying to click on selector %s: %s"
,
selector
,
e
)
,
"error"
);
return
false
;
}
}
...
...
tests/suites/casper/hooks.js
View file @
2739829
...
...
@@ -33,10 +33,9 @@ casper.then(function() {
this
.
options
.
onAlert
=
function
(
self
,
message
)
{
self
.
test
.
assertEquals
(
message
,
'plop'
,
'Casper.options.onAlert() can intercept an alert message'
);
};
}).
thenOpen
(
'tests/site/alert.html'
).
thenClick
(
'button'
,
function
()
{
this
.
options
.
onAlert
=
null
;
});
casper
.
run
(
function
()
{
this
.
options
.
onAlert
=
null
;
this
.
test
.
done
();
});
...
...
Please
register
or
sign in
to post a comment