Skip to content

Commit

Permalink
point three
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 671c1b8 commit c0f0a9e
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 31 deletions.
69 changes: 51 additions & 18 deletions tests/acceptance/features/apiWebdavOperations/search.feature
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,9 @@ 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
@skipOnOcV10 @issues-4712
# after the issue is fixed, the above scenario should be run for oCIS as well
Scenario Outline: report extra properties in search entries for a file (oCIS bug demonstration)
Given using <dav_version> DAV path
When user "Alice" searches for "upload" using the WebDAV API requesting these properties:
| oc:fileid |
Expand All @@ -226,26 +227,26 @@ Feature: Search
| 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% |
| name | value |
| {http://owncloud.org/ns}fileid | \d* |
| {http://owncloud.org/ns}permissions | ^(RDNVW\|RMDNVW)$ |
| {DAV:}getlastmodified | ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$ |
| {DAV:}getetag | NULL |
| {DAV:}getcontenttype | text\/plain |
| {http://owncloud.org/ns}size | N/A |
| {http://owncloud.org/ns}owner-id | N/A |
| {http://owncloud.org/ns}owner-display-name | N/A |
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$ |
| dav_version |
| old |
| new |

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

| dav_version |
| spaces |

@skipOnOcis
Scenario Outline: report extra properties in search entries for a folder
Given using <dav_version> DAV path
When user "Alice" searches for "upload" using the WebDAV API requesting these properties:
Expand Down Expand Up @@ -277,6 +278,38 @@ Feature: Search
| dav_version |
| spaces |

@skipOnOcV10 @issues-4712
Scenario Outline: report extra properties in search entries for a folder
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 folder "/upload folder" in the search result of user "Alice" should contain these properties:
| name | value |
| {http://owncloud.org/ns}fileid | \d* |
| {http://owncloud.org/ns}permissions | ^(RDNVCK\|RMDNVCK)$ |
| {DAV:}getlastmodified | ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$ |
| {DAV:}getetag | NULL |
| {http://owncloud.org/ns}size | 0 |
| {http://owncloud.org/ns}owner-id | N/A |
| {http://owncloud.org/ns}owner-display-name | N/A |
Examples:
| dav_version |
| old |
| new |

@skipOnOcV10 @personalSpace
Examples:
| dav_version |
| spaces |


Scenario Outline: search for entry with emoji by pattern
Given using <dav_version> DAV path
Expand Down
25 changes: 12 additions & 13 deletions tests/acceptance/features/bootstrap/SearchContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,21 +135,12 @@ public function fileOrFolderInTheSearchResultShouldContainProperties(
);
foreach ($fileProperties as $fileProperty) {
if ($fileProperty['name'] === $property['name']) {
// 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'] . "/",
Expand All @@ -160,10 +151,18 @@ public function fileOrFolderInTheSearchResultShouldContainProperties(
break;
}
}
Assert::assertTrue(
$foundProperty,
"could not find property '" . $property['name'] . "'"
);
if ($property['value'] === 'N/A') {
// not available check
Assert::assertFalse(
$foundProperty,
"Expected property '$property[name]' to not be present"
);
} else {
Assert::assertTrue(
$foundProperty,
"could not find property '" . $property['name'] . "'"
);
}
}
}

Expand Down

0 comments on commit c0f0a9e

Please sign in to comment.