From c49915066cae777fde473923f65b48668e7f6d06 Mon Sep 17 00:00:00 2001 From: Viktor Scharf Date: Fri, 14 Feb 2025 09:26:32 +0100 Subject: [PATCH] enable search tests --- tests/acceptance/bootstrap/SearchContext.php | 8 +- tests/acceptance/bootstrap/WebDav.php | 6 +- ...failures-localAPI-on-decomposed-storage.md | 63 +------------ .../features/apiContract/spacesReport.feature | 8 +- .../deprovisioningNotification.feature | 1 - .../features/apiSearch1/dateSearch.feature | 24 ++--- .../features/apiSearch1/search.feature | 80 ++++++++-------- .../apiSearch2/mediaTypeSearch.feature | 94 +++++++++---------- .../features/apiSearch2/tagSearch.feature | 71 ++++++-------- .../apiSearchContent/contentSearch.feature | 37 ++++---- .../cliCommands/searchReIndex.feature | 2 +- .../coreApiWebdavOperations/search.feature | 57 ++++------- 12 files changed, 177 insertions(+), 274 deletions(-) diff --git a/tests/acceptance/bootstrap/SearchContext.php b/tests/acceptance/bootstrap/SearchContext.php index fc66e0c4f..bb453595b 100644 --- a/tests/acceptance/bootstrap/SearchContext.php +++ b/tests/acceptance/bootstrap/SearchContext.php @@ -182,7 +182,11 @@ class SearchContext implements Context { $property['value'], $user ); - $fileResultProperty = $fileResult->xpath("d:propstat//" . $property['name']); + if (is_object($fileResult)) { + $fileResultProperty = $fileResult->xpath("d:propstat//" . $property['name']); + } else { + throw new Exception("Expected fileResult to be an object, but found " . gettype($fileResult)); + } if ($fileResultProperty) { Assert::assertMatchesRegularExpression( "/" . $property['value'] . "/", @@ -270,7 +274,7 @@ class SearchContext implements Context { ): void { // NOTE: since indexing of newly uploaded files or directories with OpenCloud is decoupled and occurs asynchronously, // a short wait is necessary before searching - sleep(5); + sleep(2); $response = $this-> searchFiles($user, $pattern, null, $scopeType, $scope, $spaceName); $this->featureContext->setResponse($response); } diff --git a/tests/acceptance/bootstrap/WebDav.php b/tests/acceptance/bootstrap/WebDav.php index c3a9f73d4..1b167642e 100644 --- a/tests/acceptance/bootstrap/WebDav.php +++ b/tests/acceptance/bootstrap/WebDav.php @@ -4594,11 +4594,7 @@ trait WebDav { // do not try to parse the resource path // if the item to search is space itself if (!GraphHelper::isSpaceId($entryNameToSearch ?? '')) { - $resourcePath = \substr($resourcePath, \strpos($resourcePath, '/') + 1); - } - if (\count($shareRootXml)) { - $shareroot = \trim((string)$shareRootXml[0], "/"); - $resourcePath = $shareroot . "/" . $resourcePath; + $resourcePath = basename($resourcePath); } $resourcePath = \rawurldecode($resourcePath); if ($entryNameToSearch === $resourcePath) { diff --git a/tests/acceptance/expected-failures-localAPI-on-decomposed-storage.md b/tests/acceptance/expected-failures-localAPI-on-decomposed-storage.md index 03a5821e8..71326821a 100644 --- a/tests/acceptance/expected-failures-localAPI-on-decomposed-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-decomposed-storage.md @@ -184,67 +184,6 @@ - [apiOcm/deleteFederatedConnections.feature:102](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiOcm/deleteFederatedConnections.feature#L102) -#### [same href in REPORT request for all dav-path-version](https://github.com/owncloud/ocis/issues/7060) - -- [apiSearch1/dateSearch.feature:17](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/dateSearch.feature#L17) -- [apiSearch1/dateSearch.feature:18](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/dateSearch.feature#L18) -- [apiSearch1/search.feature:41](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L41) -- [apiSearch1/search.feature:42](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L42) -- [apiSearch1/search.feature:69](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L69) -- [apiSearch1/search.feature:70](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L70) -- [apiSearch1/search.feature:111](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L111) -- [apiSearch1/search.feature:112](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L112) -- [apiSearch1/search.feature:197](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L197) -- [apiSearch1/search.feature:198](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L198) -- [apiSearch1/search.feature:221](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L221) -- [apiSearch1/search.feature:222](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L222) -- [apiSearch1/search.feature:242](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L242) -- [apiSearch1/search.feature:243](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L243) -- [apiSearch1/search.feature:260](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L260) -- [apiSearch1/search.feature:261](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L261) -- [apiSearch1/search.feature:278](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L278) -- [apiSearch1/search.feature:279](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L279) -- [apiSearch1/search.feature:302](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L302) -- [apiSearch1/search.feature:303](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L303) -- [apiSearch1/search.feature:354](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L354) -- [apiSearch1/search.feature:355](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L355) -- [apiSearch2/tagSearch.feature:34](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch2/tagSearch.feature#L34) -- [apiSearch2/tagSearch.feature:35](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch2/tagSearch.feature#L35) -- [apiSearch2/tagSearch.feature:62](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch2/tagSearch.feature#L62) -- [apiSearch2/tagSearch.feature:63](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch2/tagSearch.feature#L63) -- [apiSearch2/tagSearch.feature:87](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch2/tagSearch.feature#L87) -- [apiSearch2/tagSearch.feature:88](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch2/tagSearch.feature#L88) -- [apiSearch2/tagSearch.feature:110](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch2/tagSearch.feature#L110) -- [apiSearch2/tagSearch.feature:111](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch2/tagSearch.feature#L111) -- [apiSearch2/tagSearch.feature:144](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch2/tagSearch.feature#L144) -- [apiSearch2/tagSearch.feature:145](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch2/tagSearch.feature#L145) -- [apiSearch2/tagSearch.feature:182](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch2/tagSearch.feature#L182) -- [apiSearch2/tagSearch.feature:183](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch2/tagSearch.feature#L183) -- [apiSearch2/tagSearch.feature:222](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch2/tagSearch.feature#L222) -- [apiSearch2/tagSearch.feature:223](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch2/tagSearch.feature#L223) -- [apiSearch2/tagSearch.feature:241](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch2/tagSearch.feature#L241) -- [apiSearch2/tagSearch.feature:242](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch2/tagSearch.feature#L242) -- [apiSearchContent/contentSearch.feature:25](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearchContent/contentSearch.feature#L25) -- [apiSearchContent/contentSearch.feature:26](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearchContent/contentSearch.feature#L26) -- [apiSearchContent/contentSearch.feature:49](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearchContent/contentSearch.feature#L49) -- [apiSearchContent/contentSearch.feature:50](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearchContent/contentSearch.feature#L50) -- [apiSearchContent/contentSearch.feature:82](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearchContent/contentSearch.feature#L82) -- [apiSearchContent/contentSearch.feature:83](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearchContent/contentSearch.feature#L83) -- [apiSearchContent/contentSearch.feature:110](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearchContent/contentSearch.feature#L110) -- [apiSearchContent/contentSearch.feature:111](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearchContent/contentSearch.feature#L111) -- [apiSearchContent/contentSearch.feature:129](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearchContent/contentSearch.feature#L129) -- [apiSearchContent/contentSearch.feature:130](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearchContent/contentSearch.feature#L130) -- [apiSearchContent/contentSearch.feature:146](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearchContent/contentSearch.feature#L146) -- [apiSearchContent/contentSearch.feature:147](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearchContent/contentSearch.feature#L147) -- [apiSearchContent/contentSearch.feature:162](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearchContent/contentSearch.feature#L162) -- [apiSearchContent/contentSearch.feature:163](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearchContent/contentSearch.feature#L163) -- [apiSearchContent/contentSearch.feature:185](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearchContent/contentSearch.feature#L185) -- [apiSearchContent/contentSearch.feature:186](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearchContent/contentSearch.feature#L186) -- [apiSearchContent/contentSearch.feature:214](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearchContent/contentSearch.feature#L214) -- [apiSearchContent/contentSearch.feature:215](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearchContent/contentSearch.feature#L215) -- [apiSearchContent/contentSearch.feature:266](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearchContent/contentSearch.feature#L266) -- [apiSearchContent/contentSearch.feature:267](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearchContent/contentSearch.feature#L267) - #### [Shares Jail PROPFIND returns different File IDs for the same item](https://github.com/owncloud/ocis/issues/9933) - [apiSharingNg1/propfindShares.feature:149](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSharingNg1/propfindShares.feature#L149) @@ -257,7 +196,7 @@ - [apiAntivirus/antivirus.feature:309](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L309) - [apiAntivirus/antivirus.feature:310](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L310) - [apiAntivirus/antivirus.feature:311](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L310) -- [apiNotification/deprovisioningNotification.feature:128](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiNotification/deprovisioningNotification.feature#L128) +- [apiNotification/deprovisioningNotification.feature:127](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiNotification/deprovisioningNotification.feature#L127) - [apiNotification/notification.feature:284](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiNotification/notification.feature#L284) - [apiNotification/notification.feature:285](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiNotification/notification.feature#L285) - [apiNotification/spaceNotification.feature:435](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiNotification/spaceNotification.feature#435) diff --git a/tests/acceptance/features/apiContract/spacesReport.feature b/tests/acceptance/features/apiContract/spacesReport.feature index 4ab6e5279..0688e2d9b 100644 --- a/tests/acceptance/features/apiContract/spacesReport.feature +++ b/tests/acceptance/features/apiContract/spacesReport.feature @@ -18,7 +18,7 @@ Feature: REPORT request to project space When user "Alice" searches for "testFile.txt" using the WebDAV API Then the HTTP status code should be "207" And the search result of user "Alice" should contain only these entries: - | /testFile.txt | + | testFile.txt | And the following headers should match these regular expressions | X-Request-Id | %request_id_pattern% | And as user "Alice" the REPORT response should contain a resource "testFile.txt" with these key and value pairs: @@ -37,7 +37,7 @@ Feature: REPORT request to project space When user "Alice" searches for "insideTheFolder.txt" using the WebDAV API Then the HTTP status code should be "207" And the search result of user "Alice" should contain only these entries: - | /folderMain/SubFolder1/subFOLDER2/insideTheFolder.txt | + | insideTheFolder.txt | And the following headers should match these regular expressions | X-Request-Id | %request_id_pattern% | And as user "Alice" the REPORT response should contain a resource "insideTheFolder.txt" with these key and value pairs: @@ -55,7 +55,7 @@ Feature: REPORT request to project space When user "Alice" searches for "folderMain" using the WebDAV API Then the HTTP status code should be "207" And the search result of user "Alice" should contain only these entries: - | /folderMain | + | folderMain | And the following headers should match these regular expressions | X-Request-Id | %request_id_pattern% | And as user "Alice" the REPORT response should contain a resource "folderMain" with these key and value pairs: @@ -73,7 +73,7 @@ Feature: REPORT request to project space When user "Alice" searches for "*sub*" using the WebDAV API Then the HTTP status code should be "207" And the search result of user "Alice" should contain only these entries: - | /folderMain/sub-folder | + | sub-folder | And the following headers should match these regular expressions | X-Request-Id | %request_id_pattern% | And the HTTP status code should be "207" diff --git a/tests/acceptance/features/apiNotification/deprovisioningNotification.feature b/tests/acceptance/features/apiNotification/deprovisioningNotification.feature index 5f1f2d615..3dca8b484 100644 --- a/tests/acceptance/features/apiNotification/deprovisioningNotification.feature +++ b/tests/acceptance/features/apiNotification/deprovisioningNotification.feature @@ -1,4 +1,3 @@ -@skipOnStable3.0 Feature: Deprovisioning notification As a user admin I want to inform users about shutting down and deprovisioning the instance diff --git a/tests/acceptance/features/apiSearch1/dateSearch.feature b/tests/acceptance/features/apiSearch1/dateSearch.feature index 2c3e31466..10213edc6 100644 --- a/tests/acceptance/features/apiSearch1/dateSearch.feature +++ b/tests/acceptance/features/apiSearch1/dateSearch.feature @@ -36,18 +36,18 @@ Feature: date search | | Examples: | pattern | search-result-1 | search-result-2 | search-result-3 | search-result-4 | - | Mtime:today | /today.txt | | /yesterday.txt | /lastWeek.txt | - | Mtime:yesterday | /yesterday.txt | | /today.txt | | - | Mtime:"this week" | /today.txt | | /lastWeek.txt | /lastMonth.txt | - | Mtime:"this month" | /today.txt | | /lastMonth.txt | | - | Mtime:"last month" | /lastMonth.txt | | /today.txt | | - | Mtime:"this year" | /today.txt | | /lastYear.txt | | - | Mtime:"last year" | /lastYear.txt | | /today.txt | | - | Mtime>=$today | /today.txt | | /yesterday.txt | | - | Mtime>$yesterday | /today.txt | | | | - | Mtime>=$yesterday | /today.txt | /yesterday.txt | | | + | Mtime:today | today.txt | | yesterday.txt | lastWeek.txt | + | Mtime:yesterday | yesterday.txt | | today.txt | | + | Mtime:"this week" | today.txt | | lastWeek.txt | lastMonth.txt | + | Mtime:"this month" | today.txt | | lastMonth.txt | | + | Mtime:"last month" | lastMonth.txt | | today.txt | | + | Mtime:"this year" | today.txt | | lastYear.txt | | + | Mtime:"last year" | lastYear.txt | | today.txt | | + | Mtime>=$today | today.txt | | yesterday.txt | | + | Mtime>$yesterday | today.txt | | | | + | Mtime>=$yesterday | today.txt | yesterday.txt | | | # Mtime<$today. "<" has to be escaped - | Mtime<$today | /yesterday.txt | /lastYear.txt | /today.txt | | + | Mtime<$today | yesterday.txt | lastYear.txt | today.txt | | @issue-10329 Scenario: search resources using different search patterns (KQL feature) in the shares folder @@ -65,6 +65,6 @@ Feature: date search When user "Brian" searches for "Mtime:yesterday" using the WebDAV API Then the HTTP status code should be "207" And the search result of user "Brian" should contain these entries: - | sharedFolder/yesterday.txt | + | yesterday.txt | But the search result of user "Alice" should not contain these entries: | sharedFolder | diff --git a/tests/acceptance/features/apiSearch1/search.feature b/tests/acceptance/features/apiSearch1/search.feature index 977269d2e..c0229cac2 100644 --- a/tests/acceptance/features/apiSearch1/search.feature +++ b/tests/acceptance/features/apiSearch1/search.feature @@ -32,10 +32,10 @@ Feature: Search Then the HTTP status code should be "207" And the search result should contain "1" entries And the search result of user "Alice" should contain these entries: - | folderMain/SubFolder1/subFOLDER2/insideTheFolder.txt | + | insideTheFolder.txt | But the search result of user "Alice" should not contain these entries: - | /AlicePersonal/insideAlicePersonal.txt | - | /BrianPersonal/insideBrianPersonal.txt | + | insideAlicePersonal.txt | + | insideBrianPersonal.txt | Examples: | dav-path-version | | old | @@ -60,10 +60,10 @@ Feature: Search Then the HTTP status code should be "207" And the search result should contain "1" entries And the search result of user "Alice" should contain only these entries: - | AlicePersonal/insideAlicePersonal.txt | + | insideAlicePersonal.txt | But the search result of user "Alice" should not contain these entries: - | BrianPersonal/insideBrianPersonal.txt | - | folderMain/SubFolder1/subFOLDER2/insideTheFolder.txt | + | insideBrianPersonal.txt | + | insideTheFolder.txt | Examples: | dav-path-version | | old | @@ -88,9 +88,9 @@ Feature: Search Then the HTTP status code should be "207" And the search result should contain "0" entries And the search result of user "Alice" should not contain these entries: - | BrianPersonal/insideBrianPersonal.txt | - | AlicePersonal/insideAlicePersonal.txt | - | folderMain/SubFolder1/subFOLDER2/insideTheFolder.txt | + | insideBrianPersonal.txt | + | insideAlicePersonal.txt | + | insideTheFolder.txt | Examples: | dav-path-version | | old | @@ -126,9 +126,9 @@ Feature: Search Then the HTTP status code should be "207" And the search result should contain "0" entries And the search result of user "Brian" should not contain these entries: - | /SubFolder1 | - | /SubFolder1/subFOLDER2 | - | /SubFolder1/subFOLDER2/insideTheFolder.txt | + | SubFolder1 | + | subFOLDER2 | + | insideTheFolder.txt | Examples: | dav-path-version | | old | @@ -150,9 +150,9 @@ Feature: Search Then the HTTP status code should be "207" And the search result should contain "0" entries And the search result of user "Brian" should not contain these entries: - | /SubFolder1 | - | /SubFolder1/subFOLDER2 | - | /SubFolder1/subFOLDER2/insideTheFolder.txt | + | SubFolder1 | + | subFOLDER2 | + | insideTheFolder.txt | Examples: | dav-path-version | | old | @@ -187,11 +187,11 @@ Feature: Search Then the HTTP status code should be "207" And the search result should contain "3" entries And the search result of user "Alice" should contain only these entries: - | folderMain/SubFolder1 | - | folderMain/SubFolder1/subFOLDER2 | - | folderMain/SubFolder1/subFOLDER2/insideTheFolder.txt | + | SubFolder1 | + | subFOLDER2 | + | insideTheFolder.txt | But the search result of user "Alice" should not contain these entries: - | /folderMain | + | folderMain | Examples: | dav-path-version | | old | @@ -211,9 +211,9 @@ Feature: Search When user "Brian" searches for "*folder*" inside folder "/folderMain" in space "Shares" using the WebDAV API Then the HTTP status code should be "207" And the search result of user "Brian" should contain only these entries: - | folderMain/SubFolder1 | - | folderMain/SubFolder1/subFOLDER2 | - | folderMain/SubFolder1/subFOLDER2/insideTheFolder.txt | + | SubFolder1 | + | subFOLDER2 | + | insideTheFolder.txt | But the search result of user "Brian" should not contain these entries: | /folderMain | Examples: @@ -233,8 +233,8 @@ Feature: Search When user "Alice" searches for "*file*" inside folder "/Folder" using the WebDAV API Then the HTTP status code should be "207" And the search result of user "Alice" should contain only these entries: - | /Folder/file2.txt | - | /Folder/SubFolder/file3.txt | + | file2.txt | + | file3.txt | But the search result of user "Alice" should not contain these entries: | file1.txt | Examples: @@ -253,8 +253,8 @@ Feature: Search When user "Alice" searches for "*file*" inside folder "/New Folder" using the WebDAV API Then the HTTP status code should be "207" And the search result of user "Alice" should contain only these entries: - | /New Folder/file.txt | - | /New Folder/Sub Folder/file1.txt | + | file.txt | + | file1.txt | Examples: | dav-path-version | | old | @@ -270,9 +270,9 @@ Feature: Search When user "Alice" searches for "*new*" using the WebDAV API Then the HTTP status code should be "207" And the search result of user "Alice" should contain only these entries: - | /New Folder | - | /New Folder/New Sub Folder | - | /new file.txt | + | New Folder | + | New Sub Folder | + | new file.txt | Examples: | dav-path-version | | old | @@ -294,9 +294,9 @@ Feature: Search When user "Brian" searches for "shared*" using the WebDAV API Then the HTTP status code should be "207" And the search result of user "Brian" should contain these entries: - | foo/sharedToBrian | + | sharedToBrian | But the search result of user "Brian" should not contain these entries: - | /sharedToCarol | + | sharedToCarol | Examples: | dav-path-version | | old | @@ -313,12 +313,12 @@ Feature: Search And the search result of user "Alice" should contain these entries: | | Examples: - | pattern | search-result | description | - | fold* | /folderMain | starts with | - | *der1 | /folderMain/SubFolder1 | ends with | - | subfolder | /subfolder | exact search | - | name:*der2 | /folderMain/SubFolder1/subFOLDER2 | patern 'name:'' | - | name:"*der2" | /folderMain/SubFolder1/subFOLDER2 | pattern 'name:""' (with quotes) | + | pattern | search-result | description | + | fold* | folderMain | starts with | + | *der1 | SubFolder1 | ends with | + | subfolder | subfolder | exact search | + | name:*der2 | subFOLDER2 | patern 'name:'' | + | name:"*der2" | subFOLDER2 | pattern 'name:""' (with quotes) | @issue-7812 @issue-8442 @issue-10329 Scenario: try to search with invalid patterns @@ -346,9 +346,9 @@ Feature: Search Then the HTTP status code should be "207" And the search result should contain "3" entries And the search result of user "Alice" should contain these entries: - | AlicePersonal/insideAlicePersonal.txt | - | folderMain/SubFolder1/subFOLDER2/insideTheFolder.txt | - | BrianPersonal/insideBrianPersonal.txt | + | insideAlicePersonal.txt | + | insideTheFolder.txt | + | insideBrianPersonal.txt | Examples: | dav-path-version | | old | diff --git a/tests/acceptance/features/apiSearch2/mediaTypeSearch.feature b/tests/acceptance/features/apiSearch2/mediaTypeSearch.feature index be9cdaff0..8be5bb964 100644 --- a/tests/acceptance/features/apiSearch2/mediaTypeSearch.feature +++ b/tests/acceptance/features/apiSearch2/mediaTypeSearch.feature @@ -28,15 +28,15 @@ Feature: media type search | | Examples: | pattern | search-result | - | *text* | /lorem.txt | - | *pdf* | /simple.pdf | - | *jpeg* | /testavatar.jpg | - | *png* | /testavatar.png | - | *gzip* | /data.tar.gz | - | *tar* | /data.tar | - | *7z* | /data.7z | - | *rar* | /data.rar | - | *bzip2* | /data.tar.bz2 | + | *text* | lorem.txt | + | *pdf* | simple.pdf | + | *jpeg* | testavatar.jpg | + | *png* | testavatar.png | + | *gzip* | data.tar.gz | + | *tar* | data.tar | + | *7z* | data.7z | + | *rar* | data.rar | + | *bzip2* | data.tar.bz2 | @issue-10329 Scenario Outline: search for files inside sub folders using media type @@ -56,16 +56,16 @@ Feature: media type search And the search result of user "Alice" should contain these entries: | | Examples: - | pattern | search-result | - | *text* | /uploadFolder/lorem.txt | - | *pdf* | /uploadFolder/simple.pdf | - | *jpeg* | /uploadFolder/testavatar.jpg | - | *png* | /uploadFolder/testavatar.png | - | *gzip* | /uploadFolder/data.tar.gz | - | *tar* | /uploadFolder/data.tar | - | *7z* | /uploadFolder/data.7z | - | *rar* | /uploadFolder/data.rar | - | *bzip2* | /uploadFolder/data.tar.bz2 | + | pattern | search-result | + | *text* | lorem.txt | + | *pdf* | simple.pdf | + | *jpeg* | testavatar.jpg | + | *png* | testavatar.png | + | *gzip* | data.tar.gz | + | *tar* | data.tar | + | *7z* | data.7z | + | *rar* | data.rar | + | *bzip2* | data.tar.bz2 | @issue-10329 Scenario Outline: search for file inside project space using media type @@ -87,15 +87,15 @@ Feature: media type search | | Examples: | pattern | search-result | - | *text* | /lorem.txt | - | *pdf* | /simple.pdf | - | *jpeg* | /testavatar.jpg | - | *png* | /testavatar.png | - | *gzip* | /data.tar.gz | - | *tar* | /data.tar | - | *7z* | /data.7z | - | *rar* | /data.rar | - | *bzip2* | /data.tar.bz2 | + | *text* | lorem.txt | + | *pdf* | simple.pdf | + | *jpeg* | testavatar.jpg | + | *png* | testavatar.png | + | *gzip* | data.tar.gz | + | *tar* | data.tar | + | *7z* | data.7z | + | *rar* | data.rar | + | *bzip2* | data.tar.bz2 | @issue-10329 Scenario Outline: sharee searches for shared files using media type @@ -122,16 +122,16 @@ Feature: media type search And the search result of user "Alice" should contain these entries: | | Examples: - | pattern | search-result | - | *text* | /uploadFolder/lorem.txt | - | *pdf* | /uploadFolder/simple.pdf | - | *jpeg* | /uploadFolder/testavatar.jpg | - | *png* | /uploadFolder/testavatar.png | - | *gzip* | /uploadFolder/data.tar.gz | - | *tar* | /uploadFolder/data.tar | - | *7z* | /uploadFolder/data.7z | - | *rar* | /uploadFolder/data.rar | - | *bzip2* | /uploadFolder/data.tar.bz2 | + | pattern | search-result | + | *text* | lorem.txt | + | *pdf* | simple.pdf | + | *jpeg* | testavatar.jpg | + | *png* | testavatar.png | + | *gzip* | data.tar.gz | + | *tar* | data.tar | + | *7z* | data.7z | + | *rar* | data.rar | + | *bzip2* | data.tar.bz2 | @issue-10329 Scenario Outline: space viewer searches for files using mediatype filter @@ -158,15 +158,15 @@ Feature: media type search | | Examples: | pattern | search-result | - | *text* | /lorem.txt | - | *pdf* | /simple.pdf | - | *jpeg* | /testavatar.jpg | - | *png* | /testavatar.png | - | *gzip* | /data.tar.gz | - | *tar* | /data.tar | - | *7z* | /data.7z | - | *rar* | /data.rar | - | *bzip2* | /data.tar.bz2 | + | *text* | lorem.txt | + | *pdf* | simple.pdf | + | *jpeg* | testavatar.jpg | + | *png* | testavatar.png | + | *gzip* | data.tar.gz | + | *tar* | data.tar | + | *7z* | data.7z | + | *rar* | data.rar | + | *bzip2* | data.tar.bz2 | @issue-10329 Scenario: search files with different mediatype filter diff --git a/tests/acceptance/features/apiSearch2/tagSearch.feature b/tests/acceptance/features/apiSearch2/tagSearch.feature index 5361e907d..a832a9513 100644 --- a/tests/acceptance/features/apiSearch2/tagSearch.feature +++ b/tests/acceptance/features/apiSearch2/tagSearch.feature @@ -26,9 +26,9 @@ Feature: tag search When user "Alice" searches for "Tags:tag1" using the WebDAV API Then the HTTP status code should be "207" And the search result of user "Alice" should contain only these files: - | fileInRootLevel.txt | - | folderWithFile/fileInsideFolder.txt | - | folderWithFile/subFolder/fileInsideSubFolder.txt | + | fileInRootLevel.txt | + | fileInsideFolder.txt | + | fileInsideSubFolder.txt | Examples: | dav-path-version | | old | @@ -54,17 +54,13 @@ Feature: tag search When user "Alice" searches for "Tags:tag1" using the WebDAV API Then the HTTP status code should be "207" And the search result of user "Alice" should contain only these files: - | spacesFile.txt | - | spacesFolderWithFile/spacesFileInsideFolder.txt | - | spacesFolderWithFile/spacesSubFolder/spacesFileInsideSubFolder.txt | + | spacesFile.txt | + | spacesFileInsideFolder.txt | + | spacesFileInsideSubFolder.txt | Examples: | dav-path-version | | old | | new | - - @skipOnStable3.0 - Examples: - | dav-path-version | | spaces | @issue-10329 @@ -103,16 +99,12 @@ Feature: tag search When user "Alice" searches for "Tags:tag1" using the WebDAV API Then the HTTP status code should be "207" And the search result of user "Alice" should contain only these files: - | spacesFolder | - | spacesFolder/spacesSubFolder | + | spacesFolder | + | spacesSubFolder | Examples: | dav-path-version | | old | | new | - - @skipOnStable3.0 - Examples: - | dav-path-version | | spaces | @issue-10329 @@ -137,16 +129,12 @@ Feature: tag search When user "Brian" searches for "Tags:tag1" using the WebDAV API Then the HTTP status code should be "207" And the search result of user "Brian" should contain only these files: - | uploadFolder/file1.txt | - | uploadFolder/file2.txt | + | file1.txt | + | file2.txt | Examples: | dav-path-version | | old | | new | - - @skipOnStable3.0 - Examples: - | dav-path-version | | spaces | @issue-10329 @@ -174,17 +162,13 @@ Feature: tag search When user "Brian" searches for "Tags:tag1" using the WebDAV API Then the HTTP status code should be "207" And the search result of user "Alice" should contain only these files: - | spacesFile.txt | - | spacesFolderWithFile/spacesFileInsideFolder.txt | - | spacesFolderWithFile/spacesSubFolder/spacesFileInsideSubFolder.txt | + | spacesFile.txt | + | spacesFileInsideFolder.txt | + | spacesFileInsideSubFolder.txt | Examples: | dav-path-version | | old | | new | - - @skipOnStable3.0 - Examples: - | dav-path-version | | spaces | @@ -216,10 +200,9 @@ Feature: tag search When user "Alice" searches for "Tags:tag1" using the WebDAV API Then the HTTP status code should be "207" And the search result of user "Alice" should contain only these entries: - | /file1.txt | + | file1.txt | Examples: | dav-path-version | - | old | | new | | spaces | @@ -234,7 +217,7 @@ Feature: tag search When user "Alice" searches for "Tags:tag1" using the WebDAV API Then the HTTP status code should be "207" And the search result of user "Alice" should contain only these entries: - | /file.txt | + | file.txt | And the content of file "file.txt" for user "Alice" should be "version one file" Examples: | dav-path-version | @@ -267,16 +250,16 @@ Feature: tag search | | | | Examples: - | pattern | result-count | search-result-1 | search-result-2 | - | Tags:mathe | 2 | /exercises | /answers | - | tag:mathe | 2 | /exercises | /answers | - | tag:(mathe klass10) | 2 | /exercises | /answers | - | tag:klass10 AND tag:chemi | 1 | /answers | | - | tag:chemi OR tag:physik | 2 | /exercises | /answers | - | (tag:klass10) NOT tag:physik | 2 | /answers | verification work | - | (tag:(mathe klass10)) NOT tag:chemi | 1 | /exercises | | - | (tag:mathe OR tag:klass10) NOT tag:physik | 2 | /answers | /verification work | - | tag:mathe NOT name:exercises | 1 | /answers | | - | tag:mathe AND NOT name:exercises | 1 | /answers | | + | pattern | result-count | search-result-1 | search-result-2 | + | Tags:mathe | 2 | exercises | answers | + | tag:mathe | 2 | exercises | answers | + | tag:(mathe klass10) | 2 | exercises | answers | + | tag:klass10 AND tag:chemi | 1 | answers | | + | tag:chemi OR tag:physik | 2 | exercises | answers | + | (tag:klass10) NOT tag:physik | 2 | answers | verification work | + | (tag:(mathe klass10)) NOT tag:chemi | 1 | exercises | | + | (tag:mathe OR tag:klass10) NOT tag:physik | 2 | answers | verification work | + | tag:mathe NOT name:exercises | 1 | answers | | + | tag:mathe AND NOT name:exercises | 1 | answers | | # The third finding is the personal space itself - | NOT tag:mathe | 3 | /verification work | /withoutTagFolder | + | NOT tag:mathe | 3 | verification work | withoutTagFolder | diff --git a/tests/acceptance/features/apiSearchContent/contentSearch.feature b/tests/acceptance/features/apiSearchContent/contentSearch.feature index 70e34352b..b7189c4dc 100644 --- a/tests/acceptance/features/apiSearchContent/contentSearch.feature +++ b/tests/acceptance/features/apiSearchContent/contentSearch.feature @@ -102,9 +102,9 @@ Feature: content search When user "Brian" searches for "Content:hello" using the WebDAV API Then the HTTP status code should be "207" And the search result of user "Brian" should contain only these files: - | uploadFolder/keywordAtStart.txt | - | uploadFolder/keywordAtMiddle.txt | - | uploadFolder/keywordAtLast.txt | + | keywordAtStart.txt | + | keywordAtMiddle.txt | + | keywordAtLast.txt | Examples: | dav-path-version | | old | @@ -122,8 +122,8 @@ Feature: content search When user "Alice" searches for "Content:hello" using the WebDAV API Then the HTTP status code should be "207" And the search result of user "Alice" should contain only these files: - | uploadFolder/keywordAtStart.txt | - | keywordAtMiddle.txt | + | keywordAtStart.txt | + | keywordAtMiddle.txt | Examples: | dav-path-version | | old | @@ -143,7 +143,6 @@ Feature: content search | keywordAtStart.txt | Examples: | dav-path-version | - | old | | new | | spaces | @@ -177,9 +176,9 @@ Feature: content search When user "Alice" searches for "Content:hello" using the WebDAV API Then the HTTP status code should be "207" And the search result of user "Alice" should contain only these files: - | keywordAtStart.txt | - | spacesFolderWithFile/keywordAtMiddle.txt | - | spacesFolderWithFile/spacesSubFolder/keywordAtLast.txt | + | keywordAtStart.txt | + | keywordAtMiddle.txt | + | keywordAtLast.txt | Examples: | dav-path-version | | old | @@ -206,9 +205,9 @@ Feature: content search When user "Brian" searches for "Content:hello" using the WebDAV API Then the HTTP status code should be "207" And the search result of user "Alice" should contain only these files: - | keywordAtStart.txt | - | spacesFolderWithFile/keywordAtMiddle.txt | - | spacesFolderWithFile/spacesSubFolder/keywordAtLast.txt | + | keywordAtStart.txt | + | keywordAtMiddle.txt | + | keywordAtLast.txt | Examples: | dav-path-version | | old | @@ -230,13 +229,13 @@ Feature: content search | | | | Examples: - | pattern | result-count | search-result-1 | search-result-2 | - | Content:hello | 1 | /technical task.txt | | - | content:hello | 1 | /technical task.txt | | - | content:"hello" | 1 | /technical task.txt | | - | content:hel* | 2 | /technical task.txt | /task comments.txt | - | content:hel* AND tag:test | 1 | /technical task.txt | | - | (name:*task* AND content:hel*) NOT tag:test | 1 | /task comments.txt | | + | pattern | result-count | search-result-1 | search-result-2 | + | Content:hello | 1 | technical task.txt | | + | content:hello | 1 | technical task.txt | | + | content:"hello" | 1 | technical task.txt | | + | content:hel* | 2 | technical task.txt | task comments.txt | + | content:hel* AND tag:test | 1 | technical task.txt | | + | (name:*task* AND content:hel*) NOT tag:test | 1 | task comments.txt | | @issue-10329 Scenario Outline: search across files with different format with search text highlight diff --git a/tests/acceptance/features/cliCommands/searchReIndex.feature b/tests/acceptance/features/cliCommands/searchReIndex.feature index 8615135cc..cb70bff6e 100644 --- a/tests/acceptance/features/cliCommands/searchReIndex.feature +++ b/tests/acceptance/features/cliCommands/searchReIndex.feature @@ -18,7 +18,7 @@ Feature: reindex space via CLI command When user "Alice" searches for "textfile.txt" using the WebDAV API Then the HTTP status code should be "207" And the search result of user "Alice" should contain only these entries: - | /textfile.txt | + | textfile.txt | Scenario: reindex a space diff --git a/tests/acceptance/features/coreApiWebdavOperations/search.feature b/tests/acceptance/features/coreApiWebdavOperations/search.feature index 470899714..d71f325ea 100644 --- a/tests/acceptance/features/coreApiWebdavOperations/search.feature +++ b/tests/acceptance/features/coreApiWebdavOperations/search.feature @@ -22,44 +22,27 @@ Feature: Search 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 | + # 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 entries by only some letters from the middle of the entry name - Given using DAV path - And user "Alice" has created folder "FOLDER" - When user "Alice" searches for "*ol*" using the WebDAV API - Then the HTTP status code should be "207" - And the search result should contain "4" entries - And the search result of user "Alice" should contain these entries: - | /just-a-folder | - | /upload folder | - | /FOLDER | - | /just-a-folder/lolol.txt | - Examples: - | dav-path-version | - | old | - | new | - | spaces | @issue-10329 Scenario Outline: search for files by extension