Skip to content

Instantly share code, notes, and snippets.

@sjungling
Created September 17, 2013 22:45
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 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