Skip to content
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.

Commit

Permalink
added some tests for frames support
Browse files Browse the repository at this point in the history
  • Loading branch information
n1k0 committed Nov 18, 2012
1 parent dce0aa7 commit 2c0090b
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/site/frame1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CasperJS frame 1</title>
</head>
<body id="f1">This is frame 1.</body>
</html>
8 changes: 8 additions & 0 deletions tests/site/frame2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CasperJS frame 2</title>
</head>
<body id="f2">This is frame 2.</body>
</html>
12 changes: 12 additions & 0 deletions tests/site/frames.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>CasperJS test frames</title>
</head>
<frameset cols="50%,50%%">
<frame src="frame1.html" name="frame1">
<frame src="frame2.html" name="frame2">
</frameset>
</html>

18 changes: 18 additions & 0 deletions tests/suites/casper/frames.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*global casper*/
/*jshint strict:false*/
casper.start('tests/site/frames.html', function() {
this.test.assertTitle('CasperJS test frames');
this.page.switchToChildFrame("frame1");
this.test.assertTitle('CasperJS frame 1');
this.test.assertExists("#f1");
this.test.assertDoesntExist("#f2");
this.page.switchToParentFrame();
this.page.switchToChildFrame("frame2");
this.test.assertTitle('CasperJS frame 2');
this.test.assertExists("#f2");
this.test.assertDoesntExist("#f1");
});

casper.run(function() {
this.test.done();
});

0 comments on commit 2c0090b

Please sign in to comment.