Refactor the syntax of the scenarios in local API tests

This commit is contained in:
Swikriti Tripathi
2023-04-20 15:32:15 +05:45
parent 53419c9f2b
commit 7db5b86bd4
49 changed files with 528 additions and 463 deletions
@@ -1,5 +1,8 @@
@api @skipOnOcV10
Feature: sharing
As a user
I want to share resources with different permissions
So that I can manage the access to the resource
Background:
Given using OCS API version "1"
@@ -10,7 +13,7 @@ Feature: sharing
And using spaces DAV path
Scenario: Correct webdav share-permissions for received file with edit and reshare permissions
Scenario: correct webdav share-permissions for received file with edit and reshare permissions
Given user "Alice" has uploaded file with content "foo" to "/tmp.txt"
And user "Alice" has shared file "/tmp.txt" with user "Brian"
And user "Brian" has accepted share "/tmp.txt" offered by user "Alice"
@@ -21,7 +24,7 @@ Feature: sharing
And the single response should contain a property "ocs:share-permissions" with value "19"
Scenario: Correct webdav share-permissions for received group shared file with edit and reshare permissions
Scenario: correct webdav share-permissions for received group shared file with edit and reshare permissions
Given group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has uploaded file with content "foo" to "/tmp.txt"
@@ -38,7 +41,7 @@ Feature: sharing
And the single response should contain a property "ocs:share-permissions" with value "19"
Scenario: Correct webdav share-permissions for received file with edit permissions but no reshare permissions
Scenario: correct webdav share-permissions for received file with edit permissions but no reshare permissions
Given user "Alice" has uploaded file with content "foo" to "/tmp.txt"
And user "Alice" has shared file "tmp.txt" with user "Brian"
And user "Brian" has accepted share "/tmp.txt" offered by user "Alice"
@@ -48,7 +51,7 @@ Feature: sharing
And as user "Brian" file "/tmp.txt" inside space "Shares" should contain a property "ocs:share-permissions" with value "3"
Scenario: Correct webdav share-permissions for received group shared file with edit permissions but no reshare permissions
Scenario: correct webdav share-permissions for received group shared file with edit permissions but no reshare permissions
Given group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has uploaded file with content "foo" to "/tmp.txt"
@@ -65,7 +68,7 @@ Feature: sharing
And the single response should contain a property "ocs:share-permissions" with value "3"
Scenario: Correct webdav share-permissions for received file with reshare permissions but no edit permissions
Scenario: correct webdav share-permissions for received file with reshare permissions but no edit permissions
Given user "Alice" has uploaded file with content "foo" to "/tmp.txt"
And user "Alice" has shared file "tmp.txt" with user "Brian"
And user "Brian" has accepted share "/tmp.txt" offered by user "Alice"
@@ -75,7 +78,7 @@ Feature: sharing
And as user "Brian" file "/tmp.txt" inside space "Shares" should contain a property "ocs:share-permissions" with value "17"
Scenario: Correct webdav share-permissions for received group shared file with reshare permissions but no edit permissions
Scenario: correct webdav share-permissions for received group shared file with reshare permissions but no edit permissions
Given group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has uploaded file with content "foo" to "/tmp.txt"
@@ -92,7 +95,7 @@ Feature: sharing
And the single response should contain a property "ocs:share-permissions" with value "17"
Scenario: Correct webdav share-permissions for received folder with all permissions
Scenario: correct webdav share-permissions for received folder with all permissions
Given user "Alice" has created folder "/tmp"
And user "Alice" has shared file "/tmp" with user "Brian"
And user "Brian" has accepted share "/tmp" offered by user "Alice"
@@ -103,7 +106,7 @@ Feature: sharing
And the single response should contain a property "ocs:share-permissions" with value "31"
Scenario: Correct webdav share-permissions for received group shared folder with all permissions
Scenario: correct webdav share-permissions for received group shared folder with all permissions
Given group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "/tmp"
@@ -119,7 +122,7 @@ Feature: sharing
And the single response should contain a property "ocs:share-permissions" with value "31"
Scenario: Correct webdav share-permissions for received folder with all permissions but edit
Scenario: correct webdav share-permissions for received folder with all permissions but edit
Given user "Alice" has created folder "/tmp"
And user "Alice" has shared file "/tmp" with user "Brian"
And user "Brian" has accepted share "/tmp" offered by user "Alice"
@@ -129,7 +132,7 @@ Feature: sharing
And as user "Brian" folder "/tmp" inside space "Shares" should contain a property "ocs:share-permissions" with value "29"
Scenario: Correct webdav share-permissions for received group shared folder with all permissions but edit
Scenario: correct webdav share-permissions for received group shared folder with all permissions but edit
Given group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "/tmp"
@@ -139,24 +142,24 @@ Feature: sharing
| shareWith | grp1 |
| permissions | share,delete,create,read |
And user "Brian" has accepted share "/tmp" offered by user "Alice"
When user "Brian" gets the following properties of folder "/tmp" inside space "Shares" using the WebDAV API
When user "Brian" gets the following properties of folder "/tmp" inside space "Shares" using the WebDAV API
| propertyName |
| ocs:share-permissions |
Then the HTTP status code should be "200"
And the single response should contain a property "ocs:share-permissions" with value "29"
Scenario: Correct webdav share-permissions for received folder with all permissions but create
Scenario: correct webdav share-permissions for received folder with all permissions but create
Given user "Alice" has created folder "/tmp"
And user "Alice" has shared file "/tmp" with user "Brian"
And user "Brian" has accepted share "/tmp" offered by user "Alice"
When user "Alice" updates the last share using the sharing API with
| permissions | share,delete,update,read |
Then the HTTP status code should be "200"
And as user "Brian" folder "/tmp" inside space "Shares" should contain a property "ocs:share-permissions" with value "27"
And as user "Brian" folder "/tmp" inside space "Shares" should contain a property "ocs:share-permissions" with value "27"
Scenario: Correct webdav share-permissions for received group shared folder with all permissions but create
Scenario: correct webdav share-permissions for received group shared folder with all permissions but create
Given group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "/tmp"
@@ -173,7 +176,7 @@ Feature: sharing
And the single response should contain a property "ocs:share-permissions" with value "27"
Scenario: Correct webdav share-permissions for received folder with all permissions but delete
Scenario: correct webdav share-permissions for received folder with all permissions but delete
Given user "Alice" has created folder "/tmp"
And user "Alice" has shared file "/tmp" with user "Brian"
And user "Brian" has accepted share "/tmp" offered by user "Alice"
@@ -183,7 +186,7 @@ Feature: sharing
And as user "Brian" folder "/tmp" inside space "Shares" should contain a property "ocs:share-permissions" with value "23"
Scenario: Correct webdav share-permissions for received group shared folder with all permissions but delete
Scenario: correct webdav share-permissions for received group shared folder with all permissions but delete
Given group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "/tmp"
@@ -200,7 +203,7 @@ Feature: sharing
And the single response should contain a property "ocs:share-permissions" with value "23"
Scenario: Correct webdav share-permissions for received folder with all permissions but share
Scenario: correct webdav share-permissions for received folder with all permissions but share
Given user "Alice" has created folder "/tmp"
And user "Alice" has shared file "/tmp" with user "Brian"
And user "Brian" has accepted share "/tmp" offered by user "Alice"
@@ -210,7 +213,7 @@ Feature: sharing
And as user "Brian" folder "/tmp" inside space "Shares" should contain a property "ocs:share-permissions" with value "15"
Scenario: Correct webdav share-permissions for received group shared folder with all permissions but share
Scenario: correct webdav share-permissions for received group shared folder with all permissions but share
Given group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "/tmp"
@@ -227,7 +230,7 @@ Feature: sharing
And the single response should contain a property "ocs:share-permissions" with value "15"
Scenario: Uploading a file to a folder received as a read-only group share
Scenario: uploading a file to a folder received as a read-only group share
Given group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "FOLDER"
@@ -242,7 +245,7 @@ Feature: sharing
And as "Alice" file "/FOLDER/textfile.txt" should not exist
Scenario: Uploading a file to a folder received as a upload-only user share
Scenario: uploading a file to a folder received as a upload-only user share
Given user "Alice" has created folder "FOLDER"
And user "Alice" has created a share with settings
| path | FOLDER |
@@ -255,12 +258,12 @@ Feature: sharing
And the following headers should match these regular expressions for user "Brian"
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
And the content of file "/FOLDER/textfile.txt" for user "Alice" should be:
"""
new description
"""
"""
new description
"""
Scenario: Uploading a file to a folder received as a upload-only group share
Scenario: uploading a file to a folder received as a upload-only group share
Given group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "FOLDER"
@@ -275,12 +278,12 @@ Feature: sharing
And the following headers should match these regular expressions for user "Brian"
| ETag | /^"[a-f0-9:\.]{1,32}"$/ |
And the content of file "/FOLDER/textfile.txt" for user "Alice" should be:
"""
new description
"""
"""
new description
"""
Scenario: Uploading a file to a folder received as a read/write user share
Scenario: uploading a file to a folder received as a read/write user share
Given user "Alice" has created folder "FOLDER"
And user "Alice" has created a share with settings
| path | FOLDER |
@@ -291,12 +294,12 @@ Feature: sharing
When user "Brian" uploads a file inside space "Shares" with content "new description" to "/FOLDER/textfile.txt" using the WebDAV API
Then the HTTP status code should be "201"
And the content of file "/FOLDER/textfile.txt" for user "Alice" should be:
"""
new description
"""
"""
new description
"""
Scenario: Uploading a file to a folder received as a read/write group share
Scenario: uploading a file to a folder received as a read/write group share
Given group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "FOLDER"
@@ -309,12 +312,12 @@ Feature: sharing
When user "Brian" uploads a file inside space "Shares" with content "new description" to "/FOLDER/textfile.txt" using the WebDAV API
Then the HTTP status code should be "201"
And the content of file "/FOLDER/textfile.txt" for user "Alice" should be:
"""
new description
"""
"""
new description
"""
Scenario: Uploading to a user shared folder with read/write permission when the sharer has insufficient quota
Scenario: uploading to a user shared folder with read/write permission when the sharer has insufficient quota
Given user "Alice" has created folder "FOLDER"
And user "Alice" has created a share with settings
| path | FOLDER |
@@ -328,7 +331,7 @@ Feature: sharing
And as "Alice" file "/FOLDER/textfile.txt" should not exist
Scenario: Uploading to a user shared folder with upload-only permission when the sharer has insufficient quota
Scenario: uploading to a user shared folder with upload-only permission when the sharer has insufficient quota
Given user "Alice" has created folder "FOLDER"
And user "Alice" has created a share with settings
| path | FOLDER |
@@ -342,7 +345,7 @@ Feature: sharing
And as "Alice" file "/FOLDER/textfile.txt" should not exist
Scenario: Uploading a file to a group shared folder with upload-only permission when the sharer has insufficient quota
Scenario: uploading a file to a group shared folder with upload-only permission when the sharer has insufficient quota
Given group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "FOLDER"
@@ -358,7 +361,7 @@ Feature: sharing
And as "Alice" file "/FOLDER/textfile.txt" should not exist
Scenario Outline: Sharer can download file uploaded with different permission by sharee to a shared folder
Scenario Outline: sharer can download file uploaded with different permission by sharee to a shared folder
Given user "Alice" has created folder "FOLDER"
And user "Alice" has created a share with settings
| path | FOLDER |
@@ -370,7 +373,7 @@ Feature: sharing
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:
Examples:
| permissions |
| change |
| create |