- Renamed validatePassword method, usePwstrength and useZxcvbn,

- Moved passwordOptions from settings.json to ActiveEntry configuration object
- Used zxcvbn rule set if showPasswordStrengthIndicator is true, used regular expression rule set if showPasswordStrengthIndicator is false
This commit is contained in:
Aysel Afsar committed 2016-02-04 17:53:01 -05:00
1 parent 4e986c8395
commit e659f0f4b3
17 files changed
+165 -102

No files matched your search

@@ -61,7 +61,7 @@ describe('clinical:active-entry', function () {
expect(ActiveEntry.errorMessages.get('password')).to.equal("Password is required");
ActiveEntry.verifyPassword('kittens');
expect(ActiveEntry.errorMessages.get('password')).to.equal("Password must have at least 8 characters. It must contain at least 1 uppercase, 1 lowercase, 1 number and 1 special character.");
expect(ActiveEntry.errorMessages.get('password')).to.equal(Session.get('passwordWarning'));
ActiveEntry.verifyPassword('K1tt#ns123');
expect(ActiveEntry.successMessages.get('password')).to.equal("Password present");
@@ -21,13 +21,13 @@
module.exports = {
tags: ['users', 'entry'],
before: function(client){
before: function (client) {
client
.url("http://localhost:3000/entrySignUp")
.initializeUsers()
.resizeWindow(1024, 768)
.resizeWindow(1600, 1200);
},
"new user should be able to register on desktop" : function (client) {
"new user should be able to register on desktop": function (client) {
client
.verify.elementPresent("#entrySignUp")
.verify.elementPresent("#signUpPageTitle")
@@ -35,21 +35,21 @@ module.exports = {
.verify.elementPresent("#signUpPageEmailInput")
.verify.elementPresent("#signUpPagePasswordInput")
.verify.elementPresent("#signUpPageJoinNowButton")
.verify.elementPresent("#signUpPageSignInButton")
.verify.elementPresent("#signUpPageSignInButton");
},
"company logo should display on sign-in page" : function (client) {
"company logo should display on sign-in page": function (client) {
client
.verify.elementPresent("#entrySignUp")
.verify.elementPresent("#entryAppLogo")
.verify.elementPresent("#entryAppLogo");
},
"user should be able to request be able to create new account" : function (client) {
"user should be able to request be able to create new account": function (client) {
client.verify.elementPresent("#signUpPageEmailInput")
.verify.elementPresent("#signUpPagePasswordInput")
.verify.elementPresent("#signUpPagePasswordConfirmInput")
.verify.elementPresent("#signUpPageJoinNowButton")
.verify.elementPresent("#signUpPagePasswordInput")
.verify.elementPresent("#signUpPageJoinNowButton");
},
"guest should be notified if password is insecure" : function (client) {
"guest should be notified if password is insecure": function (client) {
client
.clearValue("input")
.verify.elementPresent("#signUpPagePasswordInput")
@@ -59,14 +59,15 @@ module.exports = {
.setValue("#signUpPagePasswordInput", "iceD*e123")
.verify.cssProperty('#signUpPagePasswordInput', 'border', '1px solid green')
.verify.cssProperty('#signUpPagePasswordConfirmInput', 'border', '1px solid gray')
.verify.cssProperty('#signUpPagePasswordConfirmInput', 'border', '1px solid gray')
.setValue("#signUpPagePasswordConfirmInput", "ja")
.verify.cssProperty('#signUpPagePasswordConfirmInput', 'border', '1px solid rgb(242, 222, 222)')
.verify.cssProperty('#signUpPagePasswordConfirmInput', 'border',
'1px solid rgb(242, 222, 222)')
.clearValue("#signUpPagePasswordConfirmInput")
.setValue("#signUpPagePasswordConfirmInput", "Janiced*e123")
.verify.cssProperty('#signUpPagePasswordConfirmInput', 'border', '1px solid green')
.verify.cssProperty('#signUpPagePasswordConfirmInput', 'border', '1px solid green');
},
"guest should be notified if passwords do not match" : function (client) {
"guest should be notified if passwords do not match": function (client) {
client
.clearValue("#signUpPagePasswordConfirmInput")
.clearValue("#signUpPagePasswordInput")
@@ -79,9 +80,9 @@ module.exports = {
.verify.cssProperty('#signUpPagePasswordConfirmInput', 'border', '1px solid gray')
.setValue("#signUpPagePasswordConfirmInput", "Janiced*e123")
.verify.cssProperty('#signUpPagePasswordInput', 'border', '1px solid green')
.verify.cssProperty('#signUpPagePasswordConfirmInput', 'border', '1px solid green')
.verify.cssProperty('#signUpPagePasswordConfirmInput', 'border', '1px solid green');
},
"guest should be notified if email is not correctly formatted" : function (client) {
"guest should be notified if email is not correctly formatted": function (client) {
client
.clearValue("#signUpPageEmailInput")
.resetEntry()
@@ -90,43 +91,43 @@ module.exports = {
.setValue("#signUpPageEmailInput", "janicedoe")
.verify.cssProperty('#signUpPageEmailInput', 'border', '1px solid rgb(242, 222, 222)')
.setValue("#signUpPageEmailInput", "@symptomatic.io")
.verify.cssProperty('#signUpPageEmailInput', 'border', '1px solid green')
.verify.cssProperty('#signUpPageEmailInput', 'border', '1px solid green');
},
"when new user fills out form and registers, new user should get created" : function (client) {
"when new user fills out form and registers, new user should get created": function (client) {
client
.verify.elementPresent("#entrySignUp")
.clearValue("#signUpPagePasswordConfirmInput")
.clearValue("#signUpPagePasswordConfirmInput")
.clearValue("#signUpPagePasswordInput")
.clearValue("#signUpPageFullNameInput")
.clearValue("#signUpPageEmailInput")
.resetEntry()
.setValue("#signUpPageFullNameInput", "Janice Doe")
.setValue("#signUpPageFullNameInput", "Janice Doe")
.setValue("#signUpPageEmailInput", "janicedoe@symptomatic.io")
.setValue("#signUpPagePasswordInput", "Janiced*e123")
.setValue("#signUpPagePasswordConfirmInput", "Janiced*e123")
.click("#signUpPageJoinNowButton").pause(1000)
.click("#signUpPageJoinNowButton").pause(1000)
.verify.containsText("#usernameLink", "janicedoe@symptomatic.io")
.verify.containsText("#usernameLink", "janicedoe@symptomatic.io");
},
"user should be able to signout" : function (client) {
"user should be able to signout": function (client) {
client
.verify.elementPresent("#logoutButton")
.click("#logoutButton").pause(300)
.verify.containsText("#usernameLink", "Sign In")
.verify.containsText("#usernameLink", "Sign In");
},
"user should be able to request reset password email" : function (client) {
client
"user should be able to request reset password email": function (client) {
client
.url("http://localhost:3000/entrySignIn")
.verify.elementPresent("#forgotPasswordButton")
.click("#forgotPasswordButton")
.verify.elementPresent("#forgotPassword")
.verify.elementPresent("#signInPageEmailInput")
.verify.elementPresent("#sendReminderButton")
.verify.elementPresent("#sendReminderButton");
},
"existing user should be able to sign in on desktop" : function (client) {
"existing user should be able to sign in on desktop": function (client) {
client
.url("http://localhost:3000/entrySignIn")
.resizeWindow(1600, 1200)
@@ -134,9 +135,9 @@ module.exports = {
.signIn("janicedoe@symptomatic.io", "Janiced*e123").pause(500)
.verify.containsText("#usernameLink", "janicedoe@symptomatic.io")
.click("#logoutButton").pause(200)
.verify.containsText("#usernameLink", "Sign In")
.verify.containsText("#usernameLink", "Sign In");
},
"existing user should be able to sign in on tablet" : function (client) {
"existing user should be able to sign in on tablet": function (client) {
client
.url("http://localhost:3000/entrySignIn")
.resizeWindow(1024, 768)
@@ -144,20 +145,21 @@ module.exports = {
.signIn("janicedoe@symptomatic.io", "Janiced*e123").pause(500)
.verify.containsText("#usernameLink", "janicedoe@symptomatic.io")
.click("#logoutButton").pause(200)
.verify.containsText("#usernameLink", "Sign In")
.verify.containsText("#usernameLink", "Sign In");
},
"existing user should be able to sign in on phone" : function (client) {
"existing user should be able to sign in on phone": function (client) {
client
.url("http://localhost:3000/entrySignIn")
.resizeWindow(320, 960)
// .verify.containsText("#usernameLink", "Sign In")
.signIn("janicedoe@symptomatic.io", "Janiced*e123").pause(500)
.click("#sidebarToggle").pause(300)
.click("#navbarHeader").pause(300)
.verify.containsText("#usernameLink", "janicedoe@symptomatic.io")
.click("#logoutButton").pause(200)
.verify.containsText("#usernameLink", "Sign In")
.verify.containsText("#usernameLink", "Sign In");
},
"if anonymous user tries to log in with non-existing account, a message is shown" : function (client) {
"if anonymous user tries to log in with non-existing account, a message is shown": function (
client) {
client
.url("http://localhost:3000/entrySignIn")
.resizeWindow(1024, 768)
@@ -165,18 +167,18 @@ module.exports = {
.verify.containsText("#signInPageMessage", "User not found [403]")
.verify.cssProperty("#signInPageMessage", "color", "rgba(169, 68, 66, 1)")
.verify.cssProperty("#signInPageMessage", "background-color", "rgba(242, 222, 222, 1)")
.verify.cssProperty("#signInPageMessage", "border-color", "rgb(235, 204, 209)")
.verify.cssProperty("#signInPageMessage", "border-color", "rgb(235, 204, 209)");
},
"anonymous guest should be notified if email already exists" : function (client) {
"anonymous guest should be notified if email already exists": function (client) {
client
.url("http://localhost:3000/entrySignUp")
.resizeWindow(1024, 768)
.signUp("janicedoe@symptomatic.io", "Janiced*e123").pause(500)
.click("#signUpPageEmailInput").pause(500)
.click("#signUpPageJoinNowButton").pause(1000)
.verify.elementPresent("#signUpPageMessage")
.verify.containsText("#signUpPageMessage", "Email already exists. [403]")
.verify.containsText("#signUpPageMessage", "Email already exists. [403]");
},
after: function(client){
after: function (client) {
client
.dropEntryUsers()
.end();