Created
May 9, 2013 15:13
-
-
Save EndangeredMassa/5548087 to your computer and use it in GitHub Desktop.
Multiple calls to casper.start
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
Scenario = (message, tests) -> | |
casper.start() | |
casper.test.info message | |
tests() | |
casper.run -> | |
casper.test.done() | |
Scenario 'Test a 200', -> | |
casper.open 'http://httpstat.us/200' | |
casper.then -> | |
casper.test.assertHttpStatus 200 | |
Scenario 'Test a 201', -> | |
casper.open 'http://httpstat.us/201' | |
casper.then -> | |
casper.test.assertHttpStatus 201 |
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
Scenario = (message, tests) -> | |
casper.start() | |
casper.test.info message | |
tests() | |
casper.run -> | |
casper.test.done() | |
Scenario 'Test a 201', -> | |
casper.open 'http://httpstat.us/201' | |
casper.then -> | |
casper.test.assertHttpStatus 201 |
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
Scenario = (message, tests) -> | |
casper.start() | |
casper.test.info message | |
tests() | |
casper.run -> | |
casper.test.done() | |
Scenario 'Test a 200', -> | |
casper.open 'http://httpstat.us/200' | |
casper.then -> | |
casper.test.assertHttpStatus 200 |
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
$ casperjs test single-open1.coffee | |
Test file: single-open1.coffee | |
Test a 201 | |
PASS HTTP status code is: 201 | |
PASS 1 tests executed in 0.348s, 1 passed, 0 failed. | |
$ casperjs test single-open2.coffee | |
Test file: single-open2.coffee | |
Test a 200 | |
PASS HTTP status code is: 200 | |
PASS 1 tests executed in 0.549s, 1 passed, 0 failed. | |
$ casperjs test double-open.coffee | |
Test file: double-open.coffee | |
Test a 200 | |
Test a 201 | |
PASS HTTP status code is: 201 | |
PASS 1 tests executed in 0.358s, 1 passed, 0 failed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment