diff --git a/tests/acceptance/expected-failures-with-oc10-server-oauth2-login.md b/tests/acceptance/expected-failures-with-oc10-server-oauth2-login.md index 34b06d04b52..e2f4e87d6b0 100644 --- a/tests/acceptance/expected-failures-with-oc10-server-oauth2-login.md +++ b/tests/acceptance/expected-failures-with-oc10-server-oauth2-login.md @@ -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) 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 d6bbbff115c..74a09ebbb21 100644 --- a/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md +++ b/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md @@ -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) -- [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) @@ -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) diff --git a/tests/acceptance/features/webUIFilesActionMenu/versions.feature b/tests/acceptance/features/webUIFilesActionMenu/versions.feature index 5a278cba4c3..e4dba300dc5 100644 --- a/tests/acceptance/features/webUIFilesActionMenu/versions.feature +++ b/tests/acceptance/features/webUIFilesActionMenu/versions.feature @@ -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" @@ -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" diff --git a/tests/acceptance/pageObjects/FilesPageElement/versionsDialog.js b/tests/acceptance/pageObjects/FilesPageElement/versionsDialog.js index 77d46e4b062..3a7ab6bc4ca 100644 --- a/tests/acceptance/pageObjects/FilesPageElement/versionsDialog.js +++ b/tests/acceptance/pageObjects/FilesPageElement/versionsDialog.js @@ -18,6 +18,14 @@ module.exports = { .initAjaxCounters() .click('@restorePreviousVersion') .waitForOutstandingAjaxCalls() + }, + /** + * @returns {*} + */ + downloadFilePreviousVersion: function () { + return this.waitForElementVisible('@downloadPreviousVersion').click( + '@downloadPreviousVersion' + ) } }, elements: { @@ -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' } } } diff --git a/tests/acceptance/stepDefinitions/filesContext.js b/tests/acceptance/stepDefinitions/filesContext.js index 460becc16d7..5ca6e3f94e6 100644 --- a/tests/acceptance/stepDefinitions/filesContext.js +++ b/tests/acceptance/stepDefinitions/filesContext.js @@ -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