Skip to content

Commit

Permalink
different response checker
Browse files Browse the repository at this point in the history
  • Loading branch information
jasson99 committed Jun 7, 2021
1 parent c8b7f05 commit f196e91
Showing 1 changed file with 59 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<ocs_api_version>"
And user "Alice" has uploaded file with content "Random data" to "/randomfile.txt"
Expand All @@ -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 <webDavApi> 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 |
Expand All @@ -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 "<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
Expand All @@ -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 <webDavApi> 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 <webDavApi> 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 <webDavApi> 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 "<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 "<ocs_status_code>"
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
Expand Down Expand Up @@ -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 "<ocs_api_version>"
And user "Alice" has uploaded file with content "Random data" to "/randomfile.txt"
Expand Down Expand Up @@ -374,24 +398,24 @@ Feature: create a public link share
And the HTTP status code should be "<http_status_code>"
And the public upload to the last publicly shared folder using the <webDavApi> 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
Expand Down Expand Up @@ -436,6 +460,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 "<ocs_api_version>"
And user "Alice" has created folder "/afolder"
Expand Down Expand Up @@ -615,7 +640,6 @@ 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 |
Expand Down Expand Up @@ -673,6 +697,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_version> 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
Expand All @@ -686,6 +711,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_version> DAV path
And user "Alice" has created folder "testFolder"
Expand Down

0 comments on commit f196e91

Please sign in to comment.