diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-10-16 14:26:35 +0200 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-11-02 13:30:22 +0100 |
commit | f57b07e2c2c6a2ff7cc027eeeeab6ab8da123ad5 (patch) | |
tree | 6df3ea2b93ade4bb3747ed8435c5a04d5fffbd1e /tests | |
parent | a784e1fcc12b75cb905429a8953840152e39bbbe (diff) | |
download | nextcloud-server-f57b07e2c2c6a2ff7cc027eeeeab6ab8da123ad5.tar.gz nextcloud-server-f57b07e2c2c6a2ff7cc027eeeeab6ab8da123ad5.zip |
Add acceptance test steps to be used from Talk acceptance tests
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/acceptance/features/bootstrap/FilesAppContext.php | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/acceptance/features/bootstrap/FilesAppContext.php b/tests/acceptance/features/bootstrap/FilesAppContext.php index 03bf371095d..4a7af441e57 100644 --- a/tests/acceptance/features/bootstrap/FilesAppContext.php +++ b/tests/acceptance/features/bootstrap/FilesAppContext.php @@ -314,6 +314,15 @@ class FilesAppContext implements Context, ActorAwareInterface { } /** + * @return Locator + */ + public static function passwordProtectByTalkCheckboxInput() { + return Locator::forThe()->checkbox("Password protect by Talk")-> + descendantOf(self::shareLinkMenu())-> + describedAs("Password protect by Talk checkbox input in the details view in Files app"); + } + + /** * @Given I close the details view */ public function iCloseTheDetailsView() { @@ -416,6 +425,28 @@ class FilesAppContext implements Context, ActorAwareInterface { } /** + * @When I set the password of the shared link as protected by Talk + */ + public function iSetThePasswordOfTheSharedLinkAsProtectedByTalk() { + $this->showShareLinkMenuIfNeeded(); + + $this->iSeeThatThePasswordOfTheLinkShareIsNotProtectedByTalk(); + + $this->actor->find(self::passwordProtectByTalkCheckbox(), 2)->click(); + } + + /** + * @When I set the password of the shared link as not protected by Talk + */ + public function iSetThePasswordOfTheSharedLinkAsNotProtectedByTalk() { + $this->showShareLinkMenuIfNeeded(); + + $this->iSeeThatThePasswordOfTheLinkShareIsProtectedByTalk(); + + $this->actor->find(self::passwordProtectByTalkCheckbox(), 2)->click(); + } + + /** * @Then I see that the current page is the Files app */ public function iSeeThatTheCurrentPageIsTheFilesApp() { @@ -569,6 +600,24 @@ class FilesAppContext implements Context, ActorAwareInterface { } /** + * @Then I see that the password of the link share is protected by Talk + */ + public function iSeeThatThePasswordOfTheLinkShareIsProtectedByTalk() { + $this->showShareLinkMenuIfNeeded(); + + PHPUnit_Framework_Assert::assertTrue($this->actor->find(self::passwordProtectByTalkCheckboxInput(), 10)->isChecked()); + } + + /** + * @Then I see that the password of the link share is not protected by Talk + */ + public function iSeeThatThePasswordOfTheLinkShareIsNotProtectedByTalk() { + $this->showShareLinkMenuIfNeeded(); + + PHPUnit_Framework_Assert::assertFalse($this->actor->find(self::passwordProtectByTalkCheckboxInput(), 10)->isChecked()); + } + + /** * @Then I see that the checkbox to protect the password of the link share by Talk is not shown */ public function iSeeThatTheCheckboxToProtectThePasswordOfTheLinkShareByTalkIsNotShown() { |