diff options
author | William Desportes <williamdes@wdes.fr> | 2020-05-24 14:25:12 +0300 |
---|---|---|
committer | William Desportes <williamdes@wdes.fr> | 2020-05-24 14:25:12 +0300 |
commit | 1910579791a633b2eef25707ff490a79c4fe7494 (patch) | |
tree | 5b7b5589786509ef6c977fc04fc9e1b30b176a96 /test/selenium | |
parent | c4da7f6a9a82d37950087552c38e2ea7271eeb0f (diff) |
Add getters for some ENVs in the selenium test suite
Signed-off-by: William Desportes <williamdes@wdes.fr>
Diffstat (limited to 'test/selenium')
-rw-r--r-- | test/selenium/ChangePasswordTest.php | 6 | ||||
-rw-r--r-- | test/selenium/TestBase.php | 17 |
2 files changed, 20 insertions, 3 deletions
diff --git a/test/selenium/ChangePasswordTest.php b/test/selenium/ChangePasswordTest.php index da5b2b9882..183fc3d986 100644 --- a/test/selenium/ChangePasswordTest.php +++ b/test/selenium/ChangePasswordTest.php @@ -64,13 +64,13 @@ class ChangePasswordTest extends TestBase $this->assertNotEquals('', $this->byName('pma_pw2')->getAttribute('value')); $this->assertNotEquals('', $this->byName('generated_pw')->getAttribute('value')); - if ($GLOBALS['TESTSUITE_PASSWORD'] != '') { + if ($this->getTestSuiteUserPassword() !== '') { $this->byName('pma_pw')->clear(); $this->byName('pma_pw2')->clear(); - $this->byName('pma_pw')->click()->sendKeys($GLOBALS['TESTSUITE_PASSWORD']); + $this->byName('pma_pw')->click()->sendKeys($this->getTestSuiteUserPassword()); - $this->byName('pma_pw2')->click()->sendKeys($GLOBALS['TESTSUITE_PASSWORD']); + $this->byName('pma_pw2')->click()->sendKeys($this->getTestSuiteUserPassword()); } else { $this->byId('nopass_1')->click(); } diff --git a/test/selenium/TestBase.php b/test/selenium/TestBase.php index 043d409d83..c6e20859e3 100644 --- a/test/selenium/TestBase.php +++ b/test/selenium/TestBase.php @@ -163,6 +163,23 @@ abstract class TestBase extends TestCase } } + private function getBrowserStackCredentials(): string + { + return getenv('TESTSUITE_BROWSERSTACK_USER') . ':' . getenv('TESTSUITE_BROWSERSTACK_KEY'); + } + + protected function getTestSuiteUserLogin(): string + { + $user = getenv('TESTSUITE_USER'); + return $user === false ? '' : $user; + } + + protected function getTestSuiteUserPassword(): string + { + $user = getenv('TESTSUITE_PASSWORD'); + return $user === false ? '' : $user; + } + /** * Has CI config ( CI_MODE == selenium ) */ |