added test to create text file with /app/new endpoint

This commit is contained in:
Prajwol Amatya
2024-09-02 14:52:36 +05:45
parent 3b85d45459
commit 78fa278ed0
2 changed files with 209 additions and 0 deletions
@@ -89,4 +89,27 @@ class CollaborationContext implements Context {
)
);
}
/**
* @When user :user creates a file :file inside folder :folder in space :space using wopi endpoint
* @When user :user tries to create a file :file inside folder :folder in space :space using wopi endpoint
*
* @param string $user
* @param string $file
* @param string $folder
* @param string $space
*
* @return void
*/
public function userCreatesFileInsideFolderInSpaceUsingWopiEndpoint(string $user, string $file, string $folder, string $space): void {
$parent_container_id = $this->spacesContext->getResourceId($user, $space, $folder);
$this->featureContext->setResponse(
HttpRequestHelper::post(
$this->featureContext->getBaseUrl() . "/app/new?parent_container_id=$parent_container_id&filename=$file",
$this->featureContext->getStepLineRef(),
$user,
$this->featureContext->getPasswordForUser($user)
)
);
}
}