Skip to content

Commit

Permalink
Improved then step to suite apiWebdavMove1
Browse files Browse the repository at this point in the history
  • Loading branch information
SagarGi committed Mar 3, 2022
1 parent 0603065 commit 953209d
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ Feature: move (rename) file
Given user "Alice" has stored id of file "/textfile0.txt"
And user "Alice" has created folder "FOLDER"
When user "Alice" moves file "/textfile0.txt" asynchronously to "/FOLDER/textfile0.txt" using the WebDAV API
Then user "Alice" file "/FOLDER/textfile0.txt" should have the previously stored id
Then the HTTP status code should be "202"
And user "Alice" file "/FOLDER/textfile0.txt" should have the previously stored id
And user "Alice" should not see the following elements
| /textfile0.txt |

Expand Down Expand Up @@ -208,8 +209,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
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Feature: users cannot move (rename) a file to a blacklisted name
| /textfile0.txt |

Scenario: rename a file to a banned filename
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" asynchronously to "/blacklisted-file.txt" using the WebDAV API
Given 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" asynchronously to "/blacklisted-file.txt" using the WebDAV API
Then the HTTP status code should be "403"
And user "Alice" should see the following elements
| /textfile0.txt |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ Feature: users cannot move (rename) a file to or into an excluded directory
And the administrator has enabled async operations

Scenario: rename a file to an excluded directory name
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" asynchronously to "/.github" using the WebDAV API
Given the administrator has updated system config key "excluded_directories" with value '[".github"]' and type "json"
When user "Alice" moves file "/textfile0.txt" asynchronously to "/.github" using the WebDAV API
Then the HTTP status code should be "403"
And user "Alice" should see the following elements
| /textfile0.txt |

Scenario: rename a file to an excluded directory name inside a parent directory
Given 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" asynchronously 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" asynchronously to "/FOLDER/.github" using the WebDAV API
Then the HTTP status code should be "403"
And user "Alice" should see the following elements
| /textfile0.txt |
Expand Down
8 changes: 4 additions & 4 deletions tests/acceptance/features/apiWebdavMove1/moveFolder.feature
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ Feature: move (rename) folder
Scenario Outline: renaming folder 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>/abc.txt" using the WebDAV API
And user "Alice" moves folder "<folder_name>" to "/uploadFolder" using the WebDAV API
And user "Alice" has uploaded file with content "uploaded content for file name ending with a dot" to "<folder_name>/abc.txt"
When user "Alice" moves folder "<folder_name>" to "/uploadFolder" using the WebDAV API
Then the HTTP status code should be "201"
And the content of file "/uploadFolder/abc.txt" for user "Alice" should be "uploaded content for file name ending with a dot"
Examples:
Expand Down Expand Up @@ -172,8 +172,8 @@ Feature: move (rename) folder
Examples:
| dav_version | mover |
| old | Alice |
| new | Alice |
| old | Brian |
| new | Alice |
| new | Brian |
@files_sharing-app-required @skipOnOcis
Expand All @@ -196,6 +196,6 @@ Feature: move (rename) folder
Examples:
| dav_version | mover |
| old | Alice |
| new | Alice |
| old | Brian |
| new | Alice |
| new | Brian |
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Feature: users cannot move (rename) a folder to a blacklisted name
Scenario Outline: Rename a folder to a banned name
Given using <dav_version> DAV path
And user "Alice" has created folder "/testshare"
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 folder "/testshare" 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 folder "/testshare" to "/blacklisted-file.txt" using the WebDAV API
Then the HTTP status code should be "403"
And user "Alice" should see the following elements
| /testshare/ |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Feature: users cannot move (rename) a folder to or into an excluded directory
Scenario Outline: Rename a folder to an excluded directory name
Given using <dav_version> DAV path
And user "Alice" has created folder "/testshare"
When the administrator updates system config key "excluded_directories" with value '[".github"]' and type "json" using the occ command
And user "Alice" moves folder "/testshare" 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 folder "/testshare" to "/.github" using the WebDAV API
Then the HTTP status code should be "403"
And user "Alice" should see the following elements
| /testshare/ |
Expand All @@ -32,8 +32,8 @@ Feature: users cannot move (rename) a folder to or into an excluded directory
Given using <dav_version> DAV path
And user "Alice" has created folder "/testshare"
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 folder "/testshare" 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 folder "/testshare" to "/FOLDER/.github" using the WebDAV API
Then the HTTP status code should be "403"
And user "Alice" should see the following elements
| /testshare/ |
Expand Down
6 changes: 4 additions & 2 deletions tests/acceptance/features/apiWebdavMove2/moveFile.feature
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ Feature: move (rename) file
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "textfile0.txt"
And user "Alice" has stored id of file "/textfile0.txt"
When user "Alice" moves file "/textfile0.txt" to "/FOLDER/textfile0.txt" using the WebDAV API
Then user "Alice" file "/FOLDER/textfile0.txt" should have the previously stored id
Then the HTTP status code should be "201"
And user "Alice" file "/FOLDER/textfile0.txt" should have the previously stored id
And user "Alice" should not see the following elements
| /textfile0.txt |
Examples:
Expand All @@ -256,7 +257,8 @@ 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 as "Brian" folder "/folderA" should exist
# 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
And as "Brian" folder "/folderA/ONE/TWO" should not exist
Expand Down

0 comments on commit 953209d

Please sign in to comment.