Skip to content

Commit

Permalink
add test download previos version
Browse files Browse the repository at this point in the history
фs usual forgot about lint

fix row number

fix after review

add steps folder Shares

fix expected failure

skip test in Ocis
  • Loading branch information
ScharfViktor committed Dec 13, 2021
1 parent 2a3b012 commit dd075a6
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 19 deletions.
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:94](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesActionMenu/versions.feature#L94)
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)
- [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:94](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesActionMenu/versions.feature#L94)

### [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
35 changes: 18 additions & 17 deletions tests/acceptance/features/webUIFilesActionMenu/versions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Feature: Versions of a file
Then the versions list should contain 1 entries

@ocis-reva-issue-110
@skipOnStorage:ceph @files_primary_s3-issue-155
@skipOnStorage:ceph @files_primary_s3-issue-155 @skipOnOCIS
Scenario: file versions cannot be seen on the webUI for all users after deleting versions for all users
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"
Expand All @@ -77,23 +77,24 @@ 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 created file "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
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

@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

0 comments on commit dd075a6

Please sign in to comment.