Skip to content

Commit

Permalink
Improved then step to suite apiSharePublicLink1
Browse files Browse the repository at this point in the history
  • Loading branch information
SagarGi committed Mar 7, 2022
1 parent 4fb8f37 commit 7c63148
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ Feature: accessing a public link share
| permissions | change |
| password | testpass1 |
When the public accesses the preview of file "testavatar.jpg" from the last shared public link using the sharing API
Then the HTTP status code should be "404"
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 the public accesses the preview of file "textfile0.txt" from the last shared public link using the sharing API
Then the HTTP status code of responses on all endpoints should be "404"

Scenario: Access to the preview of public shared file inside a folder without password
Given the administrator has enabled DAV tech_preview
Expand All @@ -50,6 +49,5 @@ Feature: accessing a public link share
| path | /FOLDER |
| permissions | change |
When the public accesses the preview of file "testavatar.jpg" from the last shared public link using the sharing API
Then the HTTP status code should be "200"
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 "200"
And the public accesses the preview of file "textfile0.txt" from the last shared public link using the sharing API
Then the HTTP status code of responses on all endpoints should be "200"
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,8 @@ Feature: create a public link share
| 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
Then as "Alice" file "testFolder/file.txt" should exist
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"
And the mtime of file "file.txt" in the last shared public link using the WebDAV API should be "Thu, 08 Aug 2019 04:18:13 GMT"

Expand All @@ -665,7 +666,8 @@ Feature: create a public link share
| 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
Then as "Alice" file "/testFolder/file.txt" should exist
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"
And the mtime of file "file.txt" in the last shared public link using the WebDAV API should be "Thu, 08 Aug 2019 04:18:13 GMT"

Expand Down Expand Up @@ -695,4 +697,4 @@ Feature: create a public link share
Examples:
| ocs_api_version | ocs_status_code | http_status_code |
| 1 | 100 | 200 |
| 2 | 200 | 200 |
| 2 | 200 | 200 |
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,28 @@ Feature: create a public link share

Background:
Given user "Alice" has been created with default attributes and without skeleton files

@issue-37605
Scenario: Get the mtime of a file inside a folder shared by public link using new webDAV version
Given user "Alice" has created folder "testFolder"
And user "Alice" has created folder "testFolder"
And user "Alice" has created a public link share with settings
| path | /testFolder |
| permissions | read,update,create,delete |

@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
Then as "Alice" file "testFolder/file.txt" should exist
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"
# And as "Alice" the mtime of the file "testFolder/file.txt" should be "Thu, 08 Aug 2019 04:18:13 GMT"
And the mtime of file "file.txt" in the last shared public link using the WebDAV API should not be "Thu, 08 Aug 2019 04:18:13 GMT"
# And the mtime of file "file.txt" in the last shared public link using the WebDAV API should be "Thu, 08 Aug 2019 04:18:13 GMT"

@issue-37605
Scenario: overwriting a file changes its mtime (new public webDAV API)
Given user "Alice" has created folder "testFolder"
When user "Alice" uploads file with content "uploaded content for file name ending with a dot" to "testFolder/file.txt" using the WebDAV API
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
Then as "Alice" file "/testFolder/file.txt" should exist
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
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"
# And as "Alice" the mtime of the file "testFolder/file.txt" should be "Thu, 08 Aug 2019 04:18:13 GMT"
And the mtime of file "file.txt" in the last shared public link using the WebDAV API should not be "Thu, 08 Aug 2019 04:18:13 GMT"
# And the mtime of file "file.txt" in the last shared public link using the WebDAV API should be "Thu, 08 Aug 2019 04:18:13 GMT"
# And the mtime of file "file.txt" in the last shared public link using the WebDAV API should be "Thu, 08 Aug 2019 04:18:13 GMT"
2 changes: 2 additions & 0 deletions tests/acceptance/features/bootstrap/Sharing.php
Original file line number Diff line number Diff line change
Expand Up @@ -3337,6 +3337,8 @@ public function thePublicAccessesThePreviewOfTheSharedFileUsingTheSharingApi(str
$shareData = $this->getLastShareData();
$token = (string) $shareData->data->token;
$this->getPublicPreviewOfFile($path, $token);
$this->pushToLastStatusCodesArrays();

}

/**
Expand Down

0 comments on commit 7c63148

Please sign in to comment.