[tests-only][full-ci]Json assertion apigraph master branch (#5989)
* Json assertion for api graph suite * Review Address
This commit is contained in:
@@ -125,7 +125,27 @@ Feature: add users to group
|
||||
And group "groupA" has been created
|
||||
When user "Alice" tries to add himself to group "groupA" using the Graph API
|
||||
Then the HTTP status code should be "403"
|
||||
And the last response should be an unauthorized response
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"error"
|
||||
],
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"message"
|
||||
],
|
||||
"properties": {
|
||||
"type": "string",
|
||||
"enum": ["Unauthorized"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| role |
|
||||
| Space Admin |
|
||||
@@ -139,7 +159,27 @@ Feature: add users to group
|
||||
And group "groupA" has been created
|
||||
When user "Alice" tries to add user "Brian" to group "groupA" using the Graph API
|
||||
Then the HTTP status code should be "403"
|
||||
And the last response should be an unauthorized response
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"error"
|
||||
],
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"message"
|
||||
],
|
||||
"properties": {
|
||||
"type": "string",
|
||||
"enum": ["Unauthorized"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| role |
|
||||
| Space Admin |
|
||||
|
||||
@@ -17,9 +17,21 @@ Feature: edit user
|
||||
Scenario Outline: the admin user can edit another user's email
|
||||
When the user "Alice" changes the email of user "Brian" to "<newEmail>" using the Graph API
|
||||
Then the HTTP status code should be "<code>"
|
||||
And the user "Brian" should have information with these key and value pairs:
|
||||
| key | value |
|
||||
| mail | <emailAsResult> |
|
||||
And the user information of "Brian" should match this JSON schema
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"mail"
|
||||
],
|
||||
"properties": {
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["<emailAsResult>"]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| action description | newEmail | code | emailAsResult |
|
||||
| change to a valid email | newemail@example.com | 200 | newemail@example.com |
|
||||
@@ -33,15 +45,27 @@ Feature: edit user
|
||||
Given user "Carol" has been created with default attributes and without skeleton files
|
||||
When the user "Alice" changes the user name of user "Carol" to "<userName>" using the Graph API
|
||||
Then the HTTP status code should be "<code>"
|
||||
And the user "<userNameAsResult>" should have information with these key and value pairs:
|
||||
| key | value |
|
||||
| onPremisesSamAccountName | <userNameAsResult> |
|
||||
And the user information of "<newUserName>" should match this JSON schema
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"onPremisesSamAccountName"
|
||||
],
|
||||
"properties": {
|
||||
"type": "string",
|
||||
"onPremisesSamAccountName": {
|
||||
"enum": ["<newUserName>"]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| action description | userName | code | userNameAsResult |
|
||||
| change to a valid user name | Lionel | 200 | Lionel |
|
||||
| user name characters | *:!;_+-& | 200 | *:!;_+-& |
|
||||
| change to existing user name | Brian | 409 | Brian |
|
||||
| empty user name | | 200 | Brian |
|
||||
| action description | userName | code | newUserName |
|
||||
| change to a valid user name | Lionel | 200 | Lionel |
|
||||
| user name characters | *:!;_+-& | 200 | *:!;_+-& |
|
||||
| change to existing user name | Brian | 409 | Brian |
|
||||
| empty user name | | 200 | Brian |
|
||||
|
||||
@skipOnStable2.0
|
||||
Scenario: the admin user changes the name of a user to the name of an existing disabled user
|
||||
@@ -53,9 +77,21 @@ Feature: edit user
|
||||
And the user "Alice" has disabled user "Brian" using the Graph API
|
||||
When the user "Alice" changes the user name of user "sam" to "Brian" using the Graph API
|
||||
Then the HTTP status code should be "409"
|
||||
And the user "sam" should have information with these key and value pairs:
|
||||
| key | value |
|
||||
| onPremisesSamAccountName | sam |
|
||||
And the user information of "sam" should match this JSON schema
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"onPremisesSamAccountName"
|
||||
],
|
||||
"properties": {
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["sam"]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
@skipOnStable2.0
|
||||
Scenario: the admin user changes the name of a user to the name of a previously deleted user
|
||||
@@ -67,18 +103,42 @@ Feature: edit user
|
||||
And the user "Alice" has deleted a user "sam" using the Graph API
|
||||
When the user "Alice" changes the user name of user "Brian" to "sam" using the Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the user "sam" should have information with these key and value pairs:
|
||||
| key | value |
|
||||
| onPremisesSamAccountName | sam |
|
||||
And the user information of "sam" should match this JSON schema
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"onPremisesSamAccountName"
|
||||
],
|
||||
"properties": {
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["sam"]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
|
||||
Scenario Outline: a normal user should not be able to change their email address
|
||||
Given the administrator has given "Brian" the role "<role>" using the settings api
|
||||
When the user "Brian" tries to change the email of user "Brian" to "newemail@example.com" using the Graph API
|
||||
Then the HTTP status code should be "401"
|
||||
And the user "Brian" should have information with these key and value pairs:
|
||||
| key | value |
|
||||
| mail | brian@example.com |
|
||||
And the user information of "Brian" should match this JSON schema
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"mail"
|
||||
],
|
||||
"properties": {
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["brian@example.com"]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| role |
|
||||
| Space Admin |
|
||||
@@ -96,9 +156,21 @@ Feature: edit user
|
||||
And the administrator has given "Carol" the role "<role>" using the settings api
|
||||
When the user "Brian" tries to change the email of user "Carol" to "newemail@example.com" using the Graph API
|
||||
Then the HTTP status code should be "401"
|
||||
And the user "Carol" should have information with these key and value pairs:
|
||||
| key | value |
|
||||
| mail | carol@example.com |
|
||||
And the user information of "Carol" should match this JSON schema
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"mail"
|
||||
],
|
||||
"properties": {
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["carol@example.com"]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| userRole | role |
|
||||
| Space Admin | Space Admin |
|
||||
@@ -118,9 +190,21 @@ Feature: edit user
|
||||
Scenario Outline: the admin user can edit another user display name
|
||||
When the user "Alice" changes the display name of user "Brian" to "<newDisplayName>" using the Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the user "Brian" should have information with these key and value pairs:
|
||||
| key | value |
|
||||
| displayName | <displayNameAsResult> |
|
||||
And the user information of "Brian" should match this JSON schema
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"displayName"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"type": "string",
|
||||
"enum": ["<displayNameAsResult>"]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| action description | newDisplayName | code | displayNameAsResult |
|
||||
| change to a display name | Olaf Scholz | 200 | Olaf Scholz |
|
||||
@@ -133,9 +217,21 @@ Feature: edit user
|
||||
Given the administrator has given "Brian" the role "<role>" using the settings api
|
||||
When the user "Brian" tries to change the display name of user "Brian" to "Brian Murphy" using the Graph API
|
||||
Then the HTTP status code should be "401"
|
||||
And the user "Alice" should have information with these key and value pairs:
|
||||
| key | value |
|
||||
| displayName | Alice Hansen |
|
||||
And the user information of "Alice" should match this JSON schema
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"displayName"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"type": "string",
|
||||
"enum": ["Alice Hansen"]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| role |
|
||||
| Space Admin |
|
||||
@@ -153,9 +249,21 @@ Feature: edit user
|
||||
And the administrator has given "Carol" the role "<role>" using the settings api
|
||||
When the user "Brian" tries to change the display name of user "Carol" to "Alice Hansen" using the Graph API
|
||||
Then the HTTP status code should be "401"
|
||||
And the user "Carol" should have information with these key and value pairs:
|
||||
| key | value |
|
||||
| displayName | Carol King |
|
||||
And the user information of "Carol" should match this JSON schema
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"displayName"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"type": "string",
|
||||
"enum": ["Carol King"]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| userRole | role |
|
||||
| Space Admin | Space Admin |
|
||||
@@ -213,9 +321,41 @@ Feature: edit user
|
||||
Then the HTTP status code should be "200"
|
||||
When user "Alice" gets information of user "Brian" using Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the user retrieve API response should contain the following information:
|
||||
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
|
||||
| Brian Murphy | %uuid_v4% | brian@example.com | Brian | false |
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"displayName",
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName",
|
||||
"accountEnabled"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"type": "string",
|
||||
"enum": ["Brian Murphy"]
|
||||
},
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["brian@example.com"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Brian"]
|
||||
},
|
||||
"accountEnabled": {
|
||||
"type": "boolean",
|
||||
"enum": [false]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
@skipOnStable2.0
|
||||
Scenario Outline: a normal user should not be able to disable another user
|
||||
@@ -225,9 +365,41 @@ Feature: edit user
|
||||
Then the HTTP status code should be "401"
|
||||
When user "Alice" gets information of user "Carol" using Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the user retrieve API response should contain the following information:
|
||||
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
|
||||
| Carol King | %uuid_v4% | carol@example.org | Carol | true |
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"displayName",
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName",
|
||||
"accountEnabled"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"type": "string",
|
||||
"enum": ["Carol King"]
|
||||
},
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["carol@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Carol"]
|
||||
},
|
||||
"accountEnabled": {
|
||||
"type": "boolean",
|
||||
"enum": [true]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| role |
|
||||
| Space Admin |
|
||||
@@ -241,9 +413,41 @@ Feature: edit user
|
||||
Then the HTTP status code should be "200"
|
||||
When user "Alice" gets information of user "Brian" using Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the user retrieve API response should contain the following information:
|
||||
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
|
||||
| Brian Murphy | %uuid_v4% | brian@example.com | Brian | true |
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"displayName",
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName",
|
||||
"accountEnabled"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"type": "string",
|
||||
"enum": ["Brian Murphy"]
|
||||
},
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["brian@example.com"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Brian"]
|
||||
},
|
||||
"accountEnabled": {
|
||||
"type": "boolean",
|
||||
"enum": [true]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
@skipOnStable2.0
|
||||
Scenario Outline: a normal user should not be able to enable another user
|
||||
@@ -254,9 +458,41 @@ Feature: edit user
|
||||
Then the HTTP status code should be "401"
|
||||
When user "Alice" gets information of user "Carol" using Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the user retrieve API response should contain the following information:
|
||||
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
|
||||
| Carol King | %uuid_v4% | carol@example.org | Carol | false |
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"displayName",
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName",
|
||||
"accountEnabled"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"type": "string",
|
||||
"enum": ["Carol King"]
|
||||
},
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["carol@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Carol"]
|
||||
},
|
||||
"accountEnabled": {
|
||||
"type": "boolean",
|
||||
"enum": [false]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| role |
|
||||
| Space Admin |
|
||||
|
||||
@@ -29,7 +29,27 @@ Feature: get groups and their members
|
||||
And group "h2o-lover" has been created
|
||||
When user "Brian" gets all the groups using the Graph API
|
||||
Then the HTTP status code should be "403"
|
||||
And the last response should be an unauthorized response
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"error"
|
||||
],
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"message"
|
||||
],
|
||||
"properties": {
|
||||
"type": "string",
|
||||
"enum": ["Unauthorized"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| role |
|
||||
| Space Admin |
|
||||
@@ -58,7 +78,27 @@ Feature: get groups and their members
|
||||
And group "tea-lover" has been created
|
||||
When user "Brian" gets all the members of group "tea-lover" using the Graph API
|
||||
Then the HTTP status code should be "403"
|
||||
And the last response should be an unauthorized response
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"error"
|
||||
],
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"message"
|
||||
],
|
||||
"properties": {
|
||||
"type": "string",
|
||||
"enum": ["Unauthorized"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| role |
|
||||
| Space Admin |
|
||||
@@ -78,13 +118,119 @@ Feature: get groups and their members
|
||||
And user "Carol" has been added to group "tea-lover"
|
||||
When user "Alice" retrieves all groups along with their members using the Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the group 'coffee-lover' should have the following member information
|
||||
| displayName | id | mail | onPremisesSamAccountName |
|
||||
| Brian Murphy | %uuid_v4% | brian@example.org | Brian |
|
||||
And the group 'tea-lover' should have the following member information
|
||||
| displayName | id | mail | onPremisesSamAccountName |
|
||||
| Alice Hansen | %uuid_v4% | alice@example.org | Alice |
|
||||
| Carol King | %uuid_v4% | carol@example.org | Carol |
|
||||
And the JSON data of the response should contain the group "coffee-lover" in the item 'value', the group-details should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"members"
|
||||
],
|
||||
"properties": {
|
||||
"members": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"displayName",
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"type": "string",
|
||||
"enum": ["Brian Murphy"]
|
||||
},
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["brian@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Brian"]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
And the JSON data of the response should contain the group "tea-lover" in the item 'value', the group-details should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"members"
|
||||
],
|
||||
"properties": {
|
||||
"members": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"displayName",
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"type": "string",
|
||||
"enum": ["Alice Hansen"]
|
||||
},
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["alice@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Alice"]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"displayName",
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"type": "string",
|
||||
"enum": ["Carol King"]
|
||||
},
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["carol@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Carol"]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
@issue-5938
|
||||
Scenario Outline: user other than the admin shouldn't get all groups along with its member's information
|
||||
@@ -96,7 +242,27 @@ Feature: get groups and their members
|
||||
And user "Brian" has been added to group "coffee-lover"
|
||||
When user "Brian" retrieves all groups along with their members using the Graph API
|
||||
Then the HTTP status code should be "403"
|
||||
And the last response should be an unauthorized response
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"error"
|
||||
],
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"message"
|
||||
],
|
||||
"properties": {
|
||||
"type": "string",
|
||||
"enum": ["Unauthorized"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| role |
|
||||
| Space Admin |
|
||||
@@ -110,10 +276,76 @@ Feature: get groups and their members
|
||||
And user "Alice" has been added to group "tea-lover"
|
||||
And user "Brian" has been added to group "tea-lover"
|
||||
When user "Alice" gets all the members information of group "tea-lover" using the Graph API
|
||||
And the group 'tea-lover' should have the following member information
|
||||
| displayName | id | mail | onPremisesSamAccountName |
|
||||
| Alice Hansen | %uuid_v4% | alice@example.org | Alice |
|
||||
| Brian Murphy | %uuid_v4% | brian@example.org | Brian |
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"members"
|
||||
],
|
||||
"properties": {
|
||||
"members": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"displayName",
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"type": "string",
|
||||
"enum": ["Alice Hansen"]
|
||||
},
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["alice@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Alice"]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"displayName",
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"type": "string",
|
||||
"enum": ["Brian Murphy"]
|
||||
},
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["brian@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Brian"]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
@issue-5604
|
||||
Scenario Outline: user other than the admin gets a group along with its member's information
|
||||
@@ -124,7 +356,27 @@ Feature: get groups and their members
|
||||
And user "Brian" has been added to group "tea-lover"
|
||||
When user "Brian" gets all the members information of group "tea-lover" using the Graph API
|
||||
Then the HTTP status code should be "403"
|
||||
And the last response should be an unauthorized response
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"error"
|
||||
],
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"message"
|
||||
],
|
||||
"properties": {
|
||||
"type": "string",
|
||||
"enum": ["Unauthorized"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| role |
|
||||
| Space Admin |
|
||||
|
||||
@@ -15,9 +15,41 @@ Feature: get users
|
||||
Given the administrator has given "Alice" the role "Admin" using the settings api
|
||||
When user "Alice" gets information of user "Brian" using Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the user retrieve API response should contain the following information:
|
||||
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
|
||||
| Brian Murphy | %uuid_v4% | brian@example.org | Brian | true |
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"displayName",
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName",
|
||||
"accountEnabled"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"type": "string",
|
||||
"enum": ["Brian Murphy"]
|
||||
},
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["brian@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Brian"]
|
||||
},
|
||||
"accountEnabled": {
|
||||
"type": "boolean",
|
||||
"enum": [true]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
@issue-5125
|
||||
Scenario Outline: non-admin user tries to get the information of a user
|
||||
@@ -25,7 +57,27 @@ Feature: get users
|
||||
And the administrator has given "Brian" the role "<userRole>" using the settings api
|
||||
When user "Brian" tries to get information of user "Alice" using Graph API
|
||||
Then the HTTP status code should be "401"
|
||||
And the last response should be an unauthorized response
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"error"
|
||||
],
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"message"
|
||||
],
|
||||
"properties": {
|
||||
"type": "string",
|
||||
"enum": ["Unauthorized"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| userRole | role |
|
||||
| Space Admin | Space Admin |
|
||||
@@ -46,10 +98,66 @@ Feature: get users
|
||||
Given the administrator has given "Alice" the role "Admin" using the settings api
|
||||
When user "Alice" gets all users using the Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the API response should contain following users with the information:
|
||||
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
|
||||
| Alice Hansen | %uuid_v4% | alice@example.org | Alice | true |
|
||||
| Brian Murphy | %uuid_v4% | brian@example.org | Brian | true |
|
||||
And the JSON data of the response should contain the user "Alice Hansen" in the item 'value', the user-details should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName",
|
||||
"accountEnabled"
|
||||
],
|
||||
"properties": {
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["alice@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Alice"]
|
||||
},
|
||||
"accountEnabled": {
|
||||
"type": "boolean",
|
||||
"enum": [true]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
And the JSON data of the response should contain the user "Brian Murphy" in the item 'value', the user-details should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName",
|
||||
"accountEnabled"
|
||||
],
|
||||
"properties": {
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["brian@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Brian"]
|
||||
},
|
||||
"accountEnabled": {
|
||||
"type": "boolean",
|
||||
"enum": [true]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
@skipOnStable2.0
|
||||
Scenario: admin user gets all users include disabled users
|
||||
@@ -57,17 +165,93 @@ Feature: get users
|
||||
And the user "Alice" has disabled user "Brian" using the Graph API
|
||||
When user "Alice" gets all users using the Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the API response should contain following users with the information:
|
||||
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
|
||||
| Alice Hansen | %uuid_v4% | alice@example.org | Alice | true |
|
||||
| Brian Murphy | %uuid_v4% | brian@example.org | Brian | false |
|
||||
And the JSON data of the response should contain the user "Alice Hansen" in the item 'value', the user-details should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName",
|
||||
"accountEnabled"
|
||||
],
|
||||
"properties": {
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["alice@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Alice"]
|
||||
},
|
||||
"accountEnabled": {
|
||||
"type": "boolean",
|
||||
"enum": [true]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
And the JSON data of the response should contain the user "Brian Murphy" in the item 'value', the user-details should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName",
|
||||
"accountEnabled"
|
||||
],
|
||||
"properties": {
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["brian@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Brian"]
|
||||
},
|
||||
"accountEnabled": {
|
||||
"type": "boolean",
|
||||
"enum": [false]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
|
||||
Scenario Outline: non-admin user tries to get all users
|
||||
Given the administrator has given "Alice" the role "<userRole>" using the settings api
|
||||
When user "Brian" tries to get all users using the Graph API
|
||||
Then the HTTP status code should be "401"
|
||||
And the last response should be an unauthorized response
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"error"
|
||||
],
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"message"
|
||||
],
|
||||
"properties": {
|
||||
"type": "string",
|
||||
"enum": ["Unauthorized"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| userRole |
|
||||
| Space Admin |
|
||||
@@ -79,38 +263,246 @@ Feature: get users
|
||||
Given the administrator has given "Alice" the role "Admin" using the settings api
|
||||
When the user "Alice" gets user "Brian" along with his drive information using Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the user retrieve API response should contain the following information:
|
||||
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
|
||||
| Brian Murphy | %uuid_v4% | brian@example.org | Brian | true |
|
||||
And the user retrieve API response should contain the following drive information:
|
||||
| driveType | personal |
|
||||
| driveAlias | personal/brian |
|
||||
| id | %space_id% |
|
||||
| name | Brian Murphy |
|
||||
| owner@@@user@@@id | %user_id% |
|
||||
| quota@@@state | normal |
|
||||
| root@@@id | %space_id% |
|
||||
| root@@@webDavUrl | %base_url%/dav/spaces/%space_id% |
|
||||
| webUrl | %base_url%/f/%space_id% |
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"displayName",
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName",
|
||||
"drive",
|
||||
"accountEnabled"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"type": "string",
|
||||
"enum": ["Brian Murphy"]
|
||||
},
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["brian@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Brian"]
|
||||
},
|
||||
"accountEnabled": {
|
||||
"type": "boolean",
|
||||
"enum": [true]
|
||||
},
|
||||
"drive": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"driveAlias",
|
||||
"id",
|
||||
"name",
|
||||
"owner",
|
||||
"quota",
|
||||
"root",
|
||||
"webUrl"
|
||||
],
|
||||
"properties": {
|
||||
"driveType" : {
|
||||
"type": "string",
|
||||
"enum": ["personal"]
|
||||
},
|
||||
"driveAlias" : {
|
||||
"type": "string",
|
||||
"enum": ["personal/brian"]
|
||||
},
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"enum": ["Brian Murphy"]
|
||||
},
|
||||
"owner": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"user"
|
||||
],
|
||||
"properties": {
|
||||
"user": "string",
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"enum": ["%user_id_pattern%"]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"quota": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"state"
|
||||
],
|
||||
"properties": {
|
||||
"state": {
|
||||
"type": "string",
|
||||
"enum": ["normal"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"webDavUrl"
|
||||
],
|
||||
"properties": {
|
||||
"state": {
|
||||
"type": "string",
|
||||
"enum": ["normal"]
|
||||
},
|
||||
"webDavUrl": {
|
||||
"type": "string",
|
||||
"pattern": "^%base_url%/dav/spaces/%space_id_pattern%$"
|
||||
}
|
||||
}
|
||||
},
|
||||
"webUrl": {
|
||||
"type": "string",
|
||||
"pattern": "^%base_url%/f/%space_id_pattern%$"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
@skipOnStable2.0
|
||||
Scenario Outline: non-admin user gets his/her own drive information
|
||||
Given the administrator has given "Brian" the role "<userRole>" using the settings api
|
||||
When the user "Brian" gets his drive information using Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the user retrieve API response should contain the following information:
|
||||
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
|
||||
| Brian Murphy | %uuid_v4% | brian@example.org | Brian | true |
|
||||
And the user retrieve API response should contain the following drive information:
|
||||
| driveType | personal |
|
||||
| driveAlias | personal/brian |
|
||||
| id | %space_id% |
|
||||
| name | Brian Murphy |
|
||||
| owner@@@user@@@id | %user_id% |
|
||||
| quota@@@state | normal |
|
||||
| root@@@id | %space_id% |
|
||||
| root@@@webDavUrl | %base_url%/dav/spaces/%space_id% |
|
||||
| webUrl | %base_url%/f/%space_id% |
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"displayName",
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName",
|
||||
"drive",
|
||||
"accountEnabled"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"type": "string",
|
||||
"enum": ["Brian Murphy"]
|
||||
},
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["brian@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Brian"]
|
||||
},
|
||||
"accountEnabled": {
|
||||
"type": "boolean",
|
||||
"enum": [true]
|
||||
},
|
||||
"drive": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"driveAlias",
|
||||
"id",
|
||||
"name",
|
||||
"owner",
|
||||
"quota",
|
||||
"root",
|
||||
"webUrl"
|
||||
],
|
||||
"properties": {
|
||||
"driveType" : {
|
||||
"type": "string",
|
||||
"enum": ["personal"]
|
||||
},
|
||||
"driveAlias" : {
|
||||
"type": "string",
|
||||
"enum": ["personal/brian"]
|
||||
},
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%space_id_pattern%$"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"enum": ["Brian Murphy"]
|
||||
},
|
||||
"owner": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"user"
|
||||
],
|
||||
"properties": {
|
||||
"user": "string",
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"enum": ["%user_id_pattern%"]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"quota": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"state"
|
||||
],
|
||||
"properties": {
|
||||
"state": {
|
||||
"type": "string",
|
||||
"enum": ["normal"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"webDavUrl"
|
||||
],
|
||||
"properties": {
|
||||
"state": {
|
||||
"type": "string",
|
||||
"enum": ["normal"]
|
||||
},
|
||||
"webDavUrl": {
|
||||
"type": "string",
|
||||
"pattern": "^%base_url%/dav/spaces/%space_id_pattern%$"
|
||||
}
|
||||
}
|
||||
},
|
||||
"webUrl": {
|
||||
"type": "string",
|
||||
"pattern": "^%base_url%/f/%space_id_pattern%$"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| userRole |
|
||||
| Space Admin |
|
||||
@@ -126,9 +518,60 @@ Feature: get users
|
||||
And user "Brian" has been added to group "coffee-lover"
|
||||
When the user "Alice" gets user "Brian" along with his group information using Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the user retrieve API response should contain the following information:
|
||||
| displayName | id | mail | onPremisesSamAccountName | accountEnabled | memberOf |
|
||||
| Brian Murphy | %uuid_v4% | brian@example.org | Brian | true | tea-lover, coffee-lover |
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName"
|
||||
],
|
||||
"properties": {
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["brian@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Brian"]
|
||||
},
|
||||
"memberOf": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"displayName"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"type": "string",
|
||||
"enum": ["tea-lover"]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"displayName"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"type": "string",
|
||||
"enum": ["coffee-lover"]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
@issue-5125
|
||||
Scenario Outline: non-admin user tries to get the group information of a user
|
||||
@@ -138,7 +581,27 @@ Feature: get users
|
||||
And user "Brian" has been added to group "coffee-lover"
|
||||
When the user "Alice" gets user "Brian" along with his group information using Graph API
|
||||
Then the HTTP status code should be "401"
|
||||
And the last response should be an unauthorized response
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"error"
|
||||
],
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"message"
|
||||
],
|
||||
"properties": {
|
||||
"type": "string",
|
||||
"enum": ["Unauthorized"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| userRole | role |
|
||||
| Space Admin | Space Admin |
|
||||
@@ -166,22 +629,127 @@ Feature: get users
|
||||
And user "Brian" has been added to group "coffee-lover"
|
||||
When the user "Alice" gets all users of the group "tea-lover" using the Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the API response should contain following users with the information:
|
||||
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
|
||||
| Alice Hansen | %uuid_v4% | alice@example.org | Alice | true |
|
||||
| Brian Murphy | %uuid_v4% | brian@example.org | Brian | true |
|
||||
But the API response should not contain following user with the information:
|
||||
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
|
||||
| Carol King | %uuid_v4% | carol@example.org | Carol | false |
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"value": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName",
|
||||
"accountEnabled"
|
||||
],
|
||||
"properties": {
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["alice@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Alice"]
|
||||
},
|
||||
"accountEnabled": {
|
||||
"type": "boolean",
|
||||
"enum": [true]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName",
|
||||
"accountEnabled"
|
||||
],
|
||||
"properties": {
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["brian@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Brian"]
|
||||
},
|
||||
"accountEnabled": {
|
||||
"type": "boolean",
|
||||
"enum": [true]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"additionalItems": false
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
And the JSON data of the response should not contain the user "Carol King" in the item 'value'
|
||||
When the user "Alice" gets all users of two groups "tea-lover,coffee-lover" using the Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the API response should contain following user with the information:
|
||||
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
|
||||
| Brian Murphy | %uuid_v4% | brian@example.org | Brian | true |
|
||||
But the API response should not contain following users with the information:
|
||||
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
|
||||
| Alice Hansen | %uuid_v4% | alice@example.org | Alice | true |
|
||||
| Carol King | %uuid_v4% | carol@example.org | Carol | true |
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"value"
|
||||
],
|
||||
"properties": {
|
||||
"value": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName",
|
||||
"accountEnabled"
|
||||
],
|
||||
"properties": {
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["brian@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Brian"]
|
||||
},
|
||||
"accountEnabled": {
|
||||
"type": "boolean",
|
||||
"enum": [true]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"additionalItems": false
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
And the JSON data of the response should not contain the user "Carol King" in the item 'value'
|
||||
And the JSON data of the response should not contain the user "Alice Hansen" in the item 'value'
|
||||
|
||||
|
||||
@skipOnStable2.0
|
||||
Scenario: admin user gets all users of certain groups
|
||||
@@ -195,13 +763,67 @@ Feature: get users
|
||||
And user "Carol" has been added to group "wine-lover"
|
||||
When the user "Alice" gets all users from that are members in the group "tea-lover" or the group "coffee-lover" using the Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the API response should contain following users with the information:
|
||||
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
|
||||
| Alice Hansen | %uuid_v4% | alice@example.org | Alice | true |
|
||||
| Brian Murphy | %uuid_v4% | brian@example.org | Brian | true |
|
||||
But the API response should not contain following user with the information:
|
||||
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
|
||||
| Carol King | %uuid_v4% | carol@example.org | Carol | false |
|
||||
And the JSON data of the response should contain the user "Alice Hansen" in the item 'value', the user-details should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName",
|
||||
"accountEnabled"
|
||||
],
|
||||
"properties": {
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["alice@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Alice"]
|
||||
},
|
||||
"accountEnabled": {
|
||||
"type": "boolean",
|
||||
"enum": [true]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
And the JSON data of the response should contain the user "Brian Murphy" in the item 'value', the user-details should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName",
|
||||
"accountEnabled"
|
||||
],
|
||||
"properties": {
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["brian@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Brian"]
|
||||
},
|
||||
"accountEnabled": {
|
||||
"type": "boolean",
|
||||
"enum": [true]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
But the JSON data of the response should not contain the user "Carol King" in the item 'value'
|
||||
|
||||
@skipOnStable2.0
|
||||
Scenario Outline: non admin user tries to get users of certain groups
|
||||
@@ -211,7 +833,27 @@ Feature: get users
|
||||
And user "Alice" has been added to group "tea-lover"
|
||||
When the user "Brian" gets all users of the group "tea-lover" using the Graph API
|
||||
Then the HTTP status code should be "401"
|
||||
And the last response should be an unauthorized response
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"error"
|
||||
],
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"message"
|
||||
],
|
||||
"properties": {
|
||||
"type": "string",
|
||||
"enum": ["Unauthorized"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| role |
|
||||
| Space Admin |
|
||||
@@ -228,28 +870,127 @@ Feature: get users
|
||||
And user "Brian" has been added to group "tea-lover"
|
||||
When the user "Alice" gets all users with role "Space Admin" using the Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the API response should contain following users with the information:
|
||||
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
|
||||
| Brian Murphy | %uuid_v4% | brian@example.org | Brian | true |
|
||||
| Carol King | %uuid_v4% | carol@example.org | Carol | true |
|
||||
But the API response should not contain following user with the information:
|
||||
| displayName | id | mail | onPremisesSamAccountName |
|
||||
| Alice Hansen | %uuid_v4% | alice@example.org | Alice |
|
||||
And the JSON data of the response should contain the user "Brian Murphy" in the item 'value', the user-details should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName",
|
||||
"accountEnabled"
|
||||
],
|
||||
"properties": {
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["brian@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Brian"]
|
||||
},
|
||||
"accountEnabled": {
|
||||
"type": "boolean",
|
||||
"enum": [true]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
And the JSON data of the response should contain the user "Carol King" in the item 'value', the user-details should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName",
|
||||
"accountEnabled"
|
||||
],
|
||||
"properties": {
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["carol@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Carol"]
|
||||
},
|
||||
"accountEnabled": {
|
||||
"type": "boolean",
|
||||
"enum": [true]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
But the JSON data of the response should not contain the user "Alice Hansen" in the item 'value'
|
||||
When the user "Alice" gets all users with role "Space Admin" and member of the group "tea-lover" using the Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the API response should contain following users with the information:
|
||||
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
|
||||
| Brian Murphy | %uuid_v4% | brian@example.org | Brian | true |
|
||||
But the API response should not contain following user with the information:
|
||||
| displayName | id | mail | onPremisesSamAccountName | accountEnabled |
|
||||
| Carol King | %uuid_v4% | carol@example.org | Carol | true |
|
||||
And the JSON data of the response should contain the user "Brian Murphy" in the item 'value', the user-details should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName",
|
||||
"accountEnabled"
|
||||
],
|
||||
"properties": {
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["brian@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Brian"]
|
||||
},
|
||||
"accountEnabled": {
|
||||
"type": "boolean",
|
||||
"enum": [true]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
But the JSON data of the response should not contain the user "Carol King" in the item 'value'
|
||||
|
||||
@skipOnStable2.0
|
||||
Scenario Outline: non-admin user tries to get users with a certain role
|
||||
Given the administrator has given "Alice" the role "<userRole>" using the settings api
|
||||
When the user "Alice" gets all users with role "<role>" using the Graph API
|
||||
Then the HTTP status code should be "401"
|
||||
And the last response should be an unauthorized response
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"error"
|
||||
],
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"message"
|
||||
],
|
||||
"properties": {
|
||||
"type": "string",
|
||||
"enum": ["Unauthorized"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| userRole | role |
|
||||
| Space Admin | Space Admin |
|
||||
|
||||
@@ -11,9 +11,31 @@ Feature: get user's own information
|
||||
Scenario: user gets his/her own information with no group involvement
|
||||
When the user "Alice" retrieves her information using the Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the user retrieve API response should contain the following information:
|
||||
| displayName | id | mail | onPremisesSamAccountName |
|
||||
| Alice Hansen | %uuid_v4% | alice@example.org | Alice |
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName"
|
||||
],
|
||||
"properties": {
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["alice@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Alice"]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
|
||||
Scenario: user gets his/her own information with group involvement
|
||||
@@ -23,6 +45,57 @@ Feature: get user's own information
|
||||
And user "Alice" has been added to group "coffee-lover"
|
||||
When the user "Alice" retrieves her information using the Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And the user retrieve API response should contain the following information:
|
||||
| displayName | id | mail | onPremisesSamAccountName | memberOf |
|
||||
| Alice Hansen | %uuid_v4% | alice@example.org | Alice | tea-lover, coffee-lover |
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"mail",
|
||||
"onPremisesSamAccountName"
|
||||
],
|
||||
"properties": {
|
||||
"id" : {
|
||||
"type": "string",
|
||||
"pattern": "^%user_id_pattern%$"
|
||||
},
|
||||
"mail": {
|
||||
"type": "string",
|
||||
"enum": ["alice@example.org"]
|
||||
},
|
||||
"onPremisesSamAccountName": {
|
||||
"type": "string",
|
||||
"enum": ["Alice"]
|
||||
},
|
||||
"memberOf": {
|
||||
"type": "array",
|
||||
"items": [
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"displayName"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"type": "string",
|
||||
"enum": ["tea-lover"]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"displayName"
|
||||
],
|
||||
"properties": {
|
||||
"displayName": {
|
||||
"type": "string",
|
||||
"enum": ["coffee-lover"]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
@@ -165,7 +165,27 @@ Feature: remove a user from a group
|
||||
And user "Brian" has been added to group "grp1"
|
||||
When user "Alice" tries to remove user "Brian" from group "grp1" using the Graph API
|
||||
Then the HTTP status code should be "403"
|
||||
And the last response should be an unauthorized response
|
||||
And the JSON data of the response should match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"error"
|
||||
],
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"message"
|
||||
],
|
||||
"properties": {
|
||||
"type": "string",
|
||||
"enum": ["Unauthorized"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
And user "Brian" should belong to group "grp1"
|
||||
Examples:
|
||||
| role |
|
||||
|
||||
Reference in New Issue
Block a user