Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[full-ci] [tests-only] Added test for creating group with case sensitive #4422

Merged
merged 1 commit into from
Aug 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ def testPipelines(ctx):
localApiTests(ctx, "ocis", "apiAccountsHashDifficulty"),
localApiTests(ctx, "ocis", "apiSpaces"),
localApiTests(ctx, "ocis", "apiArchiver"),
localApiTests(ctx, "ocis", "apiGraph"),
]

if "skip" not in config["apiTests"] or not config["apiTests"]["skip"]:
Expand Down
10 changes: 9 additions & 1 deletion tests/acceptance/config/behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ default:
apiAccountsHashDifficulty:
paths:
- '%paths.base%/../features/apiAccountsHashDifficulty'
context:
context: &common_ldap_suite_context
parameters:
ldapAdminPassword: admin
ldapUsersOU: TestUsers
Expand Down Expand Up @@ -58,5 +58,13 @@ default:
- FilesVersionsContext:
- PublicWebDavContext:

apiGraph:
paths:
- '%paths.base%/../features/apiGraph'
context: *common_ldap_suite_context
contexts:
- GraphContext:
- FeatureContext: *common_feature_context_params

extensions:
Cjm\Behat\StepThroughExtension: ~
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,11 @@ The expected failures in this file are from features in the owncloud/ocis repo.

### [Search by shares jail works incorrect](https://github.com/owncloud/ocis/issues/4014)
- [apiSpaces/search.feature:43](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/search.feature#L43)

### [create request for already existing user exits with status code 500 ](https://github.com/owncloud/ocis/issues/3516)
- [apiGraph/createGroupCaseSensitive.feature:16](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/createGroupCaseSensitive.feature#L16)
- [apiGraph/createGroupCaseSensitive.feature:17](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/createGroupCaseSensitive.feature#L17)
- [apiGraph/createGroupCaseSensitive.feature:18](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/createGroupCaseSensitive.feature#L18)
- [apiGraph/createGroupCaseSensitive.feature:19](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/createGroupCaseSensitive.feature#L19)
- [apiGraph/createGroupCaseSensitive.feature:20](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/createGroupCaseSensitive.feature#L20)
- [apiGraph/createGroupCaseSensitive.feature:21](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/createGroupCaseSensitive.feature#L21)
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@api
Feature: create groups, group names are case insensitive

Scenario Outline: group names are case insensitive, creating groups with different upper and lower case names
Given using OCS API version "<ocs_api_version>"
And group "<group_id1>" has been created
When the administrator creates a group "<group_id2>" using the Graph API
And the administrator creates a group "<group_id3>" using the Graph API
Then the HTTP status code of responses on all endpoints should be "400"
And these groups should not exist:
| groupname |
| <group_id2> |
| <group_id3> |
Examples:
| ocs_api_version | group_id1 | group_id2 | group_id3 |
| 1 | case-sensitive-group | Case-Sensitive-Group | CASE-SENSITIVE-GROUP |
| 1 | Case-Sensitive-Group | CASE-SENSITIVE-GROUP | case-sensitive-group |
| 1 | CASE-SENSITIVE-GROUP | case-sensitive-group | Case-Sensitive-Group |
| 2 | case-sensitive-group | Case-Sensitive-Group | CASE-SENSITIVE-GROUP |
| 2 | Case-Sensitive-Group | CASE-SENSITIVE-GROUP | case-sensitive-group |
| 2 | CASE-SENSITIVE-GROUP | case-sensitive-group | Case-Sensitive-Group |
26 changes: 26 additions & 0 deletions tests/acceptance/features/bootstrap/GraphContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,32 @@ public function adminHasAddedUserToGroupUsingTheGraphApi(
}
}

/**
* @When /^the administrator creates a group "([^"]*)" using the Graph API$/
*
* @param string $group
*
* @return void
* @throws Exception
* @throws GuzzleException
*/
public function adminCreatesGroupUsingTheGraphApi(string $group): void {
$response = GraphHelper::createGroup(
$this->featureContext->getBaseUrl(),
$this->featureContext->getStepLineRef(),
$this->featureContext->getAdminUsername(),
$this->featureContext->getAdminPassword(),
$group,
);
$this->featureContext->setResponse($response);
$this->featureContext->pushToLastHttpStatusCodesArray((string) $response->getStatusCode());

if ($response->getStatusCode() === 200) {
$groupId = $this->featureContext->getJsonDecodedResponse($response)["id"];
$this->featureContext->addGroupToCreatedGroupsList($group, true, true, $groupId);
}
}

/**
* create group with provided data
*
Expand Down