Skip to content

Commit 9e5440f

Browse files
committed
Add acceptance test steps to be used from Talk acceptance tests
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
1 parent 2936db4 commit 9e5440f

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

tests/acceptance/features/bootstrap/FilesAppContext.php

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,15 @@ public static function passwordProtectByTalkCheckbox() {
293293
describedAs("Password protect by Talk checkbox in the details view in Files app");
294294
}
295295

296+
/**
297+
* @return Locator
298+
*/
299+
public static function passwordProtectByTalkCheckboxInput() {
300+
return Locator::forThe()->checkbox("Password protect by Talk")->
301+
descendantOf(self::shareLinkMenu())->
302+
describedAs("Password protect by Talk checkbox input in the details view in Files app");
303+
}
304+
296305
/**
297306
* @Given I close the details view
298307
*/
@@ -375,6 +384,28 @@ public function iProtectTheSharedLinkWithThePassword($password) {
375384
$this->actor->find(self::passwordProtectField(), 2)->setValue($password . "\r");
376385
}
377386

387+
/**
388+
* @When I set the password of the shared link as protected by Talk
389+
*/
390+
public function iSetThePasswordOfTheSharedLinkAsProtectedByTalk() {
391+
$this->showShareLinkMenuIfNeeded();
392+
393+
$this->iSeeThatThePasswordOfTheLinkShareIsNotProtectedByTalk();
394+
395+
$this->actor->find(self::passwordProtectByTalkCheckbox(), 2)->click();
396+
}
397+
398+
/**
399+
* @When I set the password of the shared link as not protected by Talk
400+
*/
401+
public function iSetThePasswordOfTheSharedLinkAsNotProtectedByTalk() {
402+
$this->showShareLinkMenuIfNeeded();
403+
404+
$this->iSeeThatThePasswordOfTheLinkShareIsProtectedByTalk();
405+
406+
$this->actor->find(self::passwordProtectByTalkCheckbox(), 2)->click();
407+
}
408+
378409
/**
379410
* @Then I see that the current page is the Files app
380411
*/
@@ -510,6 +541,24 @@ public function iSeeThatTheLinkShareIsPasswordProtected() {
510541
PHPUnit_Framework_Assert::assertTrue($this->actor->find(self::passwordProtectField(), 10)->isVisible(), "Password protect field is visible");
511542
}
512543

544+
/**
545+
* @Then I see that the password of the link share is protected by Talk
546+
*/
547+
public function iSeeThatThePasswordOfTheLinkShareIsProtectedByTalk() {
548+
$this->showShareLinkMenuIfNeeded();
549+
550+
PHPUnit_Framework_Assert::assertTrue($this->actor->find(self::passwordProtectByTalkCheckboxInput(), 10)->isChecked());
551+
}
552+
553+
/**
554+
* @Then I see that the password of the link share is not protected by Talk
555+
*/
556+
public function iSeeThatThePasswordOfTheLinkShareIsNotProtectedByTalk() {
557+
$this->showShareLinkMenuIfNeeded();
558+
559+
PHPUnit_Framework_Assert::assertFalse($this->actor->find(self::passwordProtectByTalkCheckboxInput(), 10)->isChecked());
560+
}
561+
513562
/**
514563
* @Then I see that the checkbox to protect the password of the link share by Talk is not shown
515564
*/

0 commit comments

Comments
 (0)