diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2021-03-06 14:59:36 +0100 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2021-04-16 20:00:15 +0200 |
commit | 14b85f4eec959417db8e8ab3f765edaf18ba10d4 (patch) | |
tree | 9f1558716c83772f0a2664f1858a436bb6ef81bc /tests | |
parent | 38b88422a807c9ef0b57879aa189e3329c1258d6 (diff) | |
download | nextcloud-server-14b85f4eec959417db8e8ab3f765edaf18ba10d4.tar.gz nextcloud-server-14b85f4eec959417db8e8ab3f765edaf18ba10d4.zip |
Replace carriage return with WebDriver "ENTER" constant
When the value is set in some input fields a carriage return was sent to
simulate pressing the enter key and thus confirming the input. However,
different browsers use different keys (Firefox uses "\r", but Chrome
uses "\n"), so the carriage return was replaced with the WebDriver
"ENTER" constant which is common to both browsers.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/acceptance/features/bootstrap/FilesAppSharingContext.php | 3 | ||||
-rw-r--r-- | tests/acceptance/features/bootstrap/UsersSettingsContext.php | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/acceptance/features/bootstrap/FilesAppSharingContext.php b/tests/acceptance/features/bootstrap/FilesAppSharingContext.php index e8515fa1124..e3b63476fff 100644 --- a/tests/acceptance/features/bootstrap/FilesAppSharingContext.php +++ b/tests/acceptance/features/bootstrap/FilesAppSharingContext.php @@ -23,6 +23,7 @@ use Behat\Behat\Context\Context; use PHPUnit\Framework\Assert; +use WebDriver\Key; class FilesAppSharingContext implements Context, ActorAwareInterface { use ActorAware; @@ -427,7 +428,7 @@ class FilesAppSharingContext implements Context, ActorAwareInterface { $shareLinkMenuTriggerElement = $this->actor->find(self::shareLinkMenuTrigger(), 2); $this->actor->find(self::passwordProtectCheckbox($shareLinkMenuTriggerElement), 2)->click(); - $this->actor->find(self::passwordProtectField($shareLinkMenuTriggerElement), 2)->setValue($password . "\r"); + $this->actor->find(self::passwordProtectField($shareLinkMenuTriggerElement), 2)->setValue($password . Key::ENTER); } /** diff --git a/tests/acceptance/features/bootstrap/UsersSettingsContext.php b/tests/acceptance/features/bootstrap/UsersSettingsContext.php index 02e1825e4c9..d60261d5d1a 100644 --- a/tests/acceptance/features/bootstrap/UsersSettingsContext.php +++ b/tests/acceptance/features/bootstrap/UsersSettingsContext.php @@ -25,6 +25,7 @@ use Behat\Behat\Context\Context; use PHPUnit\Framework\Assert; +use WebDriver\Key; class UsersSettingsContext implements Context, ActorAwareInterface { use ActorAware; @@ -242,7 +243,7 @@ class UsersSettingsContext implements Context, ActorAwareInterface { * @When I set the :field for :user to :value */ public function iSetTheFieldForUserTo($field, $user, $value) { - $this->actor->find(self::inputForUserInCell($field, $user), 2)->setValue($value . "\r"); + $this->actor->find(self::inputForUserInCell($field, $user), 2)->setValue($value . Key::ENTER); } /** |