Move login to setUp() of parent::
Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
parent
16d6380805
commit
8da964fa40
@ -19,7 +19,7 @@ class ChangePasswordTest extends TestBase
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected static $createDatabase = false;
|
||||
protected $createDatabase = false;
|
||||
|
||||
/**
|
||||
* Array of AssertionFailedError->toString
|
||||
@ -35,8 +35,6 @@ class ChangePasswordTest extends TestBase
|
||||
*/
|
||||
public function testChangePassword(): void
|
||||
{
|
||||
$this->login();
|
||||
|
||||
$e = $this->waitForElement('id', 'change_password_anchor');
|
||||
$e->click();
|
||||
|
||||
|
||||
@ -17,7 +17,6 @@ class CreateDropDatabaseTest extends TestBase
|
||||
parent::setUp();
|
||||
/* TODO: For now this tests needs superuser for deleting database */
|
||||
$this->skipIfNotSuperUser();
|
||||
$this->login();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -14,7 +14,7 @@ class CreateRemoveUserTest extends TestBase
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected static $createDatabase = false;
|
||||
protected $createDatabase = false;
|
||||
|
||||
/**
|
||||
* Username for the user
|
||||
@ -39,7 +39,6 @@ class CreateRemoveUserTest extends TestBase
|
||||
$this->skipIfNotSuperUser();
|
||||
$this->txtUsername = 'pma_user';
|
||||
$this->txtPassword = 'abc_123';
|
||||
$this->login();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -31,7 +31,7 @@ class EventsTest extends TestBase
|
||||
. 'INSERT INTO `test_table` (val) VALUES (2);'
|
||||
. 'SET GLOBAL event_scheduler="ON";'
|
||||
);
|
||||
$this->login();
|
||||
|
||||
$this->navigateDatabase($this->databaseName);
|
||||
|
||||
// Let the Database page load
|
||||
|
||||
@ -11,15 +11,6 @@ use PhpMyAdmin\Tests\Selenium\TestBase;
|
||||
*/
|
||||
class OperationsTest extends TestBase
|
||||
{
|
||||
/**
|
||||
* setUp function
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->login();
|
||||
}
|
||||
|
||||
private function getToDBOperations(): void
|
||||
{
|
||||
$this->gotoHomepage();
|
||||
|
||||
@ -49,8 +49,6 @@ class ProceduresTest extends TestBase
|
||||
. ');'
|
||||
);
|
||||
|
||||
$this->login();
|
||||
|
||||
$this->navigateDatabase($this->databaseName);
|
||||
$this->expandMore();
|
||||
}
|
||||
|
||||
@ -29,8 +29,6 @@ class QueryByExampleTest extends TestBase
|
||||
. ');'
|
||||
. 'INSERT INTO `test_table` (val) VALUES (2), (6), (5), (3), (4), (4), (5);'
|
||||
);
|
||||
|
||||
$this->login();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -32,7 +32,6 @@ class StructureTest extends TestBase
|
||||
. 'INSERT INTO `test_table` (val) VALUES (2);'
|
||||
);
|
||||
|
||||
$this->login();
|
||||
$this->navigateDatabase($this->databaseName);
|
||||
|
||||
// Let the Database page load
|
||||
|
||||
@ -32,8 +32,6 @@ class TriggersTest extends TestBase
|
||||
. 'INSERT INTO `test_table2` (val) VALUES (2);'
|
||||
);
|
||||
|
||||
$this->login();
|
||||
|
||||
$this->navigateDatabase($this->databaseName);
|
||||
}
|
||||
|
||||
|
||||
@ -24,8 +24,6 @@ class ExportTest extends TestBase
|
||||
. ');'
|
||||
. 'INSERT INTO `test_table` (val) VALUES (2);'
|
||||
);
|
||||
|
||||
$this->login();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -9,15 +9,6 @@ namespace PhpMyAdmin\Tests\Selenium;
|
||||
*/
|
||||
class ImportTest extends TestBase
|
||||
{
|
||||
/**
|
||||
* setUp function
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->login();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for server level import
|
||||
*
|
||||
|
||||
@ -14,7 +14,14 @@ class LoginTest extends TestBase
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected static $createDatabase = false;
|
||||
protected $createDatabase = false;
|
||||
|
||||
/**
|
||||
* Login before starting this test
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $login = false;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
|
||||
@ -25,7 +25,6 @@ class NormalizationTest extends TestBase
|
||||
. ');'
|
||||
);
|
||||
|
||||
$this->login();
|
||||
$this->navigateTable('test_table');
|
||||
$this->waitForElement('xpath', "(//a[contains(., 'Structure')])")->click();
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ class ServerSettingsTest extends TestBase
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected static $createDatabase = false;
|
||||
protected $createDatabase = false;
|
||||
|
||||
/**
|
||||
* setUp function
|
||||
|
||||
@ -25,7 +25,6 @@ class SqlQueryTest extends TestBase
|
||||
. ');'
|
||||
. 'INSERT INTO `test_table` (val) VALUES (2), (3), (4), (5);'
|
||||
);
|
||||
$this->login();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -32,7 +32,6 @@ class BrowseTest extends TestBase
|
||||
. " (3, 'Abcd', '2012-01-20 02:00:02');"
|
||||
);
|
||||
|
||||
$this->login();
|
||||
$this->navigateTable('test_table');
|
||||
|
||||
$this->waitAjax();
|
||||
|
||||
@ -16,8 +16,6 @@ class CreateTest extends TestBase
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->login();
|
||||
$this->navigateDatabase($this->databaseName);
|
||||
}
|
||||
|
||||
|
||||
@ -28,7 +28,6 @@ class InsertTest extends TestBase
|
||||
. ');'
|
||||
);
|
||||
|
||||
$this->login();
|
||||
$this->navigateTable('test_table');
|
||||
}
|
||||
|
||||
|
||||
@ -32,7 +32,6 @@ class OperationsTest extends TestBase
|
||||
. 'INSERT INTO test_table (val, val2) VALUES (33, 44);'
|
||||
);
|
||||
|
||||
$this->login();
|
||||
$this->navigateTable('test_table');
|
||||
|
||||
$this->waitAjax();
|
||||
|
||||
@ -27,7 +27,6 @@ class StructureTest extends TestBase
|
||||
. ');'
|
||||
);
|
||||
|
||||
$this->login();
|
||||
$this->navigateTable('test_table');
|
||||
|
||||
$this->waitForElement('xpath', "(//a[contains(., 'Structure')])")->click();
|
||||
|
||||
@ -95,7 +95,14 @@ abstract class TestBase extends TestCase
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected static $createDatabase = true;
|
||||
protected $createDatabase = true;
|
||||
|
||||
/**
|
||||
* Login before starting this test
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $login = true;
|
||||
|
||||
/**
|
||||
* Did the test create the phpMyAdmin storage database ?
|
||||
@ -148,7 +155,11 @@ abstract class TestBase extends TestCase
|
||||
$this->navigateTo('');
|
||||
$this->webDriver->manage()->window()->maximize();
|
||||
|
||||
if (! static::$createDatabase) {
|
||||
if ($this->login) {
|
||||
$this->login();
|
||||
}
|
||||
|
||||
if (! $this->createDatabase) {
|
||||
// Stop here, we where not asked to create a database
|
||||
return;
|
||||
}
|
||||
|
||||
@ -30,7 +30,6 @@ class TrackingTest extends TestBase
|
||||
. 'INSERT INTO `test_table` (val) VALUES (2), (3);'
|
||||
);
|
||||
|
||||
$this->login();
|
||||
$this->skipIfNotPMADB();
|
||||
|
||||
$this->navigateDatabase($this->databaseName);
|
||||
|
||||
@ -14,13 +14,7 @@ class XssTest extends TestBase
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected static $createDatabase = false;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->login();
|
||||
}
|
||||
protected $createDatabase = false;
|
||||
|
||||
/**
|
||||
* Tests the SQL query tab with a null query
|
||||
|
||||
Loading…
Reference in New Issue
Block a user