Skip to content

Commit

Permalink
addressed review
Browse files Browse the repository at this point in the history
  • Loading branch information
sushmita56 committed Aug 4, 2022
1 parent e21b9c1 commit 1209a70
Showing 1 changed file with 43 additions and 105 deletions.
148 changes: 43 additions & 105 deletions tests/acceptance/features/apiSpaces/copySpaces.feature
Original file line number Diff line number Diff line change
Expand Up @@ -289,27 +289,16 @@ Feature: copy file
And user "Alice" has uploaded a file inside space "Project" with content "some content" to "folder2/demo.txt"
And user "Alice" has shared a space "Project" to user "Brian" with role "<role>"
When user "Brian" copies folder "folder2" to "folder1/folder2" inside space "Project" using the WebDAV API
Then the HTTP status code should be "201"
And for user "Brian" the space "Project" should contain these entries:
Then the HTTP status code should be "<status-code>"
And for user "Brian" the space "Project" <shouldOrNot> contain these entries:
| folder1/folder2/demo.txt |
Examples:
| role |
| manager |
| editor |
| role | shouldOrNot | status-code |
| manager | should | 201 |
| editor | should | 201 |
| viewer | should not | 403 |


Scenario: Copying a folder within the same space project with role viewer
Given the administrator has given "Alice" the role "Space Admin" using the settings api
And user "Alice" has created a space "Project" with the default quota using the GraphApi
And user "Alice" has created a folder "folder1" in space "Project"
And user "Alice" has created a folder "folder2" in space "Project"
And user "Alice" has uploaded a file inside space "Project" with content "some content" to "folder2/demo.txt"
And user "Alice" has shared a space "Project" to user "Brian" with role "viewer"
When user "Brian" copies folder "folder2" to "folder1/folder2" inside space "Project" using the WebDAV API
Then the HTTP status code should be "403"
And for user "Brian" the space "Project" should not contain these entries:
| folder1/folder2/demo.txt |


Scenario Outline: User copies a folder from a space project with different role to a space project with different role
Given the administrator has given "Brian" the role "Space Admin" using the settings api
Expand All @@ -320,33 +309,18 @@ Feature: copy file
And user "Brian" has shared a space "Project2" to user "Alice" with role "<to_role>"
And user "Brian" has shared a space "Project1" to user "Alice" with role "<from_role>"
When user "Alice" copies folder "folder1" from space "Project1" to "folder1" inside space "Project2" using the WebDAV API
Then the HTTP status code should be "201"
And for user "Alice" the space "Project2" should contain these entries:
| folder1/demo.txt |
Examples:
| from_role | to_role |
| manager | manager |
| manager | editor |
| editor | manager |
| editor | editor |


Scenario Outline: User copies a folder from a space project with different role to a space project with a viewer role
Given the administrator has given "Brian" the role "Space Admin" using the settings api
And user "Brian" has created a space "Project1" with the default quota using the GraphApi
And user "Brian" has created a space "Project2" with the default quota using the GraphApi
And user "Brian" has created a folder "folder1" in space "Project1"
And user "Brian" has uploaded a file inside space "Project1" with content "some content" to "/folder1/demo.txt"
And user "Brian" has shared a space "Project2" to user "Alice" with role "viewer"
And user "Brian" has shared a space "Project1" to user "Alice" with role "<role>"
When user "Alice" copies file "folder1" from space "Project1" to "folder1" inside space "Project2" using the WebDAV API
Then the HTTP status code should be "403"
And for user "Alice" the space "Project2" should not contain these entries:
Then the HTTP status code should be "<status-code>"
And for user "Alice" the space "Project2" <shouldOrNot> contain these entries:
| folder1/demo.txt |
Examples:
| role |
| manager |
| editor |
| from_role | to_role | status-code | shouldOrNot |
| manager | manager | 201 | should |
| manager | editor | 201 | should |
| editor | manager | 201 | should |
| editor | editor | 201 | should |
| manager | viewer | 403 | should not |
| editor | viewer | 403 | should not |
| viewer | viewer | 403 | should not |


Scenario Outline: User copies a folder from space project with different role to space personal
Expand All @@ -366,44 +340,27 @@ Feature: copy file
| viewer |


Scenario Outline: User copies a folder from space project with different role to space shares jail with editor role
Given the administrator has given "Brian" the role "Space Admin" using the settings api
And user "Brian" has created a space "Project" with the default quota using the GraphApi
And user "Brian" has created folder "/testshare"
And user "Brian" has created a folder "folder1" in space "Project"
And user "Brian" has uploaded a file inside space "Project" with content "some content" to "/folder1/demo.txt"
And user "Brian" has shared a space "Project" to user "Alice" with role "<role>"
And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "31"
And user "Alice" has accepted share "/testshare" offered by user "Brian"
When user "Alice" copies folder "folder1" from space "Project" to "/testshare/folder1" inside space "Shares Jail" using the WebDAV API
Then the HTTP status code should be "201"
And for user "Alice" folder "testshare/folder1" of the space "Shares Jail" should contain these files:
| demo.txt |
Examples:
| role |
| manager |
| editor |
| viewer |


