changing given step of creating share in feature file (#9092)

This commit is contained in:
Sabin Panta
2024-05-08 10:06:23 +05:45
committed by GitHub
parent 545624f1be
commit 288619f626
5 changed files with 109 additions and 48 deletions
@@ -186,7 +186,12 @@ Feature: copying file using file id
And user "Alice" has created folder "folder/sub-folder" And user "Alice" has created folder "folder/sub-folder"
And user "Alice" has uploaded file with content "some data" to "/folder/sub-folder/test.txt" And user "Alice" has uploaded file with content "some data" to "/folder/sub-folder/test.txt"
And we save it into "FILEID" And we save it into "FILEID"
And user "Alice" has shared folder "/folder" with user "Brian" with permissions "all" And user "Alice" has sent the following share invitation:
| resource | folder |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
When user "Brian" copies a file "Shares/folder/sub-folder/test.txt" into "Shares/folder" inside space "Shares" using file-id path "<dav-path>" When user "Brian" copies a file "Shares/folder/sub-folder/test.txt" into "Shares/folder" inside space "Shares" using file-id path "<dav-path>"
Then the HTTP status code should be "201" Then the HTTP status code should be "201"
And for user "Brian" folder "folder" of the space "Shares" should contain these files: And for user "Brian" folder "folder" of the space "Shares" should contain these files:
@@ -206,7 +211,12 @@ Feature: copying file using file id
Scenario Outline: copy a file from personal to share space Scenario Outline: copy a file from personal to share space
Given user "Brian" has been created with default attributes and without skeleton files Given user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has created folder "/folder" And user "Alice" has created folder "/folder"
And user "Alice" has shared folder "/folder" with user "Brian" with permissions "all" And user "Alice" has sent the following share invitation:
| resource | folder |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
And user "Brian" has uploaded file with content "some data" to "/test.txt" And user "Brian" has uploaded file with content "some data" to "/test.txt"
And we save it into "FILEID" And we save it into "FILEID"
When user "Brian" copies a file "/test.txt" into "Shares/folder" inside space "Shares" using file-id path "<dav-path>" When user "Brian" copies a file "/test.txt" into "Shares/folder" inside space "Shares" using file-id path "<dav-path>"
@@ -228,7 +238,12 @@ Feature: copying file using file id
And user "Alice" has created folder "/folder" And user "Alice" has created folder "/folder"
And user "Alice" has uploaded file with content "some data" to "/folder/test.txt" And user "Alice" has uploaded file with content "some data" to "/folder/test.txt"
And we save it into "FILEID" And we save it into "FILEID"
And user "Alice" has shared folder "/folder" with user "Brian" with permissions "all" And user "Alice" has sent the following share invitation:
| resource | folder |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
When user "Brian" copies a file "/test.txt" into "/" inside space "Personal" using file-id path "<dav-path>" When user "Brian" copies a file "/test.txt" into "/" inside space "Personal" using file-id path "<dav-path>"
Then the HTTP status code should be "201" Then the HTTP status code should be "201"
And for user "Brian" folder "folder" of the space "Shares" should contain these files: And for user "Brian" folder "folder" of the space "Shares" should contain these files:
@@ -17,25 +17,28 @@ Feature: checking file versions using file id
Scenario Outline: check the file versions of a file shared from project space Scenario Outline: check the file versions of a file shared from project space
Given user "Alice" has created a share inside of space "Project1" with settings: Given user "Alice" has sent the following share invitation:
| path | text.txt | | resource | text.txt |
| shareWith | Brian | | space | Project1 |
| role | <role> | | sharee | Brian |
| shareType | user |
| permissionsRole | <role> |
When user "Alice" gets the number of versions of file "/text.txt" using file-id path "/meta/<<FILEID>>/v" When user "Alice" gets the number of versions of file "/text.txt" using file-id path "/meta/<<FILEID>>/v"
Then the HTTP status code should be "207" Then the HTTP status code should be "207"
And the number of versions should be "1" And the number of versions should be "1"
When user "Brian" tries to get the number of versions of file "/text.txt" using file-id path "/meta/<<FILEID>>/v" When user "Brian" tries to get the number of versions of file "/text.txt" using file-id path "/meta/<<FILEID>>/v"
Then the HTTP status code should be "403" Then the HTTP status code should be "403"
Examples: Examples:
| role | | role |
| editor | | File Editor |
| viewer | | Viewer |
Scenario Outline: check the versions of a file in a shared space as editor/manager Scenario Outline: check the versions of a file in a shared space as editor/manager
Given user "Alice" has shared a space "Project1" with settings: Given user "Alice" has sent the following share invitation:
| shareWith | Brian | | space | Project1 |
| role | <space-role> | | sharee | Brian |
| shareType | user |
| permissionsRole | <space-role> |
When user "Alice" gets the number of versions of file "/text.txt" using file-id path "/meta/<<FILEID>>/v" When user "Alice" gets the number of versions of file "/text.txt" using file-id path "/meta/<<FILEID>>/v"
Then the HTTP status code should be "207" Then the HTTP status code should be "207"
And the number of versions should be "1" And the number of versions should be "1"
@@ -43,25 +46,29 @@ Feature: checking file versions using file id
Then the HTTP status code should be "207" Then the HTTP status code should be "207"
And the number of versions should be "1" And the number of versions should be "1"
Examples: Examples:
| space-role | | space-role |
| editor | | Space Editor |
| manager | | Manager |
Scenario: check the versions of a file in a shared space as viewer Scenario: check the versions of a file in a shared space as viewer
Given user "Alice" has shared a space "Project1" with settings: Given user "Alice" has sent the following share invitation:
| shareWith | Brian | | space | Project1 |
| role | viewer | | sharee | Brian |
| shareType | user |
| permissionsRole | Space Viewer |
When user "Brian" tries to get the number of versions of file "/text.txt" using file-id path "/meta/<<FILEID>>/v" When user "Brian" tries to get the number of versions of file "/text.txt" using file-id path "/meta/<<FILEID>>/v"
Then the HTTP status code should be "403" Then the HTTP status code should be "403"
@issue-7738 @issue-7738
Scenario Outline: check the versions of a file after moving to a shared folder inside a project space as editor/viewer Scenario Outline: check the versions of a file after moving to a shared folder inside a project space as editor/viewer
Given user "Alice" has created a folder "testFolder" in space "Project1" Given user "Alice" has created a folder "testFolder" in space "Project1"
And user "Alice" has created a share inside of space "Project1" with settings: And user "Alice" has sent the following share invitation:
| path | testFolder | | resource | text.txt |
| shareWith | Brian | | space | Project1 |
| role | <role> | | sharee | Brian |
| shareType | user |
| permissionsRole | <role> |
And user "Alice" has moved file "text.txt" to "/testFolder/movedText.txt" in space "Project1" And user "Alice" has moved file "text.txt" to "/testFolder/movedText.txt" in space "Project1"
When user "Alice" gets the number of versions of file "/testFolder/movedText.txt" using file-id path "/meta/<<FILEID>>/v" When user "Alice" gets the number of versions of file "/testFolder/movedText.txt" using file-id path "/meta/<<FILEID>>/v"
Then the HTTP status code should be "207" Then the HTTP status code should be "207"
@@ -69,19 +76,24 @@ Feature: checking file versions using file id
When user "Brian" tries to get the number of versions of file "/Shares/testFolder/movedText.txt" using file-id path "/meta/<<FILEID>>/v" When user "Brian" tries to get the number of versions of file "/Shares/testFolder/movedText.txt" using file-id path "/meta/<<FILEID>>/v"
Then the HTTP status code should be "403" Then the HTTP status code should be "403"
Examples: Examples:
| role | | role |
| editor | | File Editor |
| viewer | | Viewer |
@issue-7738 @issue-7738
Scenario: check the versions of a file after moving it to a shared folder inside a project space as manager Scenario: check the versions of a file after moving it to a shared folder inside a project space as manager
Given user "Alice" has created a folder "testFolder" in space "Project1" Given user "Alice" has created a folder "testFolder" in space "Project1"
And user "Alice" has created a share inside of space "Project1" with settings: And user "Alice" has sent the following share invitation:
| path | testFolder | | resource | testFolder |
| shareWith | Brian | | space | Project1 |
And user "Alice" has shared a space "Project1" with settings: | sharee | Brian |
| shareWith | Brian | | shareType | user |
| role | manager | | permissionsRole | Viewer |
And user "Alice" has sent the following share invitation:
| space | Project1 |
| sharee | Brian |
| shareType | user |
| permissionsRole | Manager |
And user "Alice" has moved file "text.txt" to "/testFolder/movedText.txt" in space "Project1" And user "Alice" has moved file "text.txt" to "/testFolder/movedText.txt" in space "Project1"
When user "Brian" gets the number of versions of file "/text.txt" using file-id path "/meta/<<FILEID>>/v" When user "Brian" gets the number of versions of file "/text.txt" using file-id path "/meta/<<FILEID>>/v"
Then the HTTP status code should be "207" Then the HTTP status code should be "207"
@@ -51,7 +51,12 @@ Feature: accessing files using file id
Given user "Brian" has been created with default attributes and without skeleton files 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 user "Alice" has uploaded file with content "some data" to "/textfile.txt"
And we save it into "FILEID" And we save it into "FILEID"
And user "Alice" has shared file "/textfile.txt" with user "Brian" And user "Alice" has sent the following share invitation:
| resource | textfile.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
When user "Brian" sends HTTP method "GET" to URL "<dav-path>" When user "Brian" sends HTTP method "GET" to URL "<dav-path>"
Then the HTTP status code should be "200" Then the HTTP status code should be "200"
And the downloaded content should be "some data" And the downloaded content should be "some data"
@@ -66,7 +71,12 @@ Feature: accessing files using file id
And user "Alice" has created folder "uploadFolder" And user "Alice" has created folder "uploadFolder"
And user "Alice" has uploaded file with content "some data" to "uploadFolder/textfile.txt" And user "Alice" has uploaded file with content "some data" to "uploadFolder/textfile.txt"
And we save it into "FILEID" And we save it into "FILEID"
And user "Alice" has shared folder "/uploadFolder" with user "Brian" And user "Alice" has sent the following share invitation:
| resource | uploadFolder |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
When user "Brian" sends HTTP method "GET" to URL "<dav-path>" When user "Brian" sends HTTP method "GET" to URL "<dav-path>"
Then the HTTP status code should be "200" Then the HTTP status code should be "200"
And the downloaded content should be "some data" And the downloaded content should be "some data"
@@ -82,9 +92,11 @@ Feature: accessing files using file id
And user "Alice" has created a space "new-space" with the default quota using the Graph API And user "Alice" has created a space "new-space" with the default quota using the Graph API
And user "Alice" has uploaded a file inside space "new-space" with content "some data" to "textfile.txt" 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 we save it into "FILEID"
And user "Alice" has shared a space "new-space" with settings: And user "Alice" has sent the following share invitation:
| shareWith | Brian | | space | new-space |
| role | viewer | | sharee | Brian |
| shareType | user |
| permissionsRole | Space Viewer |
When user "Brian" sends HTTP method "GET" to URL "<dav-path>" When user "Brian" sends HTTP method "GET" to URL "<dav-path>"
Then the HTTP status code should be "200" Then the HTTP status code should be "200"
And the downloaded content should be "some data" And the downloaded content should be "some data"
@@ -104,7 +104,12 @@ Feature: propfind a file using file id
Given user "Brian" has been created with default attributes and without skeleton files 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 user "Alice" has uploaded file with content "some data" to "/textfile.txt"
And we save it into "FILEID" And we save it into "FILEID"
And user "Alice" has shared file "/textfile.txt" with user "Brian" And user "Alice" has sent the following share invitation:
| resource | textfile.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | File Editor |
When user "Brian" sends HTTP method "PROPFIND" to URL "<dav-path>" When user "Brian" sends HTTP method "PROPFIND" to URL "<dav-path>"
Then the HTTP status code should be "207" Then the HTTP status code should be "207"
And the "PROPFIND" response to user "Alice" should contain a mountpoint "Brian Murphy" with these key and value pairs: And the "PROPFIND" response to user "Alice" should contain a mountpoint "Brian Murphy" with these key and value pairs:
@@ -120,7 +125,12 @@ Feature: propfind a file using file id
Scenario Outline: sharee sends a PROPFIND request to a file inside of a shared folder Scenario Outline: sharee sends a PROPFIND request to a file inside of a shared folder
Given user "Brian" has been created with default attributes and without skeleton files Given user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has created folder "/folder" And user "Alice" has created folder "/folder"
And user "Alice" has shared folder "/folder" with user "Brian" And user "Alice" has sent the following share invitation:
| resource | folder |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
And user "Alice" has uploaded file with content "some data" to "/folder/textfile.txt" And user "Alice" has uploaded file with content "some data" to "/folder/textfile.txt"
And we save it into "FILEID" And we save it into "FILEID"
When user "Brian" sends HTTP method "PROPFIND" to URL "<dav-path>" When user "Brian" sends HTTP method "PROPFIND" to URL "<dav-path>"
@@ -51,7 +51,12 @@ Feature: update files using file id
Given user "Brian" has been created with default attributes and without skeleton files 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 user "Alice" has uploaded file with content "some data" to "/textfile.txt"
And we save it into "FILEID" And we save it into "FILEID"
And user "Alice" has shared file "/textfile.txt" with user "Brian" And user "Alice" has sent the following share invitation:
| resource | textfile.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | File Editor |
When user "Brian" sends HTTP method "PUT" to URL "<dav-path>" with content "updated content" When user "Brian" sends HTTP method "PUT" to URL "<dav-path>" with content "updated content"
Then the HTTP status code should be "204" Then the HTTP status code should be "204"
And for user "Alice" the content of the file "/textfile.txt" of the space "Personal" should be "updated content" And for user "Alice" the content of the file "/textfile.txt" of the space "Personal" should be "updated content"
@@ -67,7 +72,12 @@ Feature: update files using file id
And user "Alice" has created folder "uploadFolder" And user "Alice" has created folder "uploadFolder"
And user "Alice" has uploaded file with content "some data" to "uploadFolder/textfile.txt" And user "Alice" has uploaded file with content "some data" to "uploadFolder/textfile.txt"
And we save it into "FILEID" And we save it into "FILEID"
And user "Alice" has shared folder "/uploadFolder" with user "Brian" And user "Alice" has sent the following share invitation:
| resource | uploadFolder |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Editor |
When user "Brian" sends HTTP method "PUT" to URL "<dav-path>" with content "updated content" When user "Brian" sends HTTP method "PUT" to URL "<dav-path>" with content "updated content"
Then the HTTP status code should be "204" Then the HTTP status code should be "204"
And for user "Alice" the content of the file "uploadFolder/textfile.txt" of the space "Personal" should be "updated content" And for user "Alice" the content of the file "uploadFolder/textfile.txt" of the space "Personal" should be "updated content"
@@ -84,17 +94,19 @@ Feature: update files using file id
And user "Alice" has created a space "new-space" with the default quota using the Graph API And user "Alice" has created a space "new-space" with the default quota using the Graph API
And user "Alice" has uploaded a file inside space "new-space" with content "some data" to "/textfile.txt" 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 we save it into "FILEID"
And user "Alice" has shared a space "new-space" with settings: And user "Alice" has sent the following share invitation:
| shareWith | Brian | | space | new-space |
| role | <space-role> | | sharee | Brian |
| shareType | user |
| permissionsRole | <space-role> |
When user "Brian" sends HTTP method "PUT" to URL "<dav-path>" with content "updated content" When user "Brian" sends HTTP method "PUT" to URL "<dav-path>" with content "updated content"
Then the HTTP status code should be "<http-status-code>" Then the HTTP status code should be "<http-status-code>"
And for user "Alice" the content of the file "/textfile.txt" of the space "new-space" should be "<file-content>" And for user "Alice" the content of the file "/textfile.txt" of the space "new-space" should be "<file-content>"
And for user "Brian" the content of the file "/textfile.txt" of the space "new-space" should be "<file-content>" And for user "Brian" the content of the file "/textfile.txt" of the space "new-space" should be "<file-content>"
Examples: Examples:
| dav-path | space-role | http-status-code | file-content | | dav-path | space-role | http-status-code | file-content |
| /remote.php/dav/spaces/<<FILEID>> | viewer | 403 | some data | | /remote.php/dav/spaces/<<FILEID>> | Space Viewer | 403 | some data |
| /dav/spaces/<<FILEID>> | editor | 204 | updated content | | /dav/spaces/<<FILEID>> | Space Editor | 204 | updated content |
Scenario Outline: user tries to update content of a file owned by others Scenario Outline: user tries to update content of a file owned by others