-
-
Save TexRx/51d8f973e87c1e0c4fc1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
<iframe name="ad_iframe" src="./casper_test.html" /> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global require:false */ | |
var casper = require('casper').create(); | |
casper.start('./iframe_test.html'); | |
casper.withFrame('ad_iframe', function () { | |
this.test.assertUrlMatch(/casper_test\.html/, 'i am on inside of iframe'); | |
this.test.assertVisible('#hoge', 'hoge is clickable'); | |
this.clickLabel('clickable hoge'); | |
}); | |
casper.withFrame('ad_iframe', function () { | |
this.test.assertUrlMatch(/#!\/hoge/, 'hash changed to hoge'); | |
this.test.assertNotVisible('#fuga', 'fuga is not clickable'); | |
this.clickLabel('unclickable fuga'); | |
}); | |
casper.withFrame('ad_iframe', function () { | |
this.test.assertUrlMatch(/#!\/hoge/, 'hash not changed to fuga'); | |
this.echo("I'm sorry, it's clickable..."); | |
}); | |
casper.run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment