Skip to content

Commit

Permalink
Point two
Browse files Browse the repository at this point in the history
Signed-off-by: Kiran Parajuli <[email protected]>
  • Loading branch information
kiranparajuli589 committed Oct 12, 2022
1 parent bebddd0 commit 671c1b8
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 5 deletions.
35 changes: 34 additions & 1 deletion tests/acceptance/features/apiWebdavOperations/search.feature
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ Feature: Search
| dav_version |
| spaces |


@skipOnOcis
Scenario Outline: report extra properties in search entries for a file
Given using <dav_version> DAV path
When user "Alice" searches for "upload" using the WebDAV API requesting these properties:
Expand Down Expand Up @@ -212,6 +212,39 @@ Feature: Search
| dav_version | last_modified_regex |
| spaces | ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$ |

@skipOnOcV10
Scenario Outline: report extra properties in search entries for a file
Given using <dav_version> DAV path
When user "Alice" searches for "upload" using the WebDAV API requesting these properties:
| oc:fileid |
| oc:permissions |
| a:getlastmodified |
| a:getetag |
| a:getcontenttype |
| oc:size |
| oc:owner-id |
| oc:owner-display-name |
Then the HTTP status code should be "207"
And file "/upload.txt" in the search result of user "Alice" should contain these properties:
| name | value |
| {http://owncloud.org/ns}fileid | \d* |
| {http://owncloud.org/ns}permissions | ^(RDNVW\|RMDNVW)$ |
| {DAV:}getlastmodified | <last_modified_regex> |
| {DAV:}getetag | NULL |
| {DAV:}getcontenttype | text\/plain |
| {http://owncloud.org/ns}size | NA |
| {http://owncloud.org/ns}owner-id | %username% |
| {http://owncloud.org/ns}owner-display-name | %displayname% |
Examples:
| dav_version | last_modified_regex |
| old | ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$ |
| new | ^[MTWFS][uedhfriatno]{2},\s(\d){2}\s[JFMAJSOND][anebrpyulgctov]{2}\s\d{4}\s\d{2}:\d{2}:\d{2} GMT$ |

@skipOnOcV10 @personalSpace
Examples:
| dav_version | last_modified_regex |
| spaces | ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$ |


Scenario Outline: report extra properties in search entries for a folder
Given using <dav_version> DAV path
Expand Down
25 changes: 21 additions & 4 deletions tests/acceptance/features/bootstrap/SearchContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,27 @@ public function fileOrFolderInTheSearchResultShouldContainProperties(
);
foreach ($fileProperties as $fileProperty) {
if ($fileProperty['name'] === $property['name']) {
Assert::assertMatchesRegularExpression(
"/" . $property['value'] . "/",
$fileProperty['value']
);
// var_dump($fileProperty['value']);
var_dump($property['name']);
var_dump($property['value']);
if ($property['value'] === 'NULL') {
Assert::assertNull(
$fileProperty['value'],
"Expected property '$property[name]' to be null"
. " but got '$fileProperty[value]'"
);
} else if ($property['value'] === "NA") {
Assert::assertArrayNotHasKey(
$property['name'],
$fileProperty,
"Expected property '$property[name]' to not exist"
);
} else {
Assert::assertMatchesRegularExpression(
"/" . $property['value'] . "/",
$fileProperty['value']
);
}
$foundProperty = true;
break;
}
Expand Down

0 comments on commit 671c1b8

Please sign in to comment.