diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2020-03-20 19:51:09 +0100 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2020-03-20 20:03:58 +0100 |
commit | 9386f24ab0a1b795f53f68ee064bde6756150217 (patch) | |
tree | 7e057503920a73cb7401dcd3a3f5a888656c2b97 /tests/acceptance/features/bootstrap | |
parent | 887e74043468106ec7a28b2b68e38d471696357e (diff) | |
download | nextcloud-server-9386f24ab0a1b795f53f68ee064bde6756150217.tar.gz nextcloud-server-9386f24ab0a1b795f53f68ee064bde6756150217.zip |
Add acceptance test for accepting an incoming share
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'tests/acceptance/features/bootstrap')
-rw-r--r-- | tests/acceptance/features/bootstrap/SettingsContext.php | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/acceptance/features/bootstrap/SettingsContext.php b/tests/acceptance/features/bootstrap/SettingsContext.php index edbb6a94d15..82b22c43338 100644 --- a/tests/acceptance/features/bootstrap/SettingsContext.php +++ b/tests/acceptance/features/bootstrap/SettingsContext.php @@ -30,6 +30,25 @@ class SettingsContext implements Context, ActorAwareInterface { /** * @return Locator */ + public static function acceptSharesByDefaultCheckbox() { + // forThe()->checkbox("Accept user...") 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() = 'Accept user and group shares by default']")-> + describedAs("Accept shares by default checkbox in Sharing section in Personal Sharing Settings"); + } + + /** + * @return Locator + */ + public static function acceptSharesByDefaultCheckboxInput() { + return Locator::forThe()->checkbox("Accept user and group shares by default")-> + describedAs("Accept shares by default checkbox input in Sharing section in Personal Sharing Settings"); + } + + /** + * @return Locator + */ public static function systemTagsSelectTagButton() { return Locator::forThe()->id("s2id_systemtag")-> describedAs("Select tag button in system tags section in Administration Settings"); @@ -85,6 +104,15 @@ class SettingsContext implements Context, ActorAwareInterface { } /** + * @When I disable accepting the shares by default + */ + public function iDisableAcceptingTheSharesByDefault() { + $this->iSeeThatSharesAreAcceptedByDefault(); + + $this->actor->find(self::acceptSharesByDefaultCheckbox(), 2)->click(); + } + + /** * @When I create the tag :tag in the settings */ public function iCreateTheTagInTheSettings($tag) { @@ -94,6 +122,22 @@ class SettingsContext implements Context, ActorAwareInterface { } /** + * @Then I see that shares are accepted by default + */ + public function iSeeThatSharesAreAcceptedByDefault() { + PHPUnit_Framework_Assert::assertTrue( + $this->actor->find(self::acceptSharesByDefaultCheckboxInput(), 10)->isChecked()); + } + + /** + * @Then I see that shares are not accepted by default + */ + public function iSeeThatSharesAreNotAcceptedByDefault() { + PHPUnit_Framework_Assert::assertFalse( + $this->actor->find(self::acceptSharesByDefaultCheckboxInput(), 10)->isChecked()); + } + + /** * @Then I see that the button to select tags is shown */ public function iSeeThatTheButtonToSelectTagsIsShown() { |