summaryrefslogtreecommitdiffstats
path: root/tests/acceptance/features/bootstrap/FilesSharingAppContext.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/acceptance/features/bootstrap/FilesSharingAppContext.php')
-rw-r--r--tests/acceptance/features/bootstrap/FilesSharingAppContext.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/acceptance/features/bootstrap/FilesSharingAppContext.php b/tests/acceptance/features/bootstrap/FilesSharingAppContext.php
index 1fe12d5f42d..531184442dd 100644
--- a/tests/acceptance/features/bootstrap/FilesSharingAppContext.php
+++ b/tests/acceptance/features/bootstrap/FilesSharingAppContext.php
@@ -104,6 +104,14 @@ class FilesSharingAppContext implements Context, ActorAwareInterface {
}
/**
+ * @return Locator
+ */
+ public static function downloadButton() {
+ return Locator::forThe()->id("downloadFile")->
+ describedAs("Download button in Shared file page");
+ }
+
+ /**
* @When I visit the shared link I wrote down
*/
public function iVisitTheSharedLinkIWroteDown() {
@@ -199,10 +207,42 @@ class FilesSharingAppContext implements Context, ActorAwareInterface {
}
/**
+ * @Then I see that the Share menu button is not shown
+ */
+ public function iSeeThatTheShareMenuButtonIsNotShown() {
+ try {
+ PHPUnit_Framework_Assert::assertFalse(
+ $this->actor->find(self::shareMenuButton())->isVisible());
+ } catch (NoSuchElementException $exception) {
+ }
+ }
+
+ /**
* @Then I see that the shared file preview shows the text :text
*/
public function iSeeThatTheSharedFilePreviewShowsTheText($text) {
PHPUnit_Framework_Assert::assertContains($text, $this->actor->find(self::textPreview(), 10)->getText());
}
+ /**
+ * @Then I see that the download button is shown
+ */
+ public function iSeeThatTheDownloadButtonIsShown() {
+ if (!WaitFor::elementToBeEventuallyShown(
+ $this->actor, self::downloadButton(), $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ PHPUnit_Framework_Assert::fail("The download button is not visible yet after $timeout seconds");
+ }
+ }
+
+ /**
+ * @Then I see that the download button is not shown
+ */
+ public function iSeeThatTheDownloadButtonIsNotShown() {
+ try {
+ PHPUnit_Framework_Assert::assertFalse(
+ $this->actor->find(self::downloadButton())->isVisible());
+ } catch (NoSuchElementException $exception) {
+ }
+ }
+
}