setup fakeoffice for acceptance test

This commit is contained in:
Prajwol Amatya committed 2024-08-23 16:15:05 +05:45
1 parent b398cb1b4b
commit 964dfc62f0
3 files changed
+111 -42

No files matched your search

@@ -4,7 +4,7 @@ Feature: App Provider
Scenario: open file with Collabora
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 Collabora service
When user "Alice" opens file "simple.odt" with collaboration service
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
@@ -4132,25 +4132,24 @@ class SpacesContext implements Context {
);
}
/**
* @When user :user opens file :filename with Collabora service
*
* @param string $user
* @param string $filename
*
* @return void
*/
public function userOpensFileWithCollaboraService(string $user, string $filename): void
{
$fileId = $this->getFileId($user, "Personal", $filename);
$url = $this->featureContext->getBaseUrl() . "/app/open?file_id=$fileId&app_name=Collabora";
$this->featureContext->setResponse(
HttpRequestHelper::post(
$url,
$this->featureContext->getStepLineRef(),
$user,
$this->featureContext->getPasswordForUser($user)
)
);
}
/**
* @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)
)
);
}
}