expand createUser.feature (#6662)

This commit is contained in:
Viktor Scharf
2023-06-29 18:10:49 +02:00
committed by GitHub
parent 8f9564edb8
commit f0d99683f0
4 changed files with 104 additions and 16 deletions
@@ -22,23 +22,24 @@ Feature: create user
Then the HTTP status code should be "<code>"
And user "<userName>" <shouldOrNot> exist
Examples:
| 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 |
| name with space | name with space | example@example.org | 123 | 400 | true | should not |
| createDisabledUser | disabled user | example@example.org | 123 | 200 | false | should |
| nameWithNumbers0123456 | user | name0123456@example.org | 123 | 200 | true | should |
| name.with.dots | user | name.w.dots@example.org | 123 | 200 | true | should |
| 123456789 | user | 123456789@example.org | 123 | 400 | true | should not |
| 0.0 | user | float@example.org | 123 | 400 | true | 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 |
| user1 | user names must not start with a number | example@example.org | my pass | 200 | true | should |
| nameWithCharacters(*:!;_+-&) | user | new@example.org | 123 | 400 | true | should not |
| name with space | name with space | example@example.org | 123 | 400 | true | should not |
| createDisabledUser | disabled user | example@example.org | 123 | 200 | false | should |
| nameWithNumbers0123456 | user | name0123456@example.org | 123 | 200 | true | should |
| name.with.dots | user | name.w.dots@example.org | 123 | 200 | true | should |
| 123456789 | user | 123456789@example.org | 123 | 400 | true | should not |
| 0.0 | user | float@example.org | 123 | 400 | true | should not |
@skipOnStable2.0
Examples:
| userName | displayName | email | password | code | enable | shouldOrNot |
| withoutEmail | without email | | 123 | 200 | true | should |
| Alice | same userName | new@example.org | 123 | 409 | true | should |
| userName | displayName | email | password | code | enable | shouldOrNot |
| withoutEmail | without email | | 123 | 200 | true | should |
| Alice | same userName | new@example.org | 123 | 409 | true | should |
Scenario: user cannot be created with empty name
@@ -94,3 +95,63 @@ Feature: create user
| accountEnabled | true |
Then the HTTP status code should be "200"
And user "Brian" should exist
@env-config
Scenario Outline: create user with setting OCIS no restriction on the user name
Given the config "GRAPH_USERNAME_MATCH" has been set to "none"
And the administrator has assigned the role "Admin" to user "Alice" using the Graph API
When the user "Alice" creates a new user using GraphAPI with the following settings:
| userName | <userName> |
| displayName | test user |
| email | new@example.org |
| password | 123 |
| accountEnabled | true |
Then the HTTP status code should be "200"
And user "<userName>" should exist
Examples:
| userName | description |
| 1248Bob | user names starts with the number |
| (*:!;+-&$%)_alice | user names starts with the ASCII characters |
@env-config
Scenario: create user with setting OCIS not to assign the default user role
Given the config "GRAPH_ASSIGN_DEFAULT_USER_ROLE" has been set to "false"
When the user "admin" creates a new user using GraphAPI with the following settings:
| userName | sam |
| displayName | test user |
| email | new@example.org |
| password | 123 |
| accountEnabled | true |
Then the HTTP status code should be "200"
And user "sam" should exist
When the administrator retrieves the assigned role of user "sam" using the Graph API
Then the HTTP status code should be "200"
And the Graph API response should have no role
@env-config
Scenario: create user with setting OCIS assign the default user role
Given the config "GRAPH_ASSIGN_DEFAULT_USER_ROLE" has been set to "true"
When the user "admin" creates a new user using GraphAPI with the following settings:
| userName | sam |
| displayName | test user |
| email | new@example.org |
| password | 123 |
| accountEnabled | true |
Then the HTTP status code should be "200"
And user "sam" should exist
And user "sam" should have the role "User" assigned
Scenario: user is created with the default User role
When the user "admin" creates a new user using GraphAPI with the following settings:
| userName | sam |
| displayName | test user |
| email | new@example.org |
| password | 123 |
| accountEnabled | true |
Then the HTTP status code should be "200"
And user "sam" should exist
And user "sam" should have the role "User" assigned