Created
July 9, 2014 14:34
-
-
Save asciidisco/57d5e50e07d2428e808d to your computer and use it in GitHub Desktop.
Fetching a random element
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict': | |
var randomPickMe = function (arr) { | |
return arr[Math.floor((Math.random()*arr.length))]; | |
}; | |
var elements = ['div', 'p', '.someClass', '#anid', 'span a']; | |
module.exports = { | |
'Check random text': function (test) { | |
test | |
.open('http://not.arandom.url') | |
.assert.text(randomPickMe(elements), 'I should fail, because you pick me randomly') | |
.done(); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment