Skip to content

Commit

Permalink
[tests-only] fix fileNotExists function in acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dpakach committed Dec 14, 2021
1 parent cc58c7e commit 4b69e50
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ Other free text and markdown formatting can be used elsewhere in the document if
- [webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature:295](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature#L295)
- [webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature:304](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature#L304)
- [webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature:313](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPublicDifferentRoles/shareByPublicLinkDifferentRoles.feature#L313)
- [webUIFilesCopy/copy.feature:98](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesCopy/copy.feature#L98)
- [webUIMoveFilesFolders/moveFiles.feature:97](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIMoveFilesFolders/moveFiles.feature#L97)
- [webUIMoveFilesFolders/moveFolders.feature:72](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIMoveFilesFolders/moveFolders.feature#L72)
- [webUIFilesActionMenu/versions.feature:90](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesActionMenu/versions.feature#L90)
Expand Down
16 changes: 10 additions & 6 deletions tests/acceptance/features/webUIFilesCopy/copy.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ Feature: copy files and folders
So that I can work safely on a copy without changing the original

Background:
Given user "Alice" has been created with default attributes and without skeleton files
Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no"
And the administrator has set the default folder for received shares to "Shares"
And user "Alice" has been created with default attributes and without skeleton files

@smokeTest @ocisSmokeTest
Scenario: copy a file and a folder into a folder
Expand Down Expand Up @@ -86,23 +88,25 @@ Feature: copy files and folders

Scenario: copy a file into another folder with no change permission
Given user "Alice" has created file "lorem.txt"
And user "Alice" has created folder "simple-folder"
And user "Brian" has been created with default attributes and without skeleton files
And user "Brian" has created folder "simple-folder"
And user "Brian" has shared folder "simple-folder" with user "Alice" with "read" permissions
And user "Alice" has accepted the share "Shares/simple-folder" offered by user "Brian"
And user "Alice" has logged in using the webUI
When the user tries to copy file "lorem.txt" into folder "simple-folder" using the webUI
Then as "Alice" file "simple-folder/lorem.txt" should not exist
When the user tries to copy file "lorem.txt" into folder "Shares/simple-folder" using the webUI
Then as "Alice" file "Shares/simple-folder/lorem.txt" should not exist


@issue-ocis-1328
Scenario: copy a folder into another folder with no change permission
Given user "Alice" has created folder "simple-empty-folder"
And user "Brian" has been created with default attributes and without skeleton files
And user "Brian" has created folder "simple-folder"
And user "Brian" has shared folder "simple-folder" with user "Alice" with "read" permissions
And user "Alice" has accepted the share "Shares/simple-folder" offered by user "Brian"
And user "Alice" has logged in using the webUI
When the user tries to copy folder "simple-empty-folder" into folder "simple-folder" using the webUI
Then as "Alice" file "simple-folder/simple-empty-folder" should not exist
When the user tries to copy folder "simple-empty-folder" into folder "Shares/simple-folder" using the webUI
Then as "Alice" file "Shares/simple-folder/simple-empty-folder" should not exist


Scenario: copy a folder into the same folder
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/stepDefinitions/webdavContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const fileOrFolderShouldExist = function (userId, element, type = 'file') {

const fileShouldNotExist = function (userId, element) {
return fileExists(userId, element).then(function (res) {
assert.ok(res.status < 300 || res.status >= 200, 'file/folder should not exist, but does')
assert.ok(res.status === 404, 'file/folder should not exist, but does')
})
}

Expand Down

0 comments on commit 4b69e50

Please sign in to comment.