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
4cb79a2c
...
4cb79a2c8654a5a38f21dae729c4acb03f3cf6ab
authored
2011-11-12 18:26:54 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
added a Casper.history property, storing all the browsed urls
1 parent
930a75d7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
casper.js
tests/run.js
casper.js
View file @
4cb79a2
...
...
@@ -53,6 +53,7 @@
timeout
:
null
,
verbose
:
false
};
// privates
// local properties
this
.
checker
=
null
;
this
.
colorizer
=
new
phantom
.
Casper
.
Colorizer
();
...
...
@@ -1605,6 +1606,8 @@
}
else
{
casper
.
log
(
"Successfully injected Casper client-side utilities"
,
"debug"
);
}
// history
casper
.
history
.
push
(
casper
.
getCurrentUrl
());
casper
.
loadInProgress
=
false
;
};
page
.
onResourceReceived
=
function
(
resource
)
{
...
...
tests/run.js
View file @
4cb79a2
...
...
@@ -210,5 +210,8 @@ casper.wait(1000, function(self) {
casper
.
run
(
function
(
self
)
{
self
.
test
.
comment
(
'logging, again'
);
self
.
test
.
assertEquals
(
self
.
result
.
log
.
length
,
3
,
'log() logged messages'
);
self
.
test
.
comment
(
'history'
);
self
.
test
.
assert
(
self
.
history
.
length
>
0
,
'Casper.history contains urls'
);
self
.
test
.
assertMatch
(
self
.
history
[
0
],
/tests
\/
site
\/
index
\.
html$/
,
'Casper.history has the correct first url'
);
self
.
test
.
renderResults
(
true
,
0
,
save
);
});
...
...
Please
register
or
sign in
to post a comment