-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33038 from owncloud/editUser-acceptance-test-changes
Refactor edit and get user provisioning API acceptance tests
- Loading branch information
Showing
6 changed files
with
332 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 14 additions & 14 deletions
28
tests/acceptance/features/apiProvisioning-v1/getUser.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,60 @@ | ||
@api @provisioning_api-app-required | ||
Feature: get user | ||
As an admin | ||
I want to be able to get user | ||
So that I can get information about user | ||
As an admin, subadmin or as myself | ||
I want to be able to retrieve user information | ||
So that I can see the information | ||
|
||
Background: | ||
Given using OCS API version "1" | ||
|
||
@smokeTest | ||
Scenario: admin gets existing user | ||
Given user "brand-new-user" has been created | ||
When user "%admin%" sends HTTP method "GET" to OCS API endpoint "/cloud/users/brand-new-user" | ||
When the administrator retrieves the information of user "brand-new-user" using the provisioning API | ||
Then the OCS status code should be "100" | ||
And the HTTP status code should be "200" | ||
And the display name returned by the API should be "brand-new-user" | ||
|
||
Scenario: admin tries to get a not existing user | ||
When user "%admin%" sends HTTP method "GET" to OCS API endpoint "/cloud/users/test" | ||
When the administrator retrieves the information of user "not-a-user" using the provisioning API | ||
Then the OCS status code should be "998" | ||
And the HTTP status code should be "200" | ||
And the API should not return any data | ||
|
||
@smokeTest | ||
Scenario: subadmin gets information of a user in his group | ||
Scenario: a subadmin gets information of a user in their group | ||
Given user "subadmin" has been created | ||
And user "newuser" has been created | ||
And group "newgroup" has been created | ||
And user "newuser" has been added to group "newgroup" | ||
And user "subadmin" has been made a subadmin of group "newgroup" | ||
When user "subadmin" sends HTTP method "GET" to OCS API endpoint "/cloud/users/newuser" | ||
When user "subadmin" retrieves the information of user "newuser" using the provisioning API | ||
Then the OCS status code should be "100" | ||
And the HTTP status code should be "200" | ||
And the display name returned by the API should be "newuser" | ||
|
||
Scenario: subadmin tries to get information of a user not in his group | ||
Scenario: a subadmin tries to get information of a user not in their group | ||
Given user "subadmin" has been created | ||
And user "newuser" has been created | ||
And group "newgroup" has been created | ||
And user "subadmin" has been made a subadmin of group "newgroup" | ||
When user "subadmin" sends HTTP method "GET" to OCS API endpoint "/cloud/users/newuser" | ||
When user "subadmin" retrieves the information of user "newuser" using the provisioning API | ||
Then the OCS status code should be "997" | ||
And the HTTP status code should be "401" | ||
And the API should not return any data | ||
|
||
Scenario: normal user tries to get information of another user | ||
Scenario: a normal user tries to get information of another user | ||
Given user "newuser" has been created | ||
And user "anotheruser" has been created | ||
When user "anotheruser" sends HTTP method "GET" to OCS API endpoint "/cloud/users/newuser" | ||
When user "anotheruser" retrieves the information of user "newuser" using the provisioning API | ||
Then the OCS status code should be "997" | ||
And the HTTP status code should be "401" | ||
And the API should not return any data | ||
|
||
@smokeTest | ||
Scenario: normal user gets his own information | ||
Scenario: a normal user gets their own information | ||
Given user "newuser" has been created | ||
When user "newuser" sends HTTP method "GET" to OCS API endpoint "/cloud/users/newuser" | ||
When user "newuser" retrieves the information of user "newuser" using the provisioning API | ||
Then the OCS status code should be "100" | ||
And the HTTP status code should be "200" | ||
And the display name returned by the API should be "newuser" | ||
And the display name returned by the API should be "newuser" |
108 changes: 74 additions & 34 deletions
108
tests/acceptance/features/apiProvisioning-v2/editUser.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,109 @@ | ||
@api @provisioning_api-app-required | ||
Feature: edit users | ||
As an admin | ||
I want to be able to edit a user | ||
So that I can change user information | ||
As an admin, subadmin or as myself | ||
I want to be able to edit user information | ||
So that I can keep the user information up-to-date | ||
|
||
Background: | ||
Given using OCS API version "2" | ||
|
||
@smokeTest | ||
Scenario: Edit a user | ||
Scenario: the administrator can edit a user email | ||
Given user "brand-new-user" has been created | ||
When user "%admin%" sends HTTP method "PUT" to OCS API endpoint "/cloud/users/brand-new-user" with body | ||
| key | quota | | ||
| value | 12MB | | ||
| key | email | | ||
| value | brand-new-user@gmail.com | | ||
Then the OCS status code should be "200" | ||
And the HTTP status code should be "200" | ||
When the administrator changes the email of user "brand-new-user" to "brand-new-user@example.com" using the provisioning API | ||
Then the HTTP status code should be "200" | ||
And the OCS status code should be "200" | ||
And user "brand-new-user" should exist | ||
And the user attributes returned by the API should include | ||
| email | brand-new-user@example.com | | ||
|
||
Scenario: Override existing user email | ||
@smokeTest | ||
Scenario: the administrator can edit a user display name | ||
Given user "brand-new-user" has been created | ||
And user "%admin%" has sent HTTP method "PUT" to OCS API endpoint "/cloud/users/brand-new-user" with body | ||
| key | email | | ||
| value | brand-new-user@gmail.com | | ||
When the administrator changes the display name of user "brand-new-user" to "A New User" using the provisioning API | ||
Then the HTTP status code should be "200" | ||
And the OCS status code should be "200" | ||
And user "brand-new-user" should exist | ||
And the user attributes returned by the API should include | ||
| displayname | A New User | | ||
|
||
@smokeTest | ||
Scenario: the administrator can edit a user quota | ||
Given user "brand-new-user" has been created | ||
When the administrator changes the quota of user "brand-new-user" to "12MB" using the provisioning API | ||
Then the HTTP status code should be "200" | ||
And the OCS status code should be "200" | ||
And user "brand-new-user" should exist | ||
And the user attributes returned by the API should include | ||
| quota definition | 12 MB | | ||
|
||
Scenario: the administrator can override existing user email | ||
Given user "brand-new-user" has been created | ||
And the administrator has changed the email of user "brand-new-user" to "brand-new-user@gmail.com" | ||
And the OCS status code should be "200" | ||
And the HTTP status code should be "200" | ||
And user "%admin%" has sent HTTP method "PUT" to OCS API endpoint "/cloud/users/brand-new-user" with body | ||
| key | email | | ||
| value | brand-new-user@example.com | | ||
And the administrator has changed the email of user "brand-new-user" to "brand-new-user@example.com" | ||
And the OCS status code should be "200" | ||
And the HTTP status code should be "200" | ||
When user "%admin%" sends HTTP method "GET" to OCS API endpoint "/cloud/users/brand-new-user" | ||
When the administrator retrieves the information of user "brand-new-user" using the provisioning API | ||
Then the OCS status code should be "200" | ||
And the HTTP status code should be "200" | ||
And the user attributes returned by the API should include | ||
| email | brand-new-user@example.com | | ||
|
||
@smokeTest | ||
Scenario: subadmin should be able to edit the user information in his group | ||
Scenario: a subadmin should be able to edit the user information in their group | ||
Given user "subadmin" has been created | ||
And user "brand-new-user" has been created | ||
And group "new-group" has been created | ||
And user "brand-new-user" has been added to group "new-group" | ||
And user "subadmin" has been made a subadmin of group "new-group" | ||
And user "subadmin" has sent HTTP method "PUT" to OCS API endpoint "/cloud/users/brand-new-user" with body | ||
| key | quota | | ||
| value | 12MB | | ||
And user "subadmin" has sent HTTP method "PUT" to OCS API endpoint "/cloud/users/brand-new-user" with body | ||
| key | email | | ||
| value | brand-new-user@example.com | | ||
When user "subadmin" sends HTTP method "GET" to OCS API endpoint "/cloud/users/brand-new-user" | ||
And user "subadmin" has changed the quota of user "brand-new-user" to "12MB" | ||
And user "subadmin" has changed the email of user "brand-new-user" to "brand-new-user@example.com" | ||
And user "subadmin" has changed the display name of user "brand-new-user" to "Anne Brown" | ||
When user "subadmin" retrieves the information of user "brand-new-user" using the provisioning API | ||
Then the OCS status code should be "200" | ||
And the HTTP status code should be "200" | ||
And the user attributes returned by the API should include | ||
| quota definition | 12 MB | | ||
| email | brand-new-user@example.com | | ||
| displayname | Anne Brown | | ||
|
||
Scenario: a normal user should be able to change their email address | ||
Given user "brand-new-user" has been created | ||
When user "brand-new-user" changes the email of user "brand-new-user" to "brand-new-user@example.com" using the provisioning API | ||
Then the OCS status code should be "200" | ||
And the HTTP status code should be "200" | ||
And the attributes of user "brand-new-user" returned by the API should include | ||
| email | brand-new-user@example.com | | ||
When user "brand-new-user" retrieves the information of user "brand-new-user" using the provisioning API | ||
Then the OCS status code should be "200" | ||
And the HTTP status code should be "200" | ||
And the attributes of user "brand-new-user" returned by the API should include | ||
| email | brand-new-user@example.com | | ||
|
||
@skip @issue-31276 | ||
Scenario: normal user should not be able to change their quota | ||
Scenario: a normal user should be able to change their display name | ||
Given user "brand-new-user" has been created | ||
When user "brand-new-user" sends HTTP method "PUT" to OCS API endpoint "/cloud/users/brand-new-user" with body | ||
| key | quota | | ||
| value | 12MB | | ||
Then the OCS status code should be "401" | ||
When user "brand-new-user" changes the display name of user "brand-new-user" to "Alan Border" using the provisioning API | ||
Then the OCS status code should be "200" | ||
And the HTTP status code should be "200" | ||
And the attributes of user "brand-new-user" returned by the API should include | ||
| displayname | Alan Border | | ||
When user "brand-new-user" retrieves the information of user "brand-new-user" using the provisioning API | ||
Then the OCS status code should be "200" | ||
And the HTTP status code should be "200" | ||
And the attributes of user "brand-new-user" returned by the API should include | ||
| displayname | Alan Border | | ||
|
||
Scenario: a normal user should not be able to change their quota | ||
Given user "brand-new-user" has been created | ||
When user "brand-new-user" changes the quota of user "brand-new-user" to "12MB" using the provisioning API | ||
Then the OCS status code should be "997" | ||
And the HTTP status code should be "401" | ||
And the attributes of user "brand-new-user" returned by the API should include | ||
| quota definition | default | | ||
| quota definition | default | | ||
When user "brand-new-user" retrieves the information of user "brand-new-user" using the provisioning API | ||
Then the OCS status code should be "200" | ||
And the HTTP status code should be "200" | ||
And the attributes of user "brand-new-user" returned by the API should include | ||
| quota definition | default | |
Oops, something went wrong.