Added Casper.waitForPage() and Casper.withChildPage()
PhantomJS 1.7 ships with support for child pages (say popups and frames). CasperJS can now wait for a child being opened and loaded to react accordingly using these two new methods: ```js casper.start('http://foo.bar/').then(function() { this.test.assertTitle('Main page title'); this.clickLabel('Open me a popup'); }); casper.waitForPage(/popup\.html$/, function() { this.withChildPage(this.childPages[0], function() { this.test.assertTitle('Popup title'); }); }); casper.then(function() { this.test.assertTitle('Main page title'); }); ```
Showing
5 changed files
with
164 additions
and
2 deletions
tests/site/child-page.html
0 → 100644
tests/suites/casper/child-page.js
0 → 100644
-
Please register or sign in to post a comment