diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2020-06-11 23:12:20 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2020-06-24 19:24:57 +0000 |
commit | b2b02ff353064f3eaf3b55cca39bb876825789b8 (patch) | |
tree | b469fc1aee734f472a7715b6a56d9b96cf557850 /tests | |
parent | 3a59ea88a8fdefe079dcb31f196586a514df4da1 (diff) | |
download | nextcloud-server-b2b02ff353064f3eaf3b55cca39bb876825789b8.tar.gz nextcloud-server-b2b02ff353064f3eaf3b55cca39bb876825789b8.zip |
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.php | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/tests/acceptance/features/bootstrap/FilesAppSharingContext.php b/tests/acceptance/features/bootstrap/FilesAppSharingContext.php index 040c5c4dd75..92f558f5002 100644 --- a/tests/acceptance/features/bootstrap/FilesAppSharingContext.php +++ b/tests/acceptance/features/bootstrap/FilesAppSharingContext.php @@ -104,22 +104,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'); } /** |