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] add test download previos version #6038

Merged
merged 1 commit into from
Dec 17, 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 @@ -195,3 +195,5 @@ Other free text and markdown formatting can be used elsewhere in the document if
- [webUISharingFilePermissionsGroups/sharePermissionsGroup.feature:66](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingFilePermissionsGroups/sharePermissionsGroup.feature#L66)
- [webUISharingPermissionToRoot/shareFileWithMultipleUsers.feature:66](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingPermissionToRoot/shareFileWithMultipleUsers.feature#L66)

### [downloading an old version of a file returns 501](https://github.com/owncloud/ocis/issues/2261)
- [webUIFilesActionMenu/versions.feature:107](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesActionMenu/versions.feature#L107)
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ Other free text and markdown formatting can be used elsewhere in the document if
- [webUIFilesActionMenu/versions.feature:48](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesActionMenu/versions.feature#L48)
- [webUIFilesActionMenu/versions.feature:63](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesActionMenu/versions.feature#L63)

### [Change the file content of a received shared file](https://github.com/owncloud/ocis/issues/2319)
ScharfViktor marked this conversation as resolved.
Show resolved Hide resolved
- [webUIFilesActionMenu/versions.feature:77](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesActionMenu/versions.feature#L77)
### [downloading an old version of a file returns 501](https://github.com/owncloud/ocis/issues/2261)
- [webUIFilesActionMenu/versions.feature:107](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesActionMenu/versions.feature#L107)

### [No occ command in ocis](https://github.com/owncloud/ocis/issues/1317)
- [webUIRestrictSharing/restrictReSharing.feature:23](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIRestrictSharing/restrictReSharing.feature#L23)
Expand Down Expand Up @@ -203,7 +203,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)
- [webUIFilesActionMenu/versions.feature:94](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesActionMenu/versions.feature#L94)

### [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
30 changes: 22 additions & 8 deletions tests/acceptance/features/webUIFilesActionMenu/versions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,23 @@ Feature: Versions of a file
Scenario: change the file content of a received shared file
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 "user0" has uploaded file with content "a text file" to "lorem.txt"
And user "user0" has shared file "lorem.txt" with user "Alice" with "all" permissions
And user "Alice" has accepted the share "Shares/lorem.txt" offered by user "user0"
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 uploaded file with content "a text file" to "simple-folder/lorem.txt"
And user "Brian" has shared folder "simple-folder" with user "Alice" with "all" permissions
And user "Alice" has accepted the share "simple-folder" offered by user "Brian"
And user "Alice" has logged in using the webUI
When the user opens folder "Shares" using the webUI
And the user uploads overwriting file "lorem.txt" using the webUI
And the user has opened folder "Shares"
And the user has opened folder "simple-folder"
When 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
Then the versions list should contain 1 entries


@issue-ocis-1328 @disablePreviews
@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"
Given the setting "shareapi_auto_accept_share" of app "core" has been set to "yes"
And 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"
Expand All @@ -97,3 +102,12 @@ Feature: Versions of a file
Then the content of file "lorem-file.txt" for user "Alice" should be "new lorem content"
And the versions list should contain 2 entries


@issue-ocis-2261
Scenario: user downloads a previous version of the file
Given user "Alice" has uploaded file with content "lorem" to "lorem.txt"
And user "Alice" has uploaded file with content "lorem content" to "lorem.txt"
And user "Alice" has logged in using the webUI
And the user browses to display the "versions" details of file "lorem.txt"
When the user downloads a previous version of the file using the webUI
Then as "Alice" the content of "lorem.txt" should be the same as the content of local file "lorem.txt"
12 changes: 12 additions & 0 deletions tests/acceptance/pageObjects/FilesPageElement/versionsDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ module.exports = {
.initAjaxCounters()
.click('@restorePreviousVersion')
.waitForOutstandingAjaxCalls()
},
/**
* @returns {*}
*/
downloadFilePreviousVersion: function () {
return this.waitForElementVisible('@downloadPreviousVersion').click(
'@downloadPreviousVersion'
)
}
},
elements: {
Expand All @@ -29,6 +37,10 @@ module.exports = {
selector:
'(//div[contains(@id,"oc-file-versions")]//tbody/tr[@class="file-row"])[1]//button[1]',
locateStrategy: 'xpath'
},
downloadPreviousVersion: {
selector: '//button[contains(@aria-label, "Download older version")]',
locateStrategy: 'xpath'
}
}
}
4 changes: 4 additions & 0 deletions tests/acceptance/stepDefinitions/filesContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,10 @@ Then(
}
)

When('the user downloads a previous version of the file using the webUI', function () {
return client.page.FilesPageElement.versionsDialog().downloadFilePreviousVersion()
})

/**
*
* @param {DataTable} entryList the list needs a heading line
Expand Down