3 declare(strict_types
=1);
5 namespace PhpMyAdmin\Tests\Selenium
;
7 use PHPUnit\Framework\Attributes\CoversNothing
;
8 use PHPUnit\Framework\Attributes\Large
;
14 class ChangePasswordTest
extends TestBase
17 * Create a test database for this test class
19 protected static bool $createDatabase = false;
22 * Tests the changing of the password
24 public function testChangePassword(): void
28 $e = $this->waitForElement('id', 'change_password_anchor');
33 $this->waitForElement('xpath', "//span[contains(., 'Change password')]");
35 $ele = $this->waitForElement('name', 'pma_pw');
36 self
::assertSame('', $ele->getAttribute('value'));
38 $ele = $this->waitForElement('name', 'pma_pw2');
39 self
::assertSame('', $ele->getAttribute('value'));
41 $ele = $this->waitForElement('name', 'generated_pw');
42 self
::assertSame('', $ele->getAttribute('value'));
44 $this->byId('button_generate_password')->click();
45 self
::assertNotSame('', $this->byName('pma_pw')->getAttribute('value'));
46 self
::assertNotSame('', $this->byName('pma_pw2')->getAttribute('value'));
47 self
::assertNotSame('', $this->byName('generated_pw')->getAttribute('value'));
49 if ($this->getTestSuiteUserPassword() !== '') {
50 $this->byName('pma_pw')->clear();
51 $this->byName('pma_pw2')->clear();
53 $this->byName('pma_pw')->click()->sendKeys($this->getTestSuiteUserPassword());
55 $this->byName('pma_pw2')->click()->sendKeys($this->getTestSuiteUserPassword());
57 $this->byId('nopass_1')->click();
60 $this->byId('changePasswordGoButton')->click();
61 $ele = $this->waitForElement('cssSelector', '.alert-success');
63 'The profile has been updated.',
64 trim($ele->getText()),