Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added some tests for frames support

  • Loading branch information...
commit 2c0090b3f586daddfaf9bad44d12d026b7650d32 1 parent dce0aa7
Nicolas Perriault authored
8 tests/site/frame1.html
View
@@ -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 tests/site/frame2.html
View
@@ -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 tests/site/frames.html
View
@@ -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 tests/suites/casper/frames.js
View
@@ -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();
+});
Please sign in to comment.
Something went wrong with that request. Please try again.