Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only][full-ci]Add valid tests that were removed by PR #5973 #6047

Merged
merged 2 commits into from
Dec 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 13 additions & 1 deletion tests/acceptance/features/webUIFilesActionMenu/versions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure this one was deleted as flaky(?) also failes CI in this PR

Copy link
Contributor Author

@SwikritiT SwikritiT Nov 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It was skipped previously because of its flakiness but should it be entirely removed? I'll try to find out if it's the test timing problem or the backend issue. if it's the latter we can skip it again and probably create an issue

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

Original file line number Diff line number Diff line change
Expand Up @@ -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
48 changes: 17 additions & 31 deletions tests/acceptance/helpers/webdavHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Comment on lines +204 to +205
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adjusting this pause time to 1600 fixes the versions issue, the tests are passing even in multiple runs https://drone.owncloud.com/owncloud/web/20534/9/19

}

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())
}

/**
Expand Down