Skip to content

Commit

Permalink
Update expected to failures to include more incoming tests
Browse files Browse the repository at this point in the history
Signed-off-by: Kiran Parajuli <kiranparajuli589@gmail.com>
  • Loading branch information
kiranparajuli589 committed Aug 23, 2022
1 parent 9f6267e commit 01a909d
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .drone.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# The test runner source for API tests
CORE_COMMITID=809f7256bdea4cd3dee45dfd5cd078542f4c55cf
CORE_COMMITID=f79fbff0a0d129df7b6ec20bc202665c4fda5fad
CORE_BRANCH=master

# The test runner source for UI tests
Expand Down
24 changes: 6 additions & 18 deletions tests/acceptance/expected-failures-API-on-OCIS-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -447,12 +447,6 @@ File and sync features in a shared scenario

- [apiShareManagementToShares/mergeShare.feature:105](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToShares/mergeShare.feature#L105)

#### [not possible to move file into a received folder](https://github.com/owncloud/ocis/issues/764)

- [apiShareManagementBasicToShares/createShareToSharesFolder.feature:500](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementBasicToShares/createShareToSharesFolder.feature#L500)
- [apiSpaces/changingFilesShare.feature:12](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSpaces/changingFilesShare.feature#L12)
- [apiSpaces/changingFilesShare.feature:67](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiSpaces/changingFilesShare.feature#L67)

#### [File deletion using dav gives unique string in filename in the trashbin](https://github.com/owncloud/product/issues/178)

- [apiShareManagementBasicToShares/deleteShareFromShares.feature:67](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementBasicToShares/deleteShareFromShares.feature#L67)
Expand Down Expand Up @@ -587,18 +581,14 @@ cannot share a folder with create permission
- [apiShareOperationsToShares2/uploadToShare.feature:211](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares2/uploadToShare.feature#L211)

#### [not possible to move file into a received folder](https://github.com/owncloud/ocis/issues/764)

- [apiShareManagementBasicToShares/createShareToSharesFolder.feature:500](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementBasicToShares/createShareToSharesFolder.feature#L500)
- [apiShareOperationsToShares1/changingFilesShare.feature:25](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L25)
- [apiShareOperationsToShares1/changingFilesShare.feature:26](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L26)
- [apiShareOperationsToShares1/changingFilesShare.feature:31](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L31)
- [apiShareOperationsToShares1/changingFilesShare.feature:119](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L119)
- [apiShareOperationsToShares1/changingFilesShare.feature:120](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L120)
- [apiShareOperationsToShares1/changingFilesShare.feature:125](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L125)
- [apiShareOperationsToShares1/changingFilesShare.feature:146](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L146)
- [apiShareOperationsToShares1/changingFilesShare.feature:147](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L147)
- [apiShareOperationsToShares1/changingFilesShare.feature:152](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L152)
- [apiVersions/fileVersionsSharingToShares.feature:220](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiVersions/fileVersionsSharingToShares.feature#L220)
- [apiVersions/fileVersionsSharingToShares.feature:221](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiVersions/fileVersionsSharingToShares.feature#L221)
- [apiShareOperationsToShares1/changingFilesShare.feature:110](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L110)
- [apiShareOperationsToShares1/changingFilesShare.feature:111](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L111)
- [apiShareOperationsToShares1/changingFilesShare.feature:131](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L131)
- [apiShareOperationsToShares1/changingFilesShare.feature:132](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L132)
-

Scenario Outline: Moving a file into a shared folder as the sharee and as the sharer

Expand Down Expand Up @@ -970,8 +960,6 @@ And other missing implementation of favorites
- [apiWebdavLocks2/setTimeoutSharesToShares.feature:82](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L82)
- [apiWebdavLocks2/setTimeoutSharesToShares.feature:83](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L83)
- [apiWebdavLocks2/setTimeoutSharesToShares.feature:84](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavLocks2/setTimeoutSharesToShares.feature#L84)
- [apiShareOperationsToShares1/changingFilesShare.feature:98](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L98)
- [apiShareOperationsToShares1/changingFilesShare.feature:173](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareOperationsToShares1/changingFilesShare.feature#L173)
- [apiWebdavMove2/moveShareOnOcis.feature:38](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L38)
- [apiWebdavMove2/moveShareOnOcis.feature:39](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L39)
- [apiWebdavMove2/moveShareOnOcis.feature:68](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavMove2/moveShareOnOcis.feature#L68)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ The expected failures in this file are from features in the owncloud/ocis repo.

### [Search by shares jail works incorrect](https://github.com/owncloud/ocis/issues/4014)
- [apiSpaces/search.feature:43](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/search.feature#L43)

#### [not possible to move file into a received folder](https://github.com/owncloud/ocis/issues/764)
- [apiSpaces/changingFilesShare.feature:33](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/changingFilesShare.feature#L33)
- [apiSpaces/changingFilesShare.feature:54](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/changingFilesShare.feature#L54)
23 changes: 5 additions & 18 deletions tests/acceptance/features/apiSpaces/changingFilesShare.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,11 @@
Feature:

Background:
Given these users have been created with default attributes and without skeleton files:
Given using spaces DAV path
And these users have been created with default attributes and without skeleton files:
| username |
| Alice |
| Brian |
And using spaces DAV path

@issue-764
Scenario: Moving a file into a share as recipient
Given user "Alice" has created folder "/shared"
And user "Alice" has shared folder "/shared" with user "Brian"
And user "Brian" has accepted share "/shared" offered by user "Alice"
And user "Brian" has uploaded file with content "some data" to "/textfile0.txt"
When user "Brian" moves file "textfile0.txt" from space "Personal" to "shared/shared_file.txt" inside space "Shares Jail" using the WebDAV API
Then the HTTP status code should be "201"
And for user "Brian" folder "shared" of the space "Shares Jail" should contain these entries:
| shared_file.txt |
And for user "Alice" the space "Personal" should contain these entries:
| shared_file.txt |


Scenario: Moving files between shares by same user
Expand Down Expand Up @@ -63,7 +50,7 @@ Feature:
And for user "Alice" the space "Personal" should contain these entries:
| share2/shared_file.txt |

@issue-4421
@issue-764 @issue-4421
Scenario: Move files between shares by different users
Given user "Carol" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file with content "some data" to "/textfile0.txt"
Expand Down Expand Up @@ -93,5 +80,5 @@ Feature:
Then the HTTP status code should be "204"
And for user "Brian" the space "Shares Jail" should contain these entries:
| textfile1.txt |
And the content of file "textfile1.txt" inside space "Shares Jail" for user "Brian" should be "this is a new content"
And the content of file "textfile1.txt" inside space "Personal" for user "Alice" should be "this is a new content"
And for user "Brian" the content of the file "/textfile1.txt" of the space "Shares Jail" should be "this is a new content"
And for user "Alice" the content of the file "/textfile1.txt" of the space "Personal" should be "this is a new content"
49 changes: 17 additions & 32 deletions tests/acceptance/features/bootstrap/SpacesContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,20 @@ public function verifyTableNodeColumnsCount(
}
}

/**
* Escapes the given string for
* 1. Space --> %20
* 2. Opening Small Bracket --> %28
* 3. Closing Small Bracket --> %29
*
* @param string $path - File path to parse
*
* @return string
*/
public function escapePath(string $path): string {
return \str_replace([" ", "(", ")"], ["%20", "%28", "%29"], $path);
}

/**
* parses a PROPFIND response from $this->response into xml
* and returns found search results if found else returns false
Expand Down Expand Up @@ -1372,7 +1386,7 @@ public function findEntryFromPropfindResponse(
$trimmedEntryNameToSearch = \trim($entryNameToSearch, "/");

// url encode for spaces and brackets that may appear in the filePath
$folderPath = \str_replace([" ", "(", ")"], ["%20", "%28", "%29"], $folderPath);
$folderPath = $this->escapePath($folderPath);

// topWebDavPath should be something like /remote.php/webdav/ or
// /remote.php/dav/files/alice/
Expand Down Expand Up @@ -1864,8 +1878,7 @@ public function userMovesFileWithinSpaceUsingTheWebDAVAPI(
$spaceName
);

$fileSource = \trim($fileSource, "/");
$fileSource = \str_replace([" ", "(", ")"], ["%20", "%28", "%29"], $fileSource);
$fileSource = $this->escapePath(\trim($fileSource, "/"));
$fullUrl = $space["root"]["webDavUrl"] . '/' . $fileSource;
$this->moveFilesAndFoldersRequest($user, $fullUrl, $headers);
}
Expand Down Expand Up @@ -1990,8 +2003,7 @@ public function userMovesFileFromAndToSpaceBetweenSpaces(
public function destinationHeaderValueWithSpaceName(string $user, string $fileDestination, string $spaceName):string {
$space = $this->getSpaceByName($user, $spaceName);

$fileDestination = \ltrim($fileDestination, "/");
$fileDestination = \str_replace([" ", "(", ")"], ["%20", "%28", "%29"], $fileDestination);
$fileDestination = $this->escapePath(\ltrim($fileDestination, "/"));

return $space["root"]["webDavUrl"] . '/' . $fileDestination;
}
Expand Down Expand Up @@ -3186,31 +3198,4 @@ public function asUserFileInsideSpaceShouldContainAPropertyWithValue(
$expectedValue
);
}

/**
* @Given /^the content of file "([^"]*)" inside space "([^"]*)" for user "([^"]*)" should be "([^"]*)"$/
* @throws GuzzleException
*/
public function theContentOfFileInsideSpaceForUserShouldBe($fileSource, $spaceName, $user, $expectedContent) {
$user = $this->featureContext->getActualUsername($user);
$space = $this->getSpaceByName($user, $spaceName);
$fullUrl = $space["root"]["webDavUrl"] . '/' . ltrim($fileSource, "/");
$this->featureContext->setResponse(
HttpRequestHelper::get(
$fullUrl,
$this->featureContext->getStepLineRef(),
$user,
$this->featureContext->getPasswordForUser($user),
)
);
$this->featureContext->theHttpStatusCodeShouldBe(200);
$actualContent = (string) $this->featureContext->getResponse()->getBody();
Assert::assertEquals(
$expectedContent,
$actualContent,
__METHOD__ . " Downloaded content mis-match for resource at '$fileSource' inside space '$spaceName'" .
"\n- Expected content: $expectedContent" .
"\n+ Actual content: $actualContent"
);
}
}

0 comments on commit 01a909d

Please sign in to comment.