Last active
February 23, 2016 10:28
-
-
Save asciidisco/8377479 to your computer and use it in GitHub Desktop.
Reuse tests or navigation functions across DalekJS files
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
module.exports = { | |
loginLocal: function (test) { | |
test | |
.open('http://thefalloftheeleventh.com') | |
.type('[name="user"]', 'John Smith') | |
.type('[name="pass"]', 'tardis') | |
.click('button[type="submit"]') | |
.done(); | |
}, | |
killLocalStorage: function (test) { | |
test | |
.execute(function () { | |
window.localstorage.clear(); | |
}) | |
.wait(500) | |
.done(); | |
} | |
}; |
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
var fns = require('./functions'); | |
module.exports = { | |
'clear browser storage': fns.killLocalStorage, | |
'login': fns.loginLocal, | |
'a test': function (test) { | |
test | |
.click('#aLink') | |
.assert.text('#aText', 'Lorem ipsum...') | |
.done(); | |
}, | |
'clear storage on end': fns.killLocalStorage | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment