PageRenderTime 69ms CodeModel.GetById 2ms app.highlight 61ms RepoModel.GetById 1ms app.codeStats 1ms

/modules/users/tests/e2e/users.e2e.tests.js

https://bitbucket.org/patricksile/csa_app
JavaScript | 552 lines | 402 code | 24 blank | 126 comment | 0 complexity | ba64f1ca5fd9efd357fd97a3e824aad7 MD5 | raw file
  1'use strict';
  2
  3describe('Users E2E Tests:', function () {
  4  var user1 = {
  5    firstName: 'test',
  6    lastName: 'user',
  7    email: 'test.user@meanjs.com',
  8    username: 'testUser',
  9    password: 'P@$$w0rd!!'
 10  };
 11
 12  var user2 = {
 13    firstName: 'test',
 14    lastName: 'user2',
 15    email: 'test.user2@meanjs.com',
 16    username: 'testUser2',
 17    password: 'P@$$w0rd!!'
 18  };
 19
 20  var signout = function () {
 21    // Make sure user is signed out first
 22    browser.get('http://localhost:3001/authentication/signout');
 23    // Delete all cookies
 24    browser.driver.manage().deleteAllCookies();
 25  };
 26
 27  describe('Signup Validation', function () {
 28    it('Should report missing first name', function () {
 29      browser.get('http://localhost:3001/authentication/signup');
 30      // Enter Last Name
 31      element(by.model('vm.credentials.lastName')).sendKeys(user1.lastName);
 32      // Enter Email
 33      element(by.model('vm.credentials.email')).sendKeys(user1.email);
 34      // Enter Username
 35      element(by.model('vm.credentials.username')).sendKeys(user1.username);
 36      // Enter Password
 37      element(by.model('vm.credentials.password')).sendKeys(user1.password);
 38      // Click Submit button
 39      element(by.css('button[type=submit]')).click();
 40      // First Name Error
 41      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('First name is required.');
 42    });
 43
 44    it('Should report missing last name', function () {
 45      browser.get('http://localhost:3001/authentication/signup');
 46      // Enter First Name
 47      element(by.model('vm.credentials.firstName')).sendKeys(user1.firstName);
 48      // Enter Email
 49      element(by.model('vm.credentials.email')).sendKeys(user1.email);
 50      // Enter Username
 51      element(by.model('vm.credentials.username')).sendKeys(user1.username);
 52      // Enter Password
 53      element(by.model('vm.credentials.password')).sendKeys(user1.password);
 54      // Click Submit button
 55      element(by.css('button[type=submit]')).click();
 56      // Last Name Error
 57      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('Last name is required.');
 58    });
 59
 60    it('Should report missing email address', function () {
 61      browser.get('http://localhost:3001/authentication/signup');
 62      // Enter First Name
 63      element(by.model('vm.credentials.firstName')).sendKeys(user1.firstName);
 64      // Enter Last Name
 65      element(by.model('vm.credentials.lastName')).sendKeys(user1.lastName);
 66      // Enter Username
 67      element(by.model('vm.credentials.username')).sendKeys(user1.username);
 68      // Enter Password
 69      element(by.model('vm.credentials.password')).sendKeys(user1.password);
 70      // Click Submit button
 71      element(by.css('button[type=submit]')).click();
 72      // Email address error
 73      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('Email address is required.');
 74    });
 75
 76    it('Should report invalid email address - "123"', function () {
 77      browser.get('http://localhost:3001/authentication/signup');
 78      // Enter First Name
 79      element(by.model('vm.credentials.firstName')).sendKeys(user1.firstName);
 80      // Enter Last Name
 81      element(by.model('vm.credentials.lastName')).sendKeys(user1.lastName);
 82      // Enter Email
 83      element(by.model('vm.credentials.email')).sendKeys('123');
 84      // Enter Username
 85      element(by.model('vm.credentials.username')).sendKeys(user1.username);
 86      // Enter Password
 87      element(by.model('vm.credentials.password')).sendKeys(user1.password);
 88      // Click Submit button
 89      element(by.css('button[type=submit]')).click();
 90      // Email address error
 91      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('Email address is invalid.');
 92    });
 93
 94    /**
 95     * Note: 123@123 is a valid email adress according to HTML5.
 96     * However, 123@123@123 is an invalid email address.
 97     */
 98    it('Should report invalid email address - "123@123@123"', function () {
 99      browser.get('http://localhost:3001/authentication/signup');
100      // Enter First Name
101      element(by.model('vm.credentials.firstName')).sendKeys(user1.firstName);
102      // Enter Last Name
103      element(by.model('vm.credentials.lastName')).sendKeys(user1.lastName);
104      // Enter Email
105      element(by.model('vm.credentials.email')).sendKeys('123@123@123');
106      // Enter Username
107      element(by.model('vm.credentials.username')).sendKeys(user1.username);
108      // Enter Password
109      element(by.model('vm.credentials.password')).sendKeys(user1.password);
110      // Click Submit button
111      element(by.css('button[type=submit]')).click();
112      // Email address error
113      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('Email address is invalid.');
114    });
115
116    it('Should report invalid username - ".login"', function () {
117      browser.get('http://localhost:3001/authentication/signup');
118      // Enter First Name
119      element(by.model('vm.credentials.firstName')).sendKeys(user1.firstName);
120      // Enter Last Name
121      element(by.model('vm.credentials.lastName')).sendKeys(user1.lastName);
122      // Enter Email
123      element(by.model('vm.credentials.email')).sendKeys(user1.email);
124      // Enter Username
125      element(by.model('vm.credentials.username')).sendKeys('.login');
126      // Enter Password
127      element(by.model('vm.credentials.password')).sendKeys(user1.password);
128      // Click Submit button
129      element(by.css('button[type=submit]')).click();
130      // Email address error
131      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('Please enter a valid username: 3+ characters long, non restricted word, characters "_-.", no consecutive dots, does not begin or end with dots, letters a-z and numbers 0-9.');
132    });
133
134    it('Should report invalid username - "login."', function () {
135      browser.get('http://localhost:3001/authentication/signup');
136      // Enter First Name
137      element(by.model('vm.credentials.firstName')).sendKeys(user1.firstName);
138      // Enter Last Name
139      element(by.model('vm.credentials.lastName')).sendKeys(user1.lastName);
140      // Enter Email
141      element(by.model('vm.credentials.email')).sendKeys(user1.email);
142      // Enter Username
143      element(by.model('vm.credentials.username')).sendKeys('login.');
144      // Enter Password
145      element(by.model('vm.credentials.password')).sendKeys(user1.password);
146      // Click Submit button
147      element(by.css('button[type=submit]')).click();
148      // Email address error
149      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('Please enter a valid username: 3+ characters long, non restricted word, characters "_-.", no consecutive dots, does not begin or end with dots, letters a-z and numbers 0-9.');
150    });
151
152    it('Should report invalid username - "log..in"', function () {
153      browser.get('http://localhost:3001/authentication/signup');
154      // Enter First Name
155      element(by.model('vm.credentials.firstName')).sendKeys(user1.firstName);
156      // Enter Last Name
157      element(by.model('vm.credentials.lastName')).sendKeys(user1.lastName);
158      // Enter Email
159      element(by.model('vm.credentials.email')).sendKeys(user1.email);
160      // Enter Username
161      element(by.model('vm.credentials.username')).sendKeys('log..in');
162      // Enter Password
163      element(by.model('vm.credentials.password')).sendKeys(user1.password);
164      // Click Submit button
165      element(by.css('button[type=submit]')).click();
166      // Email address error
167      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('Please enter a valid username: 3+ characters long, non restricted word, characters "_-.", no consecutive dots, does not begin or end with dots, letters a-z and numbers 0-9.');
168    });
169
170    it('Should report invalid username - "lo"', function () {
171      browser.get('http://localhost:3001/authentication/signup');
172      // Enter First Name
173      element(by.model('vm.credentials.firstName')).sendKeys(user1.firstName);
174      // Enter Last Name
175      element(by.model('vm.credentials.lastName')).sendKeys(user1.lastName);
176      // Enter Email
177      element(by.model('vm.credentials.email')).sendKeys(user1.email);
178      // Enter Username
179      element(by.model('vm.credentials.username')).sendKeys('lo');
180      // Enter Password
181      element(by.model('vm.credentials.password')).sendKeys(user1.password);
182      // Click Submit button
183      element(by.css('button[type=submit]')).click();
184      // Email address error
185      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('Please enter a valid username: 3+ characters long, non restricted word, characters "_-.", no consecutive dots, does not begin or end with dots, letters a-z and numbers 0-9.');
186    });
187
188    it('Should report invalid username - "log$in"', function () {
189      browser.get('http://localhost:3001/authentication/signup');
190      // Enter First Name
191      element(by.model('vm.credentials.firstName')).sendKeys(user1.firstName);
192      // Enter Last Name
193      element(by.model('vm.credentials.lastName')).sendKeys(user1.lastName);
194      // Enter Email
195      element(by.model('vm.credentials.email')).sendKeys(user1.email);
196      // Enter Username
197      element(by.model('vm.credentials.username')).sendKeys('log$in');
198      // Enter Password
199      element(by.model('vm.credentials.password')).sendKeys(user1.password);
200      // Click Submit button
201      element(by.css('button[type=submit]')).click();
202      // Email address error
203      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('Please enter a valid username: 3+ characters long, non restricted word, characters "_-.", no consecutive dots, does not begin or end with dots, letters a-z and numbers 0-9.');
204    });
205
206    it('Should signup username with . - "log.in"', function () {
207      browser.get('http://localhost:3001/authentication/signup');
208      // Enter First Name
209      element(by.model('vm.credentials.firstName')).sendKeys(user2.firstName);
210      // Enter Last Name
211      element(by.model('vm.credentials.lastName')).sendKeys(user2.lastName);
212      // Enter Email
213      element(by.model('vm.credentials.email')).sendKeys('someemail@meanjs.com');
214      // Enter Username
215      element(by.model('vm.credentials.username')).sendKeys('log.in');
216      // Enter Password
217      element(by.model('vm.credentials.password')).sendKeys(user2.password);
218      // Click Submit button
219      element(by.css('button[type=submit]')).click();
220      // Signup successful with username having .
221      expect(browser.getCurrentUrl()).toEqual('http://localhost:3001/');
222
223      signout();
224    });
225
226    it('Should report missing username', function () {
227      browser.get('http://localhost:3001/authentication/signup');
228      // Enter First Name
229      element(by.model('vm.credentials.firstName')).sendKeys(user1.firstName);
230      // Enter Last Name
231      element(by.model('vm.credentials.lastName')).sendKeys(user1.lastName);
232      // Enter Email
233      element(by.model('vm.credentials.email')).sendKeys(user1.email);
234      // Enter Password
235      element(by.model('vm.credentials.password')).sendKeys(user1.password);
236      // Click Submit button
237      element(by.css('button[type=submit]')).click();
238      // Username Error
239      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('Username is required.');
240    });
241
242    it('Should report a password with less than 10 characters long - "P@$$w0rd!"', function () {
243      browser.get('http://localhost:3001/authentication/signup');
244      // Enter First Name
245      element(by.model('vm.credentials.firstName')).sendKeys(user1.firstName);
246      // Enter Last Name
247      element(by.model('vm.credentials.lastName')).sendKeys(user1.lastName);
248      // Enter Email
249      element(by.model('vm.credentials.email')).sendKeys(user1.email);
250      // Enter Username
251      element(by.model('vm.credentials.username')).sendKeys(user1.username);
252      // Enter Invalid Password
253      element(by.model('vm.credentials.password')).sendKeys('P@$$w0rd!');
254      // Click Submit button
255      element(by.css('button[type=submit]')).click();
256      // Password Error
257      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('The password must be at least 10 characters long.');
258    });
259
260    it('Should report a password with greater than 128 characters long.', function () {
261      browser.get('http://localhost:3001/authentication/signup');
262      // Enter First Name
263      element(by.model('vm.credentials.firstName')).sendKeys(user1.firstName);
264      // Enter Last Name
265      element(by.model('vm.credentials.lastName')).sendKeys(user1.lastName);
266      // Enter Email
267      element(by.model('vm.credentials.email')).sendKeys(user1.email);
268      // Enter Username
269      element(by.model('vm.credentials.username')).sendKeys(user1.username);
270      // Enter Invalid Password
271      element(by.model('vm.credentials.password')).sendKeys(')!/uLT="lh&:`6X!]|15o!$!TJf,.13l?vG].-j],lFPe/QhwN#{Z<[*1nX@n1^?WW-%_.*D)m$toB+N7z}kcN#B_d(f41h%w@0F!]igtSQ1gl~6sEV&r~}~1ub>If1c+');
272      // Click Submit button
273      element(by.css('button[type=submit]')).click();
274      // Password Error
275      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('The password must be fewer than 128 characters.');
276    });
277
278    it('Should report a password with more than 3 or more repeating characters - "P@$$w0rd!!!"', function () {
279      browser.get('http://localhost:3001/authentication/signup');
280      // Enter First Name
281      element(by.model('vm.credentials.firstName')).sendKeys(user1.firstName);
282      // Enter Last Name
283      element(by.model('vm.credentials.lastName')).sendKeys(user1.lastName);
284      // Enter Email
285      element(by.model('vm.credentials.email')).sendKeys(user1.email);
286      // Enter Username
287      element(by.model('vm.credentials.username')).sendKeys(user1.username);
288      // Enter Invalid Password
289      element(by.model('vm.credentials.password')).sendKeys('P@$$w0rd!!!');
290      // Click Submit button
291      element(by.css('button[type=submit]')).click();
292      // Password Error
293      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('The password may not contain sequences of three or more repeated characters.');
294    });
295
296    it('Should report a password with no uppercase letters - "p@$$w0rd!!"', function () {
297      browser.get('http://localhost:3001/authentication/signup');
298      // Enter First Name
299      element(by.model('vm.credentials.firstName')).sendKeys(user1.firstName);
300      // Enter Last Name
301      element(by.model('vm.credentials.lastName')).sendKeys(user1.lastName);
302      // Enter Email
303      element(by.model('vm.credentials.email')).sendKeys(user1.email);
304      // Enter Username
305      element(by.model('vm.credentials.username')).sendKeys(user1.username);
306      // Enter Invalid Password
307      element(by.model('vm.credentials.password')).sendKeys('p@$$w0rd!!');
308      // Click Submit button
309      element(by.css('button[type=submit]')).click();
310      // Password Error
311      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('The password must contain at least one uppercase letter.');
312    });
313
314    it('Should report a password with less than one number - "P@$$word!!"', function () {
315      browser.get('http://localhost:3001/authentication/signup');
316      // Enter First Name
317      element(by.model('vm.credentials.firstName')).sendKeys(user1.firstName);
318      // Enter Last Name
319      element(by.model('vm.credentials.lastName')).sendKeys(user1.lastName);
320      // Enter Email
321      element(by.model('vm.credentials.email')).sendKeys(user1.email);
322      // Enter Username
323      element(by.model('vm.credentials.username')).sendKeys(user1.username);
324      // Enter Invalid Password
325      element(by.model('vm.credentials.password')).sendKeys('P@$$word!!');
326      // Click Submit button
327      element(by.css('button[type=submit]')).click();
328      // Password Error
329      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('The password must contain at least one number.');
330    });
331
332    it('Should report a password with less than one special character - "Passw0rdss"', function () {
333      browser.get('http://localhost:3001/authentication/signup');
334      // Enter First Name
335      element(by.model('vm.credentials.firstName')).sendKeys(user1.firstName);
336      // Enter Last Name
337      element(by.model('vm.credentials.lastName')).sendKeys(user1.lastName);
338      // Enter Email
339      element(by.model('vm.credentials.email')).sendKeys(user1.email);
340      // Enter Username
341      element(by.model('vm.credentials.username')).sendKeys(user1.username);
342      // Enter Invalid Password
343      element(by.model('vm.credentials.password')).sendKeys('Passw0rdss');
344      // Click Submit button
345      element(by.css('button[type=submit]')).click();
346      // Password Error
347      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('The password must contain at least one special character.');
348    });
349
350    it('Should Successfully register new user', function () {
351      browser.get('http://localhost:3001/authentication/signup');
352      // Enter FirstName
353      element(by.model('vm.credentials.firstName')).sendKeys(user1.firstName);
354      // Enter LastName
355      element(by.model('vm.credentials.lastName')).sendKeys(user1.lastName);
356      // Enter Email
357      element(by.model('vm.credentials.email')).sendKeys(user1.email);
358      // Enter UserName
359      element(by.model('vm.credentials.username')).sendKeys(user1.username);
360      // Enter Password
361      element(by.model('vm.credentials.password')).sendKeys(user1.password);
362      // Click Submit button
363      element(by.css('button[type="submit"]')).click();
364      expect(browser.getCurrentUrl()).toEqual('http://localhost:3001/');
365    });
366
367    it('Should report Email already exists', function () {
368      // Make sure user is signed out first
369      signout();
370      // Signup
371      browser.get('http://localhost:3001/authentication/signup');
372      // Enter First Name
373      element(by.model('vm.credentials.firstName')).sendKeys(user2.firstName);
374      // Enter Last Name
375      element(by.model('vm.credentials.lastName')).sendKeys(user2.lastName);
376      // Enter Email
377      element(by.model('vm.credentials.email')).sendKeys(user1.email);
378      // Enter Username
379      element(by.model('vm.credentials.username')).sendKeys(user2.username);
380      // Enter Invalid Password
381      element(by.model('vm.credentials.password')).sendKeys(user2.password);
382      // Click Submit button
383      element(by.css('button[type=submit]')).click();
384      // Password Error
385      expect(element.all(by.css('.message')).get(0).getText()).toBe('Email already exists');
386    });
387
388    it('Should report Username already exists', function () {
389      // Signup
390      browser.get('http://localhost:3001/authentication/signup');
391      // Enter First Name
392      element(by.model('vm.credentials.firstName')).sendKeys(user2.firstName);
393      // Enter Last Name
394      element(by.model('vm.credentials.lastName')).sendKeys(user2.lastName);
395      // Enter Email
396      element(by.model('vm.credentials.email')).sendKeys(user2.email);
397      // Enter Username
398      element(by.model('vm.credentials.username')).sendKeys(user1.username);
399      // Enter Invalid Password
400      element(by.model('vm.credentials.password')).sendKeys(user2.password);
401      // Click Submit button
402      element(by.css('button[type=submit]')).click();
403      // Password Error
404      expect(element.all(by.css('.message')).get(0).getText()).toBe('Username already exists');
405    });
406
407  });
408
409  describe('Signin Validation', function () {
410
411    it('Should report missing credentials', function () {
412      // Make sure user is signed out first
413      signout();
414      // Sign in
415      browser.get('http://localhost:3001/authentication/signin');
416      // Click Submit button
417      element(by.css('button[type="submit"]')).click();
418      // Username Error
419      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('Username or Email is required.');
420      // Password Error
421      expect(element.all(by.css('.error-text')).get(1).getText()).toBe('Password is required.');
422    });
423
424    it('Verify that the user is logged in', function () {
425      // Make sure user is signed out first
426      signout();
427      // Sign in
428      browser.get('http://localhost:3001/authentication/signin');
429      // Enter UserName
430      element(by.model('vm.credentials.usernameOrEmail')).sendKeys(user1.username);
431      // Enter Password
432      element(by.model('vm.credentials.password')).sendKeys(user1.password);
433      // Click Submit button
434      element(by.css('button[type="submit"]')).click();
435      expect(browser.getCurrentUrl()).toEqual('http://localhost:3001/');
436    });
437
438  });
439
440  describe('Change Password Settings Validation', function () {
441
442    it('Should report missing passwords', function () {
443      browser.get('http://localhost:3001/settings/password');
444      // Click Submit button
445      element(by.css('button[type=submit]')).click();
446      // Password Errors
447      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('Your current password is required.');
448      expect(element.all(by.css('.error-text')).get(1).getText()).toBe('Enter a new password.');
449      expect(element.all(by.css('.error-text')).get(2).getText()).toBe('Verify your new password.');
450    });
451
452    it('Should report a password with less than 10 characters long - "P@$$w0rd!"', function () {
453      browser.get('http://localhost:3001/settings/password');
454      // Enter Current Password
455      element(by.model('vm.passwordDetails.currentPassword')).sendKeys(user1.password);
456      // Enter Invalid Password
457      element(by.model('vm.passwordDetails.newPassword')).sendKeys('P@$$w0rd!');
458      // Click Submit button
459      element(by.css('button[type=submit]')).click();
460      // Password Error
461      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('The password must be at least 10 characters long.');
462    });
463
464    it('Should report a password with greater than 128 characters long.', function () {
465      browser.get('http://localhost:3001/settings/password');
466      // Enter Current Password
467      element(by.model('vm.passwordDetails.currentPassword')).sendKeys(user1.password);
468      // Enter Invalid Password
469      element(by.model('vm.passwordDetails.newPassword')).sendKeys(')!/uLT="lh&:`6X!]|15o!$!TJf,.13l?vG].-j],lFPe/QhwN#{Z<[*1nX@n1^?WW-%_.*D)m$toB+N7z}kcN#B_d(f41h%w@0F!]igtSQ1gl~6sEV&r~}~1ub>If1c+');
470      // Click Submit button
471      element(by.css('button[type=submit]')).click();
472      // Password Error
473      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('The password must be fewer than 128 characters.');
474    });
475
476    it('Should report a password with more than 3 or more repeating characters - "P@$$w0rd!!!"', function () {
477      browser.get('http://localhost:3001/settings/password');
478      // Enter Current Password
479      element(by.model('vm.passwordDetails.currentPassword')).sendKeys(user1.password);
480      // Enter Invalid Password
481      element(by.model('vm.passwordDetails.newPassword')).sendKeys('P@$$w0rd!!!');
482      // Click Submit button
483      element(by.css('button[type=submit]')).click();
484      // Password Error
485      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('The password may not contain sequences of three or more repeated characters.');
486    });
487
488    it('Should report a password with no uppercase letters - "p@$$w0rd!!"', function () {
489      browser.get('http://localhost:3001/settings/password');
490      // Enter Current Password
491      element(by.model('vm.passwordDetails.currentPassword')).sendKeys(user1.password);
492      // Enter Invalid Password
493      element(by.model('vm.passwordDetails.newPassword')).sendKeys('p@$$w0rd!!');
494      // Click Submit button
495      element(by.css('button[type=submit]')).click();
496      // Password Error
497      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('The password must contain at least one uppercase letter.');
498    });
499
500    it('Should report a password with less than one number - "P@$$word!!"', function () {
501      browser.get('http://localhost:3001/settings/password');
502      // Enter Current Password
503      element(by.model('vm.passwordDetails.currentPassword')).sendKeys(user1.password);
504      // Enter Invalid Password
505      element(by.model('vm.passwordDetails.newPassword')).sendKeys('P@$$word!!');
506      // Click Submit button
507      element(by.css('button[type=submit]')).click();
508      // Password Error
509      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('The password must contain at least one number.');
510    });
511
512    it('Should report a password with less than one special character - "Passw0rdss"', function () {
513      browser.get('http://localhost:3001/settings/password');
514      // Enter Current Password
515      element(by.model('vm.passwordDetails.currentPassword')).sendKeys(user1.password);
516      // Enter Invalid Password
517      element(by.model('vm.passwordDetails.newPassword')).sendKeys('Passw0rdss');
518      // Click Submit button
519      element(by.css('button[type=submit]')).click();
520      // Password Error
521      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('The password must contain at least one special character.');
522    });
523
524    it('Should report passwords do not match', function () {
525      browser.get('http://localhost:3001/settings/password');
526      // Enter Current Password
527      element(by.model('vm.passwordDetails.currentPassword')).sendKeys(user1.password);
528      // Enter New Password
529      element(by.model('vm.passwordDetails.newPassword')).sendKeys('P@$$w0rds!!');
530      // Verify New Password
531      element(by.model('vm.passwordDetails.verifyPassword')).sendKeys(user1.password);
532      // Click Submit button
533      element(by.css('button[type=submit]')).click();
534      // Password Errors
535      expect(element.all(by.css('.error-text')).get(0).getText()).toBe('Passwords do not match.');
536    });
537
538    it('Should change the password to - "P@$$w0rds!!"', function () {
539      browser.get('http://localhost:3001/settings/password');
540      // Enter Current Password
541      element(by.model('vm.passwordDetails.currentPassword')).sendKeys(user1.password);
542      // Enter New Password
543      element(by.model('vm.passwordDetails.newPassword')).sendKeys('P@$$w0rds!!');
544      // Verify New Password
545      element(by.model('vm.passwordDetails.verifyPassword')).sendKeys('P@$$w0rds!!');
546      // Click Submit button
547      element(by.css('button[type=submit]')).click();
548      // Password Changed
549      expect(element.all(by.css('.ui-notification')).get(0).getText()).toBe('Password Changed Successfully');
550    });
551  });
552});