added test for getting details of a single group (#5760)

addressed reviews

updated steps with JSON drill-down functionality

reviews addressed

fixed linter error

conflicts resolved

fixed errors

addressed reviews
This commit is contained in:
Prajwol Amatya
2023-03-15 12:10:59 +05:45
committed by GitHub
parent 67296caf14
commit e836b2d138
4 changed files with 51 additions and 3 deletions

View File

@@ -31,7 +31,7 @@ class GraphHelper {
* @return string
*/
public static function getUUIDv4Regex(): string {
return '[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}';
return '[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}';
}
/**

View File

@@ -105,3 +105,29 @@ Feature: get groups and their members
When user "Brian" gets all the members information of group "tea-lover" using the Graph API
Then the HTTP status code should be "401"
And the last response should be an unauthorized response
Scenario: Get details of a group
Given group "tea-lover" has been created
When user "Alice" gets details of the group "tea-lover" using the Graph API
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"displayName",
"id"
],
"properties": {
"displayName": {
"type": "string",
"enum": ["tea-lover"]
},
"id": {
"type": "string",
"pattern": "^%group_id_pattern%$"
}
}
}
"""

View File

@@ -2081,4 +2081,26 @@ class GraphContext implements Context {
. "\nExpected rolId for role '$role'' to be '" . $this->appEntity["appRoles"][$role] . "' but got '" . $response['appRoleId'] . "'"
);
}
/**
* @When user :user gets details of the group :groupName using the Graph API
*
* @param string $user
* @param string $groupName
*
* @return void
*/
public function userGetsDetailsOfTheGroupUsingTheGraphApi(string $user, string $groupName): void {
$credentials = $this->getAdminOrUserCredentials($user);
$this->featureContext->setResponse(
GraphHelper::getGroup(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
$credentials["username"],
$credentials["password"],
$groupName
)
);
}
}

View File

@@ -9,7 +9,7 @@ Feature: capabilities
When the administrator retrieves the capabilities using the capabilities API
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And the JSON data of the response should match
And the ocs JSON data of the response should match
"""
{
"type": "object",
@@ -212,7 +212,7 @@ Feature: capabilities
@smokeTest
Scenario: getting default capabilities with admin user
When the administrator retrieves the capabilities using the capabilities API
And the ocs JSON data of the response should match
Then the ocs JSON data of the response should match
"""
{
"type": "object",