Skip to content

Commit 10a998b

Browse files
committed
Wait for plugins_options to be visible in Selenium\ExportTest
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
1 parent 77f9ebb commit 10a998b

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

‎test/selenium/ExportTest.php‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace PhpMyAdmin\Tests\Selenium;
66

77
use function sleep;
8+
use function strtolower;
89

910
/**
1011
* @coversNothing
@@ -153,12 +154,19 @@ private function doExport(string $type, string $plugin): string
153154
$this->scrollIntoView('radio_view_as_text');
154155
$this->byCssSelector('label[for=radio_view_as_text]')->click();
155156

157+
$this->waitUntilElementIsVisible('id', 'format_specific_opts');
158+
$this->scrollIntoView('format_specific_opts');
159+
$this->waitUntilElementIsVisible('id', strtolower($plugin) . '_options');
160+
$this->scrollIntoView(strtolower($plugin) . '_options');
161+
156162
if ($plugin === 'SQL') {
157163
if ($type !== 'db') {
164+
$this->waitUntilElementIsVisible('id', 'radio_sql_structure_or_data_structure_and_data');
158165
$this->scrollIntoView('radio_sql_structure_or_data_structure_and_data');
159166
$this->byCssSelector('label[for=radio_sql_structure_or_data_structure_and_data]')->click();
160167
}
161168

169+
$this->waitUntilElementIsVisible('id', 'checkbox_sql_if_not_exists');
162170
$this->scrollIntoView('checkbox_sql_if_not_exists');
163171
$ele = $this->byId('checkbox_sql_if_not_exists');
164172
if (! $ele->isSelected()) {

‎test/selenium/TestBase.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ public function waitUntilElementIsPresent(string $func, string $arg, int $timeou
765765
* @param string $arg Selector
766766
* @param int $timeout Timeout in seconds
767767
*/
768-
public function waitUntilElementIsVisible(string $func, string $arg, int $timeout): WebDriverElement
768+
public function waitUntilElementIsVisible(string $func, string $arg, int $timeout = 10): WebDriverElement
769769
{
770770
$element = $this->webDriver->wait($timeout, 500)->until(
771771
WebDriverExpectedCondition::visibilityOfElementLocated(WebDriverBy::$func($arg))

0 commit comments

Comments
 (0)