From 877b8e45e02961a1112c44f96ef9598e6b14b684 Mon Sep 17 00:00:00 2001 From: Viktor Scharf Date: Fri, 14 Feb 2025 10:45:27 +0100 Subject: [PATCH] squash two search.feature --- ...cted-failures-API-on-decomposed-storage.md | 26 --- ...failures-localAPI-on-decomposed-storage.md | 10 + .../features/apiSearch1/search.feature | 111 +++++++++ .../coreApiWebdavOperations/search.feature | 214 ------------------ 4 files changed, 121 insertions(+), 240 deletions(-) delete mode 100644 tests/acceptance/features/coreApiWebdavOperations/search.feature diff --git a/tests/acceptance/expected-failures-API-on-decomposed-storage.md b/tests/acceptance/expected-failures-API-on-decomposed-storage.md index 633d717ee6..dc2e5c45cb 100644 --- a/tests/acceptance/expected-failures-API-on-decomposed-storage.md +++ b/tests/acceptance/expected-failures-API-on-decomposed-storage.md @@ -63,15 +63,6 @@ _ocdav: api compatibility, return correct status code_ - [coreApiAuth/webDavLOCKAuth.feature:46](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiAuth/webDavLOCKAuth.feature#L46) - [coreApiAuth/webDavLOCKAuth.feature:58](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiAuth/webDavLOCKAuth.feature#L58) -#### [Missing properties in REPORT response](https://github.com/owncloud/ocis/issues/9780), [d:getetag property has empty value in REPORT response](https://github.com/opencloud-eu/opencloud/issues/9783) - -- [coreApiWebdavOperations/search.feature:180](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavOperations/search.feature#L180) -- [coreApiWebdavOperations/search.feature:181](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavOperations/search.feature#L181) -- [coreApiWebdavOperations/search.feature:182](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavOperations/search.feature#L182) -- [coreApiWebdavOperations/search.feature:208](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavOperations/search.feature#L208) -- [coreApiWebdavOperations/search.feature:209](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavOperations/search.feature#L209) -- [coreApiWebdavOperations/search.feature:210](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavOperations/search.feature#L210) - #### [Support for favorites](https://github.com/owncloud/ocis/issues/1228) - [coreApiFavorites/favorites.feature:101](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiFavorites/favorites.feature#L101) @@ -158,23 +149,6 @@ _ocdav: api compatibility, return correct status code_ - [coreApiWebdavProperties/copyFile.feature:1095](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavProperties/copyFile.feature#L1095) - [coreApiWebdavProperties/copyFile.feature:1096](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavProperties/copyFile.feature#L1096) -#### [same href in REPORT request for all dav-path-version](https://github.com/owncloud/ocis/issues/7060) - -- [coreApiWebdavOperations/search.feature:42](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavOperations/search.feature#L42) -- [coreApiWebdavOperations/search.feature:43](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavOperations/search.feature#L43) -- [coreApiWebdavOperations/search.feature:60](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavOperations/search.feature#L60) -- [coreApiWebdavOperations/search.feature:61](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavOperations/search.feature#L61) -- [coreApiWebdavOperations/search.feature:79](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavOperations/search.feature#L79) -- [coreApiWebdavOperations/search.feature:80](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavOperations/search.feature#L80) -- [coreApiWebdavOperations/search.feature:110](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavOperations/search.feature#L110) -- [coreApiWebdavOperations/search.feature:111](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavOperations/search.feature#L111) -- [coreApiWebdavOperations/search.feature:130](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavOperations/search.feature#L130) -- [coreApiWebdavOperations/search.feature:131](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavOperations/search.feature#L131) -- [coreApiWebdavOperations/search.feature:151](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavOperations/search.feature#L151) -- [coreApiWebdavOperations/search.feature:152](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavOperations/search.feature#L152) -- [coreApiWebdavOperations/search.feature:229](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavOperations/search.feature#L229) -- [coreApiWebdavOperations/search.feature:230](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiWebdavOperations/search.feature#L230) - #### [Trying to restore personal file to file of share received folder returns 403 but the share file is deleted (new dav path)](https://github.com/owncloud/ocis/issues/10356) - [coreApiTrashbin/trashbinSharingToShares.feature:277](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/coreApiTrashbin/trashbinSharingToShares.feature#L277) diff --git a/tests/acceptance/expected-failures-localAPI-on-decomposed-storage.md b/tests/acceptance/expected-failures-localAPI-on-decomposed-storage.md index 71326821ab..0919abd5b9 100644 --- a/tests/acceptance/expected-failures-localAPI-on-decomposed-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-decomposed-storage.md @@ -202,5 +202,15 @@ - [apiNotification/spaceNotification.feature:435](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiNotification/spaceNotification.feature#435) +#### [Missing properties in REPORT response](https://github.com/owncloud/ocis/issues/9780), [d:getetag property has empty value in REPORT response](https://github.com/owncloud/ocis/issues/9783) + +- [apiSearch1/search.feature:437](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L437) +- [apiSearch1/search.feature:438](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L438) +- [apiSearch1/search.feature:439](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L439) +- [apiSearch1/search.feature:465](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L465) +- [apiSearch1/search.feature:466](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L466) +- [apiSearch1/search.feature:467](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L467) + + 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. diff --git a/tests/acceptance/features/apiSearch1/search.feature b/tests/acceptance/features/apiSearch1/search.feature index c0229cac29..f37381a226 100644 --- a/tests/acceptance/features/apiSearch1/search.feature +++ b/tests/acceptance/features/apiSearch1/search.feature @@ -354,3 +354,114 @@ Feature: Search | old | | new | | spaces | + + @issue-10329 + Scenario Outline: search for files by extension + Given using DAV path + When user "Alice" searches for "*txt*" using the WebDAV API + Then the HTTP status code should be "207" + And the search result of user "Alice" should contain these entries: + | insideTheFolder.txt | + Examples: + | dav-path-version | + | old | + | new | + | spaces | + + + Scenario Outline: search with empty field + Given using DAV path + When user "Alice" searches for "" using the WebDAV API + Then the HTTP status code should be "400" + Examples: + | dav-path-version | + | old | + | new | + | spaces | + + @issue-10329 + Scenario Outline: limit returned search entries to only 1 entry + Given using DAV path + When user "Alice" searches for "*folder*" and limits the results to "1" items using the WebDAV API + Then the HTTP status code should be "207" + And the search result of user "Alice" should contain any "1" of these entries: + | insideTheFolder.txt | + | folderMain | + | SubFolder1 | + | subFOLDER2 | + Examples: + | dav-path-version | + | old | + | new | + | spaces | + + @issue-10329 + Scenario Outline: search for entry with emoji by pattern + Given using DAV path + And user "Alice" has uploaded file with content "hello world" to "upload😀 😁.txt" + When user "Alice" searches for '"*😀 😁*"' using the WebDAV API + Then the HTTP status code should be "207" + And the search result of user "Alice" should contain these entries: + | upload😀 😁.txt | + Examples: + | dav-path-version | + | old | + | new | + | spaces | + + @issue-4712 @issue-9780 @issue-9781 @issue-9783 @issue-10329 + Scenario Outline: report extra properties in search entries for a file + Given using DAV path + When user "Alice" searches for "*insideTheFo*" using the WebDAV API requesting these properties: + | oc:fileid | + | oc:permissions | + | d:getlastmodified | + | d:getetag | + | d:getcontenttype | + | oc:size | + | oc:owner-id | + | oc:owner-display-name | + Then the HTTP status code should be "207" + And file "insideTheFolder.txt" in the search result of user "Alice" should contain these properties: + | name | value | + | oc:fileid | \d* | + | oc:permissions | ^(RDNVW\|RMDNVW)$ | + | d:getlastmodified | ^[MTWFS][uedhfriatno]{2},\s(\d){2}\s[JFMAJSOND][anebrpyulgctov]{2}\s\d{4}\s\d{2}:\d{2}:\d{2} GMT$ | + | d:getetag | ^\"[a-f0-9:\.]{1,32}\"$ | + | d:getcontenttype | text\/plain | + | oc:size | 15 | + | oc:owner-id | %username% | + | oc:owner-display-name | %displayname% | + Examples: + | dav-path-version | + | old | + | new | + | spaces | + + @issue-4712 @issue-9780 @issue-9781 @issue-9783 @issue-10329 + Scenario Outline: report extra properties in search entries for a folder + Given using DAV path + When user "Alice" searches for "*folderMain*" using the WebDAV API requesting these properties: + | oc:fileid | + | oc:permissions | + | d:getlastmodified | + | d:getetag | + | d:getcontenttype | + | oc:size | + | oc:owner-id | + | oc:owner-display-name | + Then the HTTP status code should be "207" + And folder "folderMain" in the search result of user "Alice" should contain these properties: + | name | value | + | oc:fileid | \d* | + | oc:permissions | ^(RDNVCK\|RMDNVCK)$ | + | d:getlastmodified | ^[MTWFS][uedhfriatno]{2},\s(\d){2}\s[JFMAJSOND][anebrpyulgctov]{2}\s\d{4}\s\d{2}:\d{2}:\d{2} GMT$ | + | d:getetag | ^\"[a-f0-9:\.]{1,32}\"$ | + | oc:size | 0 | + | oc:owner-id | %username% | + | oc:owner-display-name | %displayname% | + Examples: + | dav-path-version | + | old | + | new | + | spaces | diff --git a/tests/acceptance/features/coreApiWebdavOperations/search.feature b/tests/acceptance/features/coreApiWebdavOperations/search.feature deleted file mode 100644 index d71f325ea6..0000000000 --- a/tests/acceptance/features/coreApiWebdavOperations/search.feature +++ /dev/null @@ -1,214 +0,0 @@ -@issue-1330 -Feature: Search - As a user - I would like to be able to search for files - So that I can find needed files quickly - - Background: - Given user "Alice" has been created with default attributes - And user "Alice" has created folder "/just-a-folder" - And user "Alice" has created folder "/फनी näme" - And user "Alice" has created folder "/upload folder" - And user "Alice" has created folder "/upload😀 😁" - And user "Alice" has uploaded file with content "does-not-matter" to "/upload.txt" - And user "Alice" has uploaded file with content "does-not-matter" to "/a-image.png" - And user "Alice" has uploaded file with content "does-not-matter" to "/just-a-folder/upload.txt" - And user "Alice" has uploaded file with content "does-not-matter" to "/just-a-folder/lolol.txt" - And user "Alice" has uploaded file with content "does-not-matter" to "/just-a-folder/a-image.png" - And user "Alice" has uploaded file with content "does-not-matter" to "/just-a-folder/uploadÜठिF.txt" - And user "Alice" has uploaded file with content "does-not-matter" to "/फनी näme/upload.txt" - And user "Alice" has uploaded file with content "does-not-matter" to "/फनी näme/a-image.png" - And user "Alice" has uploaded file with content "does-not-matter" to "/upload😀 😁/upload😀 😁.txt" - And user "Alice" has uploaded file with content "file with comma in filename" to "/upload😀 😁/upload,1.txt" - - @smokeTest @issue-10329 - # Scenario Outline: search for entry by pattern - # Given using DAV path - # When user "Alice" searches for "*upload*" using the WebDAV API - # Then the HTTP status code should be "207" - # And the search result of user "Alice" should contain these entries: - # | /upload.txt | - # | /just-a-folder/upload.txt | - # | /upload folder | - # | /just-a-folder/uploadÜठिF.txt | - # | /फनी näme/upload.txt | - # | /upload😀 😁 | - # | /upload😀 😁/upload😀 😁.txt | - # | /upload😀 😁/upload,1.txt | - # But the search result of user "Alice" should not contain these entries: - # | /a-image.png | - # Examples: - # | dav-path-version | - # | old | - # | new | - # | spaces | - - - @issue-10329 - Scenario Outline: search for files by extension - Given using DAV path - When user "Alice" searches for "*png*" using the WebDAV API - Then the HTTP status code should be "207" - And the search result of user "Alice" should contain these entries: - | /a-image.png | - | /just-a-folder/a-image.png | - | /फनी näme/a-image.png | - But the search result of user "Alice" should not contain these entries: - | /upload.txt | - | /just-a-folder/upload.txt | - | /just-a-folder/uploadÜठिF.txt | - Examples: - | dav-path-version | - | old | - | new | - | spaces | - - - Scenario Outline: search with empty field - Given using DAV path - When user "Alice" searches for "" using the WebDAV API - Then the HTTP status code should be "400" - Examples: - | dav-path-version | - | old | - | new | - | spaces | - - @issue-10329 - Scenario Outline: limit returned search entries - Given using DAV path - When user "Alice" searches for "*upload*" and limits the results to "3" items using the WebDAV API - Then the HTTP status code should be "207" - And the search result of user "Alice" should contain any "3" of these entries: - | /just-a-folder/upload.txt | - | /just-a-folder/uploadÜठिF.txt | - | /upload folder | - | /upload.txt | - | /फनी näme/upload.txt | - | /upload😀 😁 | - | /upload😀 😁/upload😀 😁.txt | - | /upload😀 😁/upload,1.txt | - Examples: - | dav-path-version | - | old | - | new | - | spaces | - - @issue-10329 - Scenario Outline: limit returned search entries to only 1 entry - Given using DAV path - When user "Alice" searches for "*upload*" and limits the results to "1" items using the WebDAV API - Then the HTTP status code should be "207" - And the search result of user "Alice" should contain any "1" of these entries: - | /just-a-folder/upload.txt | - | /just-a-folder/uploadÜठिF.txt | - | /upload folder | - | /upload.txt | - | /फनी näme/upload.txt | - | /upload😀 😁 | - | /upload😀 😁/upload😀 😁.txt | - | /upload😀 😁/upload,1.txt | - Examples: - | dav-path-version | - | old | - | new | - | spaces | - - @issue-10329 - Scenario Outline: limit returned search entries to more entries than there are - Given using DAV path - When user "Alice" searches for "*upload*" and limits the results to "100" items using the WebDAV API - Then the HTTP status code should be "207" - And the search result should contain "8" entries - And the search result of user "Alice" should contain these entries: - | /upload.txt | - | /just-a-folder/upload.txt | - | /upload folder | - | /just-a-folder/uploadÜठिF.txt | - | /फनी näme/upload.txt | - | /upload😀 😁 | - | /upload😀 😁/upload😀 😁.txt | - | /upload😀 😁/upload,1.txt | - Examples: - | dav-path-version | - | old | - | new | - | spaces | - - @issue-4712 @issue-9780 @issue-9781 @issue-9783 @issue-10329 - Scenario Outline: report extra properties in search entries for a file - Given using DAV path - When user "Alice" searches for "*upload*" using the WebDAV API requesting these properties: - | oc:fileid | - | oc:permissions | - | d:getlastmodified | - | d:getetag | - | d: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 | - | oc:fileid | \d* | - | oc:permissions | ^(RDNVW\|RMDNVW)$ | - | d:getlastmodified | ^[MTWFS][uedhfriatno]{2},\s(\d){2}\s[JFMAJSOND][anebrpyulgctov]{2}\s\d{4}\s\d{2}:\d{2}:\d{2} GMT$ | - | d:getetag | ^\"[a-f0-9:\.]{1,32}\"$ | - | d:getcontenttype | text\/plain | - | oc:size | 15 | - | oc:owner-id | %username% | - | oc:owner-display-name | %displayname% | - Examples: - | dav-path-version | - | old | - | new | - | spaces | - - @issue-4712 @issue-9780 @issue-9781 @issue-9783 @issue-10329 - Scenario Outline: report extra properties in search entries for a folder - Given using DAV path - When user "Alice" searches for "*upload*" using the WebDAV API requesting these properties: - | oc:fileid | - | oc:permissions | - | d:getlastmodified | - | d:getetag | - | d: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 | - | oc:fileid | \d* | - | oc:permissions | ^(RDNVCK\|RMDNVCK)$ | - | d:getlastmodified | ^[MTWFS][uedhfriatno]{2},\s(\d){2}\s[JFMAJSOND][anebrpyulgctov]{2}\s\d{4}\s\d{2}:\d{2}:\d{2} GMT$ | - | d:getetag | ^\"[a-f0-9:\.]{1,32}\"$ | - | oc:size | 0 | - | oc:owner-id | %username% | - | oc:owner-display-name | %displayname% | - Examples: - | dav-path-version | - | old | - | new | - | spaces | - - @issue-10329 - Scenario Outline: search for entry with emoji by pattern - Given using DAV path - When user "Alice" searches for '"*😀 😁*"' using the WebDAV API - Then the HTTP status code should be "207" - And the search result of user "Alice" should contain these entries: - | /upload😀 😁 | - | /upload😀 😁/upload😀 😁.txt | - But the search result of user "Alice" should not contain these entries: - | /a-image.png | - | /upload.txt | - | /just-a-folder/upload.txt | - | /upload folder | - | /just-a-folder/uploadÜठिF.txt | - | /फनी näme/upload.txt | - Examples: - | dav-path-version | - | old | - | new | - | spaces |