From 42be9558794143334311e14393dc10d4fc341f9c Mon Sep 17 00:00:00 2001 From: ScharfViktor Date: Mon, 26 Jul 2021 00:11:21 +0200 Subject: [PATCH] upload or create into folder Shares --- .drone.star | 23 ++-- package.json | 2 +- ...-failures-with-oc10-server-oauth2-login.md | 2 +- ...-failures-with-ocis-server-ocis-storage.md | 5 + .../accessToSharesFolder.feature | 110 ++++++++++++++++++ tests/acceptance/pageObjects/personalPage.js | 6 + .../stepDefinitions/filesContext.js | 4 + 7 files changed, 143 insertions(+), 9 deletions(-) create mode 100644 tests/acceptance/features/webUIOperationsWithFolderShares/accessToSharesFolder.feature diff --git a/.drone.star b/.drone.star index 02241a0edfa..550758ad29e 100644 --- a/.drone.star +++ b/.drone.star @@ -66,6 +66,7 @@ config = { "oC10MoveUpload": [ "webUIMoveFilesFolders", "webUIUpload", + "webUIOperationsWithFolderShares", ], "oC10Resharing": [ "webUIResharing1", @@ -141,6 +142,7 @@ config = { }, "visualTesting": False, "screenShots": False, + "filterTags": "not @skipOnOC10 and not @notToImplementOnOC10", }, "webUINotification": { "type": NOTIFICATIONS, @@ -159,6 +161,7 @@ config = { }, "visualTesting": False, "screenShots": False, + "filterTags": "not @skipOnOC10 and not @notToImplementOnOC10", "notificationsAppNeeded": True, }, "webUIFederation": { @@ -172,6 +175,7 @@ config = { "EXPECTED_FAILURES_FILE": "%s/tests/acceptance/expected-failures-with-oc10-server-oauth2-login.md" % dir["web"], }, "notificationsAppNeeded": True, + "filterTags": "not @skipOnOC10 and not @notToImplementOnOC10", "federatedServerNeeded": True, "federatedServerVersion": "daily-master-qa", }, @@ -189,7 +193,7 @@ config = { "SCREEN_RESOLUTION": "768x1024", }, "notificationsAppNeeded": True, - "filterTags": "@smokeTest and not @skipOnXGAPortraitResolution and not @skip and not @skipOnOC10", + "filterTags": "@smokeTest and not @skipOnXGAPortraitResolution and not @skip and not @skipOnOC10 and not @notToImplementOnOC10", }, "webUI-XGA": { "type": FULL, @@ -206,6 +210,7 @@ config = { "webUIFilesList", "webUIFilesSearch", "webUILogin", + "webUIOperationsWithFolderShares", "webUIPreview", "webUIPrivateLinks", "webUIRenameFiles", @@ -267,7 +272,7 @@ config = { "EXPECTED_FAILURES_FILE": "%s/tests/acceptance/expected-failures-XGA-with-oc10-server-oauth2-login.md" % dir["web"], "SCREEN_RESOLUTION": "768x1024", }, - "filterTags": "@smokeTest and not @skipOnXGAPortraitResolution and not @skip and not @skipOnOC10", + "filterTags": "@smokeTest and not @skipOnXGAPortraitResolution and not @skip and not @skipOnOC10 and not @notToImplementOnOC10", }, "webUI-Notifications-iPhone": { "type": NOTIFICATIONS, @@ -283,7 +288,7 @@ config = { "SCREEN_RESOLUTION": "375x812", }, "notificationsAppNeeded": True, - "filterTags": "@smokeTest and not @skipOnIphoneResolution and not @skip and not @skipOnOC10", + "filterTags": "@smokeTest and not @skipOnIphoneResolution and not @skip and not @skipOnOC10 and not @notToImplementOnOC10", }, "webUI-iPhone": { "type": FULL, @@ -300,6 +305,7 @@ config = { "webUIFilesList", "webUIFilesSearch", "webUILogin", + "webUIOperationsWithFolderShares", "webUIPreview", "webUIPrivateLinks", "webUIRenameFiles", @@ -361,7 +367,7 @@ config = { "EXPECTED_FAILURES_FILE": "%s/tests/acceptance/expected-failures-Iphone-oc10-server-oauth2-login.md" % dir["web"], "SCREEN_RESOLUTION": "375x812", }, - "filterTags": "@smokeTest and not @skipOnIphoneResolution and not @skip and not @skipOnOC10", + "filterTags": "@smokeTest and not @skipOnIphoneResolution and not @skip and not @skipOnOC10 and not @notToImplementOnOC10", }, "webUI-ocis": { "type": FULL, @@ -451,6 +457,7 @@ config = { "webUIUpload", "webUIMoveFilesFolders", "webUIUserJourney", + "webUIOperationsWithFolderShares", ], }, "extraEnvironment": { @@ -481,7 +488,7 @@ config = { "SERVER_HOST": "http://owncloud/index.php/apps/web/index.html", "EXPECTED_FAILURES_FILE": "%s/tests/acceptance/expected-failures-with-oc10-server-oauth2-login-and-web-integration-app.md" % dir["web"], }, - "filterTags": "not @skip and not @skipOnOC10 and not @openIdLogin and @smokeTest", + "filterTags": "not @skip and not @skipOnOC10 and not @notToImplementOnOC10 and not @openIdLogin and @smokeTest", "oc10IntegrationAppIncluded": True, "notificationsAppNeeded": True, "screenShots": False, @@ -501,6 +508,7 @@ config = { "webUIFilesList", "webUIFilesSearch", "webUILogin", + "webUIOperationsWithFolderShares", "webUIPreview", "webUIPrivateLinks", "webUIRenameFiles", @@ -563,7 +571,7 @@ config = { "SERVER_HOST": "http://owncloud/index.php/apps/web/index.html", "EXPECTED_FAILURES_FILE": "%s/tests/acceptance/expected-failures-with-oc10-server-oauth2-login-and-web-integration-app.md" % dir["web"], }, - "filterTags": "not @skip and not @skipOnOC10 and not @openIdLogin and @smokeTest", + "filterTags": "not @skip and not @skipOnOC10 and not @notToImplementOnOC10 and not @openIdLogin and @smokeTest", "oc10IntegrationAppIncluded": True, "screenShots": False, }, @@ -621,6 +629,7 @@ basicTestSuites = [ "webUILogin", "webUIMarkdownEditor", "webUIMoveFilesFolders", + "webUIOperationsWithFolderShares", "webUIPreview", "webUIPrivateLinks", "webUIRenameFiles", @@ -1064,7 +1073,7 @@ def acceptance(ctx): "databases": ["mysql:5.5"], "extraEnvironment": {}, "cronOnly": False, - "filterTags": "not @skip and not @skipOnOC10 and not @openIdLogin", + "filterTags": "not @skip and not @skipOnOC10 and not @notToImplementOnOC10 and not @openIdLogin", "logLevel": "2", "notificationsAppNeeded": False, "federatedServerNeeded": False, diff --git a/package.json b/package.json index 708c76546b6..1fb609c394c 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "lint": "eslint '{packages,tests}/**/*.{js,ts,vue}' --color", "serve": "SERVER=true yarn build:w", "test:acceptance:drone": "cucumber-js --retry 1 --require-module @babel/register --require-module @babel/polyfill --require tests/acceptance/setup.js --require tests/acceptance/stepDefinitions --format node_modules/cucumber-pretty", - "test:acceptance:oc10": "cucumber-js --require-module @babel/register --require-module @babel/polyfill --require tests/acceptance/setup.js --require tests/acceptance/stepDefinitions --format node_modules/cucumber-pretty -t \"${TEST_TAGS:-not @skip and not @skipOnOC10}\"", + "test:acceptance:oc10": "cucumber-js --require-module @babel/register --require-module @babel/polyfill --require tests/acceptance/setup.js --require tests/acceptance/stepDefinitions --format node_modules/cucumber-pretty -t \"${TEST_TAGS:-not @skip and not @skipOnOC10 and not @notToImplementOnOC10}\"", "test:acceptance:ocis": "NODE_TLS_REJECT_UNAUTHORIZED=0 RUN_ON_OCIS=true cucumber-js --require-module @babel/register --require-module @babel/polyfill --require tests/acceptance/setup.js --require tests/acceptance/stepDefinitions --format node_modules/cucumber-pretty -t \"${TEST_TAGS:-not @skip and not @skipOnOCIS and not @notToImplementOnOCIS}\"", "test:unit": "jest --coverage --config ./tests/unit/config/jest.config.js", "test:integration": "jest --config ./tests/integration/config/jest.config.js" 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 d421991e9e3..34a8a4bf763 100644 --- a/tests/acceptance/expected-failures-with-oc10-server-oauth2-login.md +++ b/tests/acceptance/expected-failures-with-oc10-server-oauth2-login.md @@ -167,4 +167,4 @@ Other free text and markdown formatting can be used elsewhere in the document if - [webUISharingAcceptShares/acceptShares.feature:31](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUISharingAcceptShares/acceptShares.feature#L31) ### [Change the file content of a received shared file](https://github.com/owncloud/ocis/issues/2319) -- [webUIFilesActionMenu/versions.feature:88](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesActionMenu/versions.feature#L88) \ No newline at end of file +- [webUIFilesActionMenu/versions.feature:88](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFilesActionMenu/versions.feature#L88) 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 993b279867b..fe4f92351cd 100644 --- a/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md +++ b/tests/acceptance/expected-failures-with-ocis-server-ocis-storage.md @@ -524,6 +524,11 @@ Other free text and markdown formatting can be used elsewhere in the document if - [webUIUpload/upload.feature:138](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIUpload/upload.feature#L138) - [webUIUpload/uploadEdgecases.feature:67](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIUpload/uploadEdgecases.feature#L67) +### [user cannot upload new folder/file into folder Shares](https://github.com/owncloud/ocis/issues/2322) +- [webUIOperationsWithFolderShares/accessToSharesFolder.feature:29](https://github.com/owncloud/web/blob/master/tests/acceptance/webUIOperationsWithFolderShares/accessToSharesFolder.feature#L29) +- [webUIOperationsWithFolderShares/accessToSharesFolder.feature:38](https://github.com/owncloud/web/blob/master/tests/acceptance/webUIOperationsWithFolderShares/accessToSharesFolder.feature#L38) +- [webUIOperationsWithFolderShares/accessToSharesFolder.feature:89](https://github.com/owncloud/web/blob/master/tests/acceptance/webUIOperationsWithFolderShares/accessToSharesFolder.feature#L89) + ### [browsing directly to a details 'tab' is not possible](https://github.com/owncloud/web/issues/5464) - [webUIFiles/browseDirectlyToDetailsTab.feature:21](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFiles/browseDirectlyToDetailsTab.feature#L21) - [webUIFiles/browseDirectlyToDetailsTab.feature:22](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUIFiles/browseDirectlyToDetailsTab.feature#L22) diff --git a/tests/acceptance/features/webUIOperationsWithFolderShares/accessToSharesFolder.feature b/tests/acceptance/features/webUIOperationsWithFolderShares/accessToSharesFolder.feature new file mode 100644 index 00000000000..68a52ec8681 --- /dev/null +++ b/tests/acceptance/features/webUIOperationsWithFolderShares/accessToSharesFolder.feature @@ -0,0 +1,110 @@ +Feature: Upload into a folder Shares + This suite of tests describes different behavior in oCIS and os ownCloud10 with respect to + the folder "Shares". + The folder "Shares" in oCIS is the mount point for all incoming shares so it is only used for reading + The folder "Shares" in ownCloud10 is a folder in which you can download or save files + + Background: + 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 "Alice" has been created with default attributes and without skeleton files + And user "Brian" has been created with default attributes and without skeleton files + + @issue-ocis-2322 + Scenario: the Shares folder does not exist if no share has been accepted + Given user "Brian" has created file "lorem.txt" + And user "Brian" has shared file "lorem.txt" with user "Alice" with "all" permissions + When user "Alice" logs in using the webUI + Then folder "Shares" should not be listed on the webUI + + @issue-ocis-2322 + Scenario: the Shares folder exists after accepting the first shared file + Given user "Brian" has created file "lorem.txt" + And user "Brian" has shared file "lorem.txt" with user "Alice" with "all" permissions + And user "Alice" has accepted the share "lorem.txt" offered by user "Brian" + When user "Alice" logs in using the webUI + Then folder "Shares" should be listed on the webUI + + @issue-ocis-2322 @notToImplementOnOC10 + Scenario: try to upload a file or a folder into a folder Shares with all permissions in oCIS + Given user "Brian" has created file "lorem.txt" + And user "Brian" has shared file "lorem.txt" with user "Alice" with "all" permissions + And user "Alice" has accepted the share "lorem.txt" offered by user "Brian" + And user "Alice" has logged in using the webUI + When the user opens folder "Shares" using the webUI + Then it should not be possible to create files using the webUI + + @issue-ocis-2322 @notToImplementOnOC10 + Scenario: try to upload a file or a folder into a folder Shares with read permissions in oCIS + Given user "Brian" has created file "lorem.txt" + And user "Brian" has shared file "lorem.txt" with user "Alice" with "read" permissions + And user "Alice" has accepted the share "lorem.txt" offered by user "Brian" + And user "Alice" has logged in using the webUI + When the user opens folder "Shares" using the webUI + Then it should not be possible to create files using the webUI + + @issue-ocis-2322 @notToImplementOnOCIS + Scenario: upload of a file into a folder Shares in oc10 + Given user "Brian" has created file "lorem.txt" + And user "Brian" has shared file "lorem.txt" with user "Alice" with "all" permissions + And user "Alice" has accepted the share "lorem.txt" offered by user "Brian" + And user "Alice" has logged in using the webUI + And the user has opened folder "Shares" + When the user uploads file "new-lorem.txt" using the webUI + Then file "new-lorem.txt" should be listed on the webUI + + @issue-ocis-2322 @notToImplementOnOCIS + Scenario: upload of a folder into a folder Shares in oc 10 + Given user "Brian" has created file "lorem.txt" + And user "Brian" has shared file "lorem.txt" with user "Alice" with "all" permissions + And user "Alice" has accepted the share "lorem.txt" offered by user "Brian" + And user "Alice" has logged in using the webUI + And the user has opened folder "Shares" + When the user uploads folder "PARENT" using the webUI + Then no message should be displayed on the webUI + And folder "PARENT" should be listed on the webUI + + @issue-ocis-2322 @notToImplementOnOCIS + Scenario: create a new folder into a folder Shares in oc10 + Given user "Brian" has been created with default attributes and without skeleton files + And user "Brian" has created file "lorem.txt" + And user "Brian" has shared file "lorem.txt" with user "Alice" with "all" permissions + And user "Alice" has accepted the share "lorem.txt" offered by user "Brian" + And user "Alice" has logged in using the webUI + And the user has opened folder "Shares" + When the user creates a folder with the name "New folder" using the webUI + Then folder "New folder" should be listed on the webUI + + @issue-ocis-2322 @notToImplementOnOCIS + Scenario: move a file or a folder into a folder Shares in oc10 + Given user "Brian" has created file "lorem.txt" + And user "Brian" has shared file "lorem.txt" with user "Alice" with "read" permissions + And user "Alice" has accepted the share "lorem.txt" offered by user "Brian" + And user "Alice" has created folder "NewFolder" + And user "Alice" has logged in using the webUI + When the user moves folder "NewFolder" into folder "Shares" using the webUI + Then folder "NewFolder" should be listed on the webUI + + @issue-ocis-2322 @notToImplementOnOC10 + Scenario: try to move a file or a folder into a folder Shares in oCIS + Given user "Brian" has created file "lorem.txt" + And user "Brian" has shared file "lorem.txt" with user "Alice" with "read" permissions + And user "Alice" has accepted the share "lorem.txt" offered by user "Brian" + And user "Alice" has created folder "NewFolder" + And user "Alice" has logged in using the webUI + When the user tries to move folder "NewFolder" into folder "Shares" using the webUI + Then the move here folder button should be disabled + + @issue-ocis-2322 @notToImplementOnOCIS + Scenario: the user can delete files that they wrote into the folder Shares + Given user "Brian" has created file "lorem.txt" + And user "Brian" has shared file "lorem.txt" with user "Alice" with "all" permissions + And user "Alice" has accepted the share "lorem.txt" offered by user "Brian" + And user "Alice" has logged in using the webUI + And user "Alice" has created folder "Shares/NewFolder" + And user "Alice" has uploaded file with content "some data" to "Shares/textfile.txt" + And the user has opened folder "Shares" + When the user deletes folder "NewFolder" using the webUI + And the user deletes file "textfile.txt" using the webUI + Then folder "NewFolder" should not be listed on the webUI + And file "textfile.tx" should not be listed on the webUI diff --git a/tests/acceptance/pageObjects/personalPage.js b/tests/acceptance/pageObjects/personalPage.js index 793dd213d62..7e7bcde5ea6 100644 --- a/tests/acceptance/pageObjects/personalPage.js +++ b/tests/acceptance/pageObjects/personalPage.js @@ -326,6 +326,9 @@ module.exports = { .waitForElementVisible('@clearSelectionBtn') .click('@clearSelectionBtn') .waitForElementNotPresent('@clearSelectionBtn') + }, + checkForButtonMoveHereDisabled: function() { + return this.waitForElementVisible('@moveHereConfirmBtn') } }, elements: { @@ -436,6 +439,9 @@ module.exports = { }, dialogBoxInputTextInRed: { selector: '.oc-text-input-danger' + }, + moveHereConfirmBtn: { + selector: '#location-picker-btn-confirm:disabled' } } } diff --git a/tests/acceptance/stepDefinitions/filesContext.js b/tests/acceptance/stepDefinitions/filesContext.js index 85926d96d63..8742c10ad85 100644 --- a/tests/acceptance/stepDefinitions/filesContext.js +++ b/tests/acceptance/stepDefinitions/filesContext.js @@ -1250,6 +1250,10 @@ When('the user tries to move file/folder {string} into folder {string} using the ) }) +Then('the move here file/folder button should be disabled', function() { + return client.page.personalPage().checkForButtonMoveHereDisabled() +}) + When('the user selects move action for folder/file {string} using the webUI', async function( resource ) {