diff --git a/tests/acceptance/features/apiAppProvider/appProvider.feature b/tests/acceptance/features/apiAppProvider/appProvider.feature index 84515fda8..5d8f18093 100644 --- a/tests/acceptance/features/apiAppProvider/appProvider.feature +++ b/tests/acceptance/features/apiAppProvider/appProvider.feature @@ -1,10 +1,14 @@ Feature: App Provider + As a user + I want to access files with collaboration service apps + So that I can get the content of the file - Scenario: open file with Collabora + Scenario Outline: open file with .odt extension with collaboration app Given user "Alice" has been created with default attributes and without skeleton files And user "Alice" has uploaded file "filesForUpload/simple.odt" to "simple.odt" - When user "Alice" opens file "simple.odt" with collaboration service + And we save it into "FILEID" + When user "Alice" sends HTTP method "POST" to URL "" Then the HTTP status code should be "200" And the JSON data of the response should match """ @@ -18,7 +22,7 @@ Feature: App Provider "properties": { "app_url": { "type": "string", - "pattern": "^https:\\/\\/host\\.docker\\.internal:9980\\/browser\\/8ec5fda\\/cool\\.html\\?WOPISrc=https%3A%2F%2Fhost\\.docker\\.internal%3A9300%2Fwopi%2Ffiles%2F[a-fA-F0-9]{64}$" + "pattern": "^https:\\/\\/fakeoffice\\.owncloud\\.test\\/not\\/relevant\\?WOPISrc=http%3A%2F%2Fwopiserver%3A9300%2Fwopi%2Ffiles%2F[a-fA-F0-9]{64}$" }, "method": { "const": "POST" @@ -41,3 +45,7 @@ Feature: App Provider } } """ + Examples: + | endpoint | + | /app/open?file_id=<>&app_name=FakeOffice | + | /app/open?file_id=<> | diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index 3a224d961..9cf94d860 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -4131,25 +4131,4 @@ class SpacesContext implements Context { ) ); } - - /** - * @When user :user opens file :filename with collaboration service - * - * @param string $user - * @param string $filename - * - * @return void - */ - public function userOpensFileWithCollaborationService(string $user, string $filename): void { - $fileId = $this->getFileId($user, "Personal", $filename); - $url = $this->featureContext->getBaseUrl() . "/app/open?file_id=$fileId&app_name=FakeOffice"; - $this->featureContext->setResponse( - HttpRequestHelper::post( - $url, - $this->featureContext->getStepLineRef(), - $user, - $this->featureContext->getPasswordForUser($user) - ) - ); - } } diff --git a/tests/acceptance/features/bootstrap/WebDav.php b/tests/acceptance/features/bootstrap/WebDav.php index be822278b..70f2ac38f 100644 --- a/tests/acceptance/features/bootstrap/WebDav.php +++ b/tests/acceptance/features/bootstrap/WebDav.php @@ -1745,13 +1745,14 @@ trait WebDav { * * @return void */ - public function userHasUploadedAFileTo(string $user, string $source, string $destination):void { + public function userHasUploadedAFileTo(string $user, string $source, string $destination):array { $response = $this->uploadFile($user, $source, $destination, true); $this->theHTTPStatusCodeShouldBe( ["201", "204"], "HTTP status code was not 201 or 204 while trying to upload file '$source' to '$destination' for user '$user'", $response ); + return $response->getHeader('oc-fileid'); } /**