Add acceptance test for sharing a folder without create permission
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
parent
ae3af29646
commit
244a7e16f3
|
@ -314,3 +314,23 @@ Feature: app-files-sharing
|
||||||
Then I see that the file is shared with "user1"
|
Then I see that the file is shared with "user1"
|
||||||
And I see that "user1" can not edit the share
|
And I see that "user1" can not edit the share
|
||||||
And I see that "user1" can not be allowed to edit the share
|
And I see that "user1" can not be allowed to edit the share
|
||||||
|
|
||||||
|
Scenario: sharee can not reshare a folder with create permission if the sharer disables it
|
||||||
|
Given I act as John
|
||||||
|
And I am logged in as the admin
|
||||||
|
And I act as Jane
|
||||||
|
And I am logged in
|
||||||
|
And I act as John
|
||||||
|
And I create a new folder named "Shared folder"
|
||||||
|
And I see that the file list contains a file named "Shared folder"
|
||||||
|
And I share "Shared folder" with "user0"
|
||||||
|
And I see that the file is shared with "user0"
|
||||||
|
And I set the share with "user0" as not creatable
|
||||||
|
And I see that "user0" can not create in the share
|
||||||
|
When I act as Jane
|
||||||
|
# The Files app is open again to reload the file list
|
||||||
|
And I open the Files app
|
||||||
|
And I share "Shared folder" with "user1"
|
||||||
|
Then I see that the file is shared with "user1"
|
||||||
|
And I see that "user1" can not create in the share
|
||||||
|
And I see that "user1" can not be allowed to create in the share
|
||||||
|
|
|
@ -135,6 +135,20 @@ class FilesAppSharingContext implements Context, ActorAwareInterface {
|
||||||
return self::permissionCheckboxInputFor($sharedWithName, 'Allow editing');
|
return self::permissionCheckboxInputFor($sharedWithName, 'Allow editing');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Locator
|
||||||
|
*/
|
||||||
|
public static function canCreateCheckbox($sharedWithName) {
|
||||||
|
return self::permissionCheckboxFor($sharedWithName, 'Allow creating');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Locator
|
||||||
|
*/
|
||||||
|
public static function canCreateCheckboxInput($sharedWithName) {
|
||||||
|
return self::permissionCheckboxInputFor($sharedWithName, 'Allow creating');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Locator
|
* @return Locator
|
||||||
*/
|
*/
|
||||||
|
@ -397,6 +411,17 @@ class FilesAppSharingContext implements Context, ActorAwareInterface {
|
||||||
$this->actor->find(self::canEditCheckbox($shareWithName), 2)->click();
|
$this->actor->find(self::canEditCheckbox($shareWithName), 2)->click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @When I set the share with :shareWithName as not creatable
|
||||||
|
*/
|
||||||
|
public function iSetTheShareWithAsNotCreatable($shareWithName) {
|
||||||
|
$this->showShareWithMenuIfNeeded($shareWithName);
|
||||||
|
|
||||||
|
$this->iSeeThatCanCreateInTheShare($shareWithName);
|
||||||
|
|
||||||
|
$this->actor->find(self::canCreateCheckbox($shareWithName), 2)->click();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @When I set the share with :shareWithName as not reshareable
|
* @When I set the share with :shareWithName as not reshareable
|
||||||
*/
|
*/
|
||||||
|
@ -464,6 +489,36 @@ class FilesAppSharingContext implements Context, ActorAwareInterface {
|
||||||
$this->actor->find(self::canEditCheckboxInput($sharedWithName), 10)->isChecked());
|
$this->actor->find(self::canEditCheckboxInput($sharedWithName), 10)->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Then I see that :sharedWithName can not be allowed to create in the share
|
||||||
|
*/
|
||||||
|
public function iSeeThatCanNotBeAllowedToCreateInTheShare($sharedWithName) {
|
||||||
|
$this->showShareWithMenuIfNeeded($sharedWithName);
|
||||||
|
|
||||||
|
PHPUnit_Framework_Assert::assertEquals(
|
||||||
|
$this->actor->find(self::canCreateCheckboxInput($sharedWithName), 10)->getWrappedElement()->getAttribute("disabled"), "disabled");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Then I see that :sharedWithName can create in the share
|
||||||
|
*/
|
||||||
|
public function iSeeThatCanCreateInTheShare($sharedWithName) {
|
||||||
|
$this->showShareWithMenuIfNeeded($sharedWithName);
|
||||||
|
|
||||||
|
PHPUnit_Framework_Assert::assertTrue(
|
||||||
|
$this->actor->find(self::canCreateCheckboxInput($sharedWithName), 10)->isChecked());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Then I see that :sharedWithName can not create in the share
|
||||||
|
*/
|
||||||
|
public function iSeeThatCanNotCreateInTheShare($sharedWithName) {
|
||||||
|
$this->showShareWithMenuIfNeeded($sharedWithName);
|
||||||
|
|
||||||
|
PHPUnit_Framework_Assert::assertFalse(
|
||||||
|
$this->actor->find(self::canCreateCheckboxInput($sharedWithName), 10)->isChecked());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Then I see that :sharedWithName can reshare the share
|
* @Then I see that :sharedWithName can reshare the share
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue