2017-09-01 15:24:36 +08:00
|
|
|
Feature: Settings
|
2017-10-10 15:17:55 +08:00
|
|
|
As a user
|
|
|
|
I want to be able to change Profile data for my account
|
|
|
|
So that I have a my prefered settings
|
2017-09-01 15:24:36 +08:00
|
|
|
|
|
|
|
Background:
|
2017-10-10 15:17:55 +08:00
|
|
|
Given the "BioSistemika Process" team exists
|
|
|
|
Given the following users are registered
|
|
|
|
| email | password | password_confirmation | full_name | initials |
|
|
|
|
| nonadmin@myorg.com | mypassword1234 | mypassword1234 | Karli Novak | KN |
|
|
|
|
And "nonadmin@myorg.com" is in "BioSistemika Process" team as a "normal_user"
|
2017-11-08 00:18:41 +08:00
|
|
|
And "nonadmin@myorg.com" is signed in with "mypassword1234"
|
2017-09-01 15:24:36 +08:00
|
|
|
|
2018-03-13 17:46:48 +08:00
|
|
|
@javascript @wip
|
2017-09-01 15:24:36 +08:00
|
|
|
Scenario: Successful navigate to profile page
|
2017-10-10 15:17:55 +08:00
|
|
|
Given I'm on the home page of "BioSistemika Process" team
|
2017-10-11 15:51:20 +08:00
|
|
|
And I click on Avatar
|
2017-10-27 22:37:42 +08:00
|
|
|
And I click "Settings" link within "#user-account-dropdown"
|
2018-01-31 19:05:45 +08:00
|
|
|
Then I should see "My profile"
|
2017-09-01 15:24:36 +08:00
|
|
|
|
2017-10-11 15:51:20 +08:00
|
|
|
@javascript
|
2017-10-16 22:21:52 +08:00
|
|
|
Scenario: Unsuccessful avatar image upload, file is too big
|
2017-10-11 15:51:20 +08:00
|
|
|
Given I'm on the profile page
|
|
|
|
Then I click on image within ".avatar-container" element
|
2018-01-31 19:05:45 +08:00
|
|
|
And I attach a "Moon.png" file to "user_avatar" field
|
2018-04-26 19:47:31 +08:00
|
|
|
And I click on "Upload"
|
2018-01-31 19:05:45 +08:00
|
|
|
And I should see "Your avatar file cannot be larger than 0.2 MB. (Please try again with a smaller file.)" error message
|
2017-09-01 15:24:36 +08:00
|
|
|
|
2017-10-16 22:21:52 +08:00
|
|
|
@javascript
|
|
|
|
Scenario: Unsuccessful avatar image upload, file is invalid
|
|
|
|
Given I'm on the profile page
|
|
|
|
Then I click on image within ".avatar-container" element
|
2018-01-31 19:05:45 +08:00
|
|
|
And I attach a "File.txt" file to "user_avatar" field
|
2018-04-26 19:47:31 +08:00
|
|
|
And I click on "Upload"
|
2018-01-31 19:05:45 +08:00
|
|
|
And I should see "Avatar content type is invalid" error message
|
2017-09-01 15:24:36 +08:00
|
|
|
|
2017-10-16 22:21:52 +08:00
|
|
|
@javascript
|
|
|
|
Scenario: Successful upload avatar image
|
|
|
|
Given I'm on the profile page
|
|
|
|
Then I click on image within ".avatar-container" element
|
2018-01-31 19:05:45 +08:00
|
|
|
And I attach a "Star.png" file to "user_avatar" field
|
2017-10-24 21:39:06 +08:00
|
|
|
Then I click "Upload" button
|
2017-09-01 15:24:36 +08:00
|
|
|
And I should see "Your account has been updated successfully" flash message
|
|
|
|
|
2017-10-16 22:21:52 +08:00
|
|
|
@javascript
|
|
|
|
Scenario: Successfully changes user full name
|
|
|
|
Given I'm on the profile page
|
2018-01-31 19:05:45 +08:00
|
|
|
Then I click on Edit on ".settings-page-full-name" input field
|
|
|
|
And I fill in "Karli Novak Novakovic" in ".settings-page-full-name" input field
|
2018-04-25 20:34:23 +08:00
|
|
|
Then I click "Save" button
|
2018-01-31 19:05:45 +08:00
|
|
|
And I should see "Karli Novak Novakovic" in ".settings-page-full-name" input field
|
2017-09-01 15:24:36 +08:00
|
|
|
|
2017-10-16 22:21:52 +08:00
|
|
|
@javascript
|
|
|
|
Scenario: Unsuccessfully changes user initials, text is too long
|
|
|
|
Given I'm on the profile page
|
2018-01-31 19:05:45 +08:00
|
|
|
Then I click on Edit on ".settings-page-initials" input field
|
|
|
|
And I fill in "KNOCK" in ".settings-page-initials" input field
|
2018-04-25 20:34:23 +08:00
|
|
|
Then I click "Save" button
|
2018-01-31 19:05:45 +08:00
|
|
|
And I should see "is too long (maximum is 4 characters)" error message
|
2017-09-01 15:24:36 +08:00
|
|
|
|
2017-10-16 22:21:52 +08:00
|
|
|
@javascript
|
|
|
|
Scenario: Successfully changes user initials
|
|
|
|
Given I'm on the profile page
|
2018-01-31 19:05:45 +08:00
|
|
|
Then I click on Edit on ".settings-page-initials" input field
|
|
|
|
And I fill in "KN" in ".settings-page-initials" input field
|
2018-04-25 20:34:23 +08:00
|
|
|
Then I click "Save" button
|
2018-01-31 19:05:45 +08:00
|
|
|
And I should see "KN" in ".settings-page-initials" input field
|
2017-09-01 15:24:36 +08:00
|
|
|
|
2017-10-16 22:21:52 +08:00
|
|
|
@javascript
|
|
|
|
Scenario: Successfully changes user email
|
|
|
|
Given I'm on the profile page
|
2018-01-31 19:05:45 +08:00
|
|
|
Then I click on Edit on ".settings-page-email" input field
|
2017-10-16 22:21:52 +08:00
|
|
|
And I change "nonadmin@myorg.com" with "user@myorg.com" email
|
2018-02-12 18:42:22 +08:00
|
|
|
And I fill in "mypassword1234" in "#edit-email-current-password" field of ".settings-page-email" form
|
2018-04-25 20:34:23 +08:00
|
|
|
Then I click "Save" button
|
2018-01-31 19:05:45 +08:00
|
|
|
And I should see "user@myorg.com" in ".settings-page-email" input field
|
2017-09-01 15:24:36 +08:00
|
|
|
|
2017-10-16 22:21:52 +08:00
|
|
|
@javascript
|
|
|
|
Scenario: Unsuccessful Password Change, password is too short
|
|
|
|
Given I'm on the profile page
|
2018-01-31 19:05:45 +08:00
|
|
|
Then I click on Edit on ".settings-page-change-password" input field
|
2018-02-12 18:42:22 +08:00
|
|
|
And I fill in "mypassword1234" in "#edit-password-current-password" field of ".settings-page-change-password" form
|
|
|
|
And I fill in "mypass" in "#user_password" field of ".settings-page-change-password" form
|
|
|
|
And I fill in "mypass" in "#user_password_confirmation" field of ".settings-page-change-password" form
|
2018-04-25 20:34:23 +08:00
|
|
|
Then I click "Save" button
|
2017-10-16 22:21:52 +08:00
|
|
|
And I should see "is too short (minimum is 8 characters)"
|
2017-09-01 15:24:36 +08:00
|
|
|
|
2017-10-16 22:21:52 +08:00
|
|
|
@javascript
|
|
|
|
Scenario: Unsuccessful Password Change, passwords does not match
|
|
|
|
Given I'm on the profile page
|
2018-01-31 19:05:45 +08:00
|
|
|
Then I click on Edit on ".settings-page-change-password" input field
|
2018-02-12 18:42:22 +08:00
|
|
|
And I fill in "mypassword1234" in "#edit-password-current-password" field of ".settings-page-change-password" form
|
|
|
|
And I fill in "mypassword5678" in "#user_password" field of ".settings-page-change-password" form
|
|
|
|
And I fill in "mypassword56788" in "#user_password_confirmation" field of ".settings-page-change-password" form
|
2018-04-25 20:34:23 +08:00
|
|
|
Then I click "Save" button
|
2017-10-24 19:49:33 +08:00
|
|
|
And I should see "doesn't match"
|
2017-09-01 15:24:36 +08:00
|
|
|
|
2017-10-16 22:21:52 +08:00
|
|
|
@javascript
|
2017-09-01 15:24:36 +08:00
|
|
|
Scenario: Unsuccessful Password Change, current password is invalid
|
2017-10-16 22:21:52 +08:00
|
|
|
Given I'm on the profile page
|
2018-01-31 19:05:45 +08:00
|
|
|
Then I click on Edit on ".settings-page-change-password" input field
|
2018-02-12 18:42:22 +08:00
|
|
|
And I fill in "mypassword123" in "#edit-password-current-password" field of ".settings-page-change-password" form
|
|
|
|
And I fill in "mypassword5678" in "#user_password" field of ".settings-page-change-password" form
|
|
|
|
And I fill in "mypassword5678" in "#user_password_confirmation" field of ".settings-page-change-password" form
|
2018-04-25 20:34:23 +08:00
|
|
|
Then I click "Save" button
|
2018-01-31 19:05:45 +08:00
|
|
|
And I should see "is invalid"
|
2017-09-01 15:24:36 +08:00
|
|
|
|
2017-10-16 22:21:52 +08:00
|
|
|
@javascript
|
2017-09-01 15:24:36 +08:00
|
|
|
Scenario: Successful Password Change
|
2017-10-16 22:21:52 +08:00
|
|
|
Given I'm on the profile page
|
2018-01-31 19:05:45 +08:00
|
|
|
Then I click on Edit on ".settings-page-change-password" input field
|
2018-02-12 18:42:22 +08:00
|
|
|
And I fill in "mypassword1234" in "#edit-password-current-password" field of ".settings-page-change-password" form
|
|
|
|
And I fill in "mypassword5678" in "#user_password" field of ".settings-page-change-password" form
|
|
|
|
And I fill in "mypassword5678" in "#user_password_confirmation" field of ".settings-page-change-password" form
|
2018-04-25 20:34:23 +08:00
|
|
|
Then I click "Save" button
|
2018-01-31 19:05:45 +08:00
|
|
|
And I should see "Password successfully updated." flash message
|