Created
October 10, 2013 07:52
-
-
Save naoya/6914622 to your computer and use it in GitHub Desktop.
This file contains 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
casper.test.begin 'トップページから検索して貼り付けHTMLを取得', 7, (test) -> | |
casper.start 'http://app.amazlet.com/', -> | |
test.assertHttpStatus 200 | |
test.assertTitleMatch /^amazlet/, "タイトル文字列が期待通り" | |
test.assertExists 'form', "メインフォームがある" | |
@fill 'form', keyword: "chef solo" | |
@click 'form input[type="submit"]' | |
casper.then -> | |
test.assertHttpStatus 200 | |
test.assertExists 'p.title', '検索結果が一つ以上ある' | |
@click 'a.minibutton' | |
casper.then -> | |
test.assertHttpStatus 200 | |
result = @evaluate -> document.getElementById('standard').value | |
test.assertMatch result, /^<div/, 'HTMLタグが取得できた' | |
casper.run -> | |
do test.done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment