Skip to content

Instantly share code, notes, and snippets.

@asciidisco
Last active August 29, 2015 13:55
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 asciidisco/8731237 to your computer and use it in GitHub Desktop.
Save asciidisco/8731237 to your computer and use it in GitHub Desktop.
Check existence of attributes with Dalek
test.execute(function () {
var nl = document.querySelectorAll(".menubar a[href]");
var as = Array.prototype.slice.call(nl);
as.foreach(function (el) {
var attr = el.getAttribute('data-tracking-id');
this.assert.ok((attr !== null), 'Attribute exists for:' + el.outerHTML);
}.bind(this))
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment