summaryrefslogtreecommitdiffstats
path: root/tests/acceptance/features/bootstrap/FilesAppContext.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/acceptance/features/bootstrap/FilesAppContext.php')
-rw-r--r--tests/acceptance/features/bootstrap/FilesAppContext.php61
1 files changed, 61 insertions, 0 deletions
diff --git a/tests/acceptance/features/bootstrap/FilesAppContext.php b/tests/acceptance/features/bootstrap/FilesAppContext.php
index 408995b9a83..4b648bfc544 100644
--- a/tests/acceptance/features/bootstrap/FilesAppContext.php
+++ b/tests/acceptance/features/bootstrap/FilesAppContext.php
@@ -235,6 +235,27 @@ class FilesAppContext implements Context, ActorAwareInterface {
/**
* @return Locator
*/
+ public static function hideDownloadCheckbox() {
+ // forThe()->checkbox("Hide download") 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() = 'Hide download']")->
+ descendantOf(self::shareLinkMenu())->
+ describedAs("Hide download checkbox in the details view in Files app");
+ }
+
+ /**
+ * @return Locator
+ */
+ public static function hideDownloadCheckboxInput() {
+ return Locator::forThe()->checkbox("Hide download")->
+ descendantOf(self::shareLinkMenu())->
+ describedAs("Hide download checkbox input in the details view in Files app");
+ }
+
+ /**
+ * @return Locator
+ */
public static function allowUploadAndEditingRadioButton() {
// forThe()->radio("Allow upload and editing") can not be used here;
// that would return the radio button itself, but the element that the
@@ -335,6 +356,28 @@ class FilesAppContext implements Context, ActorAwareInterface {
}
/**
+ * @When I set the download of the shared link as hidden
+ */
+ public function iSetTheDownloadOfTheSharedLinkAsHidden() {
+ $this->showShareLinkMenuIfNeeded();
+
+ $this->iSeeThatTheDownloadOfTheLinkShareIsShown();
+
+ $this->actor->find(self::hideDownloadCheckbox(), 2)->click();
+ }
+
+ /**
+ * @When I set the download of the shared link as shown
+ */
+ public function iSetTheDownloadOfTheSharedLinkAsShown() {
+ $this->showShareLinkMenuIfNeeded();
+
+ $this->iSeeThatTheDownloadOfTheLinkShareIsHidden();
+
+ $this->actor->find(self::hideDownloadCheckbox(), 2)->click();
+ }
+
+ /**
* @When I set the shared link as editable
*/
public function iSetTheSharedLinkAsEditable() {
@@ -461,6 +504,24 @@ class FilesAppContext implements Context, ActorAwareInterface {
}
/**
+ * @Then I see that the download of the link share is hidden
+ */
+ public function iSeeThatTheDownloadOfTheLinkShareIsHidden() {
+ $this->showShareLinkMenuIfNeeded();
+
+ PHPUnit_Framework_Assert::assertTrue($this->actor->find(self::hideDownloadCheckboxInput(), 10)->isChecked());
+ }
+
+ /**
+ * @Then I see that the download of the link share is shown
+ */
+ public function iSeeThatTheDownloadOfTheLinkShareIsShown() {
+ $this->showShareLinkMenuIfNeeded();
+
+ PHPUnit_Framework_Assert::assertFalse($this->actor->find(self::hideDownloadCheckboxInput(), 10)->isChecked());
+ }
+
+ /**
* @Then I see that the working icon for password protect is shown
*/
public function iSeeThatTheWorkingIconForPasswordProtectIsShown() {