Skip to content

Commit

Permalink
made tests dry
Browse files Browse the repository at this point in the history
  • Loading branch information
swoichha committed Dec 23, 2020
1 parent c90f05f commit f9efe76
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ Feature: sharing
Given the administrator has set the default folder for received shares to "Shares"
And auto-accept shares has been disabled
And user "Alice" has been created with default attributes and skeleton files
And user "Brian" has been created with default attributes and skeleton files


Scenario: Uploading file to a user read-only share folder does not work
Given user "Alice" has created a share with settings
Given user "Brian" has been created with default attributes and skeleton files
And user "Alice" has created a share with settings
| path | FOLDER |
| shareType | user |
| permissions | read |
Expand All @@ -22,6 +21,7 @@ Feature: sharing

Scenario Outline: Uploading file to a group read-only share folder does not work
Given using <dav-path> DAV path
And user "Brian" has been created with default attributes and skeleton files
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created a share with settings
Expand All @@ -41,6 +41,7 @@ Feature: sharing

Scenario Outline: Uploading file to a user upload-only share folder works
Given using <dav-path> DAV path
And user "Brian" has been created with default attributes and skeleton files
And user "Alice" has created a share with settings
| path | FOLDER |
| shareType | user |
Expand All @@ -65,6 +66,7 @@ Feature: sharing

Scenario Outline: Uploading file to a group upload-only share folder works
Given using <dav-path> DAV path
And user "Brian" has been created with default attributes and skeleton files
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created a share with settings
Expand All @@ -91,6 +93,7 @@ Feature: sharing
@smokeTest
Scenario Outline: Uploading file to a user read/write share folder works
Given using <dav-path> DAV path
And user "Brian" has been created with default attributes and skeleton files
And user "Alice" has created a share with settings
| path | FOLDER |
| shareType | user |
Expand All @@ -113,6 +116,7 @@ Feature: sharing

Scenario Outline: Uploading file to a group read/write share folder works
Given using <dav-path> DAV path
And user "Brian" has been created with default attributes and skeleton files
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created a share with settings
Expand All @@ -137,6 +141,7 @@ Feature: sharing
@smokeTest
Scenario Outline: Check quota of owners parent directory of a shared file
Given using <dav-path> DAV path
And user "Brian" has been created with default attributes and skeleton files
And the quota of user "Brian" has been set to "0"
And user "Alice" has moved file "/welcome.txt" to "/myfile.txt"
And user "Alice" has shared file "myfile.txt" with user "Brian"
Expand All @@ -159,6 +164,7 @@ Feature: sharing

Scenario Outline: Uploading to a user shared folder with read/write permission when the sharer has unsufficient quota does not work
Given using <dav-path> DAV path
And user "Brian" has been created with default attributes and skeleton files
And user "Alice" has created a share with settings
| path | FOLDER |
| shareType | user |
Expand All @@ -177,6 +183,7 @@ Feature: sharing

Scenario Outline: Uploading to a group shared folder with read/write permission when the sharer has unsufficient quota does not work
Given using <dav-path> DAV path
And user "Brian" has been created with default attributes and skeleton files
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created a share with settings
Expand All @@ -197,6 +204,7 @@ Feature: sharing

Scenario Outline: Uploading to a user shared folder with upload-only permission when the sharer has insufficient quota does not work
Given using <dav-path> DAV path
And user "Brian" has been created with default attributes and skeleton files
And user "Alice" has created a share with settings
| path | FOLDER |
| shareType | user |
Expand All @@ -215,6 +223,7 @@ Feature: sharing

Scenario Outline: Uploading to a group shared folder with upload-only permission when the sharer has insufficient quota does not work
Given using <dav-path> DAV path
And user "Brian" has been created with default attributes and skeleton files
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created a share with settings
Expand All @@ -235,6 +244,7 @@ Feature: sharing

Scenario: Uploading a file in to a shared folder without edit permissions
Given using new DAV path
And user "Brian" has been created with default attributes and skeleton files
And user "Alice" creates folder "/READ_ONLY" using the WebDAV API
And user "Alice" has created a share with settings
| path | /READ_ONLY |
Expand All @@ -249,36 +259,20 @@ Feature: sharing
Then the HTTP status code should be "403"
And as "Alice" file "/FOLDER/myfile.txt" should not exist

Scenario Outline: Sharer can download file uploaded with read/write permission by sharee to a shared folder
Given using <dav-path> DAV path
And user "Alice" has created a share with settings
| path | FOLDER |
| shareType | user |
| permissions | change |
| shareWith | Brian |
And user "Brian" has accepted share "/FOLDER" offered by user "Alice"
And user "Brian" has uploaded file with content "some content" to "/Shares/FOLDER/textFile.txt"
When user "Alice" downloads file "/FOLDER/textFile.txt" using the WebDAV API
Then the HTTP status code should be "200"
And the downloaded content should be "some content"
Examples:
| dav-path |
| old |
| new |

Scenario Outline: Sharer can download file uploaded with upload-only permission by sharee to a shared folder
Scenario Outline: Sharer can download file uploaded with different permission by sharee to a shared folder
Given using <dav-path> DAV path
And user "Brian" has been created with default attributes and skeleton files
And user "Alice" has created a share with settings
| path | FOLDER |
| shareType | user |
| permissions | create |
| shareWith | Brian |
| path | FOLDER |
| shareType | user |
| permissions | <permissions> |
| shareWith | Brian |
And user "Brian" has accepted share "/FOLDER" offered by user "Alice"
And user "Brian" has uploaded file with content "some content" to "/Shares/FOLDER/textFile.txt"
When user "Alice" downloads file "/FOLDER/textFile.txt" using the WebDAV API
When user "Brian" uploads file with content "some content" to "/Shares/FOLDER/textFile.txt" using the WebDAV API
And user "Alice" downloads file "/FOLDER/textFile.txt" using the WebDAV API
Then the HTTP status code should be "200"
And the downloaded content should be "some content"
Examples:
| dav-path |
| old |
| new |
| dav-path | permissions |
| old | change |
| new | create |
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ Feature: sharing
When user "Alice" deletes file "/FOLDER/textFile.txt" using the WebDAV API
Then the HTTP status code should be "204"
And as "Brian" file "/Shares/FOLDER/textFile.txt" should not exist
And as "Alice" file "/textFile.txt" should not exist
Examples:
| dav-path |
| old |
Expand Down

0 comments on commit f9efe76

Please sign in to comment.