From e5a43d83bc5027c90c26860c39067ffc71d71445 Mon Sep 17 00:00:00 2001 From: Jasmine Baral Date: Mon, 7 Jun 2021 14:15:16 +0545 Subject: [PATCH] different response checker --- .../createPublicLinkShare.feature | 101 ++++++++++++------ 1 file changed, 67 insertions(+), 34 deletions(-) diff --git a/tests/acceptance/features/apiSharePublicLink1/createPublicLinkShare.feature b/tests/acceptance/features/apiSharePublicLink1/createPublicLinkShare.feature index 538181ff1a33..f44983bc5b86 100644 --- a/tests/acceptance/features/apiSharePublicLink1/createPublicLinkShare.feature +++ b/tests/acceptance/features/apiSharePublicLink1/createPublicLinkShare.feature @@ -5,7 +5,7 @@ Feature: create a public link share Background: Given user "Alice" has been created with default attributes and without skeleton files - @smokeTest @issue-ocis-2079 + @smokeTest Scenario Outline: A new public link share of a file using the default permissions only grants read access using the public WebDAV API Given using OCS API version "" And user "Alice" has uploaded file with content "Random data" to "/randomfile.txt" @@ -29,7 +29,7 @@ Feature: create a public link share Then the downloaded content should be "Random dat" And the public upload to the last publicly shared file using the public WebDAV API should fail with HTTP status code "403" - @notToImplementOnOCIS + @notToImplementOnOCIS @issue-ocis-2079 Examples: | ocs_api_version | ocs_status_code | webDavApi | | 1 | 100 | old | @@ -41,9 +41,8 @@ Feature: create a public link share | 1 | 100 | new | | 2 | 200 | new | - - @smokeTest @issue-ocis-2079 - Scenario Outline: Creating a new public link share of a file with password using the public WebDAV API + @smokeTest @notToImplementOnOCIS @issue-ocis-2079 + Scenario Outline: Creating a new public link share of a file with password using the old public WebDAV API Given using OCS API version "" And user "Alice" has uploaded file with content "Random data" to "/randomfile.txt" When user "Alice" creates a public link share using the sharing API with settings @@ -63,24 +62,48 @@ Feature: create a public link share | uid_file_owner | %username% | | uid_owner | %username% | | name | | - And the public should be able to download the last publicly shared file using the public WebDAV API with password "%public%" and the content should be "Random data" + And the public should be able to download the last publicly shared file using the old public WebDAV API with password "%public%" and the content should be "Random data" And the HTTP status code should be "200" - And the public download of the last publicly shared file using the public WebDAV API with password "%regular%" should fail with HTTP status code "401" + And the public download of the last publicly shared file using the old public WebDAV API with password "%regular%" should fail with HTTP status code "401" And the value of the item "//s:message" in the response should be "Cannot authenticate over ajax calls" - And the public download of the last publicly shared file using the public WebDAV API without a password should fail with HTTP status code "401" + And the public download of the last publicly shared file using the old public WebDAV API without a password should fail with HTTP status code "401" And the value of the item "//s:message" in the response should be "Cannot authenticate over ajax calls" - - @notToImplementOnOCIS Examples: - | ocs_api_version | ocs_status_code | webDavApi | - | 1 | 100 | old | - | 2 | 200 | old | + | ocs_api_version | ocs_status_code | + | 1 | 100 | + | 2 | 200 | - @issue-ocis-reva-199 + @smokeTest @issue-ocis-reva-199 + Scenario Outline: Creating a new public link share of a file with password using the new public WebDAV API + Given using OCS API version "" + And user "Alice" has uploaded file with content "Random data" to "/randomfile.txt" + When user "Alice" creates a public link share using the sharing API with settings + | path | randomfile.txt | + | password | %public% | + Then the OCS status code should be "" + And the HTTP status code should be "200" + And the fields of the last response to user "Alice" should include + | item_type | file | + | mimetype | text/plain | + | file_target | /randomfile.txt | + | path | /randomfile.txt | + | permissions | read | + | share_type | public_link | + | displayname_file_owner | %displayname% | + | displayname_owner | %displayname% | + | uid_file_owner | %username% | + | uid_owner | %username% | + | name | | + And the public should be able to download the last publicly shared file using the new public WebDAV API with password "%public%" and the content should be "Random data" + And the HTTP status code should be "200" + And the public download of the last publicly shared file using the new public WebDAV API with password "%regular%" should fail with HTTP status code "401" + And the value of the item "//s:message" in the response should match "/Username or password was incorrect/" + And the public download of the last publicly shared file using the new public WebDAV API without a password should fail with HTTP status code "401" + And the value of the item "//s:message" in the response should match "/No 'Authorization: Basic' header found/" Examples: - | ocs_api_version | ocs_status_code | webDavApi | - | 1 | 100 | new | - | 2 | 200 | new | + | ocs_api_version | ocs_status_code | + | 1 | 100 | + | 2 | 200 | Scenario Outline: Trying to create a new public link share of a file with edit permissions only grants read access using the public WebDAV API @@ -220,6 +243,7 @@ Feature: create a public link share | 1 | 100 | | 2 | 200 | + Scenario Outline: Getting the share information of passwordless public-links hides credential placeholders Given using OCS API version "" And user "Alice" has uploaded file with content "Random data" to "/randomfile.txt" @@ -237,7 +261,6 @@ Feature: create a public link share And the fields of the last response should not include | share_with | ANY_VALUE | | share_with_displayname | ANY_VALUE | - Examples: | ocs_api_version | ocs_status_code | | 1 | 100 | @@ -374,24 +397,25 @@ Feature: create a public link share And the HTTP status code should be "" And the public upload to the last publicly shared folder using the public WebDAV API should fail with HTTP status code "403" - @notToImplementOnOCIS @issue-ocis-2079 + @notToImplementOnOCIS @issue-ocis-2079 Examples: - | ocs_api_version | ocs_status_code | http_status_code | permission | webDavApi| - | 1 | 100 | 200 | create | old | - | 2 | 200 | 200 | create | old | - | 1 | 100 | 200 | create,read,update | old | - | 2 | 200 | 200 | create,read,update | old | - | 1 | 100 | 200 | read,create,update,delete | old | - | 2 | 200 | 200 | read,create,update,delete | old | + | ocs_api_version | ocs_status_code | http_status_code | permission | webDavApi | + | 1 | 100 | 200 | create | old | + | 2 | 200 | 200 | create | old | + | 1 | 100 | 200 | create,read,update | old | + | 2 | 200 | 200 | create,read,update | old | + | 1 | 100 | 200 | read,create,update,delete | old | + | 2 | 200 | 200 | read,create,update,delete | old | + Examples: - | ocs_api_version | ocs_status_code | http_status_code | permission | webDavApi| - | 1 | 100 | 200 | create | new | - | 2 | 200 | 200 | create | new | - | 1 | 100 | 200 | create,read,update | new | - | 2 | 200 | 200 | create,read,update | new | - | 1 | 100 | 200 | read,create,update,delete | new | - | 2 | 200 | 200 | read,create,update,delete | new | + | ocs_api_version | ocs_status_code | http_status_code | permission | webDavApi | + | 1 | 100 | 200 | create | new | + | 2 | 200 | 200 | create | new | + | 1 | 100 | 200 | create,read,update | new | + | 2 | 200 | 200 | create,read,update | new | + | 1 | 100 | 200 | read,create,update,delete | new | + | 2 | 200 | 200 | read,create,update,delete | new | @issue-ocis-reva-41 Scenario Outline: Creating a link share with read+update+create permissions defaults to read permissions when public upload is disabled globally and accessing using the public webDAV API @@ -415,6 +439,7 @@ Feature: create a public link share | 1 | 100 | old | | 2 | 200 | old | + Examples: | ocs_api_version | ocs_status_code | webDavApi | | 1 | 100 | new | @@ -436,6 +461,7 @@ Feature: create a public link share | 1 | 403 | 200 | | 2 | 403 | 403 | + Scenario Outline: Creating a link share with edit permissions keeps it using the public WebDAV API Given using OCS API version "" And user "Alice" has created folder "/afolder" @@ -456,6 +482,7 @@ Feature: create a public link share | 1 | 100 | old | | 2 | 200 | old | + Examples: | ocs_api_version | ocs_status_code | webDavApi | | 1 | 100 | new | @@ -482,6 +509,7 @@ Feature: create a public link share | 1 | 100 | old | | 2 | 200 | old | + Examples: | ocs_api_version | ocs_status_code | webDavApi | | 1 | 100 | new | @@ -529,6 +557,7 @@ Feature: create a public link share | 1 | 100 | old | | 2 | 200 | old | + Examples: | ocs_api_version | ocs_status_code | webDavApi | | 1 | 100 | new | @@ -550,6 +579,7 @@ Feature: create a public link share | 1 | 100 | old | | 2 | 200 | old | + Examples: | ocs_api_version | ocs_status_code | webDavApi | | 1 | 100 | new | @@ -573,6 +603,7 @@ Feature: create a public link share | 1 | 100 | old | | 2 | 200 | old | + Examples: | ocs_api_version | ocs_status_code | webDavApi | | 1 | 100 | new | @@ -615,7 +646,7 @@ Feature: create a public link share | 1 | 100 | 200 | old | | 2 | 200 | 200 | old | - @issue-ocis-2079 + Examples: | ocs_api_version | ocs_status_code | http_status_code | webDavApi | | 1 | 100 | 200 | new | @@ -673,6 +704,7 @@ Feature: create a public link share Then the HTTP status code should be "207" And the size of the file should be "19" + Scenario Outline: Get the mtime of a file shared by public link Given using DAV path And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the WebDAV API @@ -686,6 +718,7 @@ Feature: create a public link share | old | | new | + Scenario Outline: Get the mtime of a file inside a folder shared by public link Given using DAV path And user "Alice" has created folder "testFolder"