Skip to content

Commit

Permalink
add test for search by deleted tag
Browse files Browse the repository at this point in the history
  • Loading branch information
nabim777 committed Jul 10, 2023
1 parent cd304b4 commit 80e9122
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/acceptance/config/behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ default:
- TUSContext:
- SpacesTUSContext:
- OcisConfigContext:
- TagContext:

apiCors:
paths:
Expand Down
97 changes: 97 additions & 0 deletions tests/acceptance/features/apiGraph/fullSearch.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
@api
Feature: full text 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 Outline: search files using a tag
Given using <dav-path-version> 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 |
Examples:
| dav-path-version |
| old |
| new |
| spaces |


Scenario Outline: as a sharee search a file tagged by sharer using tag
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has created folder "uploadFolder"
And user "Alice" has uploaded file with content "hello world" to "uploadFolder/file1.txt"
And user "Alice" has uploaded file with content "Namaste nepal" to "uploadFolder/file2.txt"
And user "Alice" has uploaded file with content "hello nepal" to "uploadFolder/file3.txt"
And user "Alice" has created the following tags for file "uploadFolder/file1.txt" of the space "Personal":
| tag1 |
And user "Alice" has created the following tags for file "uploadFolder/file2.txt" of the space "Personal":
| tag1 |
And user "Alice" has shared folder "/uploadFolder" with user "Brian"
And user "Brian" has accepted share "/uploadFolder" offered by user "Alice"
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:
| file1.txt |
| file2.txt |
Examples:
| dav-path-version |
| old |
| new |


Scenario Outline: as a sharee search a file tagged by sharee using tag
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has created folder "uploadFolder"
And user "Alice" has uploaded file with content "hello world" to "uploadFolder/file1.txt"
And user "Alice" has uploaded file with content "Namaste nepal" to "uploadFolder/file2.txt"
And user "Alice" has uploaded file with content "hello nepal" to "uploadFolder/file3.txt"
And user "Alice" has shared folder "/uploadFolder" with user "Brian"
And user "Brian" has accepted share "/uploadFolder" offered by user "Alice"
And user "Brian" has created the following tags for file "uploadFolder/file1.txt" of the space "Shares":
| tag1 |
And user "Brian" has created the following tags for file "uploadFolder/file2.txt" of the space "Shares":
| tag1 |
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:
| file1.txt |
| file2.txt |
Examples:
| dav-path-version |
| old |
| new |


Scenario Outline: search files using a deleted tag
Given using <dav-path-version> 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 created the following tags for file "file1.txt" of the space "Personal":
| tag1 |
When user "Alice" removes the following tags for file "file1.txt" of space "Personal":
| tag1 |
And user "Alice" searches for "Tags:tag1" using the WebDAV API
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:
| file1.txt |
Examples:
| dav-path-version |
| old |
| new |
| spaces |

0 comments on commit 80e9122

Please sign in to comment.