From d630efbc365af28a0135c15299e1821c359d6f9e Mon Sep 17 00:00:00 2001 From: Swikriti Tripathi Date: Tue, 23 Nov 2021 14:24:18 +0545 Subject: [PATCH 1/2] Add valid tests that were removed by PR --- ...-failures-with-ocis-server-ocis-storage.md | 1 + .../webUIFilesActionMenu/versions.feature | 12 +++++ .../trashbinDelete.feature | 19 ++++++++ tests/acceptance/helpers/webdavHelper.js | 48 +++++++------------ 4 files changed, 49 insertions(+), 31 deletions(-) diff --git a/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md b/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md index 6c45c38f272..918cacfc419 100644 --- a/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md +++ b/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md @@ -209,6 +209,7 @@ Other free text and markdown formatting can be used elsewhere in the document if - [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) ### [Accepting different shares with same filename from different users overwrites one file](https://github.com/owncloud/ocis/issues/713) - [webUISharingAcceptShares/acceptShares.feature:212](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingAcceptShares/acceptShares.feature#L212) diff --git a/tests/acceptance/features/webUIFilesActionMenu/versions.feature b/tests/acceptance/features/webUIFilesActionMenu/versions.feature index 3e392b973d3..98063c17702 100644 --- a/tests/acceptance/features/webUIFilesActionMenu/versions.feature +++ b/tests/acceptance/features/webUIFilesActionMenu/versions.feature @@ -85,3 +85,15 @@ Feature: Versions of a file And the user uploads overwriting file "lorem.txt" using the webUI And the user browses to display the "versions" details of file "lorem.txt" Then the versions list should contain 1 entries + + @issue-ocis-1328 @disablePreviews + Scenario: sharee can see the versions of a file + Given user "user0" has uploaded file with content "lorem content" to "lorem-file.txt" + And user "user0" has uploaded file with content "lorem" to "lorem-file.txt" + And user "user0" has uploaded file with content "new lorem content" to "lorem-file.txt" + And user "user0" has shared file "lorem-file.txt" with user "Alice" + And user "Alice" has logged in using the webUI + When the user browses to display the "versions" details of file "lorem-file.txt" + Then the content of file "lorem-file.txt" for user "Alice" should be "new lorem content" + And the versions list should contain 2 entries + diff --git a/tests/acceptance/features/webUITrashbinDelete/trashbinDelete.feature b/tests/acceptance/features/webUITrashbinDelete/trashbinDelete.feature index 1fd9ec84ff3..263ebb2af06 100644 --- a/tests/acceptance/features/webUITrashbinDelete/trashbinDelete.feature +++ b/tests/acceptance/features/webUITrashbinDelete/trashbinDelete.feature @@ -132,3 +132,22 @@ Feature: files and folders can be deleted from the trashbin | fo.xyz | Then the deleted elements should not be listed on the webUI And the deleted elements should not be listed on the webUI after a page reload + + @issue-product-188 @issue-4582 + Scenario: Select all except for some files and delete from trashbin in a batch + When the user marks all files for batch action using the webUI + And the user unmarks these files for batch action using the webUI + | name | + | lorem.txt | + | lorem-big.txt | + And the user batch deletes the marked files using the webUI + Then file "lorem.txt" should be listed on the webUI + And file "lorem-big.txt" should be listed on the webUI + But file "data.zip" should not be listed on the webUI + And folder "simple-folder" should not be listed on the webUI + + @issue-product-188 @issue-4582 + Scenario: Select all files and delete from trashbin in a batch + When the user marks all files for batch action using the webUI + And the user batch deletes the marked files using the webUI + Then there should be no resources listed on the webUI diff --git a/tests/acceptance/helpers/webdavHelper.js b/tests/acceptance/helpers/webdavHelper.js index 457790dbd1b..2e980d39070 100644 --- a/tests/acceptance/helpers/webdavHelper.js +++ b/tests/acceptance/helpers/webdavHelper.js @@ -192,44 +192,30 @@ exports.createFolder = function (user, folderName) { * @param {string} user * @param {string} fileName * @param {string} contents - * @param {number} waitMaxIfExisting */ -exports.createFile = async function (user, fileName, contents = '', waitMaxIfExisting = 10000) { +exports.createFile = async function (user, fileName, contents = '') { + const davPath = exports.createDavPath(user, fileName) /** * makes sure upload operations are carried out maximum once a second to avoid version issues * see https://github.com/owncloud/core/issues/23151 */ - uploadTimeStamps[user] = uploadTimeStamps[user] || {} - - const pollCheck = async (retries = 0, waitFor = 100, waitMax = waitMaxIfExisting) => { - if (!uploadTimeStamps[user][fileName] || waitMax <= waitFor) { - return - } else { - uploadTimeStamps[user][fileName] = true + if (uploadTimeStamps[user] && uploadTimeStamps[user][fileName]) { + const timeSinceLastFileUpload = Date.now() - uploadTimeStamps[user][fileName] + if (timeSinceLastFileUpload <= 1600) { + await client.pause(1600 - timeSinceLastFileUpload) } - - retries++ - await client.pause(waitFor) - - // O(n) - await pollCheck(retries, waitFor * retries, waitMax) } - - await pollCheck() - - const davPath = exports.createDavPath(user, fileName) - const putResponse = await httpHelper.put(davPath, user, contents) - - delete uploadTimeStamps[user][fileName] - - const statusResponse = await httpHelper.checkStatus( - putResponse, - `Could not create the file "${fileName}" for user "${user}".` - ) - - await client.pause(500) - - return statusResponse.text() + return httpHelper + .put(davPath, user, contents) + .then(function (res) { + uploadTimeStamps[user] = uploadTimeStamps[user] || {} + uploadTimeStamps[user][fileName] = Date.now() + return httpHelper.checkStatus( + res, + `Could not create the file "${fileName}" for user "${user}".` + ) + }) + .then((res) => res.text()) } /** From b5beb4a6d94429b850247a952cf3d32045287344 Mon Sep 17 00:00:00 2001 From: Swikriti Tripathi Date: Wed, 1 Dec 2021 14:01:44 +0545 Subject: [PATCH 2/2] unskip test --- .../acceptance/features/webUIFilesActionMenu/versions.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/features/webUIFilesActionMenu/versions.feature b/tests/acceptance/features/webUIFilesActionMenu/versions.feature index 98063c17702..5a278cba4c3 100644 --- a/tests/acceptance/features/webUIFilesActionMenu/versions.feature +++ b/tests/acceptance/features/webUIFilesActionMenu/versions.feature @@ -11,7 +11,7 @@ Feature: Versions of a file | user0 | | Alice | - @disablePreviews @skipOnOC10 @issue-5853 + @disablePreviews @issue-5853 Scenario: upload new file with same name to see if different versions are shown Given user "user0" has logged in using the webUI And user "user0" has uploaded file "lorem.txt" to "lorem.txt" @@ -96,4 +96,4 @@ Feature: Versions of a file When the user browses to display the "versions" details of file "lorem-file.txt" Then the content of file "lorem-file.txt" for user "Alice" should be "new lorem content" And the versions list should contain 2 entries - +