Skip to content

Commit

Permalink
Improved then step to suite apiWebdavMove2
Browse files Browse the repository at this point in the history
  • Loading branch information
SagarGi committed Feb 28, 2022
1 parent 1b00e84 commit 9f97430
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 30 deletions.
47 changes: 37 additions & 10 deletions tests/acceptance/features/apiWebdavMove2/moveFile.feature
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ Feature: move (rename) file
| shareWith | Alice |
When user "Alice" moves file "/textfile0.txt" to "/testshare/textfile0.txt" using the WebDAV API
Then the HTTP status code should be "403"
When user "Alice" downloads file "/testshare/textfile0.txt" using the WebDAV API
Then the HTTP status code should be "404"
And user "Alice" should not be able to download file "/testshare/textfile0.txt"
Examples:
| dav_version |
| old |
Expand Down Expand Up @@ -257,7 +256,7 @@ Feature: move (rename) file
And user "Brian" has stored id of folder "/folderA/ONE"
And user "Brian" has created folder "/folderA/ONE/TWO"
When user "Brian" moves folder "/folderA/ONE" to "/folderB/ONE" using the WebDAV API
# Then the HTTP status code should be "201"
Then the HTTP status code should be "201"
And as "Brian" folder "/folderA" should exist
And as "Brian" folder "/folderA/ONE" should not exist
# yes, a weird bug used to make this one fail
Expand Down Expand Up @@ -343,8 +342,8 @@ Feature: move (rename) file
Scenario Outline: renaming file with dots in the path
Given using <dav_version> DAV path
And user "Alice" has created folder "<folder_name>"
When user "Alice" uploads file with content "uploaded content for file name ending with a dot" to "<folder_name>/<file_name>" using the WebDAV API
And user "Alice" moves file "<folder_name>/<file_name>" to "<folder_name>/abc.txt" using the WebDAV API
And user "Alice" has uploaded file with content "uploaded content for file name ending with a dot" to "<folder_name>/<file_name>"
When user "Alice" moves file "<folder_name>/<file_name>" to "<folder_name>/abc.txt" using the WebDAV API
Then the HTTP status code should be "201"
And as "Alice" file "<folder_name>/abc.txt" should exist
Examples:
Expand Down Expand Up @@ -422,6 +421,10 @@ Feature: move (rename) file
| path |
| .hidden_file102 |
| /FOLDER/.hidden_file101 |
And the content of the following files for user "Alice" should be "hidden file"
| path |
| .hidden_file102 |
| /FOLDER/.hidden_file101 |
Examples:
| dav_version |
| old |
Expand All @@ -448,6 +451,10 @@ Feature: move (rename) file
| path |
| .hidden_file102 |
| hidden_file102.txt |
And the content of the following files for user "Alice" should be "hidden file"
| path |
| .hidden_file102 |
| hidden_file102.txt |
Examples:
| dav_version |
| old |
Expand Down Expand Up @@ -536,18 +543,38 @@ Feature: move (rename) file
| spaces | texta | file.txt | 0 |


Scenario: move a file of size zero byte
Given user "Alice" has uploaded file "filesForUpload/zerobyte.txt" to "/zerobyte.txt"
Scenario Outline: move a file of size zero byte
Given using <dav_version> DAV path
And user "Alice" has uploaded file "filesForUpload/zerobyte.txt" to "/zerobyte.txt"
And user "Alice" has created folder "/testZeroByte"
When user "Alice" moves file "/zerobyte.txt" to "/testZeroByte/zerobyte.txt" using the WebDAV API
Then the HTTP status code should be "201"
And as "Alice" file "/testZeroByte/zerobyte.txt" should exist
And as "Alice" file "/zerobyte.txt" should not exist
Examples:
| dav_version |
| old |
| new |

@skipOnOcV10 @personalSpace
Examples:
| dav_version |
| spaces |


