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
b44b1dc3
...
b44b1dc37ed786e957665b15ada5cdf55f7f4f07
authored
2012-05-20 10:17:35 +0200
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
code documentation effort
1 parent
ca81b7dd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
modules/clientutils.js
modules/tester.js
modules/clientutils.js
View file @
b44b1dc
...
...
@@ -352,7 +352,7 @@
};
/**
* Retrieves a single DOM element mat
hc
ing a given XPath expression.
* Retrieves a single DOM element mat
ch
ing a given XPath expression.
*
* @param String expression The XPath expression
* @return HTMLElement or null
...
...
@@ -380,7 +380,7 @@
};
/**
* Remove
d
all DOM elements matching a given XPath expression.
* Remove
s
all DOM elements matching a given XPath expression.
*
* @param String expression The XPath expression
* @return Array
...
...
modules/tester.js
View file @
b44b1dc
...
...
@@ -40,6 +40,8 @@ exports.create = function create(casper, options) {
/**
* Casper tester: makes assertions, stores test results and display then.
*
* @param Casper casper A valid Casper instance
* @param Object|null options Options object
*/
var
Tester
=
function
Tester
(
casper
,
options
)
{
if
(
!
utils
.
isCasperObject
(
casper
))
{
...
...
@@ -149,7 +151,6 @@ var Tester = function Tester(casper, options) {
* @param Mixed expected The unwanted value
* @param String message Test description
*/
this
.
assertNotEquals
=
function
assertNotEquals
(
subject
,
shouldnt
,
message
)
{
var
eventName
;
message
=
message
||
""
;
...
...
@@ -176,7 +177,6 @@ var Tester = function Tester(casper, options) {
});
};
/**
* Asserts that a code evaluation in remote DOM resolves to true.
*
...
...
@@ -202,16 +202,23 @@ var Tester = function Tester(casper, options) {
};
/**
* Asserts that an element matching the provided
CSS3 selector
exists in
* Asserts that an element matching the provided
selector expression
exists in
* remote DOM.
*
* @param String selector
CSS3 selector
* @param String selector
Selector expression
* @param String message Test description
*/
this
.
assertExists
=
this
.
assertExist
=
function
assertExists
(
selector
,
message
)
{
return
this
.
assert
(
casper
.
exists
(
selector
),
message
);
};
/**
* Asserts that an element matching the provided selector expression does not
* exists in remote DOM.
*
* @param String selector Selector expression
* @param String message Test description
*/
this
.
assertDoesntExist
=
this
.
assertNotExists
=
function
assertDoesntExist
(
selector
,
message
)
{
return
this
.
assertNot
(
casper
.
exists
(
selector
),
message
);
};
...
...
@@ -296,10 +303,10 @@ var Tester = function Tester(casper, options) {
};
/**
* Asserts that at least an element matching the provided
CSS3 selector
* Asserts that at least an element matching the provided
selector expression
* exists in remote DOM.
*
* @param String selector A
CSS3 selector
string
* @param String selector A
selector expression
string
* @param String message Test description
*/
this
.
assertSelectorExists
=
this
.
assertSelectorExist
=
function
assertSelectorExists
(
selector
,
message
)
{
...
...
Please
register
or
sign in
to post a comment