Skip to content

Commit a002455

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-60875' into 2.3-develop-pr40
2 parents 0f32b68 + 325e27b commit a002455

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Search.php

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use Magento\Mtf\Client\Locator;
1111

1212
/**
13-
* Class Search
1413
* Block for "Search" section
1514
*/
1615
class Search extends Block
@@ -158,4 +157,24 @@ public function clickSuggestedText($text)
158157
$searchAutocomplete = sprintf($this->searchAutocomplete, $text);
159158
$this->_rootElement->find($searchAutocomplete, Locator::SELECTOR_XPATH)->click();
160159
}
160+
161+
/**
162+
* Wait for element is enabled.
163+
*
164+
* @param string $selector
165+
* @param string $strategy
166+
* @return bool|null
167+
*/
168+
public function waitForElementEnabled($selector, $strategy = Locator::SELECTOR_CSS)
169+
{
170+
$browser = $this->browser;
171+
172+
return $browser->waitUntil(
173+
function () use ($browser, $selector, $strategy) {
174+
$element = $browser->find($selector, $strategy);
175+
176+
return !$element->isDisabled() ? true : null;
177+
}
178+
);
179+
}
161180
}

dev/tests/functional/tests/app/Magento/SalesRule/Test/Block/Adminhtml/Promo/Quote/Edit/PromoQuoteForm.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ class PromoQuoteForm extends FormSections
2828
*/
2929
protected $waitForSelectorVisible = false;
3030

31+
/**
32+
* Selector of name element on the form.
33+
*
34+
* @var string
35+
*/
36+
private $nameElementSelector = 'input[name=name]';
37+
3138
/**
3239
* Fill form with sections.
3340
*
@@ -38,6 +45,8 @@ class PromoQuoteForm extends FormSections
3845
*/
3946
public function fill(FixtureInterface $fixture, SimpleElement $element = null, array $replace = null)
4047
{
48+
$this->waitForElementNotVisible($this->waitForSelector);
49+
$this->waitForElementVisible($this->nameElementSelector);
4150
$sections = $this->getFixtureFieldsByContainers($fixture);
4251
if ($replace) {
4352
$sections = $this->prepareData($sections, $replace);

0 commit comments

Comments
 (0)