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
6b3b906e
...
6b3b906e7355ec834a5ab58decb97ec0896e2922
authored
2012-05-21 12:20:05 +0200
by
Brikou CARRE
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
other single/double quote converting
1 parent
125db333
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
samples/bbcshots.coffee
samples/bbcshots.js
samples/bbcshots.coffee
View file @
6b3b906
...
...
@@ -18,8 +18,8 @@ casper.start "http://www.bbc.co.uk/", ->
return
__utils__
.
findAll
(
'#promo2_carousel_items_items li'
).
length
@
echo
"
#{
nbLinks
}
items founds"
# hide navigation arrows
@
hide
'.nav_left'
@
hide
'.nav_right'
@
hide
".nav_left"
@
hide
".nav_right"
@
mouse
.
move
'#promo2_carousel'
@
waitUntilVisible
'.autoplay.nav_pause'
,
->
@
echo
"Moving over pause button"
...
...
@@ -29,7 +29,7 @@ casper.start "http://www.bbc.co.uk/", ->
@
waitUntilVisible
'.autoplay.nav_play'
,
->
@
echo
"Carousel has been paused"
# hide play button
@
hide
'.autoplay'
@
hide
".autoplay"
# Capture carrousel area
next
=
->
...
...
@@ -57,7 +57,7 @@ buildPage = ->
fs
.
write
'result.html'
,
pageHtml
,
'w'
@
thenOpen
"file://
#{
fs
.
workingDirectory
}
/result.html"
,
->
@
echo
"Resulting image saved to result.png"
@
capture
'result.png'
@
capture
"result.png"
casper
.
then
next
...
...
samples/bbcshots.js
View file @
6b3b906
...
...
@@ -21,8 +21,8 @@ casper.start("http://www.bbc.co.uk/", function() {
});
this
.
echo
(
nbLinks
+
" items founds"
);
// hide navigation arrows
this
.
hide
(
'.nav_left'
);
this
.
hide
(
'.nav_right'
);
this
.
hide
(
".nav_left"
);
this
.
hide
(
".nav_right"
);
this
.
mouse
.
move
(
'#promo2_carousel'
);
this
.
waitUntilVisible
(
'.autoplay.nav_pause'
,
function
()
{
this
.
echo
(
"Moving over pause button"
);
...
...
@@ -32,7 +32,7 @@ casper.start("http://www.bbc.co.uk/", function() {
this
.
waitUntilVisible
(
'.autoplay.nav_play'
,
function
()
{
this
.
echo
(
"Carousel has been paused"
);
// hide play button
this
.
hide
(
'.autoplay'
);
this
.
hide
(
".autoplay"
);
});
});
});
...
...
@@ -65,7 +65,7 @@ var buildPage = function buildPage() {
fs
.
write
(
'result.html'
,
pageHtml
,
'w'
);
this
.
thenOpen
(
"file://"
+
fs
.
workingDirectory
+
"/result.html"
,
function
()
{
this
.
echo
(
"Resulting image saved to result.png"
);
this
.
capture
(
'result.png'
);
this
.
capture
(
"result.png"
);
});
};
...
...
Please
register
or
sign in
to post a comment