Skip to content

Commit 71fd413

Browse files
author
Dmytro Aponasenko
committed
MTA-1994: Analyse functional test failures - Sprint 10
1 parent 00ecd24 commit 71fd413

File tree

6 files changed

+5
-66
lines changed

6 files changed

+5
-66
lines changed

dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/FormTabs.php

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@
1313
use Magento\Mtf\Fixture\InjectableFixture;
1414
use Magento\Mtf\Client\BrowserInterface;
1515
use Magento\Mtf\Client\Element\SimpleElement;
16-
use Magento\Mtf\Util\Iterator\File;
17-
use Magento\Mtf\Util\XmlConverter;
1816

1917
/**
20-
* Class FormTabs
2118
* Is used to represent any form with tabs on the page
2219
*
2320
* @SuppressWarnings(PHPMD.NumberOfChildren)
@@ -30,11 +27,6 @@ class FormTabs extends Form
3027
*/
3128
protected $tabs = [];
3229

33-
/**
34-
* @var XmlConverter
35-
*/
36-
protected $xmlConverter;
37-
3830
/**
3931
* Fields which aren't assigned to any tab
4032
*
@@ -48,54 +40,24 @@ class FormTabs extends Form
4840
* @param Mapper $mapper
4941
* @param BlockFactory $blockFactory
5042
* @param BrowserInterface $browser
51-
* @param XmlConverter $xmlConverter
5243
* @param array $config
5344
*/
5445
public function __construct(
5546
SimpleElement $element,
5647
Mapper $mapper,
5748
BlockFactory $blockFactory,
5849
BrowserInterface $browser,
59-
XmlConverter $xmlConverter,
6050
array $config = []
6151
) {
62-
$this->xmlConverter = $xmlConverter;
6352
parent::__construct($element, $blockFactory, $mapper, $browser, $config);
6453
}
6554

6655
/**
6756
* Initialize block
6857
*/
69-
protected function _init()
58+
protected function init()
7059
{
71-
$this->tabs = $this->getTabs();
72-
}
73-
74-
/**
75-
* Get all tabs on the form
76-
*
77-
* @return array
78-
*/
79-
protected function getTabs()
80-
{
81-
$result = [];
82-
83-
$paths = glob(
84-
MTF_TESTS_PATH . preg_replace('/Magento\/\w+/', '*/*', str_replace('\\', '/', get_class($this))) . '.xml'
85-
);
86-
$files = new File($paths);
87-
88-
foreach ($files as $file) {
89-
$presetXml = simplexml_load_string($file);
90-
if ($presetXml instanceof \SimpleXMLElement) {
91-
$array = $this->xmlConverter->convert($presetXml);
92-
if (is_array($array)) {
93-
$result = array_replace_recursive($result, $array);
94-
}
95-
}
96-
}
97-
98-
return $result;
60+
$this->tabs = $this->getFormMapping();
9961
}
10062

10163
/**

dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/AttributeForm.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Magento\Mtf\Client\Element\SimpleElement;
1616
use Magento\Mtf\Client\Locator;
1717
use Magento\Mtf\Fixture\FixtureInterface;
18-
use Magento\Mtf\Util\XmlConverter;
1918

2019
/**
2120
* Edit attribute form on catalog product edit page.
@@ -49,18 +48,16 @@ class AttributeForm extends FormTabs
4948
* @param Mapper $mapper
5049
* @param BlockFactory $blockFactory
5150
* @param BrowserInterface $browser
52-
* @param XmlConverter $xmlConverter
5351
* @param array $config
5452
*/
5553
public function __construct(
5654
SimpleElement $element,
5755
Mapper $mapper,
5856
BlockFactory $blockFactory,
5957
BrowserInterface $browser,
60-
XmlConverter $xmlConverter,
6158
array $config = []
6259
) {
63-
parent::__construct($element, $mapper, $blockFactory, $browser, $xmlConverter, $config);
60+
parent::__construct($element, $mapper, $blockFactory, $browser, $config);
6461
$this->browser->switchToFrame(new Locator($this->iFrame));
6562
}
6663

dev/tests/functional/tests/app/Magento/Customer/Test/Repository/Customer.xml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,6 @@
5555
<field name="gender" xsi:type="string">Male</field>
5656
</dataset>
5757

58-
<dataset name="johndoe_with_balance">
59-
<field name="firstname" xsi:type="string">John</field>
60-
<field name="lastname" xsi:type="string">Doe</field>
61-
<field name="email" xsi:type="string">JohnDoe_%isolation%@example.com</field>
62-
<field name="password" xsi:type="string">123123q</field>
63-
<field name="password_confirmation" xsi:type="string">123123q</field>
64-
<field name="dob" xsi:type="string">01/01/1990</field>
65-
<field name="gender" xsi:type="string">Male</field>
66-
<field name="amount_delta" xsi:type="string">501</field>
67-
</dataset>
68-
6958
<dataset name="defaultBackend">
7059
<field name="website_id" xsi:type="string">Main Website</field>
7160
<field name="firstname" xsi:type="string">John</field>

dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Creditmemo/Form.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,5 @@
1818
<send_email>
1919
<input>checkbox</input>
2020
</send_email>
21-
<refund_customerbalance_return_enable>
22-
<selector>#creditmemo_customerbalance_return_enable</selector>
23-
<input>checkbox</input>
24-
</refund_customerbalance_return_enable>
25-
<refund_customerbalance_return />
2621
</fields>
2722
</mapping>

dev/tests/functional/tests/app/Magento/Sales/Test/Handler/OrderInjectable/Curl.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ protected function prepareData(FixtureInterface $fixture)
101101
'collect_shipping_rates' => 1,
102102
];
103103
$result['shipping_data_method_set'] = [
104-
'order' => ['shipping_method' => isset($data['shipping_method']) ? $data['shipping_method'] : ''],
104+
'order' => ['shipping_method' => $result['order_data']['order']['shipping_method']],
105105
'payment' => $data['payment_auth_expiration'],
106106
];
107107

@@ -280,7 +280,7 @@ protected function prepareOrderData(array $data)
280280
'group_id' => $customerGroupId,
281281
'email' => $this->customer->getEmail(),
282282
],
283-
'shipping_method' => $data['shipping_method'],
283+
'shipping_method' => isset($data['shipping_method']) ? $data['shipping_method'] : '',
284284
],
285285
'item' => $this->prepareOrderProductsData($data['entity_id']),
286286
'billing_address' => $this->prepareBillingAddress($data['billing_address_id']),

dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Form.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,5 @@
1818
<send_email>
1919
<input>checkbox</input>
2020
</send_email>
21-
<refund_customerbalance_return_enable>
22-
<input>checkbox</input>
23-
</refund_customerbalance_return_enable>
24-
<refund_customerbalance_return />
2521
</fields>
2622
</mapping>

0 commit comments

Comments
 (0)