From 8c61c630bbec77b3ae9b5cb857aa5adbf794a4db Mon Sep 17 00:00:00 2001 From: Niraj Acharya Date: Tue, 28 Nov 2023 17:04:38 +0545 Subject: [PATCH 1/2] adding test for file version of a share in a projectspace --- .../fileVersionByFileID.feature | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/acceptance/features/apiSpacesDavOperation/fileVersionByFileID.feature b/tests/acceptance/features/apiSpacesDavOperation/fileVersionByFileID.feature index ca9cfa02ecf..ea677949ad0 100644 --- a/tests/acceptance/features/apiSpacesDavOperation/fileVersionByFileID.feature +++ b/tests/acceptance/features/apiSpacesDavOperation/fileVersionByFileID.feature @@ -30,3 +30,34 @@ Feature: checking file versions using file id | editor | | viewer | | all | + + + Scenario Outline: check the file versions of a shared file + Given these users have been created with default attributes and without skeleton files: + | username | + | Alice | + | Brian | + And using spaces DAV path + And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "Project1" with the default quota using the Graph API + And user "Alice" has uploaded a file inside space "Project1" with content "hello world version 1" to "text.txt" + And we save it into "FILEID" + And user "Alice" has uploaded a file inside space "Project1" with content "hello world version 1.1" to "text.txt" + And user "Alice" has shared a space "Project1" with settings: + | shareWith | Brian | + | role | | + # And user "Alice" has created a share inside of space "Project1" with settings: + # | path | text.txt | + # | shareWith | Brian | + # | role | | + And using new DAV path + When user "Alice" gets the number of versions of file "/text.txt" using file-id path "/meta/<>/v" + Then the HTTP status code should be "207" + 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/<>/v" + Then the HTTP status code should be "" + Examples: + | role | status_code| + | editor |207 | + | viewer |403| + | all |207| \ No newline at end of file From 09d4d77c7aac69f9b49ae63109ea2a36d882938c Mon Sep 17 00:00:00 2001 From: Niraj Acharya Date: Thu, 14 Dec 2023 12:56:41 +0545 Subject: [PATCH 2/2] adding test for listing file version of a file inside project space --- .../fileVersionByFileID.feature | 61 +++++++++---------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/tests/acceptance/features/apiSpacesDavOperation/fileVersionByFileID.feature b/tests/acceptance/features/apiSpacesDavOperation/fileVersionByFileID.feature index ea677949ad0..a75c105ac73 100644 --- a/tests/acceptance/features/apiSpacesDavOperation/fileVersionByFileID.feature +++ b/tests/acceptance/features/apiSpacesDavOperation/fileVersionByFileID.feature @@ -3,8 +3,7 @@ Feature: checking file versions using file id I want to share file outside of the space So that other users can access the file - - Scenario Outline: check the file versions of a shared file + Background: Given these users have been created with default attributes and without skeleton files: | username | | Alice | @@ -15,7 +14,10 @@ Feature: checking file versions using file id And user "Alice" has uploaded a file inside space "Project1" with content "hello world version 1" to "text.txt" And we save it into "FILEID" And user "Alice" has uploaded a file inside space "Project1" with content "hello world version 1.1" to "text.txt" - And user "Alice" has created a share inside of space "Project1" with settings: + + + 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: | path | text.txt | | shareWith | Brian | | role | | @@ -26,38 +28,33 @@ Feature: checking file versions using file id When user "Brian" tries to get the number of versions of file "/text.txt" using file-id path "/meta/<>/v" Then the HTTP status code should be "403" Examples: - | role | - | editor | + | role | + | editor | | viewer | | all | - Scenario Outline: check the file versions of a shared file - Given these users have been created with default attributes and without skeleton files: - | username | - | Alice | - | Brian | - And using spaces DAV path - And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API - And user "Alice" has created a space "Project1" with the default quota using the Graph API - And user "Alice" has uploaded a file inside space "Project1" with content "hello world version 1" to "text.txt" - And we save it into "FILEID" - And user "Alice" has uploaded a file inside space "Project1" with content "hello world version 1.1" to "text.txt" - And user "Alice" has shared a space "Project1" with settings: + 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: | shareWith | Brian | | role | | - # And user "Alice" has created a share inside of space "Project1" with settings: - # | path | text.txt | - # | shareWith | Brian | - # | role | | - And using new DAV path - When user "Alice" gets the number of versions of file "/text.txt" using file-id path "/meta/<>/v" - Then the HTTP status code should be "207" - 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/<>/v" - Then the HTTP status code should be "" - Examples: - | role | status_code| - | editor |207 | - | viewer |403| - | all |207| \ No newline at end of file + And using new DAV path + When user "Alice" gets the number of versions of file "/text.txt" using file-id path "/meta/<>/v" + Then the HTTP status code should be "207" + And the number of versions should be "1" + When user "Brian" gets the number of versions of file "/text.txt" using file-id path "/meta/<>/v" + Then the HTTP status code should be "207" + And the number of versions should be "1" + Examples: + | role | + | editor | + | manager | + + + Scenario: check the versions of a file in a shared space as viewer + Given user "Alice" has shared a space "Project1" with settings: + | shareWith | Brian | + | role | viewer | + And using new DAV path + When user "Brian" tries to get the number of versions of file "/text.txt" using file-id path "/meta/<>/v" + Then the HTTP status code should be "403"