diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2021-06-16 15:26:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-16 15:26:12 +0200 |
commit | 818fc95b0399b07bb41c02494292a77700b9b35a (patch) | |
tree | 5348f036d6a9b1fd2c578674f1bc0670450920c6 /tests | |
parent | 7917f4cf763a3f35f81f500b5f5b5135cd136518 (diff) | |
parent | 964fd27666192beb7929342f10ae27cef3455d8b (diff) | |
download | nextcloud-server-818fc95b0399b07bb41c02494292a77700b9b35a.tar.gz nextcloud-server-818fc95b0399b07bb41c02494292a77700b9b35a.zip |
Merge pull request #26571 from nextcloud/bugfix/noid/existing-link-no-reshare
Only allow removing existing shares that would not be allowed due to reshare restrictions
Diffstat (limited to 'tests')
-rw-r--r-- | tests/acceptance/features/bootstrap/FilesAppSharingContext.php | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/acceptance/features/bootstrap/FilesAppSharingContext.php b/tests/acceptance/features/bootstrap/FilesAppSharingContext.php index e3b63476fff..d71b0196dbb 100644 --- a/tests/acceptance/features/bootstrap/FilesAppSharingContext.php +++ b/tests/acceptance/features/bootstrap/FilesAppSharingContext.php @@ -223,6 +223,15 @@ class FilesAppSharingContext implements Context, ActorAwareInterface { /** * @return Locator */ + public static function shareLinkSingleUnshareAction() { + return Locator::forThe()->css(".sharing-entry__actions.icon-close")-> + descendantOf(self::shareLinkRow())-> + describedAs("Unshare link single action in the details view in Files app"); + } + + /** + * @return Locator + */ public static function shareLinkMenuButton() { return Locator::forThe()->css(".action-item__menutoggle")-> descendantOf(self::shareLinkMenuTrigger())-> @@ -505,10 +514,13 @@ class FilesAppSharingContext implements Context, ActorAwareInterface { * @When I unshare the link share */ public function iUnshareTheLink() { - $this->showShareLinkMenuIfNeeded(); - - $shareLinkMenuTriggerElement = $this->actor->find(self::shareLinkMenuTrigger(), 2); - $this->actor->find(self::unshareLinkButton($shareLinkMenuTriggerElement), 2)->click(); + try { + $this->actor->find(self::shareLinkSingleUnshareAction(), 2)->click(); + } catch (NoSuchElementException $e) { + $this->showShareLinkMenuIfNeeded(); + $shareLinkMenuTriggerElement = $this->actor->find(self::shareLinkMenuTrigger(), 2); + $this->actor->find(self::unshareLinkButton($shareLinkMenuTriggerElement), 2)->click(); + } } /** |