From c767e8f0f552962aec363f7404803ed82fe562e4 Mon Sep 17 00:00:00 2001 From: Viktor Scharf Date: Tue, 24 Oct 2023 12:15:37 +0200 Subject: [PATCH 1/2] add search test --- tests/acceptance/config/behat.yml | 1 + .../features/apiSearch/contentSearch.feature | 57 +++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/tests/acceptance/config/behat.yml b/tests/acceptance/config/behat.yml index 1190559c554..23d05fd21f0 100644 --- a/tests/acceptance/config/behat.yml +++ b/tests/acceptance/config/behat.yml @@ -223,6 +223,7 @@ default: - TagContext: - SpacesTUSContext: - TUSContext: + - OcisConfigContext: apiReshare: paths: diff --git a/tests/acceptance/features/apiSearch/contentSearch.feature b/tests/acceptance/features/apiSearch/contentSearch.feature index c46acab86d2..57a6d003050 100644 --- a/tests/acceptance/features/apiSearch/contentSearch.feature +++ b/tests/acceptance/features/apiSearch/contentSearch.feature @@ -27,6 +27,63 @@ Feature: content search | spaces | + Scenario Outline: search files by characters + Given using DAV path + And user "Alice" has uploaded file with content "Using k6, you can test the reliability and performance of your systems" to "wordWithNumber.md" + And user "Alice" has uploaded file with content "see our web site https://owncloud.com/infinite-scale-4-0" to "findByWebSite.txt" + And user "Alice" has uploaded file with content "einstein@example.org want to say hello" to "findByEmail.docs" + When user "Alice" searches for "Content:k6" using the WebDAV API + Then the HTTP status code should be "207" + And the search result of user "Alice" should contain only these files: + | wordWithNumber.md | + When user "Alice" searches for "Content:https://owncloud.com/" using the WebDAV API + Then the HTTP status code should be "207" + And the search result of user "Alice" should contain only these files: + | findByWebSite.txt | + When user "Alice" searches for "Content:einstein@" using the WebDAV API + Then the HTTP status code should be "207" + And the search result of user "Alice" should contain only these files: + | findByEmail.docs | + Examples: + | dav-path-version | + | old | + | new | + | spaces | + + + Scenario Outline: search files by stop words when cleaning stop words is enabled by default + Given using DAV path + And user "Alice" has uploaded file with content "He has expirience, we must to have, I have to find ...." to "fileWithStopWords.txt" + When user "Alice" searches for 'Content:"he has"' using the WebDAV API + Then the HTTP status code should be "207" + And the search result of user "Brian" should not contain these entries: + | fileWithStopWords.txt | + Examples: + | dav-path-version | + | old | + | new | + | spaces | + + @env-config + Scenario Outline: search files by stop words when cleaning stop words is disabled + Given using DAV path + And the config "SEARCH_EXTRACTOR_TIKA_CLEAN_STOP_WORDS" has been set to "false" + And user "Alice" has uploaded file with content "He has expirience, we must to have, I have to find ...." to "fileWithStopWords.txt" + And user "Alice" searches for 'Content:"he has"' using the WebDAV API + Then the HTTP status code should be "207" + And the search result of user "Alice" should contain only these files: + | fileWithStopWords.txt | + And user "Alice" searches for 'Content:"I have"' using the WebDAV API + Then the HTTP status code should be "207" + And the search result of user "Alice" should contain only these files: + | fileWithStopWords.txt | + Examples: + | dav-path-version | + | old | + | new | + | spaces | + + Scenario Outline: sharee searches files by content Given using DAV path And user "Brian" has been created with default attributes and without skeleton files From 4ddcc1e99b91ce321b2456acfa756556ba27215f Mon Sep 17 00:00:00 2001 From: Viktor Scharf Date: Thu, 26 Oct 2023 07:39:40 +0200 Subject: [PATCH 2/2] Update contentSearch.feature --- .../features/apiSearch/contentSearch.feature | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/acceptance/features/apiSearch/contentSearch.feature b/tests/acceptance/features/apiSearch/contentSearch.feature index 57a6d003050..3119bcc09fe 100644 --- a/tests/acceptance/features/apiSearch/contentSearch.feature +++ b/tests/acceptance/features/apiSearch/contentSearch.feature @@ -27,7 +27,7 @@ Feature: content search | spaces | - Scenario Outline: search files by characters + Scenario Outline: search files by different content types Given using DAV path And user "Alice" has uploaded file with content "Using k6, you can test the reliability and performance of your systems" to "wordWithNumber.md" And user "Alice" has uploaded file with content "see our web site https://owncloud.com/infinite-scale-4-0" to "findByWebSite.txt" @@ -51,7 +51,7 @@ Feature: content search | spaces | - Scenario Outline: search files by stop words when cleaning stop words is enabled by default + Scenario Outline: search files by stop words when clean_stop_words is enabled (default) Given using DAV path And user "Alice" has uploaded file with content "He has expirience, we must to have, I have to find ...." to "fileWithStopWords.txt" When user "Alice" searches for 'Content:"he has"' using the WebDAV API @@ -65,15 +65,15 @@ Feature: content search | spaces | @env-config - Scenario Outline: search files by stop words when cleaning stop words is disabled + Scenario Outline: search files by stop words when clean_stop_words is disabled Given using DAV path And the config "SEARCH_EXTRACTOR_TIKA_CLEAN_STOP_WORDS" has been set to "false" And user "Alice" has uploaded file with content "He has expirience, we must to have, I have to find ...." to "fileWithStopWords.txt" - And user "Alice" searches for 'Content:"he has"' using the WebDAV API + When user "Alice" searches for 'Content:"he has"' using the WebDAV API Then the HTTP status code should be "207" And the search result of user "Alice" should contain only these files: | fileWithStopWords.txt | - And user "Alice" searches for 'Content:"I have"' using the WebDAV API + When user "Alice" searches for 'Content:"I have"' using the WebDAV API Then the HTTP status code should be "207" And the search result of user "Alice" should contain only these files: | fileWithStopWords.txt |