Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kiranparajuli589 committed Mar 12, 2020
1 parent ce5119a commit 608b23e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,7 @@ Feature: Sharing files and folders with internal groups
| shareWith | grp1 |
| expireDate | +14 |
And user "user3" has logged in using the webUI
When the user edits share with group "grp1" of file "lorem.txt" changing following
| expireDate | +7 |
When the user edits the collaborator expiry date of "grp1" of file "lorem.txt" to "+7" days using the webUI
Then user "user1" should have received a share with target "lorem (2).txt" and expiration date in 7 days
Then user "user2" should have received a share with target "lorem (2).txt" and expiration date in 7 days
And user "user3" should have a share with these details:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,7 @@ Feature: Sharing files and folders with internal users
| shareWith | user2 |
| expireDate | +14 |
And user "user1" has logged in using the webUI
When the user edits share with user "User Two" of file "lorem.txt" changing following
| expireDate | +7 |
When the user edits the collaborator expiry date of "User Two" of file "lorem.txt" to "+7" days using the webUI
Then user "user2" should have received a share with target "lorem (2).txt" and expiration date in 7 days
And user "user1" should have a share with these details:
| field | value |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,17 +487,17 @@ module.exports = {
return this.useXpath().expect.element(collaboratorSelector).to.not.be.present
},
/**
* @param collaborator
* @param value
* @param {string} collaborator Name of the collaborator
* @param {string} days number of days to be added or subtracted from current date
*
* @return {Promise<*>}
*/
changeCollaboratorExpiryDate: async function (collaborator, value) {
changeCollaboratorExpiryDate: async function (collaborator, days) {
await collaboratorDialog.clickEditShare(collaborator)
await this.api.page
.FilesPageElement
.expirationDatePicker()
.setExpirationDate(value)
.setExpirationDate(days)
return this.saveChanges()
}
},
Expand Down
9 changes: 4 additions & 5 deletions tests/acceptance/stepDefinitions/sharingContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Given('user {string} from remote server has shared {string} with user {string} f
* @param {string} elementToShare path of file/folder being shared
* @param {string} sharer username of the sharer
* @param receiver username of the receiver
* @param {number} shareType type of share user, group, public (link), federated (cloud share).
* @param shareType Type of share 0 = user, 1 = group, 3 = public (link), 6 = federated (cloud share).
* @param {string} permissionString permissions of the share for valid permissions see sharingHelper.PERMISSION_TYPES
* @param {string} name name of the link (for public links), default = "New Share"
* @param {object} extraParams Extra parameters allowed on the share
Expand Down Expand Up @@ -777,15 +777,14 @@ When(
}
)

When('the user edits share with user/group {string} of file/folder/resource {string} changing following',
async function (collaborator, resource, dataTable) {
When('the user edits the collaborator expiry date of {string} of file/folder/resource {string} to {string} days/day using the webUI',
async function (collaborator, resource, days) {
const api = client.page.FilesPageElement
const settings = dataTable.rowsHash()
await api
.appSideBar()
.closeSidebar(100)
.openSharingDialog(resource)
return api.sharingDialog().changeCollaboratorExpiryDate(collaborator, settings.expireDate)
return api.sharingDialog().changeCollaboratorExpiryDate(collaborator, days)
})

Then('user {string} should be listed as {string} in the collaborators list on the webUI', function (user, role) {
Expand Down

0 comments on commit 608b23e

Please sign in to comment.