Skip to content

Commit

Permalink
API test to check that share can be made with file names more than 64…
Browse files Browse the repository at this point in the history
… chars
  • Loading branch information
paurakhsharma committed Oct 4, 2018
1 parent b38ea38 commit a76b274
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 0 deletions.
83 changes: 83 additions & 0 deletions tests/acceptance/features/apiShareManagement/createShare.feature
Original file line number Diff line number Diff line change
Expand Up @@ -385,3 +385,86 @@ Feature: sharing
| ocs_api_version | ocs_status_code |
| 1 | 400 |
| 2 | 400 |

Scenario Outline: user shares a file with file name longer than 64 chars to another user
Given using OCS API version "<ocs_api_version>"
And user "user1" has been created
And user "user0" has moved file "welcome.txt" to "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog.txt"
When user "user0" shares file "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog.txt" with user "user1" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And as "user1" the file "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog.txt" should exist
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

Scenario Outline: user shares a file with file name longer than 64 chars to a group
Given using OCS API version "<ocs_api_version>"
And group "grp1" has been created
And user "user1" has been created
And user "user1" has been added to group "grp1"
And user "user0" has moved file "welcome.txt" to "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog.txt"
When user "user0" shares file "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog.txt" with group "grp1" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And as "user1" the file "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog.txt" should exist
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

Scenario Outline: user shares a folder with file name longer than 64 chars to another user
Given using OCS API version "<ocs_api_version>"
And user "user1" has been created
And user "user0" has created a folder "/aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog"
When user "user0" shares folder "/aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog" with user "user1" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And as "user1" the folder "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog" should exist
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

Scenario Outline: user shares a folder with folder name longer than 64 chars to a group
Given using OCS API version "<ocs_api_version>"
And group "grp1" has been created
And user "user1" has been created
And user "user1" has been added to group "grp1"
And user "user0" has created a folder "/aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog"
When user "user0" shares folder "/aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog" with group "grp1" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And as "user1" the folder "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog" should exist
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

Scenario Outline: user create a public link share of a file with file name longer than 64 chars
Given using OCS API version "<ocs_api_version>"
And user "user0" has moved file "welcome.txt" to "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog.txt"
When user "user0" creates a public link share using the sharing API with settings
| path | /aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog.txt |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the last public shared file should be able to be downloaded without a password
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

Scenario Outline: user create a public link share of a folder with folder name longer than 64 chars
Given using OCS API version "<ocs_api_version>"
And user "user0" has created a folder "/aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog"
And user "user0" has moved file "welcome.txt" to "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog/welcome.txt"
When user "user0" creates a public link share using the sharing API with settings
| path | /aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
Then the public should be able to download the range "bytes=1-6" of file "/welcome.txt" from inside the last public shared folder and the content should be "elcome"
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
18 changes: 18 additions & 0 deletions tests/acceptance/features/bootstrap/WebDav.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,24 @@ public function shouldBeAbleToDownloadFileInsidePublicSharedFolderWithPassword(
$this->downloadedContentShouldBe($content);
}

/**
* @Then /^the public should be able to download the range "([^"]*)" of file "([^"]*)" from inside the last public shared folder and the content should be "([^"]*)"$/
*
* @param string $range
* @param string $path
* @param string $content
*
* @return void
*/
public function shouldBeAbleToDownloadFileInsidePublicSharedFolder(
$range, $path, $content
) {
$this->publicDownloadsTheFileInsideThePublicSharedFolderWithPassword(
$path, null, $range
);
$this->downloadedContentShouldBe($content);
}

/**
* @Then /^user "([^"]*)" using password "([^"]*)" should not be able to download file "([^"]*)"$/
*
Expand Down

0 comments on commit a76b274

Please sign in to comment.