diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2020-11-10 22:16:50 +0100 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2020-11-11 01:35:27 +0100 |
commit | b6dec0be998f68c7398de2fbfd7bb666a3f3ac2d (patch) | |
tree | a2496ec545bbb46d6ef4eb17cd48cf4b59c24251 /tests/acceptance/features/bootstrap | |
parent | 22d949d9d9da89eb2395b1259c44db17d1db5856 (diff) | |
download | nextcloud-server-b6dec0be998f68c7398de2fbfd7bb666a3f3ac2d.tar.gz nextcloud-server-b6dec0be998f68c7398de2fbfd7bb666a3f3ac2d.zip |
Add acceptance tests for reshares by link when resharing is disabled
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'tests/acceptance/features/bootstrap')
-rw-r--r-- | tests/acceptance/features/bootstrap/FilesAppSharingContext.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/acceptance/features/bootstrap/FilesAppSharingContext.php b/tests/acceptance/features/bootstrap/FilesAppSharingContext.php index a75c0ddda32..07ebbba1a36 100644 --- a/tests/acceptance/features/bootstrap/FilesAppSharingContext.php +++ b/tests/acceptance/features/bootstrap/FilesAppSharingContext.php @@ -327,6 +327,15 @@ class FilesAppSharingContext implements Context, ActorAwareInterface { } /** + * @return Locator + */ + public static function unshareLinkButton($shareLinkMenuTriggerElement) { + return Locator::forThe()->xpath("//li[contains(concat(' ', normalize-space(@class), ' '), ' action ')]//button[normalize-space() = 'Unshare']")-> + descendantOf(self::shareLinkMenu($shareLinkMenuTriggerElement))-> + describedAs("Unshare link button in the details view in Files app"); + } + + /** * @Given I share the link for :fileName */ public function iShareTheLinkFor($fileName) { @@ -491,6 +500,16 @@ 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(); + } + + /** * @Then I see that the file is shared with me by :sharedByName */ public function iSeeThatTheFileIsSharedWithMeBy($sharedByName) { @@ -529,6 +548,18 @@ class FilesAppSharingContext implements Context, ActorAwareInterface { } /** + * @Then I see that resharing the file by link is not available + */ + public function iSeeThatResharingTheFileByLinkIsNotAvailable() { + if (!WaitFor::elementToBeEventuallyNotShown( + $this->actor, + self::shareLinkAddNewButton(), + $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) { + PHPUnit_Framework_Assert::fail("The add new share link button is still shown after $timeout seconds"); + } + } + + /** * @Then I see that :sharedWithName can not be allowed to edit the share */ public function iSeeThatCanNotBeAllowedToEditTheShare($sharedWithName) { |