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
b382f855
...
b382f8556bc4b12dd5f455d83f914acb371b7ad9
authored
2013-02-18 22:58:19 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
code reformat
1 parent
4409d91f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
modules/casper.js
modules/tester.js
modules/casper.js
View file @
b382f85
...
...
@@ -1714,11 +1714,11 @@ Casper.prototype.wait = function wait(timeout, then) {
return
this
.
then
(
function
_step
()
{
this
.
waitStart
();
setTimeout
(
function
_check
(
self
)
{
self
.
log
(
f
(
"wait() finished waiting for %dms."
,
timeout
),
"info"
);
if
(
then
)
{
then
.
call
(
self
,
self
);
}
self
.
waitDone
();
self
.
log
(
f
(
"wait() finished waiting for %dms."
,
timeout
),
"info"
);
if
(
then
)
{
then
.
call
(
self
,
self
);
}
self
.
waitDone
();
},
timeout
,
this
);
});
};
...
...
modules/tester.js
View file @
b382f85
...
...
@@ -309,13 +309,14 @@ Tester.prototype.assertElementCount = function assertElementCount(selector, coun
if
(
!
utils
.
isNumber
(
count
)
||
count
<
0
)
{
throw
new
CasperError
(
'assertElementCount() needs a positive integer count'
);
}
return
this
.
assert
(
this
.
casper
.
evaluate
(
function
(
selector
)
{
var
elementCount
=
this
.
casper
.
evaluate
(
function
(
selector
)
{
try
{
return
__utils__
.
findAll
(
selector
).
length
;
}
catch
(
e
)
{
return
-
1
;
}
},
selector
)
===
count
,
message
,
{
},
selector
);
return
this
.
assert
(
elementCount
===
count
,
message
,
{
type
:
"assertElementCount"
,
standard
:
f
(
'%d element%s matching selector "%s" found'
,
count
,
...
...
@@ -323,7 +324,8 @@ Tester.prototype.assertElementCount = function assertElementCount(selector, coun
selector
),
values
:
{
selector
:
selector
,
count
:
count
expected
:
count
,
obtained
:
elementCount
}
});
};
...
...
Please
register
or
sign in
to post a comment