Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Handle single action unshare
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Jun 29, 2021
commit c3e7687cd24c54d6a5b69076f6d79efb08d9d6b4
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