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
97d4509c
...
97d4509c172acba25249603e2979cdd35f395acd
authored
2012-03-18 20:36:12 +0100
by
KaroDidi
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
added Tester.assertTextExists
1 parent
24a362a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
modules/tester.js
modules/tester.js
100644 → 100755
View file @
97d4509
...
...
@@ -267,6 +267,16 @@ var Tester = function(casper, options) {
};
/**
* Asserts that given text exits in the document body.
*
* @param String text Text to be found
* @param String message Test description
*/
this
.
assertTextExists
=
function
assertTextExists
(
text
,
message
)
{
return
this
.
assert
(
(
casper
.
evaluate
(
function
(){
return
document
.
body
.
innerText
;
}
).
indexOf
(
text
)
!=
-
1
),
message
);
};
/**
* Asserts that title of the remote page equals to the expected one.
*
* @param String expected The expected title string
...
...
Please
register
or
sign in
to post a comment