Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only][full-ci] add test to delete file by file-id #9760

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions tests/acceptance/features/bootstrap/WebDav.php
Original file line number Diff line number Diff line change
Expand Up @@ -2700,6 +2700,31 @@ public function userDeletesFile(string $user, string $resource):void {
$this->pushToLastStatusCodesArrays();
}

/**
* @When user :user deletes file :filename from space :space using file-id path :davPath
*
* @param string $user
* @param string $filename
* @param string $space
* @param string $davPath
*
* @return void
*/
public function userDeletesFileFromSpaceUsingFileIdPath(string $user, string $filename, string $space, string $davPath):void {
$requestUrl = $this->getBaseUrl() . $davPath;
$user = $this->getActualUsername($user);
$password = $this->getPasswordForUser($user);
$response = HttpRequestHelper::sendRequest(
$requestUrl,
null,
'DELETE',
$user,
$password
);
$this->setResponse($response);
$this->pushToLastStatusCodesArrays();
}

/**
* @Given /^user "([^"]*)" has deleted (?:file|folder|entity) "([^"]*)"$/
*
Expand Down
13 changes: 13 additions & 0 deletions tests/acceptance/features/coreApiWebdavDelete/deleteFile.feature
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,16 @@ Feature: delete file
When user "Alice" deletes file "/zerobyte.txt" using the WebDAV API
Then the HTTP status code should be "204"
And as "Alice" file "/zerobyte.txt" should not exist

@issue-9619
Scenario Outline: delete a file using file-id
Given using spaces DAV path
And user "Alice" has uploaded file with content "special file" to "/textfile.txt"
And we save it into "FILEID"
When user "Alice" deletes file "/textfile.txt" from space "Personal" using file-id path "<dav-path>"
Then the HTTP status code should be "204"
And as "Alice" file "/textfile.txt" should not exist
Examples:
| dav-path |
| /remote.php/dav/spaces/<<FILEID>> |
| /dav/spaces/<<FILEID>> |