Skip to content

Instantly share code, notes, and snippets.

@whharris
Created October 28, 2014 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whharris/33b964fb81a509023e9a to your computer and use it in GitHub Desktop.
Save whharris/33b964fb81a509023e9a to your computer and use it in GitHub Desktop.
Example CasperJS test script using a custom assertion on resource requests
require('./casper.intentmedia.js')
test_page = 'http://localhost/test_page.html'
beacon_url = /http:\/\/localhost\/beacon\.html.*/
casper.test.begin "Page fires a beacon request", 1, (test) ->
casper.start 'http://localhost', ->
casper.assertResourceRequestAfterStep beacon_url, ->
casper.open test_page
casper.run ->
test.done()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment