diff --git a/tests/TestHelpers/WebDavHelper.php b/tests/TestHelpers/WebDavHelper.php index 76623770ac..29e2c7f2e8 100644 --- a/tests/TestHelpers/WebDavHelper.php +++ b/tests/TestHelpers/WebDavHelper.php @@ -130,7 +130,7 @@ class WebDavHelper { if (\is_int($namespaceString)) { //default namespace prefix if the property has no array key //also used if no prefix is given in the property value - $namespacePrefix = "d"; + $namespacePrefix = null; } else { //calculate the namespace prefix and namespace from the array key $matches = []; @@ -145,7 +145,12 @@ class WebDavHelper { $namespacePrefix = $propertyParts[0]; $property = $propertyParts[1]; } - $propertyBody .= "<$namespacePrefix:$property/>"; + + if ($namespacePrefix){ + $propertyBody .= "<$namespacePrefix:$property/>"; + } else { + $propertyBody .= "<$property/>"; + } } $body = " " . - "$propertyValue" . - ""; + if ($namespaceString !== null) { + $matches = []; + \preg_match("/^(.*)='(.*)'$/", $namespaceString, $matches); + $namespace = $matches[2]; + $namespacePrefix = $matches[1]; + $propertyBody = "<$namespacePrefix:$propertyName" . + " xmlns:$namespacePrefix=\"$namespace\">" . + "$propertyValue" . + ""; + } else { + $propertyBody = "<$propertyName>$propertyValue"; + } $body = " diff --git a/tests/acceptance/expected-failures-API-on-OCIS-storage.md b/tests/acceptance/expected-failures-API-on-OCIS-storage.md index fc83aae9b2..c5a65ee552 100644 --- a/tests/acceptance/expected-failures-API-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-API-on-OCIS-storage.md @@ -6,7 +6,7 @@ The expected failures in this file are from features in the owncloud/ocis repo. Basic file management like up and download, move, copy, properties, trash, versions and chunking. -#### [copy personal space file to shared folder root result share in decline state](https://github.com/owncloud/ocis/issues/6999) +#### [COPY a folder to received share file/folder seems to work but no change in shares](https://github.com/owncloud/ocis/issues/6999) - [coreApiWebdavProperties/copyFile.feature:261](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties/copyFile.feature#L261) - [coreApiWebdavProperties/copyFile.feature:262](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties/copyFile.feature#L262) @@ -15,12 +15,9 @@ Basic file management like up and download, move, copy, properties, trash, versi _ocdav: double-check the webdav property parsing when custom namespaces are used_ -- [coreApiWebdavProperties/setFileProperties.feature:32](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties/setFileProperties.feature#L32) -- [coreApiWebdavProperties/setFileProperties.feature:33](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties/setFileProperties.feature#L33) -- [coreApiWebdavProperties/setFileProperties.feature:34](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties/setFileProperties.feature#L34) -- [coreApiWebdavProperties/setFileProperties.feature:69](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties/setFileProperties.feature#L69) -- [coreApiWebdavProperties/setFileProperties.feature:67](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties/setFileProperties.feature#L67) -- [coreApiWebdavProperties/setFileProperties.feature:68](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties/setFileProperties.feature#L68) +- [coreApiWebdavProperties/setFileProperties.feature:120](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties/setFileProperties.feature#L120) +- [coreApiWebdavProperties/setFileProperties.feature:121](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties/setFileProperties.feature#L121) +- [coreApiWebdavProperties/setFileProperties.feature:122](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavProperties/setFileProperties.feature#L122) #### [Cannot set custom webDav properties](https://github.com/owncloud/product/issues/264) diff --git a/tests/acceptance/features/bootstrap/WebDav.php b/tests/acceptance/features/bootstrap/WebDav.php index 98c6d7143f..ed1d2a0850 100644 --- a/tests/acceptance/features/bootstrap/WebDav.php +++ b/tests/acceptance/features/bootstrap/WebDav.php @@ -946,7 +946,7 @@ trait WebDav { * @return void */ public function downloadedContentShouldBe(string $content):void { - $this->checkDownloadedContentMatches($content); + $this->checkDownloadedContentMatches($content, '', $this->getResponse()); } /** @@ -986,7 +986,21 @@ trait WebDav { * @return void */ public function theContentInTheResponseShouldMatchTheFollowingContent(PyStringNode $content): void { - $this->checkDownloadedContentMatches($content->getRaw()); + $this->checkDownloadedContentMatches($content->getRaw(), '', $this->getResponse()); + } + + /** + * @Then the content in the response should include the following content: + * + * @param PyStringNode $content + * + * @return void + */ + public function theContentInTheResponseShouldIncludeTheFollowingContent(PyStringNode $content): void { + Assert::assertStringContainsString( + $content->getRaw(), + (string) $this->response->getBody() + ); } /** @@ -1024,7 +1038,7 @@ trait WebDav { public function checkStatusCodeForDownloadedContentShouldBe(int $statusCode, string $content):void { $actualStatusCode = $this->response->getStatusCode(); if ($actualStatusCode === $statusCode) { - $this->checkDownloadedContentMatches($content); + $this->checkDownloadedContentMatches($content, '', $this->getResponse()); } } diff --git a/tests/acceptance/features/bootstrap/WebDavPropertiesContext.php b/tests/acceptance/features/bootstrap/WebDavPropertiesContext.php index fc05fd8ca1..87b4e5fa6b 100644 --- a/tests/acceptance/features/bootstrap/WebDavPropertiesContext.php +++ b/tests/acceptance/features/bootstrap/WebDavPropertiesContext.php @@ -42,6 +42,18 @@ class WebDavPropertiesContext implements Context { */ private array $storedETAG = []; + /** + * @param string $namespaceString + * + * @return object + */ + public function parseNamespace(string $namespaceString): object { + //calculate the namespace prefix and namespace + $matches = []; + \preg_match("/^(.*)='(.*)'$/", $namespaceString, $matches); + return (object)["namespace" => $matches[2], "prefix" => $matches[1]]; + } + /** * @When /^user "([^"]*)" gets the properties of (?:file|folder|entry) "([^"]*)" using the WebDAV API$/ * @@ -183,6 +195,37 @@ class WebDavPropertiesContext implements Context { $this->featureContext->theHTTPStatusCodeShouldBe(207, "", $response); } + /** + * @When user :user gets a custom property :propertyName of file :path + * + * @param string $user + * @param string $propertyName + * @param string $path + * + * @return void + * @throws Exception + */ + public function userGetsCustomPropertyOfFile( + string $user, + string $propertyName, + string $path + ):void { + $user = $this->featureContext->getActualUsername($user); + $properties = [$propertyName]; + $response = WebDavHelper::propfind( + $this->featureContext->getBaseUrl(), + $this->featureContext->getActualUsername($user), + $this->featureContext->getUserPassword($user), + $path, + $properties, + $this->featureContext->getStepLineRef(), + "0", + "files", + $this->featureContext->getDavPathVersion() + ); + $this->featureContext->setResponse($response); + } + /** * @When user :user gets a custom property :propertyName with namespace :namespace of file :path * @@ -194,7 +237,7 @@ class WebDavPropertiesContext implements Context { * @return void * @throws Exception */ - public function userGetsPropertiesOfFile( + public function userGetsPropertiesWithNamespaceOfFile( string $user, string $propertyName, string $namespace, @@ -204,8 +247,7 @@ class WebDavPropertiesContext implements Context { $properties = [ $namespace => $propertyName ]; - $this->featureContext->setResponse( - WebDavHelper::propfind( + $response = WebDavHelper::propfind( $this->featureContext->getBaseUrl(), $this->featureContext->getActualUsername($user), $this->featureContext->getUserPassword($user), @@ -215,8 +257,8 @@ class WebDavPropertiesContext implements Context { "0", "files", $this->featureContext->getDavPathVersion() - ) ); + $this->featureContext->setResponse($response); } /** @@ -258,19 +300,19 @@ class WebDavPropertiesContext implements Context { /** * @param string $user user id who sets the property * @param string $propertyName name of property in Clark notation - * @param string $namespace namespace in the form of "x1='http://whatever.org/ns'" * @param string $path path on which to set properties to * @param string $propertyValue property value + * @param string|null $namespace namespace in the form of "x1='http://whatever.org/ns'" * * @return ResponseInterface * @throws Exception */ - public function setPropertyWithNamespaceOfResource( + public function setResourceProperty( string $user, string $propertyName, - string $namespace, string $path, - string $propertyValue + string $propertyValue, + string $namespace = null, ):ResponseInterface { $user = $this->featureContext->getActualUsername($user); return WebDavHelper::proppatch( @@ -287,7 +329,33 @@ class WebDavPropertiesContext implements Context { } /** - * @When /^user "([^"]*)" sets property "([^"]*)" with namespace "([^"]*)" of (?:file|folder|entry) "([^"]*)" to "([^"]*)" using the WebDAV API$/ + * @Given /^user "([^"]*)" sets property "([^"]*)" of (?:file|folder|entry) "([^"]*)" to "([^"]*)"$/ + * + * @param string $user user id who sets the property + * @param string $propertyName name of property in Clark notation + * @param string $path path on which to set properties to + * @param string $propertyValue property value + * + * @return void + * @throws Exception + */ + public function userSetsPropertyOfEntryTo( + string $user, + string $propertyName, + string $path, + string $propertyValue + ):void { + $response = $this->setResourceProperty( + $user, + $propertyName, + $path, + $propertyValue + ); + $this->featureContext->setResponse($response); + } + + /** + * @When /^user "([^"]*)" sets property "([^"]*)" with namespace "([^"]*)" of (?:file|folder|entry) "([^"]*)" to "([^"]*)" using the WebDAV API$/ * * @param string $user user id who sets the property * @param string $propertyName name of property in Clark notation @@ -305,14 +373,40 @@ class WebDavPropertiesContext implements Context { string $path, string $propertyValue ):void { - $response = $this->setPropertyWithNamespaceOfResource( + $response = $this->setResourceProperty( + $user, + $propertyName, + $path, + $propertyValue, + $namespace + ); + $this->featureContext->setResponse($response); + } + + /** + * @Given /^user "([^"]*)" has set property "([^"]*)" of (?:file|folder|entry) "([^"]*)" to "([^"]*)"$/ + * + * @param string $user user id who sets the property + * @param string $propertyName name of property in Clark notation + * @param string $path path on which to set properties to + * @param string $propertyValue property value + * + * @return void + * @throws Exception + */ + public function userHasSetPropertyOfEntryTo( + string $user, + string $propertyName, + string $path, + string $propertyValue + ):void { + $response = $this->setResourceProperty( $user, $propertyName, - $namespace, $path, $propertyValue ); - $this->featureContext->setResponse($response); + $this->featureContext->theHTTPStatusCodeShouldBe(207, "", $response); } /** @@ -334,46 +428,33 @@ class WebDavPropertiesContext implements Context { string $path, string $propertyValue ):void { - $response = $this->setPropertyWithNamespaceOfResource( + $response = $this->setResourceProperty( $user, $propertyName, - $namespace, $path, - $propertyValue + $propertyValue, + $namespace ); $this->featureContext->theHTTPStatusCodeShouldBe(207, "", $response); } /** - * @Then /^the response should contain a custom "([^"]*)" property with namespace "([^"]*)" and value "([^"]*)"$/ + * @Then /^the response should contain a custom "([^"]*)" property with value "(([^"\\]|\\.)*)"$/ * * @param string $propertyName - * @param string $namespaceString * @param string $propertyValue * * @return void * @throws Exception */ - public function theResponseShouldContainACustomPropertyWithValue( - string $propertyName, - string $namespaceString, - string $propertyValue - ):void { + public function theResponseShouldContainCustomPropertyWithValue(string $propertyName, string $propertyValue): void { + $propertyValue = \str_replace('\"', '"', $propertyValue); $responseXmlObject = $this->featureContext->getResponseXml( $this->featureContext->getResponse(), __METHOD__ ); - //calculate the namespace prefix and namespace - $matches = []; - \preg_match("/^(.*)='(.*)'$/", $namespaceString, $matches); - $nameSpace = $matches[2]; - $nameSpacePrefix = $matches[1]; - $responseXmlObject->registerXPathNamespace( - $nameSpacePrefix, - $nameSpace - ); $xmlPart = $responseXmlObject->xpath( - "//d:prop/" . "$nameSpacePrefix:$propertyName" + "//d:prop/" . "$propertyName" ); Assert::assertArrayHasKey( 0, @@ -389,7 +470,7 @@ class WebDavPropertiesContext implements Context { } /** - * @Then /^the response should contain a custom "([^"]*)" property with namespace "([^"]*)" and complex value "(([^"\\]|\\.)*)"$/ + * @Then /^the response should contain a custom "([^"]*)" property with namespace "([^"]*)" and value "([^"]*)"$/ * * @param string $propertyName * @param string $namespaceString @@ -398,7 +479,7 @@ class WebDavPropertiesContext implements Context { * @return void * @throws Exception */ - public function theResponseShouldContainACustomPropertyWithComplexValue( + public function theResponseShouldContainACustomPropertyWithNamespaceAndValue( string $propertyName, string $namespaceString, string $propertyValue @@ -409,17 +490,13 @@ class WebDavPropertiesContext implements Context { $this->featureContext->getResponse(), __METHOD__ ); - //calculate the namespace prefix and namespace - $matches = []; - \preg_match("/^(.*)='(.*)'$/", $namespaceString, $matches); - $nameSpace = $matches[2]; - $nameSpacePrefix = $matches[1]; + $ns = $this->parseNamespace($namespaceString); $responseXmlObject->registerXPathNamespace( - $nameSpacePrefix, - $nameSpace + $ns->prefix, + $ns->namespace ); $xmlPart = $responseXmlObject->xpath( - "//d:prop/" . "$nameSpacePrefix:$propertyName" . "/*" + "//d:prop/$propertyName" ); Assert::assertArrayHasKey( 0, @@ -428,9 +505,9 @@ class WebDavPropertiesContext implements Context { ); Assert::assertEquals( $propertyValue, - $xmlPart[0]->asXML(), + $xmlPart[0]->__toString(), "\"$propertyName\" has a value \"" . - $xmlPart[0]->asXML() . "\" but \"$propertyValue\" expected" + $xmlPart[0]->__toString() . "\" but \"$propertyValue\" expected" ); } @@ -457,6 +534,38 @@ class WebDavPropertiesContext implements Context { ); } + /** + * @Then the xml response should contain a property :key + * + * @param string $key + * + * @return void + * @throws Exception + */ + public function theResponseShouldContainProperty(string $key): void { + $this->checkResponseContainsProperty( + $this->featureContext->getResponse(), + $key + ); + } + + /** + * @Then the xml response should contain a property :key with namespace :namespace + * + * @param string $key + * @param string $namespace + * + * @return void + * @throws Exception + */ + public function theResponseShouldContainPropertyWithNamespace(string $key, string $namespace): void { + $this->checkResponseContainsProperty( + $this->featureContext->getResponse(), + $key, + $namespace + ); + } + /** * @Then the single response should contain a property :key with value :value * @@ -525,6 +634,40 @@ class WebDavPropertiesContext implements Context { ); } + /** + * @param ResponseInterface $response + * @param string $key + * @param string|null $namespaceString + * + * @return SimpleXMLElement + * @throws Exception + */ + public function checkResponseContainsProperty(ResponseInterface $response, string $key, string $namespaceString = null): SimpleXMLElement { + $xmlPart = $this->featureContext->getResponseXml($response); + + $nsPrefix = ""; + if ($namespaceString !== null) { + $ns = $this->parseNamespace($namespaceString); + $xmlPart->registerXPathNamespace( + $ns->prefix, + $ns->namespace + ); + $nsPrefix = $ns->prefix . ":"; + } + + $match = $xmlPart->xpath("//d:prop/$key"); + + Assert::assertTrue( + isset($match[0]), + "Cannot find property \"$key\"" + ); + Assert::assertEquals( + $nsPrefix.$match[0]->getName(), + $key + ); + return $match[0]; + } + /** * @param ResponseInterface $response * @param string $key @@ -542,15 +685,8 @@ class WebDavPropertiesContext implements Context { string $altExpectedValue, ?string $user = null ):void { - $xmlPart = $this->featureContext->getResponseXml($response); - $xmlPart = $xmlPart->xpath( - "//d:prop/$key" - ); - Assert::assertTrue( - isset($xmlPart[0]), - "Cannot find property \"$key\"" - ); - $value = $xmlPart[0]->__toString(); + $xmlPart = $this->checkResponseContainsProperty($response, $key); + $value = $xmlPart->__toString(); $expectedValue = $this->featureContext->substituteInLineCodes( $expectedValue, $user diff --git a/tests/acceptance/features/coreApiTrashbin/trashbinSharingToShares.feature b/tests/acceptance/features/coreApiTrashbin/trashbinSharingToShares.feature index 45598c596a..916752959b 100644 --- a/tests/acceptance/features/coreApiTrashbin/trashbinSharingToShares.feature +++ b/tests/acceptance/features/coreApiTrashbin/trashbinSharingToShares.feature @@ -30,7 +30,7 @@ Feature: using trashbin together with sharing | new | | spaces | - @issue-7555 + @issue-1224 @issue-7555 Scenario Outline: deleting a file in a received folder moves it to trashbin of both users Given using DAV path And user "Brian" has been created with default attributes and without skeleton files @@ -53,7 +53,7 @@ Feature: using trashbin together with sharing | new | | spaces | - + @issue-1124 Scenario Outline: sharee deleting a file in a group-shared folder moves it to the trashbin of sharee and sharer only Given using DAV path And user "Brian" has been created with default attributes and without skeleton files @@ -109,7 +109,7 @@ Feature: using trashbin together with sharing | new | | spaces | - + @issue-1124 Scenario Outline: sharee deleting a folder in a group-shared folder moves it to the trashbin of sharee and sharer only Given using DAV path And user "Brian" has been created with default attributes and without skeleton files @@ -128,11 +128,11 @@ Feature: using trashbin together with sharing | permissionsRole | Editor | And user "Brian" has a share "shared" synced And user "Carol" has a share "shared" synced - When user "Brian" deletes file "/Shares/shared/sub/shared_file.txt" using the WebDAV API + When user "Brian" deletes folder "/Shares/shared/sub" using the WebDAV API Then the HTTP status code should be "204" And as "Brian" the file with original path "/Shares/shared/sub/shared_file.txt" should exist in the trashbin And as "Alice" the file with original path "/shared/sub/shared_file.txt" should exist in the trashbin - And as "Carol" the file with original path "/Shares/sub/shared/shared_file.txt" should not exist in the trashbin + And as "Carol" the file with original path "/Shares/shared/sub/shared_file.txt" should not exist in the trashbin Examples: | dav-path-version | | new | @@ -157,7 +157,7 @@ Feature: using trashbin together with sharing | permissionsRole | Editor | And user "Brian" has a share "shared" synced And user "Carol" has a share "shared" synced - When user "Alice" deletes file "/shared/sub/shared_file.txt" using the WebDAV API + When user "Alice" deletes folder "/shared/sub" using the WebDAV API Then the HTTP status code should be "204" And as "Alice" the file with original path "/shared/sub/shared_file.txt" should exist in the trashbin And as "Brian" the file with original path "/Shares/shared/sub/shared_file.txt" should not exist in the trashbin @@ -167,7 +167,7 @@ Feature: using trashbin together with sharing | new | | spaces | - @issue-7555 + @issue-1124 @issue-7555 Scenario Outline: deleting a file in a received folder when restored it comes back to the original path Given using DAV path And user "Brian" has been created with default attributes and without skeleton files diff --git a/tests/acceptance/features/coreApiWebdavProperties/copyFile.feature b/tests/acceptance/features/coreApiWebdavProperties/copyFile.feature index 7d3c6ab61a..e4b6010ebc 100644 --- a/tests/acceptance/features/coreApiWebdavProperties/copyFile.feature +++ b/tests/acceptance/features/coreApiWebdavProperties/copyFile.feature @@ -214,7 +214,7 @@ Feature: copy file | new | | spaces | - @issue-1239 @skipOnReva + @issue-1239 @issue-3874 @skipOnReva Scenario Outline: copy a file over the top of an existing folder received as a user share Given using DAV path And user "Brian" has been created with default attributes and without skeleton files @@ -238,7 +238,30 @@ Feature: copy file | old | | new | - @issue-1239 @skipOnReva + @skipOnReva + Scenario Outline: copy a file over the top of an existing file received as a share + Given using DAV path + And user "Alice" has uploaded file with content "file to copy" to "copy.txt" + And user "Brian" has been created with default attributes and without skeleton files + And user "Brian" has uploaded file with content "file to share" to "lorem.txt" + And user "Brian" has sent the following resource share invitation: + | resource | lorem.txt | + | space | Personal | + | sharee | Alice | + | shareType | user | + | permissionsRole | File Editor | + And user "Alice" has a share "lorem.txt" synced + When user "Alice" copies file "copy.txt" to "Shares/lorem.txt" using the WebDAV API + Then the HTTP status code should be "204" + And the content of file "Shares/lorem.txt" for user "Alice" should be "file to copy" + And the content of file "lorem.txt" for user "Brian" should be "file to copy" + And as "Brian" file "lorem.txt" should exist + Examples: + | dav-path-version | + | old | + | new | + + @issue-1239 @issue-6999 @skipOnReva Scenario Outline: copy a folder over the top of an existing file received as a user share Given using DAV path And user "Brian" has been created with default attributes and without skeleton files @@ -261,6 +284,30 @@ Feature: copy file | old | | new | + @issue-6999 @skipOnReva + Scenario Outline: copy a folder over the top of an existing folder received as a share + Given using DAV path + And user "Brian" has been created with default attributes and without skeleton files + And user "Brian" has created folder "BRIAN-Folder" + And user "Brian" has created folder "BRIAN-Folder/brian-folder" + And user "Brian" has sent the following resource share invitation: + | resource | BRIAN-Folder | + | space | Personal | + | sharee | Alice | + | shareType | user | + | permissionsRole | Editor | + And user "Alice" has a share "BRIAN-Folder" synced + And user "Alice" has created folder "FOLDER/alice-folder" + When user "Alice" copies folder "FOLDER" to "Shares/BRIAN-Folder" using the WebDAV API + Then the HTTP status code should be "204" + And as "Alice" folder "FOLDER/alice-folder" should exist + And as "Alice" folder "Shares/BRIAN-Folder/alice-folder" should exist + And as "Alice" folder "Shares/BRIAN-Folder/brian-folder" should not exist + Examples: + | dav-path-version | + | old | + | new | + @issue-1239 @skipOnReva Scenario Outline: copy a folder into another folder at different level which is received as a user share Given using DAV path diff --git a/tests/acceptance/features/coreApiWebdavProperties/setFileProperties.feature b/tests/acceptance/features/coreApiWebdavProperties/setFileProperties.feature index 358aacaa53..d395a43345 100644 --- a/tests/acceptance/features/coreApiWebdavProperties/setFileProperties.feature +++ b/tests/acceptance/features/coreApiWebdavProperties/setFileProperties.feature @@ -10,10 +10,13 @@ Feature: set file properties @smokeTest @issue-1263 Scenario Outline: setting custom DAV property and reading it Given using DAV path - And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/testcustomprop.txt" - And user "Alice" has set property "very-custom-prop" with namespace "x1='http://whatever.org/ns'" of file "/testcustomprop.txt" to "veryCustomPropValue" - When user "Alice" gets a custom property "very-custom-prop" with namespace "x1='http://whatever.org/ns'" of file "/testcustomprop.txt" - Then the response should contain a custom "very-custom-prop" property with namespace "x1='http://whatever.org/ns'" and value "veryCustomPropValue" + And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "testcustomprop.txt" + When user "Alice" sets property "very-custom-prop" of file "testcustomprop.txt" to "veryCustomPropValue" + Then the HTTP status code should be "207" + And the xml response should contain a property "very-custom-prop" + When user "Alice" gets a custom property "very-custom-prop" of file "testcustomprop.txt" + Then the HTTP status code should be "207" + And the response should contain a custom "very-custom-prop" property with value "veryCustomPropValue" Examples: | dav-path-version | | old | @@ -24,9 +27,12 @@ Feature: set file properties Scenario Outline: setting custom complex DAV property and reading it Given using DAV path And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/testcustomprop.txt" - And user "Alice" has set property "very-custom-prop" with namespace "x1='http://whatever.org/ns'" of file "/testcustomprop.txt" to "" - When user "Alice" gets a custom property "very-custom-prop" with namespace "x1='http://whatever.org/ns'" of file "/testcustomprop.txt" - Then the response should contain a custom "very-custom-prop" property with namespace "x1='http://whatever.org/ns'" and complex value "" + When user "Alice" sets property "very-custom-prop" of file "testcustomprop.txt" to "" + Then the HTTP status code should be "207" + And the xml response should contain a property "very-custom-prop" + When user "Alice" gets a custom property "very-custom-prop" of file "testcustomprop.txt" + Then the HTTP status code should be "207" + And the response should contain a custom "very-custom-prop" property with value "" Examples: | dav-path-version | | old | @@ -37,10 +43,10 @@ Feature: set file properties Scenario Outline: setting custom DAV property and reading it after the file is renamed Given using DAV path And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/testcustompropwithmove.txt" - And user "Alice" has set property "very-custom-prop" with namespace "x1='http://whatever.org/ns'" of file "/testcustompropwithmove.txt" to "valueForMovetest" + And user "Alice" has set property "very-custom-prop" of file "testcustompropwithmove.txt" to "valueForMovetest" And user "Alice" has moved file "/testcustompropwithmove.txt" to "/catchmeifyoucan.txt" - When user "Alice" gets a custom property "very-custom-prop" with namespace "x1='http://whatever.org/ns'" of file "/catchmeifyoucan.txt" - Then the response should contain a custom "very-custom-prop" property with namespace "x1='http://whatever.org/ns'" and value "valueForMovetest" + When user "Alice" gets a custom property "very-custom-prop" of file "catchmeifyoucan.txt" + Then the response should contain a custom "very-custom-prop" property with value "valueForMovetest" Examples: | dav-path-version | | old | @@ -59,9 +65,12 @@ Feature: set file properties | shareType | user | | permissionsRole | File Editor | And user "Brian" has a share "testcustompropshared.txt" synced - And user "Alice" has set property "very-custom-prop" with namespace "x1='http://whatever.org/ns'" of file "/testcustompropshared.txt" to "valueForSharetest" - When user "Brian" gets a custom property "very-custom-prop" with namespace "x1='http://whatever.org/ns'" of file "/testcustompropshared.txt" - Then the response should contain a custom "very-custom-prop" property with namespace "x1='http://whatever.org/ns'" and value "valueForSharetest" + When user "Alice" sets property "very-custom-prop" of file "testcustompropshared.txt" to "valueForSharetest" + Then the HTTP status code should be "207" + And the xml response should contain a property "very-custom-prop" + When user "Brian" gets a custom property "very-custom-prop" of file "Shares/testcustompropshared.txt" + Then the HTTP status code should be "207" + And the response should contain a custom "very-custom-prop" property with value "valueForSharetest" Examples: | dav-path-version | | old | @@ -72,10 +81,13 @@ Feature: set file properties Scenario Outline: setting custom DAV property using one endpoint and reading it with other endpoint Given using DAV path And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/testnewold.txt" - And user "Alice" has set property "very-custom-prop" with namespace "x1='http://whatever.org/ns'" of file "/testnewold.txt" to "lucky" + When user "Alice" sets property "very-custom-prop" of file "testnewold.txt" to "lucky" + Then the HTTP status code should be "207" + And the xml response should contain a property "very-custom-prop" And using DAV path - When user "Alice" gets a custom property "very-custom-prop" with namespace "x1='http://whatever.org/ns'" of file "/testnewold.txt" - Then the response should contain a custom "very-custom-prop" property with namespace "x1='http://whatever.org/ns'" and value "lucky" + When user "Alice" gets a custom property "very-custom-prop" of file "testnewold.txt" + Then the HTTP status code should be "207" + And the response should contain a custom "very-custom-prop" property with value "lucky" Examples: | dav-path-version | dav-path-version-2 | | old | new | @@ -84,3 +96,27 @@ Feature: set file properties | spaces | old | | new | spaces | | old | spaces | + + @issue-2140 + Scenario Outline: setting custom DAV property with custom namespace and reading it + Given using DAV path + And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "testcustomprop.txt" + When user "Alice" sets property "very-custom-prop" with namespace "x1='http://whatever.org/ns'" of file "testcustomprop.txt" to "customPropValue" using the WebDAV API + Then the HTTP status code should be "207" + And the xml response should contain a property "x1:very-custom-prop" with namespace "x1='http://whatever.org/ns'" + And the content in the response should include the following content: + """ + + """ + When user "Alice" gets a custom property "x1:very-custom-prop" with namespace "x1='http://whatever.org/ns'" of file "testcustomprop.txt" + Then the HTTP status code should be "207" + And the response should contain a custom "x1:very-custom-prop" property with namespace "x1='http://whatever.org/ns'" and value "customPropValue" + And the content in the response should include the following content: + """ + customPropValue + """ + Examples: + | dav-path-version | + | old | + | new | + | spaces |