Commit 47fa2c84 authored by Sergio Bertolin's avatar Sergio Bertolin
Browse files

Adapted sharing and external features, random failures in sharing:857

parent 0d5695ce
...@@ -254,12 +254,12 @@ trait WebDav { ...@@ -254,12 +254,12 @@ trait WebDav {
} }
/** /**
* @Then /^as "([^"]*)" gets properties of folder "([^"]*)" with$/ * @Then /^as "([^"]*)" gets properties of (file|folder|entry) "([^"]*)" with$/
* @param string $user * @param string $user
* @param string $path * @param string $path
* @param \Behat\Gherkin\Node\TableNode|null $propertiesTable * @param \Behat\Gherkin\Node\TableNode|null $propertiesTable
*/ */
public function asGetsPropertiesOfFolderWith($user, $path, $propertiesTable) { public function asGetsPropertiesOfFolderWith($user, $elementType, $path, $propertiesTable) {
$properties = null; $properties = null;
if ($propertiesTable instanceof \Behat\Gherkin\Node\TableNode) { if ($propertiesTable instanceof \Behat\Gherkin\Node\TableNode) {
foreach ($propertiesTable->getRows() as $row) { foreach ($propertiesTable->getRows() as $row) {
...@@ -378,7 +378,7 @@ trait WebDav { ...@@ -378,7 +378,7 @@ trait WebDav {
} }
public function makeSabrePath($user, $path) { public function makeSabrePath($user, $path) {
return $this->encodePath($this->getDavFilesPath($user)); return $this->encodePath($this->getDavFilesPath($user) . $path);
} }
public function getSabreClient($user) { public function getSabreClient($user) {
...@@ -599,13 +599,4 @@ trait WebDav { ...@@ -599,13 +599,4 @@ trait WebDav {
return $response; return $response;
} }
/**
* @Then /^as "([^"]*)" gets properties of file "([^"]*)" with$/
* @param string $user
* @param string $path
* @param \Behat\Gherkin\Node\TableNode|null $propertiesTable
*/
public function asGetsPropertiesOfFileWith($user, $path, $propertiesTable) {
$this->asGetsPropertiesOfFolderWith($user, $path, $propertiesTable);
}
} }
Feature: external-storage Feature: external-storage
Background: Background:
Given using api version "1" Given using api version "1"
Given using dav path "remote.php/webdav" Given using old dav path
@local_storage @local_storage
Scenario: Share by link a file inside a local external storage Scenario: Share by link a file inside a local external storage
......
Feature: sharing Feature: sharing
Background: Background:
Given using api version "1" Given using api version "1"
Given using dav path "remote.php/webdav" Given using old dav path
Scenario: Creating a new share with user Scenario: Creating a new share with user
Given user "user0" exists Given user "user0" exists
...@@ -533,7 +533,7 @@ Feature: sharing ...@@ -533,7 +533,7 @@ Feature: sharing
| /myFOLDER/myTMP/ | | /myFOLDER/myTMP/ |
Scenario: Check quota of owners parent directory of a shared file Scenario: Check quota of owners parent directory of a shared file
Given using dav path "remote.php/webdav" Given using old dav path
And As an "admin" And As an "admin"
And user "user0" exists And user "user0" exists
And user "user1" exists And user "user1" exists
...@@ -607,7 +607,7 @@ Feature: sharing ...@@ -607,7 +607,7 @@ Feature: sharing
Given user "user0" exists Given user "user0" exists
And user "user1" exists And user "user1" exists
And User "user0" uploads file with content "foo" to "/tmp.txt" And User "user0" uploads file with content "foo" to "/tmp.txt"
And file "tmp.txt" of user "user0" is shared with user "user1" And file "/tmp.txt" of user "user0" is shared with user "user1"
When as "user1" gets properties of folder "/tmp.txt" with When as "user1" gets properties of folder "/tmp.txt" with
|{http://open-collaboration-services.org/ns}share-permissions | |{http://open-collaboration-services.org/ns}share-permissions |
Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "19" Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "19"
...@@ -726,16 +726,17 @@ Feature: sharing ...@@ -726,16 +726,17 @@ Feature: sharing
And the HTTP status code should be "401" And the HTTP status code should be "401"
Scenario: Merging shares for recipient when shared from outside with group and member Scenario: Merging shares for recipient when shared from outside with group and member
Given As an "admin" Given using old dav path
And As an "admin"
And user "user0" exists And user "user0" exists
And user "user1" exists And user "user1" exists
And group "group1" exists And group "group1" exists
And user "user1" belongs to group "group1" And user "user1" belongs to group "group1"
And user "user0" created a folder "merge-test-outside" And user "user0" created a folder "/merge-test-outside"
When folder "merge-test-outside" of user "user0" is shared with group "group1" When folder "/merge-test-outside" of user "user0" is shared with group "group1"
And folder "merge-test-outside" of user "user0" is shared with user "user1" And folder "/merge-test-outside" of user "user0" is shared with user "user1"
Then as "user1" the folder "merge-test-outside" exists Then as "user1" the folder "/merge-test-outside" exists
And as "user1" the folder "merge-test-outside (2)" does not exist And as "user1" the folder "/merge-test-outside (2)" does not exist
Scenario: Merging shares for recipient when shared from outside with group and member with different permissions Scenario: Merging shares for recipient when shared from outside with group and member with different permissions
Given As an "admin" Given As an "admin"
...@@ -743,13 +744,13 @@ Feature: sharing ...@@ -743,13 +744,13 @@ Feature: sharing
And user "user1" exists And user "user1" exists
And group "group1" exists And group "group1" exists
And user "user1" belongs to group "group1" And user "user1" belongs to group "group1"
And user "user0" created a folder "merge-test-outside-perms" And user "user0" created a folder "/merge-test-outside-perms"
When folder "merge-test-outside-perms" of user "user0" is shared with group "group1" with permissions 1 When folder "/merge-test-outside-perms" of user "user0" is shared with group "group1" with permissions 1
And folder "merge-test-outside-perms" of user "user0" is shared with user "user1" with permissions 31 And folder "/merge-test-outside-perms" of user "user0" is shared with user "user1" with permissions 31
Then as "user1" gets properties of folder "merge-test-outside-perms" with Then as "user1" gets properties of folder "/merge-test-outside-perms" with
|{http://owncloud.org/ns}permissions| |{http://owncloud.org/ns}permissions|
And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRDNVCK" And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRDNVCK"
And as "user1" the folder "merge-test-outside-perms (2)" does not exist And as "user1" the folder "/merge-test-outside-perms (2)" does not exist
Scenario: Merging shares for recipient when shared from outside with two groups Scenario: Merging shares for recipient when shared from outside with two groups
Given As an "admin" Given As an "admin"
...@@ -759,11 +760,11 @@ Feature: sharing ...@@ -759,11 +760,11 @@ Feature: sharing
And group "group2" exists And group "group2" exists
And user "user1" belongs to group "group1" And user "user1" belongs to group "group1"
And user "user1" belongs to group "group2" And user "user1" belongs to group "group2"
And user "user0" created a folder "merge-test-outside-twogroups" And user "user0" created a folder "/merge-test-outside-twogroups"
When folder "merge-test-outside-twogroups" of user "user0" is shared with group "group1" When folder "/merge-test-outside-twogroups" of user "user0" is shared with group "group1"
And folder "merge-test-outside-twogroups" of user "user0" is shared with group "group2" And folder "/merge-test-outside-twogroups" of user "user0" is shared with group "group2"
Then as "user1" the folder "merge-test-outside-twogroups" exists Then as "user1" the folder "/merge-test-outside-twogroups" exists
And as "user1" the folder "merge-test-outside-twogroups (2)" does not exist And as "user1" the folder "/merge-test-outside-twogroups (2)" does not exist
Scenario: Merging shares for recipient when shared from outside with two groups with different permissions Scenario: Merging shares for recipient when shared from outside with two groups with different permissions
Given As an "admin" Given As an "admin"
...@@ -773,13 +774,13 @@ Feature: sharing ...@@ -773,13 +774,13 @@ Feature: sharing
And group "group2" exists And group "group2" exists
And user "user1" belongs to group "group1" And user "user1" belongs to group "group1"
And user "user1" belongs to group "group2" And user "user1" belongs to group "group2"
And user "user0" created a folder "merge-test-outside-twogroups-perms" And user "user0" created a folder "/merge-test-outside-twogroups-perms"
When folder "merge-test-outside-twogroups-perms" of user "user0" is shared with group "group1" with permissions 1 When folder "/merge-test-outside-twogroups-perms" of user "user0" is shared with group "group1" with permissions 1
And folder "merge-test-outside-twogroups-perms" of user "user0" is shared with group "group2" with permissions 31 And folder "/merge-test-outside-twogroups-perms" of user "user0" is shared with group "group2" with permissions 31
Then as "user1" gets properties of folder "merge-test-outside-twogroups-perms" with Then as "user1" gets properties of folder "/merge-test-outside-twogroups-perms" with
|{http://owncloud.org/ns}permissions| |{http://owncloud.org/ns}permissions|
And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRDNVCK" And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRDNVCK"
And as "user1" the folder "merge-test-outside-twogroups-perms (2)" does not exist And as "user1" the folder "/merge-test-outside-twogroups-perms (2)" does not exist
Scenario: Merging shares for recipient when shared from outside with two groups and member Scenario: Merging shares for recipient when shared from outside with two groups and member
Given As an "admin" Given As an "admin"
...@@ -789,24 +790,24 @@ Feature: sharing ...@@ -789,24 +790,24 @@ Feature: sharing
And group "group2" exists And group "group2" exists
And user "user1" belongs to group "group1" And user "user1" belongs to group "group1"
And user "user1" belongs to group "group2" And user "user1" belongs to group "group2"
And user "user0" created a folder "merge-test-outside-twogroups-member-perms" And user "user0" created a folder "/merge-test-outside-twogroups-member-perms"
When folder "merge-test-outside-twogroups-member-perms" of user "user0" is shared with group "group1" with permissions 1 When folder "/merge-test-outside-twogroups-member-perms" of user "user0" is shared with group "group1" with permissions 1
And folder "merge-test-outside-twogroups-member-perms" of user "user0" is shared with group "group2" with permissions 31 And folder "/merge-test-outside-twogroups-member-perms" of user "user0" is shared with group "group2" with permissions 31
And folder "merge-test-outside-twogroups-member-perms" of user "user0" is shared with user "user1" with permissions 1 And folder "/merge-test-outside-twogroups-member-perms" of user "user0" is shared with user "user1" with permissions 1
Then as "user1" gets properties of folder "merge-test-outside-twogroups-member-perms" with Then as "user1" gets properties of folder "/merge-test-outside-twogroups-member-perms" with
|{http://owncloud.org/ns}permissions| |{http://owncloud.org/ns}permissions|
And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRDNVCK" And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRDNVCK"
And as "user1" the folder "merge-test-outside-twogroups-member-perms (2)" does not exist And as "user1" the folder "/merge-test-outside-twogroups-member-perms (2)" does not exist
Scenario: Merging shares for recipient when shared from inside with group Scenario: Merging shares for recipient when shared from inside with group
Given As an "admin" Given As an "admin"
And user "user0" exists And user "user0" exists
And group "group1" exists And group "group1" exists
And user "user0" belongs to group "group1" And user "user0" belongs to group "group1"
And user "user0" created a folder "merge-test-inside-group" And user "user0" created a folder "/merge-test-inside-group"
When folder "/merge-test-inside-group" of user "user0" is shared with group "group1" When folder "/merge-test-inside-group" of user "user0" is shared with group "group1"
Then as "user0" the folder "merge-test-inside-group" exists Then as "user0" the folder "/merge-test-inside-group" exists
And as "user0" the folder "merge-test-inside-group (2)" does not exist And as "user0" the folder "/merge-test-inside-group (2)" does not exist
Scenario: Merging shares for recipient when shared from inside with two groups Scenario: Merging shares for recipient when shared from inside with two groups
Given As an "admin" Given As an "admin"
...@@ -815,12 +816,12 @@ Feature: sharing ...@@ -815,12 +816,12 @@ Feature: sharing
And group "group2" exists And group "group2" exists
And user "user0" belongs to group "group1" And user "user0" belongs to group "group1"
And user "user0" belongs to group "group2" And user "user0" belongs to group "group2"
And user "user0" created a folder "merge-test-inside-twogroups" And user "user0" created a folder "/merge-test-inside-twogroups"
When folder "merge-test-inside-twogroups" of user "user0" is shared with group "group1" When folder "/merge-test-inside-twogroups" of user "user0" is shared with group "group1"
And folder "merge-test-inside-twogroups" of user "user0" is shared with group "group2" And folder "/merge-test-inside-twogroups" of user "user0" is shared with group "group2"
Then as "user0" the folder "merge-test-inside-twogroups" exists Then as "user0" the folder "/merge-test-inside-twogroups" exists
And as "user0" the folder "merge-test-inside-twogroups (2)" does not exist And as "user0" the folder "/merge-test-inside-twogroups (2)" does not exist
And as "user0" the folder "merge-test-inside-twogroups (3)" does not exist And as "user0" the folder "/merge-test-inside-twogroups (3)" does not exist
Scenario: Merging shares for recipient when shared from inside with group with less permissions Scenario: Merging shares for recipient when shared from inside with group with less permissions
Given As an "admin" Given As an "admin"
...@@ -829,14 +830,14 @@ Feature: sharing ...@@ -829,14 +830,14 @@ Feature: sharing
And group "group2" exists And group "group2" exists
And user "user0" belongs to group "group1" And user "user0" belongs to group "group1"
And user "user0" belongs to group "group2" And user "user0" belongs to group "group2"
And user "user0" created a folder "merge-test-inside-twogroups-perms" And user "user0" created a folder "/merge-test-inside-twogroups-perms"
When folder "merge-test-inside-twogroups-perms" of user "user0" is shared with group "group1" When folder "/merge-test-inside-twogroups-perms" of user "user0" is shared with group "group1"
And folder "merge-test-inside-twogroups-perms" of user "user0" is shared with group "group2" And folder "/merge-test-inside-twogroups-perms" of user "user0" is shared with group "group2"
Then as "user0" gets properties of folder "merge-test-inside-twogroups-perms" with Then as "user0" gets properties of folder "/merge-test-inside-twogroups-perms" with
|{http://owncloud.org/ns}permissions| |{http://owncloud.org/ns}permissions|
And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "RDNVCK" And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "RDNVCK"
And as "user0" the folder "merge-test-inside-twogroups-perms (2)" does not exist And as "user0" the folder "/merge-test-inside-twogroups-perms (2)" does not exist
And as "user0" the folder "merge-test-inside-twogroups-perms (3)" does not exist And as "user0" the folder "/merge-test-inside-twogroups-perms (3)" does not exist
Scenario: Merging shares for recipient when shared from outside with group then user and recipient renames in between Scenario: Merging shares for recipient when shared from outside with group then user and recipient renames in between
Given As an "admin" Given As an "admin"
...@@ -844,14 +845,14 @@ Feature: sharing ...@@ -844,14 +845,14 @@ Feature: sharing
And user "user1" exists And user "user1" exists
And group "group1" exists And group "group1" exists
And user "user1" belongs to group "group1" And user "user1" belongs to group "group1"
And user "user0" created a folder "merge-test-outside-groups-renamebeforesecondshare" And user "user0" created a folder "/merge-test-outside-groups-renamebeforesecondshare"
When folder "merge-test-outside-groups-renamebeforesecondshare" of user "user0" is shared with group "group1" When folder "/merge-test-outside-groups-renamebeforesecondshare" of user "user0" is shared with group "group1"
And User "user1" moved folder "/merge-test-outside-groups-renamebeforesecondshare" to "/merge-test-outside-groups-renamebeforesecondshare-renamed" And User "user1" moved folder "/merge-test-outside-groups-renamebeforesecondshare" to "/merge-test-outside-groups-renamebeforesecondshare-renamed"
And folder "merge-test-outside-groups-renamebeforesecondshare" of user "user0" is shared with user "user1" And folder "/merge-test-outside-groups-renamebeforesecondshare" of user "user0" is shared with user "user1"
Then as "user1" gets properties of folder "merge-test-outside-groups-renamebeforesecondshare-renamed" with Then as "user1" gets properties of folder "/merge-test-outside-groups-renamebeforesecondshare-renamed" with
|{http://owncloud.org/ns}permissions| |{http://owncloud.org/ns}permissions|
And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRDNVCK" And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRDNVCK"
And as "user1" the folder "merge-test-outside-groups-renamebeforesecondshare" does not exist And as "user1" the folder "/merge-test-outside-groups-renamebeforesecondshare" does not exist
Scenario: Merging shares for recipient when shared from outside with user then group and recipient renames in between Scenario: Merging shares for recipient when shared from outside with user then group and recipient renames in between
Given As an "admin" Given As an "admin"
...@@ -859,14 +860,14 @@ Feature: sharing ...@@ -859,14 +860,14 @@ Feature: sharing
And user "user1" exists And user "user1" exists
And group "group1" exists And group "group1" exists
And user "user1" belongs to group "group1" And user "user1" belongs to group "group1"
And user "user0" created a folder "merge-test-outside-groups-renamebeforesecondshare" And user "user0" created a folder "/merge-test-outside-groups-renamebeforesecondshare"
When folder "merge-test-outside-groups-renamebeforesecondshare" of user "user0" is shared with user "user1" When folder "/merge-test-outside-groups-renamebeforesecondshare" of user "user0" is shared with user "user1"
And User "user1" moved folder "/merge-test-outside-groups-renamebeforesecondshare" to "/merge-test-outside-groups-renamebeforesecondshare-renamed" And User "user1" moved folder "/merge-test-outside-groups-renamebeforesecondshare" to "/merge-test-outside-groups-renamebeforesecondshare-renamed"
And folder "merge-test-outside-groups-renamebeforesecondshare" of user "user0" is shared with group "group1" And folder "/merge-test-outside-groups-renamebeforesecondshare" of user "user0" is shared with group "group1"
Then as "user1" gets properties of folder "merge-test-outside-groups-renamebeforesecondshare-renamed" with Then as "user1" gets properties of folder "/merge-test-outside-groups-renamebeforesecondshare-renamed" with
|{http://owncloud.org/ns}permissions| |{http://owncloud.org/ns}permissions|
And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRDNVCK" And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRDNVCK"
And as "user1" the folder "merge-test-outside-groups-renamebeforesecondshare" does not exist And as "user1" the folder "/merge-test-outside-groups-renamebeforesecondshare" does not exist
Scenario: Empting trashbin Scenario: Empting trashbin
Given As an "admin" Given As an "admin"
...@@ -884,5 +885,5 @@ Feature: sharing ...@@ -884,5 +885,5 @@ Feature: sharing
And file "/common/sub" of user "user0" is shared with user "user1" And file "/common/sub" of user "user0" is shared with user "user1"
And User "user0" deletes folder "/common" And User "user0" deletes folder "/common"
When User "user0" empties trashbin When User "user0" empties trashbin
Then as "user1" the folder "sub" does not exist Then as "user1" the folder "/sub" does not exist
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment