[tests-only] extend group sharing and MOVE api tests (#9083)

* test: add more COPY/MOVE tests

* test: add sharing to group edgecase tests

* test: new line

* test: fix typo

* test: update expected failure
This commit is contained in:
Sawjan Gurung
2024-05-07 12:26:59 +05:45
committed by GitHub
parent d18d835134
commit b4e991bf63
4 changed files with 228 additions and 4 deletions

View File

@@ -353,9 +353,9 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers
- [coreApiWebdavUpload/uploadFile.feature:181](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUpload/uploadFile.feature#L181)
- [coreApiWebdavUpload/uploadFile.feature:180](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUpload/uploadFile.feature#L180)
- [coreApiWebdavUpload/uploadFile.feature:186](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUpload/uploadFile.feature#L186)
- [coreApiWebdavMove2/moveFile.feature:196](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L196)
- [coreApiWebdavMove2/moveFile.feature:197](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L197)
- [coreApiWebdavMove2/moveFile.feature:202](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L202)
- [coreApiWebdavMove2/moveFile.feature:217](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L217)
- [coreApiWebdavMove2/moveFile.feature:218](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L218)
- [coreApiWebdavMove2/moveFile.feature:223](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L223)
#### [cannot set blacklisted file names](https://github.com/owncloud/product/issues/260)
@@ -396,7 +396,7 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers
- [coreApiWebdavMove1/moveFolder.feature:44](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove1/moveFolder.feature#L44)
- [coreApiWebdavMove1/moveFolder.feature:62](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove1/moveFolder.feature#L62)
- [coreApiWebdavMove1/moveFolder.feature:80](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove1/moveFolder.feature#L80)
- [coreApiWebdavMove2/moveFile.feature:158](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L158)
- [coreApiWebdavMove2/moveFile.feature:179](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L179)
- [coreApiWebdavMove2/moveFileToBlacklistedName.feature:24](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFileToBlacklistedName.feature#L24)
#### [REPORT method on spaces returns an incorrect d:href response](https://github.com/owncloud/ocis/issues/3111)

View File

@@ -3215,3 +3215,97 @@ Feature: Send a sharing invitations
| Space Viewer | group |
| Space Editor | group |
| Manager | group |
Scenario: share a file to user and group having same name (Personal space)
Given user "Carol" has been created with default attributes and without skeleton files
And group "Brian" has been created
And the following users have been added to the following groups
| username | groupname |
| Carol | Brian |
And user "Alice" has uploaded file with content "lorem" to "textfile.txt"
When user "Alice" sends the following share invitation using the Graph API:
| resource | textfile.txt |
| space | Personal |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
Then the HTTP status code should be "200"
And for user "Brian" the space Shares should contain these entries:
| textfile.txt |
When user "Alice" sends the following share invitation using the Graph API:
| resource | textfile.txt |
| space | Personal |
| sharee | Brian |
| shareType | group |
| permissionsRole | Viewer |
Then the HTTP status code should be "200"
And for user "Carol" the space Shares should contain these entries:
| textfile.txt |
Scenario: share a file to group containing special characters in name (Personal space)
Given group "?\?@#%@;" has been created
And the following users have been added to the following groups
| username | groupname |
| Brian | ?\?@#%@; |
And user "Alice" has uploaded file with content "lorem" to "textfile.txt"
When user "Alice" sends the following share invitation using the Graph API:
| resource | textfile.txt |
| space | Personal |
| sharee | ?\?@#%@; |
| shareType | group |
| permissionsRole | Viewer |
Then the HTTP status code should be "200"
And for user "Brian" the space Shares should contain these entries:
| textfile.txt |
Scenario: share a file to user and group having same name (Project space)
Given using spaces DAV path
And user "Carol" has been created with default attributes and without skeleton files
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "NewSpace" with the default quota using the Graph API
And user "Alice" has uploaded a file inside space "NewSpace" with content "lorem" to "textfile.txt"
And group "Brian" has been created
And the following users have been added to the following groups
| username | groupname |
| Carol | Brian |
When user "Alice" sends the following share invitation using the Graph API:
| resource | textfile.txt |
| space | NewSpace |
| sharee | Brian |
| shareType | user |
| permissionsRole | Viewer |
Then the HTTP status code should be "200"
And for user "Brian" the space Shares should contain these entries:
| textfile.txt |
When user "Alice" sends the following share invitation using the Graph API:
| resource | textfile.txt |
| space | NewSpace |
| sharee | Brian |
| shareType | group |
| permissionsRole | Viewer |
Then the HTTP status code should be "200"
And for user "Carol" the space Shares should contain these entries:
| textfile.txt |
Scenario: share a file to group containing special characters in name (Project space)
Given using spaces DAV path
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "NewSpace" with the default quota using the Graph API
And user "Alice" has uploaded a file inside space "NewSpace" with content "lorem" to "textfile.txt"
And group "?\?@#%@;" has been created
And the following users have been added to the following groups
| username | groupname |
| Brian | ?\?@#%@; |
When user "Alice" sends the following share invitation using the Graph API:
| resource | textfile.txt |
| space | NewSpace |
| sharee | ?\?@#%@; |
| shareType | group |
| permissionsRole | Viewer |
Then the HTTP status code should be "200"
And for user "Brian" the space Shares should contain these entries:
| textfile.txt |

View File

@@ -126,6 +126,27 @@ Feature: move (rename) file
| spaces |
Scenario Outline: move a file to existing file name
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file with content "test file" to "testfile.txt"
And user "Alice" has uploaded file with content "some content" to "lorem.txt"
When user "Alice" moves file "testfile.txt" to "lorem.txt" using the WebDAV API
Then the HTTP status code should be "204"
And as "Alice" file "lorem.txt" should exist
And the content of file "lorem.txt" for user "Alice" should be "test file"
But as "Alice" file "testfile.txt" should not exist
And as "Alice" the file with original path "lorem.txt" should exist in the trashbin
Examples:
| dav-path-version |
| old |
| new |
@skipOnRevaMaster
Examples:
| dav-path-version |
| spaces |
Scenario Outline: move file into a not-existing folder
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "fileToMove.txt"
@@ -487,3 +508,86 @@ Feature: move (rename) file
Examples:
| dav-path-version |
| spaces |
Scenario Outline: rename file to/from special characters
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file with content "test file" to <from-file-name>
When user "Alice" moves file <from-file-name> to <to-file-name> using the WebDAV API
Then the HTTP status code should be "201"
And as "Alice" file <to-file-name> should exist
But as "Alice" file <from-file-name> should not exist
Examples:
| dav-path-version | from-file-name | to-file-name |
| old | "testfile.txt" | "'single'quotes.txt" |
| old | "testfile.txt" | '"double"quotes.txt' |
| old | "testfile.txt" | "strängé .txt" |
| old | "testfile.txt" | "file,comma.txt" |
| old | "testfile.txt" | " start with space.txt" |
| old | "'single'quotes.txt" | "testfile.txt" |
| old | '"double"quotes.txt' | "testfile.txt" |
| old | "strängé .txt" | "testfile.txt" |
| old | "file,comma.txt" | "testfile.txt" |
| old | " start with space.txt" | "testfile.txt" |
| new | "testfile.txt" | "'single'quotes.txt" |
| new | "testfile.txt" | '"double"quotes.txt' |
| new | "testfile.txt" | "strängé .txt" |
| new | "testfile.txt" | "file,comma.txt" |
| new | "testfile.txt" | " start with space.txt" |
| new | "'single'quotes.txt" | "testfile.txt" |
| new | '"double"quotes.txt' | "testfile.txt" |
| new | "strängé .txt" | "testfile.txt" |
| new | "file,comma.txt" | "testfile.txt" |
| new | " start with space.txt" | "testfile.txt" |
@skipOnRevaMaster
Examples:
| dav-path-version | from-file-name | to-file-name |
| spaces | "testfile.txt" | "'single'quotes.txt" |
| spaces | "testfile.txt" | '"double"quotes.txt' |
| spaces | "testfile.txt" | "strängé .txt" |
| spaces | "testfile.txt" | "file,comma.txt" |
| spaces | "testfile.txt" | " start with space.txt" |
| spaces | "'single'quotes.txt" | "testfile.txt" |
| spaces | '"double"quotes.txt' | "testfile.txt" |
| spaces | "strängé .txt" | "testfile.txt" |
| spaces | "file,comma.txt" | "testfile.txt" |
| spaces | " start with space.txt" | "testfile.txt" |
Scenario Outline: try to rename file to name having white space at the end
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file with content "test file" to "testfile.txt"
When user "Alice" moves file "testfile.txt" to "space at end " using the WebDAV API
Then the HTTP status code should be "201"
And as "Alice" file "space at end" should exist
But as "Alice" file "testfile.txt" should not exist
And as "Alice" file "space at end " should not exist
Examples:
| dav-path-version |
| old |
| new |
@skipOnRevaMaster
Examples:
| dav-path-version |
| spaces |
Scenario Outline: try to rename file to . and ..
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file with content "test file" to "testfile.txt"
When user "Alice" moves file "testfile.txt" to "<file-name>" using the WebDAV API
Then the HTTP status code should be "<http-status-code>"
Examples:
| dav-path-version | file-name | http-status-code |
| old | /. | 409 |
| old | /.. | 404 |
| new | /. | 409 |
| new | /.. | 404 |
@skipOnRevaMaster
Examples:
| dav-path-version | file-name | http-status-code |
| spaces | /. | 409 |
| spaces | /.. | 400 |

View File

@@ -854,3 +854,29 @@ Feature: copy file
Examples:
| dav-path-version |
| spaces |
Scenario Outline: copy a file into a folder with special characters
Given using <dav-path-version> DAV path
And user "Alice" has created folder <folder-name>
And user "Alice" has uploaded file with content "test file" to <file-name>
When user "Alice" copies file <file-name> to <destination> using the WebDAV API
Then the HTTP status code should be "201"
And as "Alice" file <file-name> should exist
And as "Alice" file <destination> should exist
And as "Alice" folder <folder-name> should exist
Examples:
| dav-path-version | file-name | folder-name | destination |
| old | "'single'" | "folder-'single'" | "folder-'single'/'single'" |
| old | "question?" | "folder-question?" | "folder-question?/question?" |
| old | "&and#hash" | "folder-&and#hash" | "folder-&and#hash/&and#hash" |
| new | "'single'" | "folder-'single'" | "folder-'single'/'single'" |
| new | "question?" | "folder-question?" | "folder-question?/question?" |
| new | "&and#hash" | "folder-&and#hash" | "folder-&and#hash/&and#hash" |
@skipOnRevaMaster
Examples:
| dav-path-version | file-name | folder-name | destination |
| spaces | "'single'" | "folder-'single'" | "folder-'single'/'single'" |
| spaces | "question?" | "folder-question?" | "folder-question?/question?" |
| spaces | "&and#hash" | "folder-&and#hash" | "folder-&and#hash/&and#hash" |