Skip to content

Commit 9b5ed77

Browse files
Oleksandr ManchenkoDmytro Aponasenko
authored andcommitted
MTA-2145: Sync qmt repository with mainline - Sprint 12
1 parent 3e55d71 commit 9b5ed77

File tree

8 files changed

+86
-23
lines changed

8 files changed

+86
-23
lines changed

dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Composite/Configure.php

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,40 @@
1313
use Magento\Catalog\Test\Block\AbstractConfigureBlock;
1414

1515
/**
16-
* Class Configure
17-
* Adminhtml catalog product composite configure block
16+
* Adminhtml catalog product composite configure block.
1817
*/
1918
class Configure extends AbstractConfigureBlock
2019
{
2120
/**
22-
* Custom options CSS selector
21+
* Configure form selector.
22+
*
23+
* @var string
24+
*/
25+
protected $configureForm = '#product_composite_configure_form';
26+
27+
/**
28+
* Custom options CSS selector.
2329
*
2430
* @var string
2531
*/
2632
protected $customOptionsSelector = '#product_composite_configure_fields_options';
2733

2834
/**
29-
* Selector for "Ok" button
35+
* Selector for "Ok" button.
3036
*
3137
* @var string
3238
*/
3339
protected $okButton = '.ui-button.action-primary';
3440

3541
/**
36-
* Backend abstract block
42+
* Backend abstract block.
3743
*
3844
* @var string
3945
*/
4046
protected $templateBlock = './ancestor::body';
4147

4248
/**
43-
* Set quantity
49+
* Set quantity.
4450
*
4551
* @param int $qty
4652
* @return void
@@ -51,7 +57,7 @@ public function setQty($qty)
5157
}
5258

5359
/**
54-
* Fill in the option specified for the product
60+
* Fill in the option specified for the product.
5561
*
5662
* @param FixtureInterface $product
5763
* @return void
@@ -61,15 +67,17 @@ public function configProduct(FixtureInterface $product)
6167
/** @var CatalogProductSimple $product */
6268
$checkoutData = $product->getCheckoutData();
6369

70+
$this->waitForFormVisible();
6471
$this->fillOptions($product);
6572
if (isset($checkoutData['qty'])) {
6673
$this->setQty($checkoutData['qty']);
6774
}
6875
$this->clickOk();
76+
$this->waitForFormNotVisible();
6977
}
7078

7179
/**
72-
* Click "Ok" button
80+
* Click "Ok" button.
7381
*
7482
* @return void
7583
*/
@@ -80,7 +88,39 @@ public function clickOk()
8088
}
8189

8290
/**
83-
* Get backend abstract block
91+
* Wait for form is visible.
92+
*
93+
* @return void
94+
*/
95+
protected function waitForFormVisible()
96+
{
97+
$context = $this->_rootElement;
98+
$selector = $this->configureForm;
99+
return $this->browser->waitUntil(
100+
function () use ($context, $selector) {
101+
return $context->find($selector)->isVisible() ? true : null;
102+
}
103+
);
104+
}
105+
106+
/**
107+
* Wait for form is not visible.
108+
*
109+
* @return void
110+
*/
111+
protected function waitForFormNotVisible()
112+
{
113+
$context = $this->_rootElement;
114+
$selector = $this->configureForm;
115+
return $this->browser->waitUntil(
116+
function () use ($context, $selector) {
117+
return $context->find($selector)->isVisible() ? null : true;
118+
}
119+
);
120+
}
121+
122+
/**
123+
* Get backend abstract block.
84124
*
85125
* @return \Magento\Backend\Test\Block\Template
86126
*/

dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/CustomerForm.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ class CustomerForm extends FormTabs
4444
*/
4545
protected $fieldWrapperControl = './/*[contains(@class, "admin__field")]/*[contains(@class,"control")]';
4646

