diff options
author | Natalja Karpinska <natalja.karpinska@zabbix.com> | 2021-01-25 12:41:02 +0300 |
---|---|---|
committer | Natalja Karpinska <natalja.karpinska@zabbix.com> | 2021-01-25 12:41:02 +0300 |
commit | f537e3154420f106ea92e8361d08eeac02d3ea01 (patch) | |
tree | 4ceca34711fb36824e3a4a5bc2bab17a4407d023 | |
parent | ffede740ca47ed985179f410fd3ed63849c851ad (diff) |
.......... [DEV-1800] changed select method for z-dropdown in autotest framework4.0.28
-rw-r--r-- | frontends/php/tests/include/web/elements/CZDropdownElement.php | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/frontends/php/tests/include/web/elements/CZDropdownElement.php b/frontends/php/tests/include/web/elements/CZDropdownElement.php index d6bffc31983..d5ad71995f7 100644 --- a/frontends/php/tests/include/web/elements/CZDropdownElement.php +++ b/frontends/php/tests/include/web/elements/CZDropdownElement.php @@ -22,8 +22,6 @@ require_once 'vendor/autoload.php'; require_once dirname(__FILE__).'/../CElement.php'; -use Facebook\WebDriver\Exception\TimeoutException; - /** * Custom dropdown (z-select) element. */ @@ -61,28 +59,19 @@ class CZDropdownElement extends CElement { return $this; } - for ($i = 0; $i < 2; $i++) { + for ($i = 0; $i < 5; $i++) { try { $this->waitUntilClickable()->click(); - $option = $this->query($xpath)->waitUntilClickable()->one(); + $this->query($xpath)->one()->click(); - break; + return $this; } - catch (TimeoutException $exception) { - if ($i === 1) { - throw new Exception('Failed to wait for the dropdown options to be present.'); - } + catch (Exception $exception) { + // Code is not missing here. } } - if ($option->isClickable()) { - $option->click(); - } - else { - throw new Exception('Cannot select disabled dropdown element.'); - } - - return $this; + throw new Exception('Failed to select dropdown option "'.$text.'".'); } /** |