Skip to content

Commit c103541

Browse files
author
Dmytro Aponasenko
committed
MTA-2723: Functional test maintenance. Part 2
1 parent 67c86ec commit c103541

File tree

3 files changed

+31
-7
lines changed

3 files changed

+31
-7
lines changed

dev/tests/functional/tests/app/Magento/Customer/Test/Page/Adminhtml/CustomerIndexEdit.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd">
99
<page name="CustomerIndexEdit" area="Adminhtml" mca="customer/index/edit" module="Magento_Customer">
10-
<block name="titleBlock" class="Magento\Theme\Test\Block\Html\Title" locator=".page-title-wrapper .page-title" strategy="css selector"/>
11-
<block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector"/>
12-
<block name="pageActionsBlock" class="Magento\Customer\Test\Block\Adminhtml\Edit\FormPageActions" locator=".page-main-actions" strategy="css selector"/>
13-
<block name="customerForm" class="Magento\Customer\Test\Block\Adminhtml\Edit\CustomerForm" locator="[id='page:main-container']" strategy="css selector"/>
14-
<block name="configureProductBlock" class="Magento\Catalog\Test\Block\Adminhtml\Product\Composite\Configure" locator="//*[@role='dialog' and ./*[@id='product_composite_configure'] and contains(@style,'display: block')]" strategy="xpath"/>
15-
<block name="modalBlock" class="Magento\Ui\Test\Block\Adminhtml\Modal" locator="._show[data-role=modal]" strategy="css selector"/>
10+
<block name="titleBlock" class="Magento\Theme\Test\Block\Html\Title" locator=".page-title-wrapper .page-title" strategy="css selector" />
11+
<block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector" />
12+
<block name="pageActionsBlock" class="Magento\Customer\Test\Block\Adminhtml\Edit\FormPageActions" locator=".page-main-actions" strategy="css selector" />
13+
<block name="customerForm" class="Magento\Customer\Test\Block\Adminhtml\Edit\CustomerForm" locator="[id='page:main-container']" strategy="css selector" />
14+
<block name="configureProductBlock" class="Magento\Catalog\Test\Block\Adminhtml\Product\Composite\Configure" locator="[data-role='modal']._show" strategy="css selector" />
15+
<block name="modalBlock" class="Magento\Ui\Test\Block\Adminhtml\Modal" locator="._show[data-role=modal]" strategy="css selector" />
1616
</page>
1717
</config>

dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Product/ProductForm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<tabs>
99
<downloadable_information>
1010
<class>\Magento\Downloadable\Test\Block\Adminhtml\Catalog\Product\Edit\Tab\Downloadable</class>
11-
<selector>#product_info_tabs_downloadable_items</selector>
11+
<selector>#product_info_tabs_product-details</selector>
1212
<strategy>css selector</strategy>
1313
</downloadable_information>
1414
</tabs>

dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/Modal.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ class Modal extends Block
4141
*/
4242
protected $inputFieldSelector = '[data-role="promptField"]';
4343

44+
/**
45+
* Modal overlay selector.
46+
*
47+
* @var string
48+
*/
49+
protected $modalOverlay = '.modals-overlay';
50+
4451
/**
4552
* Press OK on an alert, confirm, prompt a dialog.
4653
*
@@ -49,6 +56,7 @@ class Modal extends Block
4956
public function acceptAlert()
5057
{
5158
$this->_rootElement->find($this->acceptButtonSelector)->click();
59+
$this->waitModalWindowToDisappear();
5260
}
5361

5462
/**
@@ -59,6 +67,7 @@ public function acceptAlert()
5967
public function dismissAlert()
6068
{
6169
$this->_rootElement->find($this->dismissButtonSelector)->click();
70+
$this->waitModalWindowToDisappear();
6271
}
6372

6473
/**
@@ -69,6 +78,7 @@ public function dismissAlert()
6978
public function closeAlert()
7079
{
7180
$this->_rootElement->find($this->closeButtonSelector)->click();
81+
$this->waitModalWindowToDisappear();
7282
}
7383

7484
/**
@@ -91,4 +101,18 @@ public function setAlertText($text)
91101
{
92102
$this->_rootElement->find($this->inputFieldSelector)->setValue($text);
93103
}
104+
105+
/**
106+
* Wait until modal window will disapper.
107+
*
108+
* @return void
109+
*/
110+
protected function waitModalWindowToDisappear()
111+
{
112+
$this->browser->waitUntil(
113+
function () {
114+
return $this->browser->find($this->modalOverlay)->isVisible() == false ? true : null;
115+
}
116+
);
117+
}
94118
}

0 commit comments

Comments
 (0)