]> source.dussan.org Git - nextcloud-server.git/commitdiff
Generalize integration test steps to download last share
authorDaniel Calviño Sánchez <danxuliu@gmail.com>
Thu, 28 May 2020 18:50:02 +0000 (20:50 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Fri, 29 May 2020 19:38:28 +0000 (19:38 +0000)
Note that the "last link share can be downloaded" step was kept as it
tests the "url" property specific of link shares.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
build/integration/features/bootstrap/Sharing.php
build/integration/sharing_features/sharing-v1.feature

index f13abd6efadbdee22e27c1ce60edf36e897ae60f..fee8f7d2692325dbbb06c38da2303e6aea84062f 100644 (file)
@@ -164,9 +164,23 @@ trait Sharing {
        }
 
        /**
-        * @Then /^last link share with password "([^"]*)" can be downloaded$/
+        * @Then /^last share can be downloaded$/
         */
-       public function lastLinkShareWithPasswordCanBeDownloaded($password) {
+       public function lastShareCanBeDownloaded() {
+               if (count($this->lastShareData->data->element) > 0) {
+                       $token = $this->lastShareData->data[0]->token;
+               } else {
+                       $token = $this->lastShareData->data->token;
+               }
+
+               $fullUrl = substr($this->baseUrl, 0, -4) . "index.php/s/" . $token . "/download";
+               $this->checkDownload($fullUrl, null, 'text/plain');
+       }
+
+       /**
+        * @Then /^last share with password "([^"]*)" can be downloaded$/
+        */
+       public function lastShareWithPasswordCanBeDownloaded($password) {
                if (count($this->lastShareData->data->element) > 0){
                        $token = $this->lastShareData->data[0]->token;
                }
index 8440a2d874e928a5afec0f0ffda2336486276600..498fe1456f68d75ffbbd853dd6a51b8cc2dddaf3 100644 (file)
@@ -75,7 +75,7 @@ Feature: sharing
       | password | publicpw |
     Then the OCS status code should be "100"
     And the HTTP status code should be "200"
-    And last link share with password "publicpw" can be downloaded
+    And last share with password "publicpw" can be downloaded
 
   Scenario: Creating a new public share of a folder
    Given user "user0" exists
@@ -108,7 +108,7 @@ Feature: sharing
       | expireDate | +3 days |
     Then the OCS status code should be "100"
     And the HTTP status code should be "200"
-    And last link share with password "publicpw" can be downloaded
+    And last share with password "publicpw" can be downloaded
 
   Scenario: Creating a new public share, updating its expiration date and getting its info
     Given user "user0" exists