diff --git a/tests/acceptance/features/app-files.feature b/tests/acceptance/features/app-files.feature index ef3d07ae499..eeef6de601f 100644 --- a/tests/acceptance/features/app-files.feature +++ b/tests/acceptance/features/app-files.feature @@ -71,6 +71,17 @@ Feature: app-files Then I see that the current page is the Authenticate page for the shared link I wrote down And I see that a wrong password for the shared file message is shown + Scenario: access a direct download shared link protected by password with a valid password + Given I act as John + And I am logged in + And I share the link for "welcome.txt" protected by the password "abcdef" + And I write down the shared link + When I act as Jane + And I visit the direct download shared link I wrote down + And I see that the current page is the Authenticate page for the direct download shared link I wrote down + And I authenticate with password "abcdef" + Then I see that the current page is the direct download shared link I wrote down + Scenario: show the input field for tags in the details view Given I am logged in And I open the details view for "welcome.txt" diff --git a/tests/acceptance/features/bootstrap/FilesSharingAppContext.php b/tests/acceptance/features/bootstrap/FilesSharingAppContext.php index 5c5d23887cd..4b7dd08c83e 100644 --- a/tests/acceptance/features/bootstrap/FilesSharingAppContext.php +++ b/tests/acceptance/features/bootstrap/FilesSharingAppContext.php @@ -109,6 +109,13 @@ class FilesSharingAppContext implements Context, ActorAwareInterface { $this->actor->getSession()->visit($this->actor->getSharedNotebook()["shared link"]); } + /** + * @When I visit the direct download shared link I wrote down + */ + public function iVisitTheDirectDownloadSharedLinkIWroteDown() { + $this->actor->getSession()->visit($this->actor->getSharedNotebook()["shared link"] . "/download"); + } + /** * @When I authenticate with password :password */ @@ -129,7 +136,16 @@ class FilesSharingAppContext implements Context, ActorAwareInterface { */ public function iSeeThatTheCurrentPageIsTheAuthenticatePageForTheSharedLinkIWroteDown() { PHPUnit_Framework_Assert::assertEquals( - $this->actor->getSharedNotebook()["shared link"] . "/authenticate", + $this->actor->getSharedNotebook()["shared link"] . "/authenticate/preview", + $this->actor->getSession()->getCurrentUrl()); + } + + /** + * @Then I see that the current page is the Authenticate page for the direct download shared link I wrote down + */ + public function iSeeThatTheCurrentPageIsTheAuthenticatePageForTheDirectDownloadSharedLinkIWroteDown() { + PHPUnit_Framework_Assert::assertEquals( + $this->actor->getSharedNotebook()["shared link"] . "/authenticate/download", $this->actor->getSession()->getCurrentUrl()); } @@ -142,6 +158,15 @@ class FilesSharingAppContext implements Context, ActorAwareInterface { $this->actor->getSession()->getCurrentUrl()); } + /** + * @Then I see that the current page is the direct download shared link I wrote down + */ + public function iSeeThatTheCurrentPageIsTheDirectDownloadSharedLinkIWroteDown() { + PHPUnit_Framework_Assert::assertEquals( + $this->actor->getSharedNotebook()["shared link"] . "/download", + $this->actor->getSession()->getCurrentUrl()); + } + /** * @Then I see that a wrong password for the shared file message is shown */