Skip to content

Instantly share code, notes, and snippets.

@asciidisco
Last active August 29, 2015 14:03
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/33f44e2c58fd01d333e1 to your computer and use it in GitHub Desktop.
Save asciidisco/33f44e2c58fd01d333e1 to your computer and use it in GitHub Desktop.
'use strict';
module.exports = {
'Can move data around': function (test) {
test.open('http://localhost:5001/about.html')
// executed in browser scope
.execute(function () {
var message = Math.random().toString(36).substring(7);
this.data('lastMessage', message);
})
// executed in node scope
.log.message(function () {
// do some weird node stuff here
var fs = require('fs');
fs.writeFileSync('foo.txt', test.data('lastMessage'));
return test.data('lastMessage'); // outputs the message if dalek is started with -l 4
})
.done();
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment