Skip to content

Instantly share code, notes, and snippets.

@EndangeredMassa
Created May 9, 2013 15:13
Show Gist options
  • Save EndangeredMassa/5548087 to your computer and use it in GitHub Desktop.
Save EndangeredMassa/5548087 to your computer and use it in GitHub Desktop.
Multiple calls to casper.start
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
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
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
$ 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