Skip to content

Commit c44dc61

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-54456' into 2.2-develop-pr9
2 parents 86eed24 + fd5135a commit c44dc61

File tree

1 file changed

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

1 file changed

+36
-2
lines changed

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

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +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
{
20+
/**
21+
* Selector for template block.
22+
*
23+
* @var string
24+
*/
25+
private $templateBlockSelector = './ancestor::body';
26+
1827
/**
1928
* Fill form with tabs.
2029
*
@@ -25,6 +34,7 @@ class PromoForm extends FormSections
2534
*/
2635
public function fill(FixtureInterface $fixture, SimpleElement $element = null, array $replace = null)
2736
{
37+
$this->waitPageToLoad();
2838
$sections = $this->getFixtureFieldsByContainers($fixture);
2939
if ($replace) {
3040
$sections = $this->prepareData($sections, $replace);
@@ -55,4 +65,28 @@ protected function prepareData(array $tabs, array $replace)
5565

5666
return $tabs;
5767
}
68+
69+
/**
70+
* Wait page to load.
71+
*
72+
* @return void
73+
*/
74+
protected function waitPageToLoad()
75+
{
76+
$this->waitForElementVisible($this->header);
77+
$this->getTemplateBlock()->waitLoader();
78+
}
79+
80+
/**
81+
* Get template block.
82+
*
83+
* @return Template
84+
*/
85+
private function getTemplateBlock()
86+
{
87+
return $this->blockFactory->create(
88+
Template::class,
89+
['element' => $this->_rootElement->find($this->templateBlockSelector, Locator::SELECTOR_XPATH)]
90+
);
91+
}
5892
}

0 commit comments

Comments
 (0)