-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added tests for reading content of a file by fileId using WebDav API
- Loading branch information
1 parent
ee3d709
commit affbd47
Showing
4 changed files
with
124 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
tests/acceptance/features/apiSpacesDavOperation/getFileByFileId.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
@api | ||
Feature: accessing files using file id | ||
As a user | ||
I want to access the files using file id | ||
So that I can get the content of a file | ||
|
||
Background: | ||
Given using spaces DAV path | ||
And user "Alice" has been created with default attributes and without skeleton files | ||
|
||
|
||
Scenario Outline: get content of a file | ||
Given user "Alice" has uploaded file with content "some data" to "/textfile.txt" | ||
And we save it into "FILEID" | ||
When user "Alice" sends HTTP method "GET" to URL "<dav-path>" | ||
Then the HTTP status code should be "200" | ||
And the downloaded content should be "some data" | ||
Examples: | ||
| dav-path | | ||
| /remote.php/dav/spaces/<<FILEID>> | | ||
| /dav/spaces/<<FILEID>> | | ||
|
||
|
||
Scenario Outline: get content of a file inside a folder | ||
Given user "Alice" has created folder "uploadFolder" | ||
And user "Alice" has uploaded file with content "some data" to "uploadFolder/textfile.txt" | ||
And we save it into "FILEID" | ||
When user "Alice" sends HTTP method "GET" to URL "<dav-path>" | ||
Then the HTTP status code should be "200" | ||
And the downloaded content should be "some data" | ||
Examples: | ||
| dav-path | | ||
| /remote.php/dav/spaces/<<FILEID>> | | ||
| /dav/spaces/<<FILEID>> | | ||
|
||
|
||
Scenario Outline: get content of a file inside a project space | ||
Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API | ||
And user "Alice" has created a space "new-space" with the default quota using the GraphApi | ||
And user "Alice" has uploaded a file inside space "new-space" with content "some data" to "textfile.txt" | ||
And we save it into "FILEID" | ||
When user "Alice" sends HTTP method "GET" to URL "<dav-path>" | ||
Then the HTTP status code should be "200" | ||
And the downloaded content should be "some data" | ||
Examples: | ||
| dav-path | | ||
| /remote.php/dav/spaces/<<FILEID>> | | ||
| /dav/spaces/<<FILEID>> | | ||
|
||
|
||
Scenario Outline: sharee gets content of a shared file | ||
Given user "Brian" has been created with default attributes and without skeleton files | ||
And user "Alice" has uploaded file with content "some data" to "/textfile.txt" | ||
And we save it into "FILEID" | ||
And user "Alice" has shared file "/textfile.txt" with user "Brian" | ||
And user "Brian" has accepted share "/textfile.txt" offered by user "Alice" | ||
When user "Brian" sends HTTP method "GET" to URL "<dav-path>" | ||
Then the HTTP status code should be "200" | ||
And the downloaded content should be "some data" | ||
Examples: | ||
| dav-path | | ||
| /remote.php/dav/spaces/<<FILEID>> | | ||
| /dav/spaces/<<FILEID>> | | ||
|
||
|
||
Scenario Outline: sharee gets content of a file inside a shared folder | ||
Given 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 "some data" to "uploadFolder/textfile.txt" | ||
And we save it into "FILEID" | ||
And user "Alice" has shared folder "/uploadFolder" with user "Brian" | ||
And user "Brian" has accepted share "/uploadFolder" offered by user "Alice" | ||
When user "Brian" sends HTTP method "GET" to URL "<dav-path>" | ||
Then the HTTP status code should be "200" | ||
And the downloaded content should be "some data" | ||
Examples: | ||
| dav-path | | ||
| /remote.php/dav/spaces/<<FILEID>> | | ||
| /dav/spaces/<<FILEID>> | | ||
|
||
|
||
Scenario Outline: sharee gets content of a file inside a shared space | ||
Given user "Brian" has been created with default attributes and without skeleton files | ||
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API | ||
And user "Alice" has created a space "new-space" with the default quota using the GraphApi | ||
And user "Alice" has uploaded a file inside space "new-space" with content "some data" to "textfile.txt" | ||
And we save it into "FILEID" | ||
And user "Alice" has shared a space "new-space" with settings: | ||
| shareWith | Brian | | ||
| role | viewer | | ||
When user "Brian" sends HTTP method "GET" to URL "<dav-path>" | ||
Then the HTTP status code should be "200" | ||
And the downloaded content should be "some data" | ||
Examples: | ||
| dav-path | | ||
| /remote.php/dav/spaces/<<FILEID>> | | ||
| /dav/spaces/<<FILEID>> | | ||
|
||
|
||
Scenario Outline: user tries to get content of file owned by others | ||
Given user "Brian" has been created with default attributes and without skeleton files | ||
And user "Alice" has uploaded file with content "some data" to "/textfile.txt" | ||
And we save it into "FILEID" | ||
When user "Brian" sends HTTP method "GET" to URL "<dav-path>" | ||
Then the HTTP status code should be "404" | ||
Examples: | ||
| dav-path | | ||
| /remote.php/dav/spaces/<<FILEID>> | | ||
| /dav/spaces/<<FILEID>> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters