Merge pull request #4546 from owncloud/removeLockOnFolderTests

[tests-only][full-ci]Remove lock on folder tests for spaces
This commit is contained in:
Phil Davis
2022-09-09 15:19:06 +05:45
committed by GitHub
4 changed files with 14 additions and 139 deletions

View File

@@ -30,7 +30,6 @@ default:
- PublicWebDavContext:
- TrashbinContext:
- WebDavPropertiesContext:
- WebDavLockingContext:
apiSpaces:
paths:
@@ -49,7 +48,6 @@ default:
- SearchContext:
- TrashbinContext:
- WebDavPropertiesContext:
- WebDavLockingContext:
- TUSContext:
- SpacesTUSContext:
@@ -70,7 +68,6 @@ default:
- FavoritesContext:
- TrashbinContext:
- WebDavPropertiesContext:
- WebDavLockingContext:
apiGraph:
paths:

View File

@@ -31,16 +31,6 @@ The expected failures in this file are from features in the owncloud/ocis repo.
- [apiSpaces/changingFilesShare.feature:12](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/changingFilesShare.feature#L12)
#### [Webdav LOCK operations](https://github.com/owncloud/ocis/issues/1284)
- [apiSpaces/lockSpaces.feature:31](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/lockSpaces.feature#L31)
- [apiSpaces/lockSpaces.feature:32](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/lockSpaces.feature#L32)
- [apiSpaces/lockSpaces.feature:50](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/lockSpaces.feature#L50)
- [apiSpaces/lockSpaces.feature:51](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/lockSpaces.feature#L51)
- [apiSpaces/lockSpaces.feature:71](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/lockSpaces.feature#L71)
- [apiSpaces/lockSpaces.feature:72](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/lockSpaces.feature#L72)
- [apiSpaces/lockSpaces.feature:89](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/lockSpaces.feature#L89)
- [apiSpaces/lockSpaces.feature:90](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/lockSpaces.feature#L90)
### [copy to overwrite (file and folder) from Personal to Shares Jail behaves differently](https://github.com/owncloud/ocis/issues/4393)
- [apiSpaces/copySpaces.feature:487](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/copySpaces.feature#L487)
- [apiSpaces/copySpaces.feature:501](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/copySpaces.feature#L501)

View File

@@ -1,90 +0,0 @@
@api @skipOnOcV10
Feature: lock
# Note: This Feature includes all the tests from core (apiWebdavLock suite) related to /Shares since in core no implementation is there for space Shares Jail
Background:
Given these users have been created with default attributes and without skeleton files:
| username |
| Alice |
| Brian |
| Carol |
And user "Alice" has created folder "PARENT"
And user "Brian" has created folder "PARENT"
And user "Carol" has created folder "PARENT"
And using spaces DAV path
Scenario Outline: lock should propagate correctly when uploaded to a reshare that was locked by the owner
Given user "Alice" has shared folder "PARENT" with user "Brian"
And user "Brian" has accepted share "/PARENT" offered by user "Alice"
And user "Brian" has shared the following entity "PARENT" inside of space "Shares Jail" with user "Carol" with role "editor"
And user "Carol" has accepted share "/PARENT" offered by user "Brian"
And user "Alice" has locked folder "/PARENT" inside space "Personal" setting the following properties
| lockscope | <lock-scope> |
When user "Carol" uploads a file inside space "Shares Jail" with content "uploaded by carol" to "PARENT/textfile.txt" using the WebDAV API
And user "Brian" uploads a file inside space "Shares Jail" with content "uploaded by brian" to "PARENT/textfile.txt" using the WebDAV API
And user "Alice" uploads file "filesForUpload/textfile.txt" to "/PARENT/textfile.txt" using the WebDAV API
Then the HTTP status code of responses on all endpoints should be "423"
And as "Alice" file "/PARENT/textfile.txt" should not exist
Examples:
| lock-scope |
| shared |
| exclusive |
Scenario Outline: lock should propagate correctly when uploaded overwriting to a reshare that was locked by the owner
Given user "Alice" has uploaded file with content "ownCloud test text file parent" to "PARENT/parent.txt"
And user "Alice" has shared folder "PARENT" with user "Brian"
And user "Brian" has accepted share "/PARENT" offered by user "Alice"
And user "Brian" has shared the following entity "PARENT" inside of space "Shares Jail" with user "Carol" with role "editor"
And user "Carol" has accepted share "/PARENT" offered by user "Brian"
And user "Alice" has locked folder "/PARENT" inside space "Personal" setting the following properties
| lockscope | <lock-scope> |
When user "Carol" uploads a file inside space "Shares Jail" with content "uploaded by carol" to "PARENT/textfile.txt" using the WebDAV API
And user "Brian" uploads a file inside space "Shares Jail" with content "uploaded by brian" to "PARENT/textfile.txt" using the WebDAV API
And user "Alice" uploads file "filesForUpload/textfile.txt" to "/PARENT/parent.txt" using the WebDAV API
Then the HTTP status code of responses on all endpoints should be "423"
And the content of file "/PARENT/parent.txt" for user "Alice" should be "ownCloud test text file parent"
Examples:
| lock-scope |
| shared |
| exclusive |
Scenario Outline: lock should propagate correctly when the public uploads to a reshared share that was locked by the original owner
Given user "Alice" has shared folder "PARENT" with user "Brian"
And user "Brian" has accepted share "/PARENT" offered by user "Alice"
And user "Brian" has shared the following entity "PARENT" inside of space "Shares Jail" with user "Carol" with role "editor"
And user "Carol" has accepted share "/PARENT" offered by user "Brian"
And user "Carol" has created a public link share inside of space "Shares Jail" with settings:
| path | PARENT |
| shareType | 3 |
| permissions | 15 |
| name | public link |
And user "Alice" has locked folder "/PARENT" inside space "Personal" setting the following properties
| lockscope | <lock-scope> |
When the public uploads file "test.txt" with content "test" using the new public WebDAV API
Then the HTTP status code should be "423"
And as "Alice" file "/PARENT/test.txt" should not exist
Examples:
| lock-scope |
| shared |
| exclusive |
Scenario Outline: lock should propagate correctly when uploaded to a reshare that was locked by the resharing user
Given user "Alice" has shared folder "PARENT" with user "Brian"
And user "Brian" has accepted share "/PARENT" offered by user "Alice"
And user "Brian" has shared the following entity "PARENT" inside of space "Shares Jail" with user "Carol" with role "editor"
And user "Carol" has accepted share "/PARENT" offered by user "Brian"
And user "Brian" has locked folder "/PARENT" inside space "Shares Jail" setting the following properties
| lockscope | <lock-scope> |
When user "Carol" uploads a file inside space "Shares Jail" with content "uploaded by carol" to "PARENT/textfile.txt" using the WebDAV API
And user "Brian" uploads a file inside space "Shares Jail" with content "uploaded by brian" to "PARENT/textfile.txt" using the WebDAV API
And user "Alice" uploads file "filesForUpload/textfile.txt" to "/PARENT/textfile.txt" using the WebDAV API
Then the HTTP status code of responses on all endpoints should be "423"
And as "Alice" file "/PARENT/textfile.txt" should not exist
Examples:
| lock-scope |
| shared |
| exclusive |

View File

@@ -65,11 +65,6 @@ class SpacesContext implements Context {
*/
private FavoritesContext $favoritesContext;
/**
* @var WebDavLockingContext
*/
private WebDavLockingContext $webDavLockingContext;
/**
* @var ChecksumContext
*/
@@ -460,7 +455,6 @@ class SpacesContext implements Context {
$this->trashbinContext = $environment->getContext('TrashbinContext');
$this->webDavPropertiesContext = $environment->getContext('WebDavPropertiesContext');
$this->favoritesContext = $environment->getContext('FavoritesContext');
$this->webDavLockingContext = $environment->getContext('WebDavLockingContext');
$this->checksumContext = $environment->getContext('ChecksumContext');
// Run the BeforeScenario function in OCSContext to set it up correctly
$this->ocsContext->before($scope);
@@ -2988,22 +2982,6 @@ class SpacesContext implements Context {
}
}
/**
* @Given /^user "([^"]*)" has locked folder "([^"]*)" inside space "([^"]*)" setting the following properties$/
*
* @param string $user
* @param string $resource
* @param TableNode $properties
* @param string $spaceName
*
* @return void
* @throws Exception | GuzzleException
*/
public function userHasLockedResourceOfSpace(string $user, string $resource, TableNode $properties, string $spaceName): void {
$this->setSpaceIDByName($user, $spaceName);
$this->webDavLockingContext->lockFileUsingWebDavAPI($user, $resource, $properties);
}
/**
* @When /^user "([^"]*)" creates a public link share of the space "([^"]*)" with settings:$/
*
@@ -3170,20 +3148,20 @@ class SpacesContext implements Context {
$this->featureContext->setResponseXmlObject($responseXml);
}
/**
* @Then /^as user "([^"]*)" (?:file|folder|entry) "([^"]*)" inside space "([^"]*)" (should|should not) be favorited$/
*
* @param string $user
* @param string $path
* @param string $spaceName
* @param string $shouldOrNot
*
* @return void
*/
public function asUserFileOrFolderInsideSpaceShouldOrNotBeFavorited(string $user, string $path, string $spaceName, string $shouldOrNot):void {
$this->setSpaceIDByName($user, $spaceName);
$this->favoritesContext->asUserFileOrFolderShouldBeFavorited($user, $path, ($shouldOrNot === 'should') ? 1 : 0);
}
/**
* @Then /^as user "([^"]*)" (?:file|folder|entry) "([^"]*)" inside space "([^"]*)" (should|should not) be favorited$/
*
* @param string $user
* @param string $path
* @param string $spaceName
* @param string $shouldOrNot
*
* @return void
*/
public function asUserFileOrFolderInsideSpaceShouldOrNotBeFavorited(string $user, string $path, string $spaceName, string $shouldOrNot):void {
$this->setSpaceIDByName($user, $spaceName);
$this->favoritesContext->asUserFileOrFolderShouldBeFavorited($user, $path, ($shouldOrNot === 'should') ? 1 : 0);
}
/**
* @When /^user "([^"]*)" favorites element "([^"]*)" in space "([^"]*)" using the WebDAV API$/