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
b1ed9a7e
...
b1ed9a7e7681d6cb727de01fe54d51b26a7c1c3d
authored
2012-05-21 12:23:02 +0200
by
Brikou CARRE
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
others single/double quote converts
1 parent
6b3b906e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
samples/bbcshots.coffee
samples/bbcshots.js
samples/bbcshots.coffee
View file @
b1ed9a7
...
...
@@ -20,13 +20,13 @@ casper.start "http://www.bbc.co.uk/", ->
# hide navigation arrows
@
hide
".nav_left"
@
hide
".nav_right"
@
mouse
.
move
'#promo2_carousel'
@
waitUntilVisible
'.autoplay.nav_pause'
,
->
@
mouse
.
move
"#promo2_carousel"
@
waitUntilVisible
".autoplay.nav_pause"
,
->
@
echo
"Moving over pause button"
@
mouse
.
move
'.autoplay.nav_pause'
@
mouse
.
move
".autoplay.nav_pause"
@
click
".autoplay.nav_pause"
@
echo
"Clicked on pause button"
@
waitUntilVisible
'.autoplay.nav_play'
,
->
@
waitUntilVisible
".autoplay.nav_play"
,
->
@
echo
"Carousel has been paused"
# hide play button
@
hide
".autoplay"
...
...
@@ -54,7 +54,7 @@ buildPage = ->
for
image
in
images
pageHtml
+=
"<img src='file://
#{
fs
.
workingDirectory
}
/
#{
image
}
'><br>"
pageHtml
+=
"</body></html>"
fs
.
write
'result.html'
,
pageHtml
,
'w'
fs
.
write
"result.html"
,
pageHtml
,
'w'
@
thenOpen
"file://
#{
fs
.
workingDirectory
}
/result.html"
,
->
@
echo
"Resulting image saved to result.png"
@
capture
"result.png"
...
...
samples/bbcshots.js
View file @
b1ed9a7
...
...
@@ -23,13 +23,13 @@ casper.start("http://www.bbc.co.uk/", function() {
// hide navigation arrows
this
.
hide
(
".nav_left"
);
this
.
hide
(
".nav_right"
);
this
.
mouse
.
move
(
'#promo2_carousel'
);
this
.
waitUntilVisible
(
'.autoplay.nav_pause'
,
function
()
{
this
.
mouse
.
move
(
"#promo2_carousel"
);
this
.
waitUntilVisible
(
".autoplay.nav_pause"
,
function
()
{
this
.
echo
(
"Moving over pause button"
);
this
.
mouse
.
move
(
'.autoplay.nav_pause'
);
this
.
mouse
.
move
(
".autoplay.nav_pause"
);
this
.
click
(
".autoplay.nav_pause"
);
this
.
echo
(
"Clicked on pause button"
);
this
.
waitUntilVisible
(
'.autoplay.nav_play'
,
function
()
{
this
.
waitUntilVisible
(
".autoplay.nav_play"
,
function
()
{
this
.
echo
(
"Carousel has been paused"
);
// hide play button
this
.
hide
(
".autoplay"
);
...
...
@@ -62,7 +62,7 @@ var buildPage = function buildPage() {
pageHtml
+=
"<img src='file://"
+
fs
.
workingDirectory
+
"/"
+
image
+
"'><br>"
;
});
pageHtml
+=
"</body></html>"
;
fs
.
write
(
'result.html'
,
pageHtml
,
'w'
);
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"
);
...
...
Please
register
or
sign in
to post a comment