Skip to content

Commit 9ad2393

Browse files
author
Oleksandr Manchenko
committed
MAGETWO-37140: Test CreateSimpleProductEntityTest #variation 3 (FAT) random fails on inventory tab
1 parent a497cf4 commit 9ad2393

File tree

4 files changed

+71
-3
lines changed

4 files changed

+71
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab;
8+
9+
use Magento\Catalog\Test\Block\Adminhtml\Product\Edit\ProductTab;
10+
use Magento\Mtf\Client\Element\SimpleElement;
11+
use Magento\Mtf\Client\Locator;
12+
13+
/**
14+
* Advanced inventory tab.
15+
*/
16+
class AdvancedInventory extends ProductTab
17+
{
18+
/**
19+
* Styled field block selector.
20+
*
21+
* @var string
22+
*/
23+
protected $styledFieldBlock = './/*[@id="table_cataloginventory"]/div[@style][1]';
24+
25+
/**
26+
* Fill data to fields on tab.
27+
*
28+
* @param array $fields
29+
* @param SimpleElement|null $element
30+
* @return $this
31+
*/
32+
public function fillFormTab(array $fields, SimpleElement $element = null)
33+
{
34+
$this->waitInit();
35+
return parent::fillFormTab($fields, $element);
36+
}
37+
38+
/**
39+
* Get data of tab.
40+
*
41+
* @param array|null $fields
42+
* @param SimpleElement|null $element
43+
* @return array
44+
*/
45+
public function getDataFormTab($fields = null, SimpleElement $element = null)
46+
{
47+
$this->waitInit();
48+
return parent::getDataFormTab($fields, $element);
49+
}
50+
51+
/**
52+
* Wait until init tab.
53+
*
54+
* @return void
55+
*/
56+
public function waitInit()
57+
{
58+
$context = $this->_rootElement;
59+
$selector = $this->styledFieldBlock;
60+
61+
$context->waitUntil(
62+
function () use ($context, $selector) {
63+
$elements = $context->getElements($selector, Locator::SELECTOR_XPATH);
64+
return count($elements) > 0 ? true : null;
65+
}
66+
);
67+
}
68+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
</fields>
9191
</advanced-pricing>
9292
<advanced-inventory>
93-
<class>\Magento\Backend\Test\Block\Widget\Tab</class>
93+
<class>\Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\AdvancedInventory</class>
9494
<selector>#product_info_tabs_advanced-inventory</selector>
9595
<strategy>css selector</strategy>
9696
<wrapper>product[stock_data]</wrapper>

dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@
456456
<data name="product/data/price/value" xsi:type="string">10</data>
457457
<data name="product/data/stock_data/manage_stock" xsi:type="string">Yes</data>
458458
<data name="product/data/stock_data/qty" xsi:type="string">1</data>
459-
<data name="tag" xsi:type="string">test_type:acceptance_test, stable:no</data>
459+
<data name="tag" xsi:type="string">test_type:acceptance_test</data>
460460
<constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" />
461461
<constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" />
462462
</variation>

dev/tests/functional/tests/app/Magento/Customer/Test/Handler/Customer/Curl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function persist(FixtureInterface $customer = null)
9898
$response = $curl->read();
9999
$curl->close();
100100
// After caching My Account page we cannot check by success message
101-
if (!strpos($response, 'customer/account/logout')) {
101+
if (!strpos($response, 'My Dashboard')) {
102102
throw new \Exception("Customer entity creating by curl handler was not successful! Response: $response");
103103
}
104104

0 commit comments

Comments
 (0)