Commit 12e6873c 12e6873cd6342c69f913cd0f23ca285c52551455 by Nicolas Perriault

removed Casper.waitForFrame() as it's not useful

1 parent 105cf017
...@@ -1732,24 +1732,6 @@ Casper.prototype.waitFor = function waitFor(testFx, then, onTimeout, timeout) { ...@@ -1732,24 +1732,6 @@ Casper.prototype.waitFor = function waitFor(testFx, then, onTimeout, timeout) {
1732 }; 1732 };
1733 1733
1734 /** 1734 /**
1735 * Waits for a child frame page to be loaded.
1736 *
1737 * @param String frameName The frame name
1738 * @param Function then The next step function (optional)
1739 * @param Function onTimeout Function to call on operation timeout (optional)
1740 * @param Number timeout Timeout in milliseconds (optional)
1741 * @return Casper
1742 */
1743 Casper.prototype.waitForFrame = function waitForFrame(frameName, then, onTimeout, timeout) {
1744 "use strict";
1745 return this.waitFor(function() {
1746 return this.page.childFramesName().some(function(name) {
1747 return name === frameName;
1748 });
1749 }, then, onTimeout, timeout);
1750 };
1751
1752 /**
1753 * Waits for a popup page having its url matching the provided pattern to be opened 1735 * Waits for a popup page having its url matching the provided pattern to be opened
1754 * and loaded. 1736 * and loaded.
1755 * 1737 *
......
...@@ -2,16 +2,6 @@ ...@@ -2,16 +2,6 @@
2 /*jshint strict:false*/ 2 /*jshint strict:false*/
3 casper.start('tests/site/frames.html'); 3 casper.start('tests/site/frames.html');
4 4
5 casper.waitForFrame('frame1', function() {
6 this.test.pass('Casper.waithForFrame() can wait for a frame to be loaded.');
7 this.test.assertTitle('CasperJS test frames');
8 });
9
10 casper.waitForFrame('frame2', function() {
11 this.test.pass('Casper.waithForFrame() can wait for another frame to be loaded.');
12 this.test.assertTitle('CasperJS test frames');
13 });
14
15 casper.withFrame('frame1', function() { 5 casper.withFrame('frame1', function() {
16 this.test.assertTitle('CasperJS frame 1'); 6 this.test.assertTitle('CasperJS frame 1');
17 this.test.assertExists("#f1"); 7 this.test.assertExists("#f1");
...@@ -37,5 +27,5 @@ casper.withFrame('frame2', function() { ...@@ -37,5 +27,5 @@ casper.withFrame('frame2', function() {
37 27
38 casper.run(function() { 28 casper.run(function() {
39 this.test.assertTitle('CasperJS test frames'); 29 this.test.assertTitle('CasperJS test frames');
40 this.test.done(14); 30 this.test.done(10);
41 }); 31 });
......