[test-only] ApiTest. Disable/enable user (#5639) (#5739)

* [test-only] ApiTest. Disable/enable user (#5639)

* fix expected failures lines
This commit is contained in:
Viktor Scharf authored and GitHub committed 2023-03-07 09:06:22 +01:00
1 parent 5a97f72ad8
commit daddb63900
9 files changed
+295 -73

No files matched your search

@@ -1,4 +1,4 @@
@api @skipOnOcV10
@api @skipOnOcV10 @skipOnStable2.0
Feature: create user
Only user with admin permissions can create new user
@@ -8,47 +8,78 @@ Feature: create user
Background:
Given user "Alice" has been created with default attributes and without skeleton files
Scenario Outline: the admin creates a user
Given the administrator has given "Alice" the role "Admin" using the settings api
When the user "Alice" creates a new user using GraphAPI with the following settings:
| userName | <userName> |
| displayName | <displayName> |
| email | <email> |
| password | <password> |
| userName | <userName> |
| displayName | <displayName> |
| email | <email> |
| password | <password> |
| accountEnabled | <enable> |
Then the HTTP status code should be "<code>"
And user "<userName>" <shouldOrNot> exist
Examples:
| userName | displayName | email | password | code | shouldOrNot |
| SameDisplayName | Alice Hansen | new@example.org | containsCharacters(*:!;_+-&) | 200 | should |
| withoutPassSameEmail | without pass | alice@example.org | | 200 | should |
| name | pass with space | example@example.org | my pass | 200 | should |
| nameWithCharacters(*:!;_+-&) | user | new@example.org | 123 | 400 | should not |
| withoutEmail | without email | | 123 | 400 | should not |
| Alice | same userName | new@example.org | 123 | 400 | should |
| name with space | name with space | example@example.org | 123 | 400 | should not |
| userName | displayName | email | password | code | enable | shouldOrNot |
| SameDisplayName | Alice Hansen | new@example.org | containsCharacters(*:!;_+-&) | 200 | true | should |
| withoutPassSameEmail | without pass | alice@example.org | | 200 | true | should |
| name | pass with space | example@example.org | my pass | 200 | true | should |
| nameWithCharacters(*:!;_+-&) | user | new@example.org | 123 | 400 | true | should not |
| withoutEmail | without email | | 123 | 200 | true | should |
| Alice | same userName | new@example.org | 123 | 400 | true | should |
| name with space | name with space | example@example.org | 123 | 400 | true | should not |
| createDisabledUser | disabled user | example@example.org | 123 | 200 | false | should |
Scenario: a user cannot be created with empty name
Given the administrator has given "Alice" the role "Admin" using the settings api
When the user "Alice" creates a new user using GraphAPI with the following settings:
| userName | |
| displayName | emptyName |
| email | @example.org |
| password | 123 |
| userName | |
| displayName | emptyName |
| email | @example.org |
| password | 123 |
| accountEnabled | true |
Then the HTTP status code should be "400"
Scenario Outline: a user without admin right cannot create a user
Given the administrator has given "Alice" the role "<role>" using the settings api
When the user "Alice" creates a new user using GraphAPI with the following settings:
| userName | user |
| displayName | user |
| email | @example.org |
| password | 123 |
| userName | user |
| displayName | user |
| email | @example.org |
| password | 123 |
| accountEnabled | true |
Then the HTTP status code should be "401"
And user "user" should not exist
Examples:
| role |
| Space Admin |
| User |
Scenario: a user cannot be created with the name of the disabled user
Given user "Brian" has been created with default attributes and without skeleton files
And the administrator has given "Alice" the role "Admin" using the settings api
And the user "Alice" has disabled user "Brian" using the Graph API
When the user "Alice" creates a new user using GraphAPI with the following settings:
| userName | Brian |
| displayName | This is another Brian |
| email | brian@example.com |
| password | 123 |
| accountEnabled | true |
Then the HTTP status code should be "400"
Scenario: a user can be created with the name of the deleted user
Given user "Brian" has been created with default attributes and without skeleton files
And the administrator has given "Alice" the role "Admin" using the settings api
And the user "Alice" has deleted a user "Brian" using the Graph API
When the user "Alice" creates a new user using GraphAPI with the following settings:
| userName | Brian |
| displayName | This is another Brian |
| email | brian@example.com |
| password | 123 |
| accountEnabled | true |
Then the HTTP status code should be "200"
And user "Brian" should exist