diff options
Diffstat (limited to 'tests/acceptance/features/bootstrap/FilesAppSharingContext.php')
-rw-r--r-- | tests/acceptance/features/bootstrap/FilesAppSharingContext.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/acceptance/features/bootstrap/FilesAppSharingContext.php b/tests/acceptance/features/bootstrap/FilesAppSharingContext.php index c630fbfe16f..784b4bbae11 100644 --- a/tests/acceptance/features/bootstrap/FilesAppSharingContext.php +++ b/tests/acceptance/features/bootstrap/FilesAppSharingContext.php @@ -311,6 +311,15 @@ class FilesAppSharingContext implements Context, ActorAwareInterface { } /** + * @return Locator + */ + public static function unshareLinkButton() { + return Locator::forThe()->xpath("//li//button[normalize-space() = 'Unshare']")-> + descendantOf(self::shareLinkMenu())-> + describedAs("Unshare link button in the details view in Files app"); + } + + /** * @Given I share the link for :fileName */ public function iShareTheLinkFor($fileName) { @@ -452,6 +461,15 @@ class FilesAppSharingContext implements Context, ActorAwareInterface { } /** + * @When I unshare the link share + */ + public function iUnshareTheLink() { + $this->showShareLinkMenuIfNeeded(); + + $this->actor->find(self::unshareLinkButton(), 2)->click(); + } + + /** * @Then I see that the file is shared with me by :sharedByName */ public function iSeeThatTheFileIsSharedWithMeBy($sharedByName) { @@ -490,6 +508,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) { |