summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2021-06-09 10:43:50 +0200
committerJulius Härtl <jus@bitgrid.net>2021-06-29 19:09:22 +0200
commitc3e7687cd24c54d6a5b69076f6d79efb08d9d6b4 (patch)
tree1209a3bdbada022f3ac4ee68a53896632ce861a4 /tests
parentb7328fab42a2445173c2c548266715dfc077b734 (diff)
downloadnextcloud-server-c3e7687cd24c54d6a5b69076f6d79efb08d9d6b4.tar.gz
nextcloud-server-c3e7687cd24c54d6a5b69076f6d79efb08d9d6b4.zip
Handle single action unshare
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'tests')
-rw-r--r--tests/acceptance/features/bootstrap/FilesAppSharingContext.php20
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/acceptance/features/bootstrap/FilesAppSharingContext.php b/tests/acceptance/features/bootstrap/FilesAppSharingContext.php
index 07ebbba1a36..d8611ea5c05 100644
--- a/tests/acceptance/features/bootstrap/FilesAppSharingContext.php
+++ b/tests/acceptance/features/bootstrap/FilesAppSharingContext.php
@@ -221,6 +221,15 @@ class FilesAppSharingContext implements Context, ActorAwareInterface {
/**
* @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
+ */
public static function shareLinkMenuButton() {
return Locator::forThe()->css(".action-item__menutoggle")->
descendantOf(self::shareLinkMenuTrigger())->
@@ -503,10 +512,13 @@ 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();
+ 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();
+ }
}
/**