Skip to content

Commit

Permalink
[Tests-Only] refactor tests for Shares folder: webuiResharing, webuiS…
Browse files Browse the repository at this point in the history
…haringAcceptShares
  • Loading branch information
dpakach committed Sep 28, 2020
1 parent 2f6dae6 commit e427c92
Show file tree
Hide file tree
Showing 7 changed files with 803 additions and 243 deletions.
2 changes: 2 additions & 0 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ config = {
'webUISharingFolderPermissionsGroups': 'SharingFolderPermissionsGroups',
'webUISharingFolderAdvancedPermissionsGroups': 'SharingFolderAdvPermissionsGrp',
'webUIResharing': 'Resharing',
'webUIResharingToRoot': 'ResharingToRoot',
'webUISharingPublic': 'SharingPublic',
'webUISharingPublicDifferentRoles': 'SharingPublicDifferentRoles',
'webUITrashbin': 'Trashbin',
'webUIUpload': 'Upload',
'webUISharingAcceptShares': 'SharingAcceptShares',
'webUISharingAcceptSharesToRoot': 'SharingAcceptSharesRoot',
'webUISharingFilePermissionMultipleUsers': 'SharingFilePermissionMultipleUsers',
'webUISharingFolderPermissionMultipleUsers': 'SharingFolderPermissionMultipleUsers',
'webUISharingFolderAdvancedPermissionMultipleUsers': 'SharingFolderAdvancedPermissionMU',
Expand Down
182 changes: 118 additions & 64 deletions tests/acceptance/features/webUIResharing/reshareUsers.feature

Large diffs are not rendered by default.

238 changes: 238 additions & 0 deletions tests/acceptance/features/webUIResharingToRoot/reshareUsers.feature

Large diffs are not rendered by default.

240 changes: 61 additions & 179 deletions tests/acceptance/features/webUISharingAcceptShares/acceptShares.feature

Large diffs are not rendered by default.

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions tests/acceptance/helpers/sharingHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,21 @@ module.exports = {
}
return dateString
},
assertUserHasNoShares: function(user) {
const apiURL = 'apps/files_sharing/api/v1/shares?'
return httpHelper
.getOCS(apiURL, user)
.then(res => res.json())
.then(function(sharesResult) {
httpHelper.checkOCSStatus(
sharesResult,
'Could not get shares. Message: ' + sharesResult.ocs.meta.message
)
const shares = sharesResult.ocs.data
assert.equal(0, shares.length)
return this
})
},
/**
*
* @param {string } user
Expand Down
18 changes: 18 additions & 0 deletions tests/acceptance/stepDefinitions/sharingContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,10 @@ Then('user {string} should have received a share with these details:', function(
})
})

Then('user {string} should not have received any shares', function(user) {
return sharingHelper.assertUserHasNoShares(user)
})

Given('user {string} has created a new public link for resource {string}', function(
user,
resource
Expand Down Expand Up @@ -1245,6 +1249,14 @@ Given('user {string} has accepted the share {string} offered by user {code}', fu
return sharingHelper.acceptShare(filename, user, sharer)
})

Given('user {string} accepts the share {string} offered by user {code}', function(
user,
filename,
sharer
) {
return sharingHelper.acceptShare(filename, user, sharer)
})

Then('the file {string} shared by {string} should not be in {string} state', async function(
filename,
sharer,
Expand Down Expand Up @@ -1375,3 +1387,9 @@ When(
)
}
)

Given('the administrator has set the default folder for received shares to {string}', function(
folder
) {
return runOcc([`config:system:set share_folder --value=${folder}`])
})

0 comments on commit e427c92

Please sign in to comment.