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
174c8142
...
174c8142691f1b0b57e2724c16e4297f6350d9f7
authored
2012-01-28 13:28:32 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
added Tester.assertHttpStatus() for testing HTTP status code
1 parent
92e1f714
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletions
modules/tester.js
modules/tester.js
View file @
174c814
...
...
@@ -160,7 +160,7 @@ var Tester = function(casper, options) {
* Asserts that an element matching the provided CSS3 selector exists in
* remote DOM.
*
* @param String selector CSS3 selector
e
* @param String selector CSS3 selector
* @param String message Test description
*/
this
.
assertExists
=
function
assertExists
(
selector
,
message
)
{
...
...
@@ -168,6 +168,16 @@ var Tester = function(casper, options) {
};
/**
* Asserts that current HTTP status is the one passed as argument.
*
* @param Number status HTTP status code
* @param String message Test description
*/
this
.
assertHttpStatus
=
function
assertHttpStatus
(
status
,
message
)
{
return
this
.
assertEquals
(
casper
.
currentHTTPStatus
,
status
,
message
||
f
(
"HTTP status code is %d"
,
status
));
};
/**
* Asserts that a provided string matches a provided RegExp pattern.
*
* @param String subject The string to test
...
...
Please
register
or
sign in
to post a comment