47+
/**
48+
* Selector for wainting tab content to load.
49+
*
50+
* @var string
51+
*/
52+
protected $tabReadiness = '.admin__page-nav-item._active._loading';
53+
4754
/**
4855
* Fill Customer forms on tabs by customer, addresses data.
4956
*
@@ -137,4 +144,18 @@ protected function waitFields()
137144
/* Wait for field's control block is visible in the form */
138145
$this->waitForElementVisible($this->fieldWrapperControl, Locator::SELECTOR_XPATH);
139146
}
147+
148+
/**
149+
* Open tab.
150+
*
151+
* @param string $tabName
152+
* @return CustomerForm
153+
*/
154+
public function openTab($tabName)
155+
{
156+
parent::openTab($tabName);
157+
$this->waitForElementNotVisible($this->tabReadiness);
158+
159+
return $this;
160+
}
140161
}

dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Status/Assign/AssignForm.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
<fields>
1010
<label>
1111
<selector>[name="status"]</selector>
12-
<input>select</input>
12+
<input>strictselect</input>
1313
</label>
1414
<state>
15-
<input>select</input>
15+
<input>strictselect</input>
1616
</state>
1717
<is_default>
1818
<input>checkbox</input>

dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/CreditMemos/Grid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Grid extends \Magento\Backend\Test\Block\Widget\Grid
1717
*
1818
* @var string
1919
*/
20-
protected $editLink = 'td[data-column="increment_id"]';
20+
protected $editLink = 'tbody td[data-column="increment_id"]';
2121

2222
/**
2323
* Filters array mapping

dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Invoices/Grid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Grid extends \Magento\Backend\Test\Block\Widget\Grid
2424
*
2525
* @var string
2626
*/
27-
protected $invoiceId = 'td[data-column="increment_id"]';
27+
protected $invoiceId = 'tbody td[data-column="increment_id"]';
2828

2929
/**
3030
* Filters array mapping

dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Shipments/Grid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Grid extends \Magento\Backend\Test\Block\Widget\Grid
2424
*
2525
* @var string
2626
*/
27-
protected $shipmentId = 'td[data-column="real_shipment_id"]';
27+
protected $shipmentId = 'tbody td[data-column="real_shipment_id"]';
2828

2929
/**
3030
* Filters array mapping

dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderInOrdersGridOnFrontend.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ public function processAssert(
4949
'id' => $order->hasData('id') ? $order->getId() : $orderId,
5050
'status' => $statusToCheck === null ? $status : $statusToCheck,
5151
];
52-
$customerLogin = $objectManager->create(
52+
53+
$objectManager->create(
5354
'Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep',
5455
['customer' => $customer]
55-
);
56-
$customerLogin->run();
56+
)->run();
5757
$customerAccountIndex->getAccountMenuBlock()->openMenuItem('My Orders');
5858
$errorMessage = implode(', ', $filter);
5959
\PHPUnit_Framework_Assert::assertTrue(

dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/AssignCustomOrderStatusTest.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ public function test(
132132
'orderStatus',
133133
['data' => array_merge($orderStatus->getData(), $orderStatusState)]
134134
);
135+
$this->orderStatus = $orderStatus;
135136

136137
// Steps:
137138
$this->orderStatusIndex->open();
@@ -141,9 +142,6 @@ public function test(
141142
$assertion->processAssert($this->orderStatusIndex);
142143

143144
$order->persist();
144-
145-
// Prepare data for tear down
146-
$this->orderStatus = $orderStatus;
147145
$this->order = $order;
148146

149147
return [
@@ -160,8 +158,12 @@ public function test(
160158
*/
161159
public function tearDown()
162160
{
163-
$this->orderIndex->open()->getSalesOrderGrid()->massaction([['id' => $this->order->getId()]], 'Cancel');
164-
$filter = ['label' => $this->orderStatus->getLabel()];
165-
$this->orderStatusIndex->open()->getOrderStatusGrid()->searchAndUnassign($filter);
161+
if ($this->order) {
162+
$this->orderIndex->open()->getSalesOrderGrid()->massaction([['id' => $this->order->getId()]], 'Cancel');
163+
}
164+
if ($this->orderStatus) {
165+
$filter = ['label' => $this->orderStatus->getLabel()];
166+
$this->orderStatusIndex->open()->getOrderStatusGrid()->searchAndUnassign($filter);
167+
}
166168
}
167169
}

0 commit comments

Comments
 (0)