diff options
Diffstat (limited to 'tests/acceptance/features/bootstrap/FilesAppSharingContext.php')
-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) { |