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"
|
|
|
|
And is signed in with "nonadmin@myorg.com", "mypassword1234"
|
2017-09-01 15:24:36 +08:00
|
|
|
|
2017-10-11 15:51:20 +08:00
|
|
|
@javascript
|
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
|
|
|
|
And I click "Settings" link within "user-account-dropdown"
|
2017-10-10 15:17:55 +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-09-01 15:24:36 +08:00
|
|
|
Scenario: Unsuccessful add avatar, 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
|
|
|
|
And I attach a "Moon.png" file to "input#user_avatar" field
|
|
|
|
Then I click "Upload" button
|
|
|
|
And I should see "You can upload max 0.2 MB of files at one time. Please remove one or more files and try to submit again" error message under "input#user_avatar" field
|
2017-09-01 15:24:36 +08:00
|
|
|
|
|
|
|
Scenario: Unsuccessful add avatar, file is invalid
|
|
|
|
Given My profile page of a Karli Novak user
|
|
|
|
Then I click to Avatar
|
|
|
|
Then I click to Browse button
|
|
|
|
And I select a File.txt file
|
|
|
|
Then I click to Open button
|
|
|
|
Then I click to Upload button
|
|
|
|
And I should see "Avatar content type is invalid" error message under "Avatar" field
|
|
|
|
|
|
|
|
Scenario: Successful add avatar
|
|
|
|
Given My profile page of a Karli Novak user
|
|
|
|
Then I click to Avatar
|
|
|
|
Then I click to Browse button
|
|
|
|
And I select a Star.png file
|
|
|
|
Then I click to Open button
|
|
|
|
Then I click to Upload button
|
|
|
|
And I should see "Your account has been updated successfully" flash message
|
|
|
|
|
|
|
|
Scenario: Successful Full name Change
|
|
|
|
Given My profile page of a Karli Novak user
|
|
|
|
Then I click to Edit button under Full name field
|
|
|
|
And I fill in "Novakovic"
|
|
|
|
Then I click to Update button
|
|
|
|
And I should see "Karli Novak Novakovic" in Full name field
|
|
|
|
|
|
|
|
Scenario: Unsuccessful Initials Change, is too long
|
|
|
|
Given My profile page of a Karli Novak user
|
|
|
|
Then I click to Edit button under Initials field
|
|
|
|
And I fill in "KNOCK"
|
|
|
|
Then I click to Update button
|
|
|
|
And I should see "is too long (maximum is 4 characters)" flash message
|
|
|
|
|
|
|
|
Scenario: Successful Initials Change
|
|
|
|
Given My profile page of a Karli Novak user
|
|
|
|
Then I click to Edit button under Initials field
|
|
|
|
And I fill in "KN"
|
|
|
|
Then I click to Update button
|
|
|
|
And I should see "KNKN" in Full name field
|
|
|
|
|
|
|
|
Scenario: Successful Email Change
|
|
|
|
Given My profile page of a Karli Novak user
|
|
|
|
Then I click to Edit button under Email field
|
|
|
|
And I Change "nonadmin@myorg.com" with "user@myorg.com"
|
|
|
|
And I fill in "mypassword1234" in Current password field
|
|
|
|
Then I click to Update button
|
|
|
|
And I should see "user@myorg.com" in Email field
|
|
|
|
|
|
|
|
Scenario: Unsuccessful Password Change, is too short
|
|
|
|
Given My profile page of a Karli Novak user
|
|
|
|
Then I click to Edit button under Password field
|
|
|
|
And I fill in "mypassword1234" in Current pasword field
|
|
|
|
And I fill in "mypass" in New pasword field
|
|
|
|
And I fill in "mypass" in New pasword confiramtion field
|
|
|
|
Then I click to Update button
|
|
|
|
And I should see "is too short (minimum is 8 characters)" flash message under New password field
|
|
|
|
And I should see "is too short (minimum is 8 characters)" flash message under New password confiramtion field
|
|
|
|
|
|
|
|
Scenario: Unsuccessful Password Change, does not match
|
|
|
|
Given My profile page of a Karli Novak user
|
|
|
|
Then I click to Edit button under Password field
|
|
|
|
And I fill in "mypassword1234" in Current pasword field
|
|
|
|
And I fill in "mypassword5678" in New pasword field
|
|
|
|
And I fill in "mypassword56788" in New pasword confiramtion field
|
|
|
|
Then I click to Update button
|
|
|
|
And I should see "doesn't match Password" flash message under New password confiramtion field
|
|
|
|
|
|
|
|
Scenario: Unsuccessful Password Change, current password is invalid
|
|
|
|
Given My profile page of a Karli Novak user
|
|
|
|
Then I click to Edit button under Password field
|
|
|
|
And I fill in "mypassword123" in Current pasword field
|
|
|
|
And I fill in "mypassword5678" in New pasword field
|
|
|
|
And I fill in "mypassword5678" in New pasword confiramtion field
|
|
|
|
Then I click to Update button
|
|
|
|
And I should see "is invalid" flash message under Current password field
|
|
|
|
|
|
|
|
Scenario: Successful Password Change
|
|
|
|
Given My profile page of a Karli Novak user
|
|
|
|
Then I click to Edit button under Password field
|
|
|
|
And I fill in "mypassword1234" in Current pasword field
|
|
|
|
And I fill in "mypassword5678" in New pasword field
|
|
|
|
And I fill in "mypassword5678" in New pasword confiramtion field
|
|
|
|
Then I click to Update button
|
|
|
|
And I should see "XXXXX"
|