diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index a30c940e57..e20369be8b 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -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 diff --git a/test/selenium/Database/OperationsTest.php b/test/selenium/Database/OperationsTest.php index e1209fa6f1..ec0e549ea7 100644 --- a/test/selenium/Database/OperationsTest.php +++ b/test/selenium/Database/OperationsTest.php @@ -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( diff --git a/test/selenium/ImportTest.php b/test/selenium/ImportTest.php index c17bda5764..2f6309b9c0 100644 --- a/test/selenium/ImportTest.php +++ b/test/selenium/ImportTest.php @@ -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()); } } diff --git a/test/selenium/ServerSettingsTest.php b/test/selenium/ServerSettingsTest.php index d9ed8ab8e7..22c7b5ac3e 100644 --- a/test/selenium/ServerSettingsTest.php +++ b/test/selenium/ServerSettingsTest.php @@ -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()); } /** diff --git a/test/selenium/Table/OperationsTest.php b/test/selenium/Table/OperationsTest.php index bc3cb2afe2..cdff555e36 100644 --- a/test/selenium/Table/OperationsTest.php +++ b/test/selenium/Table/OperationsTest.php @@ -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(