Scenario Outline: User copies a folder from space project with different role to space shares jail with viewer role
Scenario Outline: User copies a folder from space project with different role to space shares jail with different role
Given the administrator has given "Brian" the role "Space Admin" using the settings api
And user "Brian" has created a space "Project" with the default quota using the GraphApi
And user "Brian" has created folder "/testshare"
And user "Brian" has created a folder "folder1" in space "Project"
And user "Brian" has uploaded a file inside space "Project" with content "some content" to "/folder1/demo.txt"
And user "Brian" has shared a space "Project" to user "Alice" with role "<role>"
And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "17"
And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "<share-permission>"
And user "Alice" has accepted share "/testshare" offered by user "Brian"
When user "Alice" copies folder "folder1" from space "Project" to "/testshare/folder1" inside space "Shares Jail" using the WebDAV API
Then the HTTP status code should be "403"
And for user "Alice" folder "testshare" of the space "Shares Jail" should not contain these files:
| folder1 |
Then the HTTP status code should be "<status-code>"
And for user "Alice" folder "testshare" of the space "Shares Jail" <shouldOrNot> contain these files:
| folder1/demo.txt |
Examples:
| role |
| manager |
| editor |
| viewer |
| role | shouldOrNot | share-permission | status-code |
| manager | should | 31 | 201 |
| editor | should | 31 | 201 |
| viewer | should | 31 | 201 |
| manager | should not | 17 | 403 |
| editor | should not | 17 | 403 |
| viewer | should not | 17 | 403 |


Scenario Outline: User copies a folder from space personal to space project with different role
Expand All @@ -413,49 +370,30 @@ Feature: copy file
And user "Alice" has created folder "folder1"
And user "Alice" has uploaded file with content "some content" to "folder1/demo.txt"
When user "Alice" copies folder "folder1" from space "Personal" to "folder1" inside space "Project" using the WebDAV API
Then the HTTP status code should be "201"
And for user "Alice" the space "Project" should contain these entries:
Then the HTTP status code should be "<status-code>"
And for user "Alice" the space "Project" <shouldOrNot> contain these entries:
| folder1/demo.txt |
Examples:
| role |
| manager |
| editor |

| role | shouldOrNot | status-code |
| manager | should | 201 |
| editor | should | 201 |
| viewer | should not | 403 |

Scenario: User copies a folder from space personal to space project with role viewer
Given the administrator has given "Brian" the role "Space Admin" using the settings api
And user "Brian" has created a space "Project" with the default quota using the GraphApi
And user "Brian" has shared a space "Project" to user "Alice" with role "viewer"
And user "Alice" has created folder "folder1"
And user "Alice" has uploaded file with content "some content" to "folder1/demo.txt"
When user "Alice" copies folder "folder1" from space "Personal" to "folder1" inside space "Project" using the WebDAV API
Then the HTTP status code should be "403"
And for user "Alice" the space "Project" should not contain these entries:
| folder1/demo.txt |


Scenario: User copies a folder from space personal to space shares jail with role editor
Scenario Outline: User copies a folder from space personal to space shares jail with permission editor
Given user "Brian" has created folder "/testshare"
And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "31"
And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "<share-permission>"
And user "Alice" has accepted share "/testshare" offered by user "Brian"
And user "Alice" has created folder "folder1"
And user "Alice" has uploaded file with content "some content" to "folder1/demo.txt"
When user "Alice" copies folder "folder1" from space "Personal" to "/testshare/folder1" inside space "Shares Jail" using the WebDAV API
Then the HTTP status code should be "201"
And for user "Alice" folder "testshare/folder1" of the space "Shares Jail" should contain these files:
| demo.txt |


Scenario: User copies a folder from space personal to space shares jail with role viewer
Given user "Brian" has created folder "/testshare"
And user "Brian" has shared folder "/testshare" with user "Alice" with permissions "17"
And user "Alice" has accepted share "/testshare" offered by user "Brian"
And user "Alice" has created folder "folder1"
And user "Alice" has uploaded file with content "some content" to "folder1/demo.txt"
When user "Alice" copies folder "folder1" from space "Personal" to "/testshare/folder1" inside space "Shares Jail" using the WebDAV API
Then the HTTP status code should be "403"
And for user "Alice" folder "testshare" of the space "Shares Jail" should not contain these files:
| folder1 |
Then the HTTP status code should be "<status-code>"
And for user "Alice" folder "testshare" of the space "Shares Jail" <shouldOrNot> contain these files:
| folder1/demo.txt |
Examples:
| share-permission | shouldOrNot | status-code |
| 31 | should | 201 |
| 17 | should not | 403 |


Scenario Outline: User copies a folder from space shares jail with different role to space personal
Expand Down

0 comments on commit 1209a70

Please sign in to comment.