1
0
mirror of https://github.com/owncloud/ocis.git synced 2025-04-18 23:44:07 +03:00

added test to check share-types property by sharer after sharee is deleted

This commit is contained in:
Prajwol Amatya 2025-04-03 09:25:18 +05:45
parent e9158c9496
commit 4543f3af3f
No known key found for this signature in database
GPG Key ID: 9014DDEED1FB2938
3 changed files with 76 additions and 5 deletions

View File

@ -515,9 +515,10 @@ class WebDavPropertiesContext implements Context {
}
/**
* @Then the single response should contain a property :property with a child property :childProperty
* @Then /^the single response should contain a property "([^"]*)" (with|without) a child property "([^"]*)"$/
*
* @param string $property
* @param string $withOrWithout
* @param string $childProperty
*
* @return void
@ -526,15 +527,23 @@ class WebDavPropertiesContext implements Context {
*/
public function theSingleResponseShouldContainAPropertyWithChildProperty(
string $property,
string $withOrWithout,
string $childProperty
): void {
$xmlPart = HttpRequestHelper::getResponseXml($this->featureContext->getResponse())->xpath(
"//d:prop/$property/$childProperty"
);
Assert::assertTrue(
isset($xmlPart[0]),
"Cannot find property \"$property/$childProperty\""
);
if ($withOrWithout === "with") {
Assert::assertTrue(
isset($xmlPart[0]),
"Cannot find property \"$property/$childProperty\""
);
} else {
Assert::assertFalse(
isset($xmlPart[0]),
"Found property \"$property/$childProperty\""
);
}
}
/**

View File

@ -357,5 +357,15 @@ The expected failures in this file are from features in the owncloud/ocis repo.
- [apiContract/propfindShares.feature:171](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiContract/propfindShares.feature#L171)
- [apiContract/propfindShares.feature:172](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiContract/propfindShares.feature#L172)
#### [PROPFIND request to resource shared with user when deleted retains it's <oc:share-type> property](https://github.com/owncloud/ocis/issues/9463)
- [apiContract/propfindShares.feature:194](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiContract/propfindShares.feature#L194)
- [apiContract/propfindShares.feature:195](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiContract/propfindShares.feature#L195)
- [apiContract/propfindShares.feature:196](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiContract/propfindShares.feature#L196)
- [apiContract/propfindShares.feature:197](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiContract/propfindShares.feature#L197)
- [apiContract/propfindShares.feature:198](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiContract/propfindShares.feature#L198)
- [apiContract/propfindShares.feature:199](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiContract/propfindShares.feature#L199)
- [apiContract/propfindShares.feature:223](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiContract/propfindShares.feature#L223)
- [apiContract/propfindShares.feature:224](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiContract/propfindShares.feature#L224)
Note: always have an empty line at the end of this file.
The bash script that processes this file requires that the last line has a newline on the end.

View File

@ -170,3 +170,55 @@ Feature: propfind a shares
| old |
| new |
| spaces |
@issue-9463
Scenario Outline: sharer checks share-types property after sharee is deleted (Personal Space)
Given using <dav-path-version> DAV path
And user "Alice" has created folder "folderToShare"
And user "Alice" has uploaded file with content "some content" to "testfile.txt"
And user "Alice" has sent the following resource share invitation:
| resource | <resource> |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And user "Brian" has a share "<resource>" synced
And the user "Admin" has deleted a user "Brian"
When user "Alice" gets the following properties of resource "<resource>" inside space "Personal" using the WebDAV API
| propertyName |
| oc:share-types |
Then the HTTP status code should be "207"
And the single response should contain a property "oc:share-types" without a child property "oc:share-type"
Examples:
| dav-path-version | resource |
| old | folderToShare |
| old | testfile.txt |
| new | folderToShare |
| new | testfile.txt |
| spaces | folderToShare |
| spaces | testfile.txt |
@issue-9463
Scenario Outline: sharer checks share-types property after sharee is deleted (Project Space)
Given using spaces DAV path
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "NewSpace" with the default quota using the Graph API
And user "Alice" has created a folder "folderToShare" in space "NewSpace"
And user "Alice" has uploaded a file inside space "NewSpace" with content "some content" to "testfile.txt"
And user "Alice" has sent the following resource share invitation:
| resource | <resource> |
| space | NewSpace |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
And user "Brian" has a share "<resource>" synced
And the user "Admin" has deleted a user "Brian"
When user "Alice" gets the following properties of resource "<resource>" inside space "NewSpace" using the WebDAV API
| propertyName |
| oc:share-types |
Then the HTTP status code should be "207"
And the single response should contain a property "oc:share-types" without a child property "oc:share-type"
Examples:
| resource |
| folderToShare |
| testfile.txt |