From 824b1edd7b359e305ebc7892f066810d452cd3e7 Mon Sep 17 00:00:00 2001 From: Kiran Parajuli Date: Wed, 11 Mar 2020 16:27:56 +0545 Subject: [PATCH] Modified create share step impl. to support +- days in expiration --- .../shareWithGroups.feature | 2 +- .../webUISharingInternalUsers/shareWithUsers.feature | 2 +- tests/acceptance/stepDefinitions/sharingContext.js | 12 ++++++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/acceptance/features/webUISharingInternalGroups/shareWithGroups.feature b/tests/acceptance/features/webUISharingInternalGroups/shareWithGroups.feature index b92cbc6092d..faf0ed5b662 100644 --- a/tests/acceptance/features/webUISharingInternalGroups/shareWithGroups.feature +++ b/tests/acceptance/features/webUISharingInternalGroups/shareWithGroups.feature @@ -354,7 +354,7 @@ Feature: Sharing files and folders with internal groups | path | lorem.txt | | shareTypeString | group | | shareWith | grp1 | - | expireDate | 2038-10-12 | + | 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 | diff --git a/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature b/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature index 1b9f50689b5..0d6b7782d54 100644 --- a/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature +++ b/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature @@ -607,7 +607,7 @@ Feature: Sharing files and folders with internal users Given user "user1" has created a new share with following settings | path | lorem.txt | | shareWith | user2 | - | expireDate | 2038-10-12 | + | 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 | diff --git a/tests/acceptance/stepDefinitions/sharingContext.js b/tests/acceptance/stepDefinitions/sharingContext.js index 1e6e2f206c3..7b482753354 100644 --- a/tests/acceptance/stepDefinitions/sharingContext.js +++ b/tests/acceptance/stepDefinitions/sharingContext.js @@ -140,11 +140,15 @@ const shareFileFolder = function ( Given('user {string} has created a new share with following settings', function (sharer, dataTable) { const settings = dataTable.rowsHash() - let expireDate = settings.expireDate + const expireDate = settings.expireDate + let dateToSet = '' if (typeof expireDate !== 'undefined') { - expireDate = sharingHelper.calculateDate(expireDate) + dateToSet = sharingHelper.calculateDate(expireDate) + } + let targetShareType = null + if (settings.shareTypeString) { + targetShareType = sharingHelper.humanReadableShareTypeToNumber(settings.shareTypeString) } - const targetShareType = sharingHelper.humanReadableShareTypeToNumber(settings.shareTypeString) return shareFileFolder( settings.path, sharer, @@ -153,7 +157,7 @@ Given('user {string} has created a new share with following settings', settings.permissionString, settings.name, { - expireDate: expireDate, + expireDate: dateToSet, password: settings.password } )