Skip to content

Instantly share code, notes, and snippets.

@sjungling
Created September 17, 2013 22:45
Show Gist options
  • Save sjungling/6601730 to your computer and use it in GitHub Desktop.
Save sjungling/6601730 to your computer and use it in GitHub Desktop.
casper = require('casper').create()
casper.test.begin "Check for dataLayer on product page", 1, (test) ->
casper.start 'http://local.build.com/k-690/p173354', ->
test.assertEval ->
typeof window.dataLayer.productId != "undefined"
, 'Does dataLayer.productId exist?'
test.assertEvalEquals ->
window.dataLayer.productId
, "K-690", 'Is the value of dataLayer.productId "K-690"?'
casper.run ->
test.done()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment