Skip to content

Commit

Permalink
add api test for search files using tag in project spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
nabim777 committed Jul 20, 2023
1 parent 02a3bfd commit f6f0e07
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 8 deletions.
64 changes: 56 additions & 8 deletions tests/acceptance/features/apiGraph/fullSearch.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,75 @@ Feature: full text search
Given user "Alice" has been created with default attributes and without skeleton files


Scenario Outline: search files using a tag
Scenario Outline: search files by 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":
And user "Alice" has created folder "folderWithFile"
And user "Alice" has created folder "folderWithFile/subFolder/"
And user "Alice" has uploaded file with content "hello world" to "test.txt"
And user "Alice" has uploaded file with content "Namaste nepal" to "folderWithFile/fileInsideFolder.txt"
And user "Alice" has uploaded file with content "hello nepal" to "folderWithFile/subFolder/fileInsideSubFolder.txt"
And user "Alice" has created the following tags for file "test.txt" of the space "Personal":
| tag1 |
And user "Alice" has created the following tags for file "file2.txt" of the space "Personal":
And user "Alice" has created the following tags for file "folderWithFile/fileInsideFolder.txt" of the space "Personal":
| tag1 |
And user "Alice" has created the following tags for file "folderWithFile/subFolder/fileInsideSubFolder.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 |
| test.txt |
| fileInsideFolder.txt |
| fileInsideSubFolder.txt |
Examples:
| dav-path-version |
| old |
| new |
| spaces |


Scenario Outline: search files by tag using new DAV path
Given using spaces DAV path
And user "Alice" has created folder "personalFolderWithFile"
And user "Alice" has created folder "personalFolderWithFile/subFolder"
And user "Alice" has uploaded file with content "tagged file" to "personalFile.txt"
And user "Alice" has uploaded file with content "non-tagged file" to "fileWithoutTag.txt"
And user "Alice" has uploaded file with content "tagged file in folder" to "personalFolderWithFile/personalFileInsideFolder.txt"
And user "Alice" has uploaded file with content "tagged file in subfolder" to "personalFolderWithFile/subFolder/personalFileInsideSubFolder.txt"
And user "Alice" has created the following tags for file "personalFile.txt" of the space "Personal":
| tag1 |
And user "Alice" has created the following tags for file "personalFolderWithFile/personalFileInsideFolder.txt" of the space "Personal":
| tag1 |
And user "Alice" has created the following tags for file "personalFolderWithFile/subFolder/personalFileInsideSubFolder.txt" of the space "Personal":
| tag1 |
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "tag-space" with the default quota using the GraphApi
And user "Alice" has created a folder "spacesFolderWithFile/spacesSubFolder" in space "tag-space"
And user "Alice" has uploaded a file inside space "tag-space" with content "tagged file" to "spacesFile.txt"
And user "Alice" has uploaded a file inside space "tag-space" with content "non-tagged file" to "spacesFileWithoutTag.txt"
And user "Alice" has uploaded a file inside space "tag-space" with content "tagged file in folder" to "spacesFolderWithFile/spacesFileInsideFolder.txt"
And user "Alice" has uploaded a file inside space "tag-space" with content "tagged file in subfolder" to "spacesFolderWithFile/spacesSubFolder/spacesFileInsideSubFolder.txt"
And user "Alice" has created the following tags for file "spacesFile.txt" of the space "tag-space":
| tag1 |
And user "Alice" has created the following tags for file "spacesFolderWithFile/spacesFileInsideFolder.txt" of the space "tag-space":
| tag1 |
And user "Alice" has created the following tags for file "spacesFolderWithFile/spacesSubFolder/spacesFileInsideSubFolder.txt" of the space "tag-space":
| tag1 |
And using <dav-path-version> DAV path
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:
| personalFile.txt |
| personalFileInsideFolder.txt |
| personalFileInsideSubFolder.txt |
| spacesFile.txt |
| spacesFileInsideFolder.txt |
| spacesFileInsideSubFolder.txt |
Examples:
| dav-path-version |
| old |
| new |


Scenario Outline: search folders using a tag
Given using <dav-path-version> DAV path
And user "Alice" has created folder "uploadFolder1"
Expand Down
1 change: 1 addition & 0 deletions tests/acceptance/features/bootstrap/WebDav.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ public function usingOldDavPath():void {
$this->davPath = $this->getOldDavPath();
$this->usingOldDavPath = true;
$this->customDavPath = null;
$this->usingSpacesDavPath = false;
}

/**
Expand Down

0 comments on commit f6f0e07

Please sign in to comment.