Scenario: rename a file of size zero byte
Given user "Alice" has uploaded file "filesForUpload/zerobyte.txt" to "/zerobyte.txt"
Scenario Outline: rename a file of size zero byte
Given using <dav_version> DAV path
And user "Alice" has uploaded file "filesForUpload/zerobyte.txt" to "/zerobyte.txt"
When user "Alice" moves file "/zerobyte.txt" to "/rename_zerobyte.txt" using the WebDAV API
Then the HTTP status code should be "201"
And as "Alice" file "/rename_zerobyte.txt" should exist
And as "Alice" file "/zerobyte.txt" should not exist
And as "Alice" file "/zerobyte.txt" should not exist
Examples:
| dav_version |
| old |
| new |

@skipOnOcV10 @personalSpace
Examples:
| dav_version |
| spaces |
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Feature: users cannot move (rename) a file to a blacklisted name

Scenario Outline: rename a file to a banned filename
Given using <dav_version> DAV path
When the administrator updates system config key "blacklisted_files" with value '["blacklisted-file.txt",".htaccess"]' and type "json" using the occ command
And user "Alice" moves file "/textfile0.txt" to "/blacklisted-file.txt" using the WebDAV API
And the administrator has updated system config key "blacklisted_files" with value '["blacklisted-file.txt",".htaccess"]' and type "json"
When user "Alice" moves file "/textfile0.txt" to "/blacklisted-file.txt" using the WebDAV API
Then the HTTP status code should be "403"
Examples:
| dav_version |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Feature: users cannot move (rename) a file to or into an excluded directory

Scenario Outline: rename a file to an excluded directory name
Given using <dav_version> DAV path
When the administrator updates system config key "excluded_directories" with value '[".github"]' and type "json" using the occ command
And user "Alice" moves file "/textfile0.txt" to "/.github" using the WebDAV API
And the administrator has updated system config key "excluded_directories" with value '[".github"]' and type "json"
When user "Alice" moves file "/textfile0.txt" to "/.github" using the WebDAV API
Then the HTTP status code should be "403"
Examples:
| dav_version |
Expand All @@ -29,8 +29,8 @@ Feature: users cannot move (rename) a file to or into an excluded directory
Scenario Outline: rename a file to an excluded directory name inside a parent directory
Given using <dav_version> DAV path
And user "Alice" has created folder "FOLDER"
When the administrator updates system config key "excluded_directories" with value '[".github"]' and type "json" using the occ command
And user "Alice" moves file "/textfile0.txt" to "/FOLDER/.github" using the WebDAV API
And the administrator has updated system config key "excluded_directories" with value '[".github"]' and type "json"
When user "Alice" moves file "/textfile0.txt" to "/FOLDER/.github" using the WebDAV API
Then the HTTP status code should be "403"
Examples:
| dav_version |
Expand Down
28 changes: 14 additions & 14 deletions tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ Feature: move (rename) file
| permissions | change |
| shareWith | Alice |
And user "<mover>" has uploaded file with content "test data" to "/testfile.txt"
When user "Alice" accepts share "/testshare" offered by user "Brian" using the sharing API
And user "<mover>" moves file "/testfile.txt" to "<destination_folder>/testfile.txt" using the WebDAV API
And user "Alice" has accepted share "/testshare" offered by user "Brian"
When user "<mover>" moves file "/testfile.txt" to "<destination_folder>/testfile.txt" using the WebDAV API
Then the HTTP status code should be "201"
And the content of file "/Shares/testshare/testfile.txt" for user "Alice" should be "test data"
And the content of file "/testshare/testfile.txt" for user "Brian" should be "test data"
And as "<mover>" file "/testfile.txt" should not exist
Examples:
| dav_version | mover | destination_folder |
| old | Alice | /Shares/testshare |
| new | Alice | /Shares/testshare |
| old | Brian | /testshare |
| new | Alice | /Shares/testshare |
| new | Brian | /testshare |

@personalSpace
Expand All @@ -49,17 +49,17 @@ Feature: move (rename) file
| shareType | user |
| permissions | change |
| shareWith | Alice |
When user "Alice" accepts share "/testshare" offered by user "Brian" using the sharing API
And user "<mover>" moves file "<source_folder>/testfile.txt" to "/testfile.txt" using the WebDAV API
And user "Alice" has accepted share "/testshare" offered by user "Brian"
When user "<mover>" moves file "<source_folder>/testfile.txt" to "/testfile.txt" using the WebDAV API
Then the HTTP status code should be "201"
And the content of file "/testfile.txt" for user "<mover>" should be "test data"
And as "Alice" file "/Shares/testfile.txt" should not exist
And as "Brian" file "/testshare/testfile.txt" should not exist
Examples:
| dav_version | mover | source_folder |
| old | Alice | /Shares/testshare |
| new | Alice | /Shares/testshare |
| old | Brian | /testshare |
| new | Alice | /Shares/testshare |
| new | Brian | /testshare |

@personalSpace
Expand All @@ -80,17 +80,17 @@ Feature: move (rename) file
| shareWith | Alice |
And user "<mover>" has created folder "/testsubfolder"
And user "<mover>" has uploaded file with content "test data" to "/testsubfolder/testfile.txt"
When user "Alice" accepts share "/testshare" offered by user "Brian" using the sharing API
And user "<mover>" moves folder "/testsubfolder" to "<destination_folder>/testsubfolder" using the WebDAV API
And user "Alice" has accepted share "/testshare" offered by user "Brian"
When user "<mover>" moves folder "/testsubfolder" to "<destination_folder>/testsubfolder" using the WebDAV API
Then the HTTP status code should be "201"
And the content of file "/Shares/testshare/testsubfolder/testfile.txt" for user "Alice" should be "test data"
And the content of file "/testshare/testsubfolder/testfile.txt" for user "Brian" should be "test data"
And as "<mover>" file "/testsubfolder" should not exist
Examples:
| dav_version | mover | destination_folder |
| old | Alice | /Shares/testshare |
| new | Alice | /Shares/testshare |
| old | Brian | /testshare |
| new | Alice | /Shares/testshare |
| new | Brian | /testshare |

@personalSpace
Expand All @@ -111,17 +111,17 @@ Feature: move (rename) file
| shareType | user |
| permissions | change |
| shareWith | Alice |
When user "Alice" accepts share "/testshare" offered by user "Brian" using the sharing API
And user "<mover>" moves folder "<source_folder>/testsubfolder" to "/testsubfolder" using the WebDAV API
And user "Alice" has accepted share "/testshare" offered by user "Brian"
When user "<mover>" moves folder "<source_folder>/testsubfolder" to "/testsubfolder" using the WebDAV API
Then the HTTP status code should be "201"
And the content of file "/testsubfolder/testfile.txt" for user "<mover>" should be "test data"
And as "Alice" folder "<source_folder>/testsubfolder" should not exist
And as "Brian" folder "/testshare/testsubfolder" should not exist
Examples:
| dav_version | mover | source_folder |
| old | Alice | /Shares/testshare |
| new | Alice | /Shares/testshare |
| old | Brian | /testshare |
| new | Alice | /Shares/testshare |
| new | Brian | /testshare |

@personalSpace
Expand All @@ -141,8 +141,8 @@ Feature: move (rename) file
| shareType | user |
| permissions | read |
| shareWith | Alice |
When user "Alice" accepts share "/testshare" offered by user "Brian" using the sharing API
And user "Alice" moves file "/textfile0.txt" to "/Shares/testshare/textfile0.txt" using the WebDAV API
And user "Alice" has accepted share "/testshare" offered by user "Brian"
When user "Alice" moves file "/textfile0.txt" to "/Shares/testshare/textfile0.txt" using the WebDAV API
Then the HTTP status code should be "403"
When user "Alice" downloads file "/Shares/testshare/textfile0.txt" using the WebDAV API
Then the HTTP status code should be "404"
Expand Down

0 comments on commit 9f97430

Please sign in to comment.