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
8168fe03
...
8168fe03521cbace2af5e38ebd5feccbe70dc306
authored
2011-11-09 11:31:11 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
added tests for Casper.viewport()
1 parent
47b368be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
tests/run.js
tests/run.js
View file @
8168fe0
...
...
@@ -49,7 +49,15 @@ casper.start('tests/site/index.html', function(self) {
casper
.
test
.
assert
(
casper
.
steps
.
length
===
1
,
'start() can add a new navigation step'
);
// Casper.viewport()
casper
.
test
.
comment
(
'viewport'
);
casper
.
viewport
({
width
:
1337
,
height
:
999
});
casper
.
test
.
assertEquals
(
casper
.
page
.
viewportSize
.
width
,
1337
,
'Casper.viewport() can change the width of the viewport'
);
casper
.
test
.
assertEquals
(
casper
.
page
.
viewportSize
.
height
,
999
,
'Casper.viewport() can change the height of the viewport'
);
casper
.
test
.
assertRaises
(
casper
.
viewport
,
'booh'
,
'Casper.viewport() validates viewport size data'
);
// Casper#then()
casper
.
test
.
comment
(
'then'
);
casper
.
then
(
function
(
self
)
{
self
.
test
.
assertTitle
(
'CasperJS test target'
,
'click() casper can click on a text link and react when it is loaded 1/2'
);
self
.
click
(
'a[href="form.html"]'
);
...
...
@@ -126,6 +134,7 @@ casper.then(function(self) {
});
// Casper#each()
casper
.
test
.
comment
(
'each'
);
casper
.
each
([
1
,
2
,
3
],
function
(
self
,
item
,
i
)
{
self
.
test
.
assertEquals
(
i
,
item
-
1
,
'each() passes a contextualized index'
);
});
...
...
Please
register
or
sign in
to post a comment