Fix failing Selenium tests

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
Maurício Meneghini Fauth 2023-05-23 18:05:17 -03:00
parent d1c6861b2c
commit 1a611a9641
No known key found for this signature in database
GPG Key ID: 6A16FD38AFC89CC8
5 changed files with 22 additions and 42 deletions

View File

@ -9635,11 +9635,6 @@ parameters:
count: 1
path: test/selenium/Database/OperationsTest.php
-
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertNotNull\\(\\) with Facebook\\\\WebDriver\\\\Remote\\\\RemoteWebElement will always evaluate to true\\.$#"
count: 1
path: test/selenium/Database/StructureTest.php
-
message: "#^Call to function is_string\\(\\) with non\\-falsy\\-string will always evaluate to true\\.$#"
count: 2

View File

@ -107,11 +107,10 @@ class OperationsTest extends TestBase
$this->scrollIntoView('copy_db_form', -150);
$this->byCssSelector('form#copy_db_form input[name="submit_copy"]')->click();
$this->waitForElement(
'xpath',
"//div[@class='alert alert-success' and contains(., 'Database "
. $this->databaseName
. ' has been copied to ' . $newDbName . "')]",
$success = $this->waitForElement('cssSelector', '.alert-success');
$this->assertStringContainsString(
'Database ' . $this->databaseName . ' has been copied to ' . $newDbName,
$success->getText(),
);
$this->dbQuery(

View File

@ -108,10 +108,7 @@ class ImportTest extends TestBase
$this->waitUntilElementIsVisible('id', 'buttonGo', 30);
$this->byId('buttonGo')->click();
$this->waitUntilElementIsVisible(
'xpath',
"//div[@class='alert alert-success' and contains(., 'Import has been successfully')]",
30,
);
$success = $this->waitUntilElementIsVisible('cssSelector', '.alert-success', 30);
$this->assertStringContainsString('Import has been successfully', $success->getText());
}
}

View File

@ -42,11 +42,8 @@ class ServerSettingsTest extends TestBase
$this->moveto($ele);
$ele->click();
$this->waitUntilElementIsPresent(
'xpath',
"//div[@class='alert alert-success' and contains(., 'Configuration has been saved')]",
5000,
);
$success = $this->waitUntilElementIsPresent('cssSelector', '.alert-success', 5000);
$this->assertStringContainsString('Configuration has been saved', $success->getText());
}
/**

View File

@ -61,11 +61,8 @@ class OperationsTest extends TestBase
$this->waitAjax();
$this->waitForElement(
'xpath',
"//div[@class='alert alert-success' and "
. "contains(., 'Your SQL query has been executed successfully')]",
);
$success = $this->waitForElement('cssSelector', '.alert-success');
$this->assertStringContainsString('Your SQL query has been executed successfully', $success->getText());
$this->byPartialLinkText('Browse')->click();
@ -91,12 +88,11 @@ class OperationsTest extends TestBase
$this->byCssSelector("form#moveTableForm input[type='submit']")->click();
$this->waitAjax();
$this->waitForElement(
'xpath',
"//div[@class='alert alert-success' and "
. "contains(., 'Table `" . $this->databaseName
. '`.`test_table` has been '
. 'moved to `' . $this->databaseName . "`.`test_table2`.')]",
$success = $this->waitForElement('cssSelector', '.alert-success');
$this->assertStringContainsString(
'Table `' . $this->databaseName . '`.`test_table` has been moved to `'
. $this->databaseName . '`.`test_table2`',
$success->getText(),
);
$this->dbQuery(
@ -126,11 +122,8 @@ class OperationsTest extends TestBase
$this->byCssSelector("form#tableOptionsForm input[type='submit']")->click();
$this->waitAjax();
$this->waitForElement(
'xpath',
"//div[@class='alert alert-success' and "
. "contains(., 'Table test_table has been renamed to test_table2')]",
);
$success = $this->waitForElement('cssSelector', '.alert-success');
$this->assertStringContainsString('Table test_table has been renamed to test_table2', $success->getText());
$this->dbQuery(
'USE `' . $this->databaseName . '`;'
@ -156,12 +149,11 @@ class OperationsTest extends TestBase
$this->waitForElement('cssSelector', 'form#copyTable input[type=\'submit\']')->click();
$this->waitAjax();
$this->waitForElement(
'xpath',
"//div[@class='alert alert-success' and "
. "contains(., 'Table `" . $this->databaseName
. '`.`test_table` has been '
. 'copied to `' . $this->databaseName . "`.`test_table2`.')]",
$success = $this->waitForElement('cssSelector', '.alert-success');
$this->assertStringContainsString(
'Table `' . $this->databaseName . '`.`test_table` has been copied to `'
. $this->databaseName . '`.`test_table2`',
$success->getText(),
);
$this->dbQuery(