|
|
|
|
@ -276,6 +276,15 @@ class FilesAppContext implements Context, ActorAwareInterface {
|
|
|
|
|
describedAs("Password protect checkbox in the details view in Files app");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return Locator
|
|
|
|
|
*/
|
|
|
|
|
public static function passwordProtectCheckboxInput() {
|
|
|
|
|
return Locator::forThe()->checkbox("Password protect")->
|
|
|
|
|
descendantOf(self::shareLinkMenu())->
|
|
|
|
|
describedAs("Password protect checkbox input in the details view in Files app");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return Locator
|
|
|
|
|
*/
|
|
|
|
|
@ -292,6 +301,18 @@ class FilesAppContext implements Context, ActorAwareInterface {
|
|
|
|
|
describedAs("Password protect working icon in the details view in Files app");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return Locator
|
|
|
|
|
*/
|
|
|
|
|
public static function passwordProtectByTalkCheckbox() {
|
|
|
|
|
// forThe()->checkbox("Password protect by Talk") can not be used here;
|
|
|
|
|
// that would return the checkbox itself, but the element that the user
|
|
|
|
|
// interacts with is the label.
|
|
|
|
|
return Locator::forThe()->xpath("//label[normalize-space() = 'Password protect by Talk']")->
|
|
|
|
|
descendantOf(self::shareLinkMenu())->
|
|
|
|
|
describedAs("Password protect by Talk checkbox in the details view in Files app");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Given I close the details view
|
|
|
|
|
*/
|
|
|
|
|
@ -537,6 +558,29 @@ class FilesAppContext implements Context, ActorAwareInterface {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Then I see that the link share is password protected
|
|
|
|
|
*/
|
|
|
|
|
public function iSeeThatTheLinkShareIsPasswordProtected() {
|
|
|
|
|
$this->showShareLinkMenuIfNeeded();
|
|
|
|
|
|
|
|
|
|
PHPUnit_Framework_Assert::assertTrue($this->actor->find(self::passwordProtectCheckboxInput(), 10)->isChecked(), "Password protect checkbox is checked");
|
|
|
|
|
PHPUnit_Framework_Assert::assertTrue($this->actor->find(self::passwordProtectField(), 10)->isVisible(), "Password protect field is visible");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Then I see that the checkbox to protect the password of the link share by Talk is not shown
|
|
|
|
|
*/
|
|
|
|
|
public function iSeeThatTheCheckboxToProtectThePasswordOfTheLinkShareByTalkIsNotShown() {
|
|
|
|
|
$this->showShareLinkMenuIfNeeded();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
PHPUnit_Framework_Assert::assertFalse(
|
|
|
|
|
$this->actor->find(self::passwordProtectByTalkCheckbox())->isVisible());
|
|
|
|
|
} catch (NoSuchElementException $exception) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Given I share the link for :fileName protected by the password :password
|
|
|
|
|
*/
|
|
|
|
|
|