Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only] [full-ci] [WIP] More flexible tests for share ids #40095

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -831,10 +831,9 @@ Feature: a default expiration date can be specified for shares with users or gro
| path | /textfile0.txt |
| shareWith | brand-new-group |
| expireDate | +15 days |
And the administrator has expired the last created share using the testing API
And the administrator has expired the last created public link share using the testing API
When the public accesses the preview of file "textfile0.txt" from the last shared public link using the sharing API
Then the HTTP status code should be "404"
And user "Alice" should not see the share id of the last share
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a bit of an unneeded step, IMO. We already know that the share cannot be accessed.
If someone thinks it is needed, then I could implement a step:

And user "Alice" should not see the share id of the last public link share

And as "Alice" file "/textfile0.txt" should exist


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Feature: sharing
And user "Alice" has created folder "PARENT"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/PARENT/parent.txt"
And user "Alice" has shared entry "<entry_to_share>" with group "grp1"
When user "Brian" deletes the last share using the sharing API
When user "Brian" deletes the last share of user "Alice" using the sharing API
Then the OCS status code should be "404"
And the HTTP status code should be "<http_status_code>"
And as "Alice" entry "<entry_to_share>" should exist
Expand All @@ -149,7 +149,7 @@ Feature: sharing
And user "Alice" has created folder "PARENT"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/PARENT/parent.txt"
And user "Alice" has shared entry "<entry_to_share>" with user "Brian"
When user "Brian" deletes the last share using the sharing API
When user "Brian" deletes the last share of user "Alice" using the sharing API
Then the OCS status code should be "404"
And the HTTP status code should be "<http_status_code>"
And as "Alice" entry "<entry_to_share>" should exist
Expand All @@ -165,7 +165,7 @@ Feature: sharing
Given using OCS API version "<ocs_api_version>"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "fileToShare.txt"
And user "Alice" has shared file "fileToShare.txt" with user "Brian"
When user "Brian" tries to delete the last share using the sharing API
When user "Brian" tries to delete the last share of user "Alice" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "<http_status_code>"
Examples:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ Feature: sharing
And user "Alice" has shared entry "<entry_to_share>" with group "grp1"
And user "Brian" has accepted share "<pending_entry>" offered by user "Alice"
And user "Carol" has accepted share "<pending_entry>" offered by user "Alice"
When user "Brian" deletes the last share using the sharing API
When user "Brian" deletes the last share of user "Alice" using the sharing API
Then the OCS status code should be "404"
And the HTTP status code should be "<http_status_code>"
And as "Alice" entry "<entry_to_share>" should exist
Expand Down Expand Up @@ -201,7 +201,7 @@ Feature: sharing
And user "Alice" has moved file "/textfile0.txt" to "/shared/shared_file.txt"
And user "Alice" has shared entry "<entry_to_share>" with user "Brian"
And user "Brian" has accepted share "<pending_entry>" offered by user "Alice"
When user "Brian" deletes the last share using the sharing API
When user "Brian" deletes the last share of user "Alice" using the sharing API
Then the OCS status code should be "404"
And the HTTP status code should be "<http_status_code>"
And as "Alice" entry "<entry_to_share>" should exist
Expand Down Expand Up @@ -242,7 +242,7 @@ Feature: sharing
Given using OCS API version "<ocs_api_version>"
And user "Alice" has shared file "textfile0.txt" with user "Brian"
And user "Brian" has accepted share "/textfile0.txt" offered by user "Alice"
When user "Brian" tries to delete the last share using the sharing API
When user "Brian" tries to delete the last share of user "Alice" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "<http_status_code>"
Examples:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Feature: changing a public link share
Given user "Alice" has created a public link share with settings
| path | /PARENT |
| permissions | <permissions> |
When the public deletes file "parent.txt" from the last public share using the <public-webdav-api-version> public WebDAV API
When the public deletes file "parent.txt" from the last public link share using the <public-webdav-api-version> public WebDAV API
Then the HTTP status code should be "<http-status-code>"
And as "Alice" file "PARENT/parent.txt" <should-or-not> exist

Expand All @@ -35,7 +35,7 @@ Feature: changing a public link share
Given user "Alice" has created a public link share with settings
| path | /PARENT |
| permissions | read,update,create |
When the public renames file "parent.txt" to "newparent.txt" from the last public share using the <public-webdav-api-version> public WebDAV API
When the public renames file "parent.txt" to "newparent.txt" from the last public link share using the <public-webdav-api-version> public WebDAV API
Then the HTTP status code should be "403"
And as "Alice" file "/PARENT/parent.txt" should exist
And as "Alice" file "/PARENT/newparent.txt" should not exist
Expand All @@ -55,7 +55,7 @@ Feature: changing a public link share
Given user "Alice" has created a public link share with settings
| path | /PARENT |
| permissions | read,update,create,delete |
When the public renames file "parent.txt" to "newparent.txt" from the last public share using the <public-webdav-api-version> public WebDAV API
When the public renames file "parent.txt" to "newparent.txt" from the last public link share using the <public-webdav-api-version> public WebDAV API
Then the HTTP status code should be "201"
And as "Alice" file "/PARENT/parent.txt" should not exist
And as "Alice" file "/PARENT/newparent.txt" should exist
Expand Down Expand Up @@ -114,7 +114,7 @@ Feature: changing a public link share
| path | /PARENT |
| permissions | change |
| password | newpasswd |
When the public deletes file "parent.txt" from the last public share using the password "invalid" and <public-webdav-api-version> public WebDAV API
When the public deletes file "parent.txt" from the last public link share using the password "invalid" and <public-webdav-api-version> public WebDAV API
Then the HTTP status code should be "401"
And as "Alice" file "PARENT/parent.txt" should exist

Expand All @@ -134,7 +134,7 @@ Feature: changing a public link share
| path | /PARENT |
| permissions | change |
| password | newpasswd |
When the public deletes file "parent.txt" from the last public share using the password "newpasswd" and <public-webdav-api-version> public WebDAV API
When the public deletes file "parent.txt" from the last public link share using the password "newpasswd" and <public-webdav-api-version> public WebDAV API
Then the HTTP status code should be "204"
And as "Alice" file "PARENT/parent.txt" should not exist

Expand All @@ -154,7 +154,7 @@ Feature: changing a public link share
| path | /PARENT |
| permissions | change |
| password | newpasswd |
When the public renames file "parent.txt" to "newparent.txt" from the last public share using the password "invalid" and <public-webdav-api-version> public WebDAV API
When the public renames file "parent.txt" to "newparent.txt" from the last public link share using the password "invalid" and <public-webdav-api-version> public WebDAV API
Then the HTTP status code should be "401"
And as "Alice" file "/PARENT/newparent.txt" should not exist
And as "Alice" file "/PARENT/parent.txt" should exist
Expand All @@ -175,7 +175,7 @@ Feature: changing a public link share
| path | /PARENT |
| permissions | change |
| password | newpasswd |
When the public renames file "parent.txt" to "newparent.txt" from the last public share using the password "newpasswd" and <public-webdav-api-version> public WebDAV API
When the public renames file "parent.txt" to "newparent.txt" from the last public link share using the password "newpasswd" and <public-webdav-api-version> public WebDAV API
Then the HTTP status code should be "201"
And as "Alice" file "/PARENT/newparent.txt" should exist
And as "Alice" file "/PARENT/parent.txt" should not exist
Expand Down Expand Up @@ -235,7 +235,7 @@ Feature: changing a public link share
Given user "Alice" has created a public link share with settings
| path | /PARENT |
| permissions | uploadwriteonly |
When the public renames file "parent.txt" to "newparent.txt" from the last public share using the <public-webdav-api-version> public WebDAV API
When the public renames file "parent.txt" to "newparent.txt" from the last public link share using the <public-webdav-api-version> public WebDAV API
Then the HTTP status code should be "403"
And as "Alice" file "/PARENT/parent.txt" should exist
And as "Alice" file "/PARENT/newparent.txt" should not exist
Expand All @@ -255,7 +255,7 @@ Feature: changing a public link share
Given user "Alice" has created a public link share with settings
| path | /PARENT |
| permissions | uploadwriteonly |
When the public deletes file "parent.txt" from the last public share using the <public-webdav-api-version> public WebDAV API
When the public deletes file "parent.txt" from the last public link share using the <public-webdav-api-version> public WebDAV API
Then the HTTP status code should be "403"
And as "Alice" file "PARENT/parent.txt" should exist

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Feature: create a public link share
| uid_file_owner | %username% |
| uid_owner | %username% |
| name | |
When the public downloads the last public shared file using the <public-webdav-api-version> public WebDAV API
When the public downloads the last public link shared file using the <public-webdav-api-version> public WebDAV API
Then the downloaded content should be "Random data"
And the public upload to the last publicly shared file using the <public-webdav-api-version> public WebDAV API should fail with HTTP status code "403"

Expand Down Expand Up @@ -162,7 +162,7 @@ Feature: create a public link share
| uid_file_owner | %username% |
| uid_owner | %username% |
| name | |
When the public downloads file "/randomfile.txt" from inside the last public shared folder using the <public-webdav-api-version> public WebDAV API
When the public downloads file "/randomfile.txt" from inside the last public link shared folder using the <public-webdav-api-version> public WebDAV API
Then the downloaded content should be "Random data"
And the public upload to the last publicly shared folder using the <public-webdav-api-version> public WebDAV API should fail with HTTP status code "403"

Expand Down Expand Up @@ -201,10 +201,10 @@ Feature: create a public link share
| uid_file_owner | %username% |
| uid_owner | %username% |
| name | |
And the public should be able to download file "/randomfile.txt" from inside the last public shared folder using the <public-webdav-api-version> public WebDAV API with password "%public%"
And the public should be able to download file "/randomfile.txt" from inside the last public link shared folder using the <public-webdav-api-version> public WebDAV API with password "%public%"
And the downloaded content should be "Random data"
But the public should not be able to download file "/randomfile.txt" from inside the last public shared folder using the <public-webdav-api-version> public WebDAV API without a password
And the public should not be able to download file "/randomfile.txt" from inside the last public shared folder using the <public-webdav-api-version> public WebDAV API with password "%regular%"
But the public should not be able to download file "/randomfile.txt" from inside the last public link shared folder using the <public-webdav-api-version> public WebDAV API without a password
And the public should not be able to download file "/randomfile.txt" from inside the last public link shared folder using the <public-webdav-api-version> public WebDAV API with password "%regular%"

@notToImplementOnOCIS @issue-ocis-2079
Examples:
Expand Down Expand Up @@ -331,7 +331,7 @@ Feature: create a public link share
| path | /afolder |
| permissions | read |
And parameter "shareapi_allow_public_upload" of app "core" has been set to "no"
When user "Alice" tries to update the last share using the sharing API with
When user "Alice" tries to update the last public link share using the sharing API with
| permissions | read,create |
Then the OCS status code should be "<ocs_status_code>"

Expand Down Expand Up @@ -461,7 +461,7 @@ Feature: create a public link share
| uid_file_owner | %username% |
| uid_owner | %username% |
| name | |
And the public should be able to download file "/randomfile.txt" from inside the last public shared folder using the <public-webdav-api-version> public WebDAV API
And the public should be able to download file "/randomfile.txt" from inside the last public link shared folder using the <public-webdav-api-version> public WebDAV API
And the downloaded content should be "Random data"
And the public upload to the last publicly shared folder using the <public-webdav-api-version> public WebDAV API should fail with HTTP status code "403"

Expand Down Expand Up @@ -508,7 +508,7 @@ Feature: create a public link share
| path | /aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the public should be able to download file "/randomfile.txt" from inside the last public shared folder using the <public-webdav-api-version> public WebDAV API
And the public should be able to download file "/randomfile.txt" from inside the last public link shared folder using the <public-webdav-api-version> public WebDAV API
And the downloaded content should be "Random data"

