Added nightwatch starrynight scaffold folder

This commit is contained in:
Erik Ziegler committed 2016-01-26 17:57:50 +01:00
1 parent 2ea9eae0aa
commit d2ab42e11c
18 files changed
+246

No files matched your search

@@ -0,0 +1,15 @@
exports.command = function(username, password) {
this
.waitForElementVisible('#entrySignIn', 1000)
.verify.elementPresent("#signInPageTitle")
.verify.elementPresent("#signInPageMessage")
.verify.elementPresent("#signInPageEmailInput")
.verify.elementPresent("#signInPagePasswordInput")
.verify.elementPresent("#signInToAppButton")
.verify.elementPresent("#needAnAccountButton")
.verify.containsText("#signInPageTitle", "Sign In")
.verify.containsText("#signInPageMessage", "Improve your clincal practice with checklists.")
return this; // allows the command to be chained.
};
@@ -0,0 +1,11 @@
exports.command = function(username, password) {
this
.waitForElementVisible('#entrySignUp', 1000)
.verify.elementPresent("#signUpPageEmailInput")
.verify.elementPresent("#signUpPagePasswordInput")
.verify.elementPresent("#signUpPagePasswordConfirmInput")
.verify.elementPresent("#signUpPageJoinNowButton")
return this; // allows the command to be chained.
};
@@ -0,0 +1,14 @@
exports.command = function(username, password) {
this
.waitForElementVisible('#entrySignIn', 1000)
.verify.elementPresent("#signInPageEmailInput")
.verify.elementPresent("#signInPagePasswordInput")
.setValue("#signInPageEmailInput", username)
.setValue("#signInPagePasswordInput", password)
.click("#signInToAppButton").pause(1000)
return this; // allows the command to be chained.
};
@@ -0,0 +1,8 @@
exports.command = function(email, password) {
this
.verify.elementPresent("#logoutButton")
.click("#logoutButton").pause(500)
return this; // allows the command to be chained.
};
@@ -0,0 +1,23 @@
exports.command = function(email, password) {
this
.waitForElementVisible('#entrySignUp', 1000)
.verify.elementPresent("#signUpPageEmailInput")
.verify.elementPresent("#signUpPagePasswordInput")
.verify.elementPresent("#signUpPagePasswordConfirmInput")
.clearValue("#signUpPageEmailInput")
.clearValue("#signUpPagePasswordInput")
.clearValue("#signUpPagePasswordConfirmInput")
// .setValue("#signUpPageUsernameInput", "Jane Doe")
.setValue("#signUpPageEmailInput", email)
.setValue("#signUpPagePasswordInput", password)
.setValue("#signUpPagePasswordConfirmInput", password)
.click("#signUpPageJoinNowButton").pause(200)
return this; // allows the command to be chained.
};
@@ -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;
};