phpmyadmin/tests/end-to-end/LoginTest.php
William Desportes 015d75c0d1
Merge branch 'QA_5_2'
Signed-off-by: William Desportes <williamdes@wdes.fr>
2026-02-24 15:36:06 +01:00

51 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace PhpMyAdmin\Tests\Selenium;
use PHPUnit\Framework\Attributes\CoversNothing;
use PHPUnit\Framework\Attributes\Large;
#[CoversNothing]
#[Large]
class LoginTest extends TestBase
{
/**
* Create a test database for this test class
*/
protected bool $createDatabase = false;
/**
* Login before starting this test
*/
protected bool $login = false;
protected function setUp(): void
{
parent::setUp();
$this->logOutIfLoggedIn();
}
/**
* Test for successful login
*/
public function testSuccessfulLogin(): void
{
$this->waitForElement('xpath', '//*[@id="server-breadcrumb"]');
self::assertTrue($this->isSuccessLogin());
$this->logOutIfLoggedIn();
}
/**
* Test for unsuccessful login
*/
public function testLoginWithWrongPassword(): void
{
$this->login('Admin', 'Admin');
$this->waitForElement('xpath', '//*[@class="alert alert-danger" and contains(.,\'Access denied for\')]');
self::assertTrue($this->isUnsuccessLogin());
}
}