diff --git a/.drone.yml b/.drone.yml index 44fbcf9ad3fb..33a2074bba3b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1074,6 +1074,15 @@ matrix: CHOWN_SERVER: true OWNCLOUD_LOG: true + - PHP_VERSION: 7.1 + TEST_SUITE: selenium + BEHAT_SUITE: webUIWebdavLocks + DB_TYPE: mariadb + USE_SERVER: true + INSTALL_SERVER: true + CHOWN_SERVER: true + OWNCLOUD_LOG: true + # caldav test - PHP_VERSION: 7.1 TEST_SUITE: caldav diff --git a/tests/acceptance/config/behat.yml b/tests/acceptance/config/behat.yml index 6fb2f14495b2..3901101a6569 100644 --- a/tests/acceptance/config/behat.yml +++ b/tests/acceptance/config/behat.yml @@ -324,6 +324,18 @@ default: - WebUILoginContext: - WebUISharingContext: + webUIWebdavLocks: + paths: + - %paths.base%/../features/webUIWebdavLocks + contexts: + - FeatureContext: *common_feature_context_params + - WebDavLockingContext: + - WebUIFilesContext: + - WebUIGeneralContext: + - WebUILoginContext: + - WebUIWebDavLockingContext: + - WebUISharingContext: + extensions: jarnaiz\JUnitFormatter\JUnitFormatterExtension: filename: report.xml diff --git a/tests/acceptance/features/bootstrap/WebDavLockingContext.php b/tests/acceptance/features/bootstrap/WebDavLockingContext.php new file mode 100644 index 000000000000..8ddc490c2083 --- /dev/null +++ b/tests/acceptance/features/bootstrap/WebDavLockingContext.php @@ -0,0 +1,147 @@ + + * @copyright Copyright (c) 2018 Artur Neumann artur@jankaritech.com + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, + * as published by the Free Software Foundation; + * either version 3 of the License, or any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see + * + */ + +use Behat\Behat\Context\Context; +use Behat\Behat\Hook\Scope\BeforeScenarioScope; +use Behat\Gherkin\Node\TableNode; +use TestHelpers\WebDavHelper; + +require_once 'bootstrap.php'; + +/** + * context containing API steps needed for the locking mechanism of webdav + */ +class WebDavLockingContext implements Context { + + /** + * + * @var FeatureContext + */ + private $featureContext; + /** + * + * @var string[][] + */ + private $tokenOfLastLock = []; + + /** + * @When the user :user locks file/folder :file using the WebDAV API setting following properties + * @Given the user :user has locked file/folder :file setting following properties + * + * @param string $user + * @param string $file + * @param TableNode $properties table with no heading with | property | value | + * + * @return void + */ + public function lockFileUsingWebDavAPI($user, $file, TableNode $properties) { + $baseUrl = $this->featureContext->getBaseUrl(); + $password = $this->featureContext->getPasswordForUser($user); + $body + = "" . + " "; + $headers = []; + $propertiesRows = $properties->getRows(); + foreach ($propertiesRows as $property) { + if ($property[0] === "depth") { //depth is set in the header not in the xml + $headers["Depth"] = $property[1]; + } else { + $body .= ""; + } + } + + $body .= ""; + $response = WebDavHelper::makeDavRequest( + $baseUrl, $user, $password, "LOCK", $file, $headers, $body, null, + $this->featureContext->getDavPathVersion() + ); + $responseXml = $this->featureContext->getResponseXml($response); + $responseXml->registerXPathNamespace('d', 'DAV:'); + $xmlPart = $responseXml->xpath("//d:locktoken/d:href"); + $this->tokenOfLastLock[$user][$file] = (string)$xmlPart[0]; + } + + /** + * @When the user :user unlocks the last created lock of file/folder :file using the WebDAV API + * + * @param string $user + * @param string $file + * + * @return void + */ + public function unlockLastLockUsingWebDavAPI($user, $file) { + $baseUrl = $this->featureContext->getBaseUrl(); + $password = $this->featureContext->getPasswordForUser($user); + $headers = ["Lock-Token" => $this->tokenOfLastLock[$user][$file]]; + WebDavHelper::makeDavRequest( + $baseUrl, $user, $password, "UNLOCK", $file, $headers, null, null, + $this->featureContext->getDavPathVersion() + ); + } + + /** + * @Then :count locks should be reported for file/folder :file of user :user by the WebDAV API + * + * @param int $count + * @param string $file + * @param string $user + * + * @return void + */ + public function numberOfLockShouldBeReported($count, $file, $user) { + $baseUrl = $this->featureContext->getBaseUrl(); + $password = $this->featureContext->getPasswordForUser($user); + $body + = "" . + " " . + "" . + ""; + $response = WebDavHelper::makeDavRequest( + $baseUrl, $user, $password, "PROPFIND", $file, null, $body, null, + $this->featureContext->getDavPathVersion() + ); + $responseXml = $this->featureContext->getResponseXml($response); + $responseXml->registerXPathNamespace('d', 'DAV:'); + $xmlPart = $responseXml->xpath("//d:response//d:lockdiscovery/d:activelock"); + PHPUnit_Framework_Assert::assertCount( + (int)$count, $xmlPart, + "expected $count lock(s) for '$file' but found " . \count($xmlPart) + ); + } + + /** + * This will run before EVERY scenario. + * It will set the properties for this object. + * + * @BeforeScenario + * + * @param BeforeScenarioScope $scope + * + * @return void + */ + public function before(BeforeScenarioScope $scope) { + // Get the environment + $environment = $scope->getEnvironment(); + // Get all the contexts you need in this context + $this->featureContext = $environment->getContext('FeatureContext'); + } +} diff --git a/tests/acceptance/features/bootstrap/WebUIWebDavLockingContext.php b/tests/acceptance/features/bootstrap/WebUIWebDavLockingContext.php new file mode 100644 index 000000000000..77d7e5dda81c --- /dev/null +++ b/tests/acceptance/features/bootstrap/WebUIWebDavLockingContext.php @@ -0,0 +1,177 @@ + + * @copyright Copyright (c) 2017 Artur Neumann artur@jankaritech.com + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, + * as published by the Free Software Foundation; + * either version 3 of the License, or any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see + * + */ + +use Behat\Behat\Context\Context; +use Behat\Behat\Hook\Scope\BeforeScenarioScope; +use Behat\MinkExtension\Context\RawMinkContext; +use Page\FilesPage; +use Page\SharedWithYouPage; + +require_once 'bootstrap.php'; + +/** + * context containing webUI steps needed for the locking mechanism of webdav + */ +class WebUIWebDavLockingContext extends RawMinkContext implements Context { + + /** + * + * @var FilesPage + */ + private $filesPage; + + /** + * + * @var SharedWithYouPage + */ + private $sharedWithYouPage; + + /** + * + * @var WebUIGeneralContext + */ + private $webUIGeneralContext; + + private $uploadConflictDialogTitle = "file conflict"; + + /** + * WebUIFilesContext constructor. + * + * @param FilesPage $filesPage + * @param SharedWithYouPage $sharedWithYouPage + * + * @return void + */ + public function __construct( + FilesPage $filesPage, + SharedWithYouPage $sharedWithYouPage + ) { + $this->filesPage = $filesPage; + $this->sharedWithYouPage = $sharedWithYouPage; + } + + /** + * @When the user unlocks the lock no :lockNumber of file/folder :file on the webUI + * + * @param int $lockNumber + * @param string $file + * + * @return void + */ + public function unlockFileOnTheWebui($lockNumber, $file) { + $this->closeDetailsDialog(); + $pageObject = $this->webUIGeneralContext->getCurrentPageObject(); + $fileRow = $pageObject->findFileRowByName($file, $this->getSession()); + $fileRow->deleteLockByNumber($lockNumber, $this->getSession()); + } + + /** + * @Then file/folder :file should be marked as locked on the webUI + * + * @param string $file + * + * @return void + */ + public function theFileShouldBeMarkedAsLockedOnTheWebui($file) { + $this->closeDetailsDialog(); + $pageObject = $this->webUIGeneralContext->getCurrentPageObject(); + $fileRow = $pageObject->findFileRowByName($file, $this->getSession()); + PHPUnit_Framework_Assert::assertTrue( + $fileRow->getLockState(), + "'$file' should be marked as locked, but its not" + ); + } + + /** + * @Then file/folder :file should not be marked as locked on the webUI + * + * @param string $file + * + * @return void + */ + public function theFileShouldNotBeMarkedAsLockedOnTheWebui($file) { + $this->closeDetailsDialog(); + $pageObject = $this->webUIGeneralContext->getCurrentPageObject(); + $fileRow = $pageObject->findFileRowByName($file, $this->getSession()); + PHPUnit_Framework_Assert::assertFalse( + $fileRow->getLockState(), + "'$file' should not be marked as locked, but it is" + ); + } + + /** + * @Then file/folder :file should be marked as locked by user :lockedBy in the locks tab of the details panel on the webUI + * + * @param string $file + * @param string $lockedBy + * + * @return boolean + */ + public function theFileShouldBeMarkedAsLockedByUserInLocksTab( + $file, $lockedBy + ) { + $this->closeDetailsDialog(); + $pageObject = $this->webUIGeneralContext->getCurrentPageObject(); + $fileRow = $pageObject->findFileRowByName($file, $this->getSession()); + $lockDialog = $fileRow->openLockDialog(); + $locks = $lockDialog->getAllLocks(); + foreach ($locks as $lock) { + $locker = $lock->getLockingUser(); + if ($lockedBy === $locker) { + return true; + } + } + PHPUnit_Framework_Assert::fail("cannot find a lock set by $lockedBy"); + } + + /** + * This will run before EVERY scenario. + * It will set the properties for this object. + * + * @BeforeScenario @webUI + * + * @param BeforeScenarioScope $scope + * + * @return void + */ + public function before(BeforeScenarioScope $scope) { + // Get the environment + $environment = $scope->getEnvironment(); + // Get all the contexts you need in this context + $this->webUIGeneralContext = $environment->getContext('WebUIGeneralContext'); + } + + /** + * closes any open details dialog but ignores any error (e.g. no dialog open) + * + * @return void + */ + private function closeDetailsDialog() { + $pageObject = $this->webUIGeneralContext->getCurrentPageObject(); + try { + $pageObject->closeDetailsDialog(); + } catch (Exception $e) { + //ignoge if dialog cannot be closed + //most likely there is no dialog open + } + } +} diff --git a/tests/acceptance/features/lib/FilesPageElement/FileRow.php b/tests/acceptance/features/lib/FilesPageElement/FileRow.php index 7d3f2a1bb973..b3ad88b53ac5 100644 --- a/tests/acceptance/features/lib/FilesPageElement/FileRow.php +++ b/tests/acceptance/features/lib/FilesPageElement/FileRow.php @@ -56,10 +56,12 @@ class FileRow extends OwncloudPage { protected $notMarkedFavoriteXpath = "//span[contains(@class,'icon-star')]"; protected $markedFavoriteXpath = "//span[contains(@class,'icon-starred')]"; protected $shareStateXpath = "//span[@class='state']"; + protected $lockStateXpath = "//span[contains(@class,'icon-lock')]"; protected $sharerXpath = "//a[@data-action='Share']"; protected $acceptShareBtnXpath = "//span[@class='fileactions']//a[contains(@class,'accept')]"; protected $declinePendingShareBtnXpath = "//a[@data-action='Reject']"; protected $sharingDialogXpath = ".//div[@class='dialogContainer']"; + protected $lockDialogId = "lockTabView"; protected $highlightsXpath = "//div[@class='highlights']"; /** @@ -211,6 +213,52 @@ public function openSharingDialog(Session $session) { return $sharingDialogPage; } + /** + * opens the lock dialog that list all locks of the given file row + * + * @throws ElementNotFoundException + * @return LockDialog + */ + public function openLockDialog() { + $element = $this->rowElement->find("xpath", $this->lockStateXpath); + $this->assertElementNotNull( + $element, + __METHOD__ . + " xpath $this->lockStateXpath could not find lock button in row" + ); + $element->click(); + $lockDailogElement = $this->findById($this->lockDialogId); + $this->assertElementNotNull( + $lockDailogElement, + __METHOD__ . + " id $this->lockDialogId could not find lock dialog" + ); + $this->waitFor( + STANDARD_UI_WAIT_TIMEOUT_MILLISEC / 1000, [$lockDailogElement, 'isVisible'] + ); + + /** + * + * @var LockDialog $lockDialog + */ + $lockDialog = $this->getPage("FilesPageElement\\LockDialog"); + $lockDialog->setElement($lockDailogElement); + return $lockDialog; + } + + /** + * deletes a lock by its order in the list + * + * @param int $number + * @param Session $session + * + * @return void + */ + public function deleteLockByNumber($number, Session $session) { + $lockDialog = $this->openLockDialog(); + $lockDialog->deleteLockByNumber($number, $session); + } + /** * finds the input field to rename the file/folder * @@ -419,6 +467,21 @@ public function unmarkFavorite() { $element->click(); } + /** + * returns the lock state + * + * @throws ElementNotFoundException + * + * @return bool + */ + public function getLockState() { + $element = $this->rowElement->find("xpath", $this->lockStateXpath); + if ($element === null) { + return false; + } + return $element->isVisible(); + } + /** * returns the share state (only works on the "Shared with you" page) * diff --git a/tests/acceptance/features/lib/FilesPageElement/LockDialog.php b/tests/acceptance/features/lib/FilesPageElement/LockDialog.php new file mode 100644 index 000000000000..e89718935798 --- /dev/null +++ b/tests/acceptance/features/lib/FilesPageElement/LockDialog.php @@ -0,0 +1,111 @@ + + * @copyright Copyright (c) 2017 Artur Neumann artur@jankaritech.com + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, + * as published by the Free Software Foundation; + * either version 3 of the License, or any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see + * + */ + +namespace Page\FilesPageElement; + +use Behat\Mink\Session; +use Behat\Mink\Element\NodeElement; +use Page\OwncloudPage; +use Page\FilesPageElement\LockDialogElement\LockEntry; + +/** + * The Lock Dialog, lists all the locks and gives a posibility to delete them + * + */ +class LockDialog extends OwncloudPage { + + /** + * + * @var string $path + */ + protected $path = '/index.php/apps/files/'; + /** + * @var NodeElement of this dialog + */ + protected $dialogElement; + protected $lockEntriesXpath = "//div[@class='lock-entry']"; + + /** + * sets the NodeElement for the current dialog + * a little bit like __construct() but as we access this "sub-page-object" + * from an other Page Object by + * $this->getPage("FilesPageElement\\LockDialog") + * there is no real __construct() that can take arguments + * + * @param NodeElement $dialogElement + * + * @return void + */ + public function setElement(NodeElement $dialogElement) { + $this->dialogElement = $dialogElement; + } + + /** + * + * @return LockEntry[] + */ + public function getAllLocks() { + $lockEntryElements = $this->dialogElement->findAll("xpath", $this->lockEntriesXpath); + $lockEntries = []; + foreach ($lockEntryElements as $lockEntryElement) { + /** + * + * @var LockEntry $lockEntry + */ + $lockEntry = $this->getPage("FilesPageElement\\LockDialogElement\\LockEntry"); + $lockEntry->setElement($lockEntryElement); + $lockEntries[] = $lockEntry; + } + return $lockEntries; + } + + /** + * find the lock by it order in the list + * + * @param int $number + * @param Session $session + * + * @return void + */ + public function deleteLockByNumber($number, Session $session) { + $lockEntryElements = $this->dialogElement->findAll("xpath", $this->lockEntriesXpath); + /** + * + * @var LockEntry $lockEntry + */ + $lockEntry = $this->getPage("FilesPageElement\\LockDialogElement\\LockEntry"); + $lockEntry->setElement($lockEntryElements[$number - 1]); + $lockEntry->delete($session); + } + + /** + * + * @param string $user + * @param string $resource + * + * @return void + */ + public function deleteLockByUserAndLockingResource($user, $resource) { + throw new \Exception("not yet implemented"); + } +} diff --git a/tests/acceptance/features/lib/FilesPageElement/LockDialogElement/LockEntry.php b/tests/acceptance/features/lib/FilesPageElement/LockDialogElement/LockEntry.php new file mode 100644 index 000000000000..c01aa8bc12ae --- /dev/null +++ b/tests/acceptance/features/lib/FilesPageElement/LockDialogElement/LockEntry.php @@ -0,0 +1,119 @@ + + * @copyright Copyright (c) 2017 Artur Neumann artur@jankaritech.com + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, + * as published by the Free Software Foundation; + * either version 3 of the License, or any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see + * + */ + +namespace Page\FilesPageElement\LockDialogElement; + +use Behat\Mink\Session; +use Behat\Mink\Element\NodeElement; +use Page\OwncloudPage; + +/** + * A single Lock Entry + * + */ +class LockEntry extends OwncloudPage { + + /** + * + * @var string $path + */ + protected $path = '/index.php/apps/files/'; + /** + * @var NodeElement of this dialog + */ + protected $lockElement; + protected $lockDescriptionXpath = "/div"; + protected $lockingUserExtractPattern = "/^(.*)\shas locked/"; + protected $unlockButtonXpath = "/a[@class='unlock']"; + + /** + * sets the NodeElement for the current entry + * a little bit like __construct() but as we access this "sub-page-object" + * from an other Page Object by + * $this->getPage("FilesPageElement\\LockDialog") + * there is no real __construct() that can take arguments + * + * @param NodeElement $lockElement + * + * @return void + */ + public function setElement(NodeElement $lockElement) { + $this->lockElement = $lockElement; + } + + /** + * delete the lock + * + * @param Session $session + * + * @return void + */ + public function delete(Session $session) { + $unlockButton = $this->lockElement->find("xpath", $this->unlockButtonXpath); + $this->assertElementNotNull( + $unlockButton, + __METHOD__ . " xpath $this->unlockButtonXpath " . + " cannot find unlock button" + ); + $unlockButton->click(); + $this->waitForAjaxCallsToStartAndFinish($session); + } + + /** + * gets the user that has locked the ressource + * + * @throws \Exception + * + * @return string + */ + public function getLockingUser() { + $lockDescriptionElement = $this->lockElement->find( + "xpath", $this->lockDescriptionXpath + ); + $this->assertElementNotNull( + $lockDescriptionElement, + __METHOD__ . " xpath $this->lockDescriptionXpath " . + " cannot find lock description element" + ); + $matches = []; + if (\preg_match( + $this->lockingUserExtractPattern, + $lockDescriptionElement->getText(), + $matches + ) + ) { + return $matches [1]; + } + throw new \Exception( + "could not extract locking user name from lock description '" . + $lockDescriptionElement->getText() . "'" + ); + } + + /** + * @return void + */ + public function getLockingResource() { + throw new \Exception("not yet implemented"); + } +} diff --git a/tests/acceptance/features/webUIWebdavLocks/locks.feature b/tests/acceptance/features/webUIWebdavLocks/locks.feature new file mode 100644 index 000000000000..fadf39283df9 --- /dev/null +++ b/tests/acceptance/features/webUIWebdavLocks/locks.feature @@ -0,0 +1,721 @@ +@webUI @insulated @disablePreviews +Feature: Locks + As a user + I would like to be able to delete locks of files and folders + So that I can access files with locks that have not been cleared + + Background: + #do not set email, see bugs in https://github.com/owncloud/core/pull/32250#issuecomment-434615887 + Given these users have been created: + |username | + |brand-new-user| + And user "brand-new-user" has logged in using the webUI + + Scenario: setting a lock shows the lock symbols at the correct files/folders + Given the user "brand-new-user" has locked folder "simple-folder" setting following properties + | lockscope | shared | + And the user "brand-new-user" has locked file "data.zip" setting following properties + | lockscope | exclusive | + When the user browses to the files page + Then folder "simple-folder" should be marked as locked on the webUI + And folder "simple-folder" should be marked as locked by user "brand-new-user" in the locks tab of the details panel on the webUI + But folder "simple-empty-folder" should not be marked as locked on the webUI + And file "data.zip" should be marked as locked on the webUI + And file "data.zip" should be marked as locked by user "brand-new-user" in the locks tab of the details panel on the webUI + But file "data.tar.gz" should not be marked as locked on the webUI + + Scenario: setting a lock shows the display name of a user in the locking details + Given these users have been created: + |username |displayname | + |user-with-display-name|My fancy name| + Given the user "user-with-display-name" has locked folder "simple-folder" setting following properties + | lockscope | shared | + And the user "user-with-display-name" has locked file "data.zip" setting following properties + | lockscope | exclusive | + When the user re-logs in with username "user-with-display-name" and password "%regular%" using the webUI + And folder "simple-folder" should be marked as locked by user "My fancy name" in the locks tab of the details panel on the webUI + And file "data.zip" should be marked as locked by user "My fancy name" in the locks tab of the details panel on the webUI + + Scenario: setting a lock shows the display name of a user in the locking details (user has set email address) + Given these users have been created: + |username |displayname |email | + |user-with-display-name|My fancy name|mail@oc.org| + Given the user "user-with-display-name" has locked folder "simple-folder" setting following properties + | lockscope | shared | + And the user "user-with-display-name" has locked file "data.zip" setting following properties + | lockscope | exclusive | + When the user re-logs in with username "user-with-display-name" and password "%regular%" using the webUI + And folder "simple-folder" should be marked as locked by user "My fancy name (mail@oc.org)" in the locks tab of the details panel on the webUI + And file "data.zip" should be marked as locked by user "My fancy name (mail@oc.org)" in the locks tab of the details panel on the webUI + + Scenario: setting a lock shows the user name of a user in the locking details (user has set email address) + Given these users have been created: + |username |email | + |user-with-email |mail@oc.org| + Given the user "user-with-email" has locked folder "simple-folder" setting following properties + | lockscope | shared | + And the user "user-with-email" has locked file "data.zip" setting following properties + | lockscope | exclusive | + When the user re-logs in with username "user-with-email" and password "%regular%" using the webUI + And folder "simple-folder" should be marked as locked by user "user-with-email (mail@oc.org)" in the locks tab of the details panel on the webUI + And file "data.zip" should be marked as locked by user "user-with-email (mail@oc.org)" in the locks tab of the details panel on the webUI + + Scenario: setting a lock shows the lock symbols at the correct files/folders on the favorites page + Given the user "brand-new-user" has locked folder "simple-folder" setting following properties + | lockscope | shared | + And the user "brand-new-user" has locked file "data.zip" setting following properties + | lockscope | exclusive | + When the user marks folder "simple-folder" as favorite using the webUI + And the user marks folder "simple-empty-folder" as favorite using the webUI + And the user marks file "data.zip" as favorite using the webUI + And the user marks file "data.tar.gz" as favorite using the webUI + And the user browses to the favorites page + Then folder "simple-folder" should be marked as locked on the webUI + And folder "simple-folder" should be marked as locked by user "brand-new-user" in the locks tab of the details panel on the webUI + But folder "simple-empty-folder" should not be marked as locked on the webUI + And file "data.zip" should be marked as locked on the webUI + And file "data.zip" should be marked as locked by user "brand-new-user" in the locks tab of the details panel on the webUI + But file "data.tar.gz" should not be marked as locked on the webUI + + @skip @issue-33867 + Scenario: setting a lock shows the lock symbols at the correct files/folders on the shared-with-others page + Given these users have been created: + |username | + |receiver | + And the user "brand-new-user" has locked folder "simple-folder" setting following properties + | lockscope | shared | + And the user "brand-new-user" has locked file "data.zip" setting following properties + | lockscope | exclusive | + And user "brand-new-user" has shared file "data.zip" with user "receiver" + And user "brand-new-user" has shared file "data.tar.gz" with user "receiver" + And user "brand-new-user" has shared folder "simple-folder" with user "receiver" + And user "brand-new-user" has shared folder "simple-empty-folder" with user "receiver" + When the user browses to the shared-with-others page + Then folder "simple-folder" should be marked as locked on the webUI + And folder "simple-folder" should be marked as locked by user "brand-new-user" in the locks tab of the details panel on the webUI + But folder "simple-empty-folder" should not be marked as locked on the webUI + And file "data.zip" should be marked as locked on the webUI + And file "data.zip" should be marked as locked by user "brand-new-user" in the locks tab of the details panel on the webUI + But file "data.tar.gz" should not be marked as locked on the webUI + + @skip @issue-33867 + Scenario: setting a lock shows the lock symbols at the correct files/folders on the shared-by-link page + Given the user "brand-new-user" has locked folder "simple-folder" setting following properties + | lockscope | shared | + And the user "brand-new-user" has locked file "data.zip" setting following properties + | lockscope | exclusive | + And user "brand-new-user" has created a public link share with settings + | path | data.zip | + And user "brand-new-user" has created a public link share with settings + | path | data.tar.gz | + And user "brand-new-user" has created a public link share with settings + | path | simple-folder | + And user "brand-new-user" has created a public link share with settings + | path | simple-empty-folder | + When the user browses to the shared-by-link page + Then folder "simple-folder" should be marked as locked on the webUI + And folder "simple-folder" should be marked as locked by user "brand-new-user" in the locks tab of the details panel on the webUI + But folder "simple-empty-folder" should not be marked as locked on the webUI + And file "data.zip" should be marked as locked on the webUI + And file "data.zip" should be marked as locked by user "brand-new-user" in the locks tab of the details panel on the webUI + But file "data.tar.gz" should not be marked as locked on the webUI + + @skip @issue-33867 + Scenario: setting a lock shows the lock symbols at the correct files/folders on the shared-with-you page + Given these users have been created: + |username | + |sharer | + And the user "sharer" has locked folder "simple-folder" setting following properties + | lockscope | shared | + And the user "sharer" has locked file "data.zip" setting following properties + | lockscope | exclusive | + And user "sharer" has shared file "data.zip" with user "brand-new-user" + And user "sharer" has shared file "data.tar.gz" with user "brand-new-user" + And user "sharer" has shared folder "simple-folder" with user "brand-new-user" + And user "sharer" has shared folder "simple-empty-folder" with user "brand-new-user" + When the user browses to the shared-with-you page + Then folder "simple-folder (2)" should be marked as locked on the webUI + And folder "simple-folder (2)" should be marked as locked by user "brand-new-user" in the locks tab of the details panel on the webUI + But folder "simple-empty-folder (2)" should not be marked as locked on the webUI + And file "data (2).zip" should be marked as locked on the webUI + And file "data (2).zip" should be marked as locked by user "brand-new-user" in the locks tab of the details panel on the webUI + But file "data (2).tar.gz" should not be marked as locked on the webUI + + Scenario: clicking other tabs does not change the lock symbol + When the user opens the share dialog for folder "simple-folder" + Then folder "simple-folder" should not be marked as locked on the webUI + + Scenario: lock set on a shared file shows the lock information for all involved users + Given these users have been created: + |username | + |sharer | + |receiver | + |receiver2 | + And group "receiver-group" has been created + And user "receiver2" has been added to group "receiver-group" + And user "sharer" has shared file "data.zip" with user "receiver" + And user "sharer" has shared file "data.tar.gz" with group "receiver-group" + And user "receiver" has shared file "data (2).zip" with user "brand-new-user" + And the user "sharer" has locked file "data.zip" setting following properties + | lockscope | shared | + And the user "receiver" has locked file "data (2).zip" setting following properties + | lockscope | shared | + And the user "brand-new-user" has locked file "data (2).zip" setting following properties + | lockscope | shared | + And the user "receiver2" has locked file "data.tar (2).gz" setting following properties + | lockscope | shared | + When the user browses to the files page + Then file "data (2).zip" should be marked as locked on the webUI + And file "data (2).zip" should be marked as locked by user "sharer" in the locks tab of the details panel on the webUI + And file "data (2).zip" should be marked as locked by user "receiver" in the locks tab of the details panel on the webUI + And file "data (2).zip" should be marked as locked by user "brand-new-user" in the locks tab of the details panel on the webUI + But file "data.zip" should not be marked as locked on the webUI + When the user re-logs in as "sharer" using the webUI + Then file "data.zip" should be marked as locked on the webUI + And file "data.zip" should be marked as locked by user "sharer" in the locks tab of the details panel on the webUI + And file "data.zip" should be marked as locked by user "receiver" in the locks tab of the details panel on the webUI + And file "data.zip" should be marked as locked by user "brand-new-user" in the locks tab of the details panel on the webUI + And file "data.tar.gz" should be marked as locked on the webUI + And file "data.tar.gz" should be marked as locked by user "receiver2" in the locks tab of the details panel on the webUI + When the user re-logs in as "receiver2" using the webUI + Then file "data.tar (2).gz" should be marked as locked on the webUI + And file "data.tar (2).gz" should be marked as locked by user "receiver2" in the locks tab of the details panel on the webUI + + Scenario: setting a lock on a folder shows the symbols at the sub-elements + Given the user "brand-new-user" has locked folder "simple-folder" setting following properties + | lockscope | shared | + When the user opens folder "simple-folder" using the webUI + Then folder "simple-empty-folder" should be marked as locked on the webUI + And folder "simple-empty-folder" should be marked as locked by user "brand-new-user" in the locks tab of the details panel on the webUI + And file "data.zip" should be marked as locked on the webUI + And file "data.zip" should be marked as locked by user "brand-new-user" in the locks tab of the details panel on the webUI + + Scenario: setting a depth:0 lock on a folder does not shows the symbols at the sub-elements + Given the user "brand-new-user" has locked folder "simple-folder" setting following properties + | depth | 0 | + When the user browses to the files page + Then folder "simple-folder" should be marked as locked on the webUI + When the user opens folder "simple-folder" using the webUI + Then folder "simple-empty-folder" should not be marked as locked on the webUI + And file "data.zip" should not be marked as locked on the webUI + + Scenario: unlocking by webDAV deletes the lock symbols at the correct files/folders + Given the user "brand-new-user" has locked folder "simple-folder" setting following properties + | lockscope | shared | + When the user "brand-new-user" unlocks the last created lock of folder "simple-folder" using the WebDAV API + And the user browses to the files page + Then folder "simple-folder" should not be marked as locked on the webUI + + Scenario Outline: deleting the only remaining lock of a file/folder + Given the user "brand-new-user" has locked file "lorem.txt" setting following properties + | lockscope | | + And the user "brand-new-user" has locked folder "simple-folder" setting following properties + | lockscope | | + And the user has browsed to the files page + When the user unlocks the lock no 1 of file "lorem.txt" on the webUI + And the user unlocks the lock no 1 of folder "simple-folder" on the webUI + Then file "lorem.txt" should not be marked as locked on the webUI + And folder "simple-folder" should not be marked as locked on the webUI + And 0 locks should be reported for file "lorem.txt" of user "brand-new-user" by the WebDAV API + And 0 locks should be reported for folder "simple-folder" of user "brand-new-user" by the WebDAV API + And 0 locks should be reported for file "simple-folder/lorem.txt" of user "brand-new-user" by the WebDAV API + Examples: + | lockscope | + | exclusive | + | shared | + + Scenario Outline: deleting the only remaining lock of a file/folder and reloading the page + Given the user "brand-new-user" has locked file "lorem.txt" setting following properties + | lockscope | exclusive | + And the user "brand-new-user" has locked folder "simple-folder" setting following properties + | lockscope | exclusive | + And the user has browsed to the files page + When the user unlocks the lock no 1 of file "lorem.txt" on the webUI + And the user unlocks the lock no 1 of folder "simple-folder" on the webUI + And the user reloads the current page of the webUI + Then file "lorem.txt" should not be marked as locked on the webUI + And folder "simple-folder" should not be marked as locked on the webUI + And 0 locks should be reported for file "lorem.txt" of user "brand-new-user" by the WebDAV API + And 0 locks should be reported for folder "simple-folder" of user "brand-new-user" by the WebDAV API + And 0 locks should be reported for file "simple-folder/lorem.txt" of user "brand-new-user" by the WebDAV API + Examples: + | lockscope | + | exclusive | + | shared | + + Scenario Outline: deleting the only remaining lock of a folder by deleting it from a file in folder + Given the user "brand-new-user" has locked folder "simple-folder" setting following properties + | lockscope | | + And the user has browsed to the files page + And the user has opened folder "simple-folder" using the webUI + When the user unlocks the lock no 1 of file "lorem.txt" on the webUI + And the user reloads the current page of the webUI + Then file "lorem.txt" should not be marked as locked on the webUI + And folder "simple-empty-folder" should not be marked as locked on the webUI + When the user browses to the files page + Then folder "simple-folder" should not be marked as locked on the webUI + And 0 locks should be reported for folder "simple-folder" of user "brand-new-user" by the WebDAV API + And 0 locks should be reported for file "simple-folder/lorem.txt" of user "brand-new-user" by the WebDAV API + And 0 locks should be reported for folder "simple-folder/simple-empty-folder" of user "brand-new-user" by the WebDAV API + Examples: + | lockscope | + | exclusive | + | shared | + + Scenario Outline: deleting the only remaining lock of a folder by deleting it from a file in folder and reloading the page + Given the user "brand-new-user" has locked folder "simple-folder" setting following properties + | lockscope | | + And the user has browsed to the files page + And the user has opened folder "simple-folder" using the webUI + When the user unlocks the lock no 1 of file "lorem.txt" on the webUI + And the user reloads the current page of the webUI + Then file "lorem.txt" should not be marked as locked on the webUI + And folder "simple-empty-folder" should not be marked as locked on the webUI + When the user browses to the files page + Then folder "simple-folder" should not be marked as locked on the webUI + And 0 locks should be reported for folder "simple-folder" of user "brand-new-user" by the WebDAV API + And 0 locks should be reported for file "simple-folder/lorem.txt" of user "brand-new-user" by the WebDAV API + And 0 locks should be reported for folder "simple-folder/simple-empty-folder" of user "brand-new-user" by the WebDAV API + Examples: + | lockscope | + | exclusive | + | shared | + + Scenario: deleting the first one of multiple shared locks on the webUI + Given these users have been created: + |username | + |receiver1 | + |receiver2 | + And the user has created folder "/FOLDER_TO_SHARE" + And user "brand-new-user" has shared file "/lorem.txt" with user "receiver1" + And user "brand-new-user" has shared folder "/FOLDER_TO_SHARE" with user "receiver1" + And user "brand-new-user" has shared file "/lorem.txt" with user "receiver2" + And user "brand-new-user" has shared folder "/FOLDER_TO_SHARE" with user "receiver2" + And the user "brand-new-user" has locked file "lorem.txt" setting following properties + | lockscope | shared | + And the user "brand-new-user" has locked folder "FOLDER_TO_SHARE" setting following properties + | lockscope | shared | + And the user "receiver1" has locked file "lorem (2).txt" setting following properties + | lockscope | shared | + And the user "receiver1" has locked folder "FOLDER_TO_SHARE" setting following properties + | lockscope | shared | + And the user "receiver2" has locked file "lorem (2).txt" setting following properties + | lockscope | shared | + And the user "receiver2" has locked folder "FOLDER_TO_SHARE" setting following properties + | lockscope | shared | + And the user has browsed to the files page + When the user unlocks the lock no 1 of file "lorem.txt" on the webUI + Then file "lorem.txt" should be marked as locked on the webUI + And file "lorem.txt" should be marked as locked by user "receiver1" in the locks tab of the details panel on the webUI + And file "lorem.txt" should be marked as locked by user "receiver2" in the locks tab of the details panel on the webUI + And 2 locks should be reported for file "lorem.txt" of user "brand-new-user" by the WebDAV API + And 2 locks should be reported for file "lorem (2).txt" of user "receiver1" by the WebDAV API + And 2 locks should be reported for file "lorem (2).txt" of user "receiver2" by the WebDAV API + When the user unlocks the lock no 1 of folder "FOLDER_TO_SHARE" on the webUI + Then folder "FOLDER_TO_SHARE" should be marked as locked on the webUI + And folder "FOLDER_TO_SHARE" should be marked as locked by user "receiver1" in the locks tab of the details panel on the webUI + And folder "FOLDER_TO_SHARE" should be marked as locked by user "receiver2" in the locks tab of the details panel on the webUI + And 2 locks should be reported for folder "FOLDER_TO_SHARE" of user "brand-new-user" by the WebDAV API + And 2 locks should be reported for folder "FOLDER_TO_SHARE" of user "receiver1" by the WebDAV API + And 2 locks should be reported for folder "FOLDER_TO_SHARE" of user "receiver2" by the WebDAV API + + Scenario: deleting the second one of multiple shared locks on the webUI + Given these users have been created: + |username | + |receiver1 | + |receiver2 | + And the user has created folder "/FOLDER_TO_SHARE" + And user "brand-new-user" has shared file "/lorem.txt" with user "receiver1" + And user "brand-new-user" has shared folder "/FOLDER_TO_SHARE" with user "receiver1" + And user "brand-new-user" has shared file "/lorem.txt" with user "receiver2" + And user "brand-new-user" has shared folder "/FOLDER_TO_SHARE" with user "receiver2" + And the user "receiver1" has locked file "lorem (2).txt" setting following properties + | lockscope | shared | + And the user "receiver1" has locked folder "FOLDER_TO_SHARE" setting following properties + | lockscope | shared | + And the user "brand-new-user" has locked file "lorem.txt" setting following properties + | lockscope | shared | + And the user "brand-new-user" has locked folder "FOLDER_TO_SHARE" setting following properties + | lockscope | shared | + And the user "receiver2" has locked file "lorem (2).txt" setting following properties + | lockscope | shared | + And the user "receiver2" has locked folder "FOLDER_TO_SHARE" setting following properties + | lockscope | shared | + And the user has browsed to the files page + When the user unlocks the lock no 2 of file "lorem.txt" on the webUI + Then file "lorem.txt" should be marked as locked on the webUI + And file "lorem.txt" should be marked as locked by user "receiver1" in the locks tab of the details panel on the webUI + And file "lorem.txt" should be marked as locked by user "receiver2" in the locks tab of the details panel on the webUI + And 2 locks should be reported for file "lorem.txt" of user "brand-new-user" by the WebDAV API + And 2 locks should be reported for file "lorem (2).txt" of user "receiver1" by the WebDAV API + And 2 locks should be reported for file "lorem (2).txt" of user "receiver2" by the WebDAV API + When the user unlocks the lock no 2 of folder "FOLDER_TO_SHARE" on the webUI + Then folder "FOLDER_TO_SHARE" should be marked as locked on the webUI + And folder "FOLDER_TO_SHARE" should be marked as locked by user "receiver1" in the locks tab of the details panel on the webUI + And folder "FOLDER_TO_SHARE" should be marked as locked by user "receiver2" in the locks tab of the details panel on the webUI + And 2 locks should be reported for folder "FOLDER_TO_SHARE" of user "brand-new-user" by the WebDAV API + And 2 locks should be reported for folder "FOLDER_TO_SHARE" of user "receiver1" by the WebDAV API + And 2 locks should be reported for folder "FOLDER_TO_SHARE" of user "receiver2" by the WebDAV API + + Scenario: deleting the last one of multiple shared locks on the webUI + Given these users have been created: + |username | + |receiver1 | + |receiver2 | + And the user has created folder "/FOLDER_TO_SHARE" + And user "brand-new-user" has shared file "/lorem.txt" with user "receiver1" + And user "brand-new-user" has shared folder "/FOLDER_TO_SHARE" with user "receiver1" + And user "brand-new-user" has shared file "/lorem.txt" with user "receiver2" + And user "brand-new-user" has shared folder "/FOLDER_TO_SHARE" with user "receiver2" + And the user "receiver1" has locked file "lorem (2).txt" setting following properties + | lockscope | shared | + And the user "receiver1" has locked folder "FOLDER_TO_SHARE" setting following properties + | lockscope | shared | + And the user "receiver2" has locked file "lorem (2).txt" setting following properties + | lockscope | shared | + And the user "receiver2" has locked folder "FOLDER_TO_SHARE" setting following properties + | lockscope | shared | + And the user "brand-new-user" has locked file "lorem.txt" setting following properties + | lockscope | shared | + And the user "brand-new-user" has locked folder "FOLDER_TO_SHARE" setting following properties + | lockscope | shared | + And the user has browsed to the files page + When the user unlocks the lock no 3 of file "lorem.txt" on the webUI + Then file "lorem.txt" should be marked as locked on the webUI + And file "lorem.txt" should be marked as locked by user "receiver1" in the locks tab of the details panel on the webUI + And file "lorem.txt" should be marked as locked by user "receiver2" in the locks tab of the details panel on the webUI + And 2 locks should be reported for file "lorem.txt" of user "brand-new-user" by the WebDAV API + And 2 locks should be reported for file "lorem (2).txt" of user "receiver1" by the WebDAV API + And 2 locks should be reported for file "lorem (2).txt" of user "receiver2" by the WebDAV API + When the user unlocks the lock no 3 of folder "FOLDER_TO_SHARE" on the webUI + Then folder "FOLDER_TO_SHARE" should be marked as locked on the webUI + And folder "FOLDER_TO_SHARE" should be marked as locked by user "receiver1" in the locks tab of the details panel on the webUI + And folder "FOLDER_TO_SHARE" should be marked as locked by user "receiver2" in the locks tab of the details panel on the webUI + And 2 locks should be reported for folder "FOLDER_TO_SHARE" of user "brand-new-user" by the WebDAV API + And 2 locks should be reported for folder "FOLDER_TO_SHARE" of user "receiver1" by the WebDAV API + And 2 locks should be reported for folder "FOLDER_TO_SHARE" of user "receiver2" by the WebDAV API + + Scenario Outline: deleting a lock that was created by an other user + Given these users have been created: + |username | + |receiver1 | + And user "brand-new-user" has shared file "/lorem.txt" with user "receiver1" + And the user "receiver1" has locked file "lorem (2).txt" setting following properties + | lockscope | | + And the user has browsed to the files page + When the user unlocks the lock no 1 of file "lorem.txt" on the webUI + Then notifications should be displayed on the webUI with the text + | Could not unlock, please contact the lock owner receiver1 | + And file "lorem.txt" should be marked as locked on the webUI + And file "lorem.txt" should be marked as locked by user "receiver1" in the locks tab of the details panel on the webUI + And 1 locks should be reported for file "lorem.txt" of user "brand-new-user" by the WebDAV API + And 1 locks should be reported for file "lorem (2).txt" of user "receiver1" by the WebDAV API + Examples: + | lockscope | + | exclusive | + | shared | + + Scenario Outline: deleting a locked file + Given the user "brand-new-user" has locked file "lorem.txt" setting following properties + | lockscope | | + And the user has browsed to the files page + When the user deletes file "lorem.txt" using the webUI + Then notifications should be displayed on the webUI with the text + | The file "lorem.txt" is locked and cannot be deleted. | + And as "brand-new-user" file "lorem.txt" should exist + And file "lorem.txt" should be listed on the webUI + And file "lorem.txt" should be marked as locked on the webUI + And file "lorem.txt" should be marked as locked by user "brand-new-user" in the locks tab of the details panel on the webUI + And 1 locks should be reported for file "lorem.txt" of user "brand-new-user" by the WebDAV API + Examples: + | lockscope | + | exclusive | + | shared | + + Scenario Outline: moving a locked file + Given the user "brand-new-user" has locked file "lorem.txt" setting following properties + | lockscope | | + And the user has browsed to the files page + When the user moves file "lorem.txt" into folder "simple-empty-folder" using the webUI + Then notifications should be displayed on the webUI with the text + | Could not move "lorem.txt" because either the file or the target are locked. | + And as "brand-new-user" file "lorem.txt" should exist + And file "lorem.txt" should be listed on the webUI + And file "lorem.txt" should be marked as locked on the webUI + And file "lorem.txt" should be marked as locked by user "brand-new-user" in the locks tab of the details panel on the webUI + And 1 locks should be reported for file "lorem.txt" of user "brand-new-user" by the WebDAV API + Examples: + | lockscope | + | exclusive | + | shared | + + Scenario Outline: moving a file trying to overwrite a locked file + Given the user "brand-new-user" has locked file "/simple-folder/lorem.txt" setting following properties + | lockscope | | + And the user has browsed to the files page + When the user moves file "lorem.txt" into folder "simple-folder" using the webUI + Then notifications should be displayed on the webUI with the text + | Could not move "lorem.txt" because either the file or the target are locked. | + And as "brand-new-user" file "lorem.txt" should exist + And file "lorem.txt" should be listed on the webUI + And file "lorem.txt" should not be marked as locked on the webUI + Examples: + | lockscope | + | exclusive | + | shared | + + Scenario Outline: moving a file into a locked folder + Given the user "brand-new-user" has locked file "/simple-empty-folder" setting following properties + | lockscope | | + And the user has browsed to the files page + When the user moves file "lorem.txt" into folder "simple-empty-folder" using the webUI + And as "brand-new-user" file "/simple-empty-folder/lorem.txt" should exist + And as "brand-new-user" file "lorem.txt" should not exist + And file "lorem.txt" should not be listed on the webUI + And 1 locks should be reported for file "/simple-empty-folder/lorem.txt" of user "brand-new-user" by the WebDAV API + Examples: + | lockscope | + | exclusive | + | shared | + + Scenario Outline: renaming of a locked file + Given the user "brand-new-user" has locked file "lorem.txt" setting following properties + | lockscope | | + And the user has browsed to the files page + When the user renames file "lorem.txt" to "a-renamed-file.txt" using the webUI + Then notifications should be displayed on the webUI with the text + | The file "lorem.txt" is locked and can not be renamed. | + And as "brand-new-user" file "lorem.txt" should exist + And file "lorem.txt" should be listed on the webUI + And file "lorem.txt" should be marked as locked on the webUI + And file "lorem.txt" should be marked as locked by user "brand-new-user" in the locks tab of the details panel on the webUI + And 1 locks should be reported for file "lorem.txt" of user "brand-new-user" by the WebDAV API + Examples: + | lockscope | + | exclusive | + | shared | + + Scenario Outline: uploading a file, trying to overwrite a locked file + Given the user "brand-new-user" has locked file "lorem.txt" setting following properties + | lockscope | | + And the user has browsed to the files page + When the user uploads overwriting file "lorem.txt" using the webUI + Then notifications should be displayed on the webUI with the text + | The file lorem.txt is currently locked, please try again later | + And the content of "lorem.txt" should not have changed + And file "lorem.txt" should be marked as locked on the webUI + And file "lorem.txt" should be marked as locked by user "brand-new-user" in the locks tab of the details panel on the webUI + And 1 locks should be reported for file "lorem.txt" of user "brand-new-user" by the WebDAV API + Examples: + | lockscope | + | exclusive | + | shared | + + Scenario Outline: uploading a file, trying to overwrite a file in a locked folder + Given the user "brand-new-user" has locked folder "simple-folder" setting following properties + | lockscope | | + And the user has opened folder "simple-folder" using the webUI + When the user uploads overwriting file "lorem.txt" using the webUI + Then notifications should be displayed on the webUI with the text + | The file lorem.txt is currently locked, please try again later | + And the content of "lorem.txt" should not have changed + And file "lorem.txt" should be marked as locked on the webUI + And file "lorem.txt" should be marked as locked by user "brand-new-user" in the locks tab of the details panel on the webUI + And 1 locks should be reported for file "simple-folder/lorem.txt" of user "brand-new-user" by the WebDAV API + Examples: + | lockscope | + | exclusive | + | shared | + + Scenario Outline: uploading a new file into a locked folder + Given the user "brand-new-user" has locked folder "simple-folder" setting following properties + | lockscope | | + And the user has opened folder "simple-folder" using the webUI + When the user uploads file "new-lorem.txt" using the webUI + Then file "new-lorem.txt" should be marked as locked on the webUI + And file "new-lorem.txt" should be marked as locked by user "brand-new-user" in the locks tab of the details panel on the webUI + And 1 locks should be reported for file "simple-folder/new-lorem.txt" of user "brand-new-user" by the WebDAV API + Examples: + | lockscope | + | exclusive | + | shared | + + Scenario Outline: deleting a file in a public share of a locked folder + Given the user "brand-new-user" has locked folder "simple-folder" setting following properties + | lockscope | | + And the user has browsed to the files page + And the user has created a new public link for folder "simple-folder" using the webUI with + | permission | read-write | + When the public accesses the last created public link using the webUI + And the user deletes folder "lorem.txt" using the webUI + Then notifications should be displayed on the webUI with the text + | The file "lorem.txt" is locked and cannot be deleted. | + And as "brand-new-user" file "simple-folder/lorem.txt" should exist + And 1 locks should be reported for file "simple-folder/lorem.txt" of user "brand-new-user" by the WebDAV API + Examples: + | lockscope | + | exclusive | + | shared | + + Scenario Outline: renaming a file in a public share of a locked folder + Given the user "brand-new-user" has locked folder "simple-folder" setting following properties + | lockscope | | + And the user has browsed to the files page + And the user has created a new public link for folder "simple-folder" using the webUI with + | permission | read-write | + When the public accesses the last created public link using the webUI + And the user renames file "lorem.txt" to "a-renamed-file.txt" using the webUI + Then notifications should be displayed on the webUI with the text + | The file "lorem.txt" is locked and can not be renamed. | + And as "brand-new-user" file "simple-folder/lorem.txt" should exist + And as "brand-new-user" file "simple-folder/a-renamed-file.txt" should not exist + And 1 locks should be reported for file "simple-folder/lorem.txt" of user "brand-new-user" by the WebDAV API + Examples: + | lockscope | + | exclusive | + | shared | + + Scenario Outline: moving a locked file into an other folder in a public share + Given the user "brand-new-user" has locked file "simple-folder/lorem.txt" setting following properties + | lockscope | | + And the user has browsed to the files page + And the user has created a new public link for folder "simple-folder" using the webUI with + | permission | read-write | + When the public accesses the last created public link using the webUI + And the user moves file "lorem.txt" into folder "simple-empty-folder" using the webUI + Then notifications should be displayed on the webUI with the text + | Could not move "lorem.txt" because either the file or the target are locked. | + And as "brand-new-user" file "simple-folder/lorem.txt" should exist + And as "brand-new-user" file "simple-folder/simple-empty-folder/lorem.txt" should not exist + And file "lorem.txt" should be listed on the webUI + And 1 locks should be reported for file "simple-folder/lorem.txt" of user "brand-new-user" by the WebDAV API + Examples: + | lockscope | + | exclusive | + | shared | + + Scenario Outline: uploading a file, trying to overwrite a file in a locked folder in a public share + Given the user "brand-new-user" has locked folder "simple-folder" setting following properties + | lockscope | | + And the user has browsed to the files page + And the user has created a new public link for folder "simple-folder" using the webUI with + | permission | read-write | + When the public accesses the last created public link using the webUI + And the user uploads overwriting file "lorem.txt" using the webUI + Then notifications should be displayed on the webUI with the text + | The file lorem.txt is currently locked, please try again later | + And the content of "simple-folder/lorem.txt" should not have changed + And 1 locks should be reported for file "simple-folder/lorem.txt" of user "brand-new-user" by the WebDAV API + Examples: + | lockscope | + | exclusive | + | shared | + + Scenario Outline: decline locked folder + Given these users have been created: + |username | + |sharer | + And user "sharer" has created folder "/to-share-folder" + And the user "sharer" has locked folder "to-share-folder" setting following properties + | lockscope | | + And user "sharer" has shared folder "to-share-folder" with user "brand-new-user" + When the user declines share "to-share-folder" offered by user "sharer" using the webUI + And the user has browsed to the files page + Then folder "to-share-folder" should not be listed on the webUI + And 1 locks should be reported for file "to-share-folder" of user "sharer" by the WebDAV API + And 0 locks should be reported for file "to-share-folder" of user "brand-new-user" by the WebDAV API + Examples: + | lockscope | + | exclusive | + | shared | + + Scenario Outline: accept previously declined locked folder + Given these users have been created: + |username | + |sharer | + And user "sharer" has created folder "/to-share-folder" + And the user "sharer" has locked folder "to-share-folder" setting following properties + | lockscope | | + And user "sharer" has shared folder "to-share-folder" with user "brand-new-user" + When the user declines share "to-share-folder" offered by user "sharer" using the webUI + And the user accepts share "to-share-folder" offered by user "sharer" using the webUI + And the user has browsed to the files page + Then folder "to-share-folder" should be marked as locked on the webUI + And folder "to-share-folder" should be marked as locked by user "sharer" in the locks tab of the details panel on the webUI + And 1 locks should be reported for file "to-share-folder" of user "sharer" by the WebDAV API + And 1 locks should be reported for file "to-share-folder" of user "brand-new-user" by the WebDAV API + Examples: + | lockscope | + | exclusive | + | shared | + + Scenario Outline: accept previously declined locked folder but create a folder with same name in between + Given these users have been created: + |username | + |sharer | + And user "sharer" has created folder "/to-share-folder" + And the user "sharer" has locked folder "to-share-folder" setting following properties + | lockscope | | + And user "sharer" has shared folder "to-share-folder" with user "brand-new-user" + When the user declines share "to-share-folder" offered by user "sharer" using the webUI + And user "brand-new-user" creates folder "to-share-folder" using the WebDAV API + And the user accepts share "to-share-folder" offered by user "sharer" using the webUI + And the user has browsed to the files page + Then folder "to-share-folder (2)" should be marked as locked on the webUI + And folder "to-share-folder (2)" should be marked as locked by user "sharer" in the locks tab of the details panel on the webUI + But folder "to-share-folder" should not be marked as locked on the webUI + And 1 locks should be reported for file "to-share-folder" of user "sharer" by the WebDAV API + And 1 locks should be reported for file "to-share-folder (2)" of user "brand-new-user" by the WebDAV API + Examples: + | lockscope | + | exclusive | + | shared | + + @skip @issue-33885 + Scenario Outline: creating a subfolder structure that is the same as the structure of a declined & locked share + Given these users have been created: + |username | + |sharer | + And user "sharer" has created folder "/parent" + And user "sharer" has created folder "/parent/subfolder" + And the user "sharer" has locked folder "parent" setting following properties + | lockscope | | + And user "sharer" has shared folder "parent" with user "brand-new-user" + When the user declines share "parent" offered by user "sharer" using the webUI + And user "brand-new-user" creates folder "parent" using the WebDAV API + And user "brand-new-user" creates folder "parent/subfolder" using the WebDAV API + And the user has browsed to the files page + Then folder "parent" should not be marked as locked on the webUI + When the user opens folder "parent" using the webUI + Then folder "subfolder" should not be marked as locked on the webUI + And 0 locks should be reported for file "parent" of user "brand-new-user" by the WebDAV API + And 0 locks should be reported for file "parent/subfolder" of user "brand-new-user" by the WebDAV API + Examples: + | lockscope | + | exclusive | + | shared | + + @skip @issue-33847 + Scenario Outline: unsharing a locked file/folder + Given these users have been created: + |username | + |sharer | + And the user "sharer" has locked file "lorem.txt" setting following properties + | lockscope | | + And the user "sharer" has locked folder "simple-folder" setting following properties + | lockscope | | + And user "sharer" has shared file "lorem.txt" with user "brand-new-user" + And user "sharer" has shared folder "simple-folder" with user "brand-new-user" + And the user has browsed to the files page + When the user unshares file "lorem (2).txt" using the webUI + And the user unshares folder "simple-folder (2)" using the webUI + Then as "brand-new-user" file "lorem (2).txt" should not exist + And as "brand-new-user" folder "simple-folder (2)" should not exist + And file "lorem (2).txt" should not be listed on the webUI + And folder "simple-folder (2)" should not be listed on the webUI + And 1 locks should be reported for file "lorem.txt" of user "sharer" by the WebDAV API + And 1 locks should be reported for file "simple-folder/lorem.txt" of user "sharer" by the WebDAV API + Examples: + | lockscope | + | exclusive | + | shared |