Added nightwatch starrynight scaffold folder
This commit is contained in:
1 parent
2ea9eae0aa
commit
d2ab42e11c
18 files changed
+246
No files matched your search
@@ -0,0 +1,21 @@
|
||||
// async version calls method on the server
|
||||
exports.command = function(methodName, timeout) {
|
||||
var client = this;
|
||||
if (!timeout) {
|
||||
timeout = 5000;
|
||||
}
|
||||
|
||||
this
|
||||
.timeoutsAsyncScript(timeout)
|
||||
.executeAsync(function(data, meteorCallback){
|
||||
//return HipaaLogger.logEventObject(data);
|
||||
Meteor.call(methodName, data, function(meteorError, meteorResult){
|
||||
var response = (meteorError ? { error: meteorError } : { result: meteorResult });
|
||||
meteorCallback(response);
|
||||
})
|
||||
}, [hipaaEvent], function(result){
|
||||
console.log("result.value", result.value);
|
||||
client.assert.ok(result.value);
|
||||
}).pause(1000)
|
||||
return this;
|
||||
};
|
||||
@@ -0,0 +1,40 @@
|
||||
/*exports.command = function(sessionName, expectedValue, timeout, callback) {
|
||||
|
||||
var self = this;
|
||||
if (!timeout) {
|
||||
timeout = 5000;
|
||||
}
|
||||
|
||||
var glassOpacity = false;
|
||||
|
||||
this
|
||||
.timeoutsAsyncScript(timeout)
|
||||
.executeAsync(function (data, callback) {
|
||||
return Session.get('glassOpacity');
|
||||
}, [''], function (response) { // you need to pass an ARRAY of ONE argument, must be a bug
|
||||
if (response.value.error) {
|
||||
throw 'Meteor apply (call) returned an error: ' + response.value.error;
|
||||
} else if (typeof callback === 'function') {
|
||||
callback.call(self);
|
||||
}
|
||||
})
|
||||
return this;
|
||||
};*/
|
||||
|
||||
|
||||
|
||||
|
||||
// syncrhonous version; only works for checking javascript objects on client
|
||||
exports.command = function(sessionVarName, expectedValue) {
|
||||
var client = this;
|
||||
this
|
||||
.execute(function(data){
|
||||
return Session.get(data);
|
||||
}, [sessionVarName], function(result){
|
||||
client.assert.ok(result.value);
|
||||
if(expectedValue){
|
||||
client.assert.equal(result.value, expectedValue);
|
||||
}
|
||||
}).pause(1000)
|
||||
return this;
|
||||
};
|
||||
Reference in new issue
Block a user