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
12e6873c
...
12e6873cd6342c69f913cd0f23ca285c52551455
authored
2012-12-14 11:49:40 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
removed Casper.waitForFrame() as it's not useful
1 parent
105cf017
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
29 deletions
modules/casper.js
tests/suites/casper/frames.js
modules/casper.js
View file @
12e6873
...
...
@@ -1732,24 +1732,6 @@ Casper.prototype.waitFor = function waitFor(testFx, then, onTimeout, timeout) {
};
/**
* Waits for a child frame page to be loaded.
*
* @param String frameName The frame name
* @param Function then The next step function (optional)
* @param Function onTimeout Function to call on operation timeout (optional)
* @param Number timeout Timeout in milliseconds (optional)
* @return Casper
*/
Casper
.
prototype
.
waitForFrame
=
function
waitForFrame
(
frameName
,
then
,
onTimeout
,
timeout
)
{
"use strict"
;
return
this
.
waitFor
(
function
()
{
return
this
.
page
.
childFramesName
().
some
(
function
(
name
)
{
return
name
===
frameName
;
});
},
then
,
onTimeout
,
timeout
);
};
/**
* Waits for a popup page having its url matching the provided pattern to be opened
* and loaded.
*
...
...
tests/suites/casper/frames.js
View file @
12e6873
...
...
@@ -2,16 +2,6 @@
/*jshint strict:false*/
casper
.
start
(
'tests/site/frames.html'
);
casper
.
waitForFrame
(
'frame1'
,
function
()
{
this
.
test
.
pass
(
'Casper.waithForFrame() can wait for a frame to be loaded.'
);
this
.
test
.
assertTitle
(
'CasperJS test frames'
);
});
casper
.
waitForFrame
(
'frame2'
,
function
()
{
this
.
test
.
pass
(
'Casper.waithForFrame() can wait for another frame to be loaded.'
);
this
.
test
.
assertTitle
(
'CasperJS test frames'
);
});
casper
.
withFrame
(
'frame1'
,
function
()
{
this
.
test
.
assertTitle
(
'CasperJS frame 1'
);
this
.
test
.
assertExists
(
"#f1"
);
...
...
@@ -37,5 +27,5 @@ casper.withFrame('frame2', function() {
casper
.
run
(
function
()
{
this
.
test
.
assertTitle
(
'CasperJS test frames'
);
this
.
test
.
done
(
1
4
);
this
.
test
.
done
(
1
0
);
});
...
...
Please
register
or
sign in
to post a comment