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
81293bb9
...
81293bb95ad1c2aab0f9ea0f9d40e6785ae5ec21
authored
2012-06-06 18:15:12 +0200
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
switched to more standard .textContent property to get node text
1 parent
80dc3af6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
docs
modules/casper.js
modules/clientutils.js
modules/tester.js
docs
@
c17e8c95
Subproject commit
a13ffd86fd88a9f0f82ddcec38fc121ca2554001
Subproject commit
c17e8c952e7405d3cf6f78cafb1539ad0b16c59d
...
...
modules/casper.js
View file @
81293bb
...
...
@@ -349,7 +349,7 @@ Casper.prototype.debugHTML = function debugHTML() {
*/
Casper
.
prototype
.
debugPage
=
function
debugPage
()
{
this
.
echo
(
this
.
evaluate
(
function
_evaluate
()
{
return
document
.
body
.
innerText
;
return
document
.
body
.
textContent
||
document
.
body
.
innerText
;
}));
return
this
;
};
...
...
modules/clientutils.js
View file @
81293bb
...
...
@@ -165,7 +165,7 @@
var
text
=
''
,
elements
=
this
.
findAll
(
selector
);
if
(
elements
&&
elements
.
length
)
{
Array
.
prototype
.
forEach
.
call
(
elements
,
function
_forEach
(
element
)
{
text
+=
element
.
innerText
;
text
+=
element
.
textContent
||
element
.
innerText
;
});
}
return
text
;
...
...
modules/tester.js
View file @
81293bb
...
...
@@ -355,8 +355,8 @@ var Tester = function Tester(casper, options) {
*/
this
.
assertTextExists
=
this
.
assertTextExist
=
function
assertTextExists
(
text
,
message
)
{
var
textFound
=
(
casper
.
evaluate
(
function
_evaluate
()
{
return
document
.
body
.
innerText
;
}).
indexOf
(
text
)
!=
-
1
);
return
document
.
body
.
textContent
||
document
.
body
.
innerText
;
}).
indexOf
(
text
)
!=
=
-
1
);
return
this
.
assert
(
textFound
,
message
,
{
type
:
"assertTextExists"
,
details
:
"Text was not found within the document body textual contents"
,
...
...
Please
register
or
sign in
to post a comment