Skip to content

Commit 8cea81f

Browse files
committed
MAGETWO-54456: Random FAT test fails CatalogRuleStaging_Create_ForNewCustomerGroup_ApplyAsPercentage
1 parent 4656654 commit 8cea81f

File tree

1 file changed

+21
-6
lines changed
  • dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit

1 file changed

+21
-6
lines changed

dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/PromoForm.php

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,24 @@
66

77
namespace Magento\CatalogRule\Test\Block\Adminhtml\Promo\Catalog\Edit;
88

9-
use \Magento\Ui\Test\Block\Adminhtml\FormSections;
10-
use Magento\Mtf\Client\Element\SimpleElement;
9+
use Magento\Backend\Test\Block\Template;
10+
use Magento\Mtf\Client\Locator;
1111
use Magento\Mtf\Fixture\FixtureInterface;
12+
use Magento\Mtf\Client\Element\SimpleElement;
13+
use Magento\Ui\Test\Block\Adminhtml\FormSections;
1214

1315
/**
1416
* Form for creation of a Catalog Price Rule.
1517
*/
1618
class PromoForm extends FormSections
1719
{
1820
/**
19-
* Magento form loader.
21+
* Selector for template block.
2022
*
2123
* @var string
2224
*/
23-
protected $spinner = '[data-role="spinner"]';
24-
25+
private $templateBlockSelector = './ancestor::body';
26+
2527
/**
2628
* Fill form with tabs.
2729
*
@@ -72,6 +74,19 @@ protected function prepareData(array $tabs, array $replace)
7274
protected function waitPageToLoad()
7375
{
7476
$this->waitForElementVisible($this->header);
75-
$this->waitForElementNotVisible($this->spinner);
77+
$this->getTemplateBlock()->waitLoader();
78+
}
79+
80+
/**
81+
* Get template block.
82+
*
83+
* @return Template
84+
*/
85+
protected function getTemplateBlock()
86+
{
87+
return $this->blockFactory->create(
88+
Template::class,
89+
['element' => $this->_rootElement->find($this->templateBlockSelector, Locator::SELECTOR_XPATH)]
90+
);
7691
}
7792
}

0 commit comments

Comments
 (0)