Skip to content

Commit

Permalink
Handle single action unshare
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr authored and backportbot[bot] committed Jun 18, 2021
1 parent 7b2203e commit 21437e5
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions tests/acceptance/features/bootstrap/FilesAppSharingContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,15 @@ public static function shareLinkMenuTrigger() {
describedAs("Share link menu trigger in the details view in Files app");
}

/**
* @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
*/
Expand Down Expand Up @@ -503,10 +512,13 @@ public function iUnshareTheFileWith($shareWithName) {
* @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();
}
}

/**
Expand Down

0 comments on commit 21437e5

Please sign in to comment.