@notToImplementOnOCIS @issue-ocis-2079
Expand Down Expand Up @@ -541,7 +541,7 @@ Feature: create a public link share
| permissions | read |
| uid_owner | %username% |
| expiration | +7 days |
When user "Alice" gets the info of the last share using the sharing API
When user "Alice" gets the info of the last public link share using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "<http_status_code>"
And the fields of the last response to user "Alice" should include
Expand Down Expand Up @@ -574,7 +574,7 @@ Feature: create a public link share
| path | PARENT |
| permissions | read |
When user "Alice" deletes folder "PARENT" using the WebDAV API
And the public download of file "/parent.txt" from inside the last public shared folder using the <public-webdav-api-version> public WebDAV API should fail with HTTP status code "404"
And the public download of file "/parent.txt" from inside the last public link shared folder using the <public-webdav-api-version> public WebDAV API should fail with HTTP status code "404"

@notToImplementOnOCIS @issue-ocis-2079
Examples:
Expand All @@ -593,7 +593,7 @@ Feature: create a public link share
And user "Alice" has created a public link share with settings
| path | PARENT |
| permissions | uploadwriteonly |
When the public downloads file "parent.txt" from inside the last public shared folder using the <public-webdav-api-version> public WebDAV API
When the public downloads file "parent.txt" from inside the last public link shared folder using the <public-webdav-api-version> public WebDAV API
Then the value of the item "//s:message" in the response should be "<response>"
And the HTTP status code should be "404"

Expand Down Expand Up @@ -652,7 +652,7 @@ Feature: create a public link share
And user "Alice" has created a public link share with settings
| path | /testFolder |
| permissions | read,update,create,delete |
When the public uploads file "file.txt" to the last shared folder with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the new public WebDAV API
When the public uploads file "file.txt" to the last public link shared folder with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the new public WebDAV API
Then the HTTP status code should be "201"
And as "Alice" file "testFolder/file.txt" should exist
And as "Alice" the mtime of the file "testFolder/file.txt" should be "Thu, 08 Aug 2019 04:18:13 GMT"
Expand All @@ -665,7 +665,7 @@ Feature: create a public link share
And user "Alice" creates a public link share using the sharing API with settings
| path | /testFolder |
| permissions | read,update,create,delete |
And the public uploads file "file.txt" to the last shared folder with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the new public WebDAV API
And the public uploads file "file.txt" to the last public link shared folder with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the new public WebDAV API
Then the HTTP status code should be "204"
And as "Alice" file "/testFolder/file.txt" should exist
And as "Alice" the mtime of the file "testFolder/file.txt" should be "Thu, 08 Aug 2019 04:18:13 GMT"
Expand All @@ -684,7 +684,7 @@ Feature: create a public link share
| path | /textfile0.txt |
| name | link2 |
| expireDateAsString | +5 days |
And the administrator expires the last created share using the testing API
And the administrator expires the last created public link share using the testing API
Then the HTTP status code should be "<http_status_code>"
When user "Alice" gets all the shares from the file "textfile0.txt" using the sharing API
Then the HTTP status code should be "<http_status_code>"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Feature: create a public link share

@issue-37605
Scenario: Get the mtime of a file inside a folder shared by public link using new webDAV version
When the public uploads file "file.txt" to the last shared folder with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the new public WebDAV API
When the public uploads file "file.txt" to the last public link shared folder with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the new public WebDAV API
Then the HTTP status code should be "201"
And as "Alice" file "testFolder/file.txt" should exist
And as "Alice" the mtime of the file "testFolder/file.txt" should not be "Thu, 08 Aug 2019 04:18:13 GMT"
Expand All @@ -22,7 +22,7 @@ Feature: create a public link share
@issue-37605
Scenario: overwriting a file changes its mtime (new public webDAV API)
Given user "Alice" has uploaded file with content "uploaded content for file name ending with a dot" to "testFolder/file.txt"
When the public uploads file "file.txt" to the last shared folder with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the new public WebDAV API
When the public uploads file "file.txt" to the last public link shared folder with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the new public WebDAV API
Then the HTTP status code should be "204"
And as "Alice" file "/testFolder/file.txt" should exist
And as "Alice" the mtime of the file "testFolder/file.txt" should not be "Thu, 08 Aug 2019 04:18:13 GMT"
Expand Down
Loading