Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2020-06-12 00:12:20 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2020-06-24 22:22:38 +0300
commite815b132657c6dddfb5d1997cce4aa8002ab1829 (patch)
treedf7571aa5404408885ba5785bfa8a38399e412b8 /tests
parentd4343de3ebe9c71c2191990f01009ef82bfce93b (diff)
Generalize functions to get locators for share permission checkboxes
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/acceptance/features/bootstrap/FilesAppSharingContext.php32
1 files changed, 23 insertions, 9 deletions
diff --git a/tests/acceptance/features/bootstrap/FilesAppSharingContext.php b/tests/acceptance/features/bootstrap/FilesAppSharingContext.php
index 6b30d49d71e..8cbe64a3331 100644
--- a/tests/acceptance/features/bootstrap/FilesAppSharingContext.php
+++ b/tests/acceptance/features/bootstrap/FilesAppSharingContext.php
@@ -103,22 +103,36 @@ class FilesAppSharingContext implements Context, ActorAwareInterface {
/**
* @return Locator
*/
- public static function canReshareCheckbox($sharedWithName) {
- // forThe()->checkbox("Can reshare") can not be used here; that would
- // return the checkbox itself, but the element that the user interacts
- // with is the label.
- return Locator::forThe()->xpath("//label[normalize-space() = 'Allow resharing']")->
+ public static function permissionCheckboxFor($sharedWithName, $itemText) {
+ // forThe()->checkbox($itemText) can not be used here; that would return
+ // the checkbox itself, but the element that the user interacts with is
+ // the label.
+ return Locator::forThe()->xpath("//label[normalize-space() = '$itemText']")->
descendantOf(self::shareWithMenu($sharedWithName))->
- describedAs("Allow resharing checkbox in the share with $sharedWithName menu in the details view in Files app");
+ describedAs("$itemText checkbox in the share with $sharedWithName menu in the details view in Files app");
}
/**
* @return Locator
*/
- public static function canReshareCheckboxInput($sharedWithName) {
- return Locator::forThe()->checkbox("Allow resharing")->
+ public static function permissionCheckboxInputFor($sharedWithName, $itemText) {
+ return Locator::forThe()->checkbox($itemText)->
descendantOf(self::shareWithMenu($sharedWithName))->
- describedAs("Allow resharing checkbox input in the share with $sharedWithName menu in the details view in Files app");
+ describedAs("$itemText checkbox input in the share with $sharedWithName menu in the details view in Files app");
+ }
+
+ /**
+ * @return Locator
+ */
+ public static function canReshareCheckbox($sharedWithName) {
+ return self::permissionCheckboxFor($sharedWithName, 'Allow resharing');
+ }
+
+ /**
+ * @return Locator
+ */
+ public static function canReshareCheckboxInput($sharedWithName) {
+ return self::permissionCheckboxInputFor($sharedWithName, 'Allow resharing');
}
/**