From 6493152a70f2c4195d02ec23d9c967c30cd9ac4a Mon Sep 17 00:00:00 2001 From: nabim777 Date: Tue, 27 Jun 2023 16:15:47 +0545 Subject: [PATCH] add api test for search file through tag --- tests/acceptance/config/behat.yml | 1 + .../features/apiGraph/fullSearch.feature | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 tests/acceptance/features/apiGraph/fullSearch.feature diff --git a/tests/acceptance/config/behat.yml b/tests/acceptance/config/behat.yml index 98c60cf2e9c..77951dd6ed2 100644 --- a/tests/acceptance/config/behat.yml +++ b/tests/acceptance/config/behat.yml @@ -139,6 +139,7 @@ default: - TUSContext: - SpacesTUSContext: - OcisConfigContext: + - TagContext: apiCors: paths: diff --git a/tests/acceptance/features/apiGraph/fullSearch.feature b/tests/acceptance/features/apiGraph/fullSearch.feature new file mode 100644 index 00000000000..32aee1d6afe --- /dev/null +++ b/tests/acceptance/features/apiGraph/fullSearch.feature @@ -0,0 +1,23 @@ +@api +Feature: search + As a user + I want to do full text search + So that I can find the files with the content I am looking for + + Background: + Given user "Alice" has been created with default attributes and without skeleton files + + Scenario: search a file using tag + Given using spaces DAV path + And user "Alice" has uploaded file with content "hello world" to "file1.txt" + And user "Alice" has uploaded file with content "Namaste nepal" to "file2.txt" + And user "Alice" has uploaded file with content "hello nepal" to "file3.txt" + And user "Alice" has created the following tags for file "file1.txt" of the space "Personal": + | tag1 | + And user "Alice" has created the following tags for file "file2.txt" of the space "Personal": + | tag1 | + 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: + | file1.txt | + | file2.txt |