Skip to content

Commit 2d52faa

Browse files
committed
Merge branch 'MTA-3235' of github.com:magento-qmt/magento2ce into MTA-3333
2 parents 3cb99f8 + f16e2dc commit 2d52faa

File tree

47 files changed

+1305
-118
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1305
-118
lines changed

dev/tests/functional/tests/app/Magento/Bundle/Test/Fixture/BundleProduct.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
<field name="tax_class_id" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\Product\TaxClass" />
7777
<field name="thumbnail" is_required="0" />
7878
<field name="thumbnail_label" is_required="0" />
79-
<field name="tier_price" is_required="0" group="advanced-pricing" repository="Magento\Catalog\Test\Repository\Product\TierPrice" />
79+
<field name="tier_price" is_required="0" group="advanced-pricing" source="Magento\Catalog\Test\Fixture\Product\TierPrice" repository="Magento\Catalog\Test\Repository\Product\TierPrice" />
8080
<field name="updated_at" is_required="1" />
8181
<field name="url_key" is_required="0" group="search-engine-optimization" />
8282
<field name="url_path" is_required="0" />

dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
<field name="tax_class_id" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\Product\TaxClass" />
6565
<field name="thumbnail" is_required="0" />
6666
<field name="thumbnail_label" is_required="0" />
67-
<field name="tier_price" is_required="0" group="advanced-pricing" repository="Magento\Catalog\Test\Repository\Product\TierPrice" />
67+
<field name="tier_price" is_required="0" group="advanced-pricing" source="Magento\Catalog\Test\Fixture\Product\TierPrice" repository="Magento\Catalog\Test\Repository\Product\TierPrice" />
6868
<field name="updated_at" is_required="1" />
6969
<field name="url_key" is_required="0" group="search-engine-optimization" />
7070
<field name="url_path" is_required="0" />

dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductVirtual.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
<field name="tax_class_id" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\Product\TaxClass" />
6767
<field name="thumbnail" is_required="0" />
6868
<field name="thumbnail_label" is_required="0" />
69-
<field name="tier_price" is_required="0" group="advanced-pricing" repository="Magento\Catalog\Test\Repository\Product\TierPrice" />
69+
<field name="tier_price" is_required="0" group="advanced-pricing" source="Magento\Catalog\Test\Fixture\Product\TierPrice" repository="Magento\Catalog\Test\Repository\Product\TierPrice" />
7070
<field name="stock_data" group="advanced-inventory" />
7171
<field name="updated_at" is_required="1" />
7272
<field name="url_key" is_required="0" group="search-engine-optimization" />
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Catalog\Test\Fixture\Product;
8+
9+
use Magento\Mtf\Fixture\DataSource;
10+
use Magento\Mtf\Fixture\FixtureFactory;
11+
use Magento\Customer\Test\Fixture\CustomerGroup;
12+
use Magento\Mtf\Repository\RepositoryFactory;
13+
14+
/**
15+
* TierPrice data source.
16+
*
17+
* Data keys:
18+
* - dataset
19+
*/
20+
class TierPrice extends DataSource
21+
{
22+
/**
23+
* Customer group fixture array.
24+
*
25+
* @var array
26+
*/
27+
private $customerGroups;
28+
29+
/**
30+
* @constructor
31+
* @param RepositoryFactory $repositoryFactory
32+
* @param FixtureFactory $fixtureFactory
33+
* @param array $params
34+
* @param array $data
35+
* @throws \Exception
36+
*/
37+
public function __construct(
38+
RepositoryFactory $repositoryFactory,
39+
FixtureFactory $fixtureFactory,
40+
array $params,
41+
$data = []
42+
) {
43+
$this->params = $params;
44+
if (!isset($data['dataset'])) {
45+
throw new \Exception("Data must be set");
46+
}
47+
$this->data = $repositoryFactory->get($this->params['repository'])->get($data['dataset']);
48+
foreach ($this->data as $key => $item) {
49+
/** @var CustomerGroup $customerGroup */
50+
$customerGroup = $fixtureFactory->createByCode(
51+
'customerGroup',
52+
['dataset' => $item['customer_group']['dataset']]
53+
);
54+
if (!$customerGroup->hasData('customer_group_id')) {
55+
$customerGroup->persist();
56+
}
57+
$this->data[$key]['customer_group'] = $customerGroup->getCustomerGroupCode();
58+
$this->customerGroups[$key] = $customerGroup;
59+
}
60+
}
61+
62+
/**
63+
* Return customer group fixture.
64+
*
65+
* @return array
66+
*/
67+
public function getCustomerGroups()
68+
{
69+
return $this->customerGroups;
70+
}
71+
}

dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,7 @@ class Curl extends AbstractCurl implements CatalogProductSimpleInterface
138138
]
139139
],
140140
'customer_group' => [
141-
'name' => 'cust_group',
142-
'data' => [
143-
'ALL GROUPS' => 32000,
144-
'NOT LOGGED IN' => 0,
145-
'General' => 1
146-
]
141+
'name' => 'cust_group'
147142
]
148143
];
149144

@@ -455,9 +450,14 @@ protected function prepareAdvancedPricing()
455450
*/
456451
protected function preparePriceFields(array $fields)
457452
{
458-
foreach ($fields as &$field) {
453+
foreach ($fields as $priceKey => &$field) {
459454
foreach ($this->priceData as $key => $data) {
460-
$field[$data['name']] = $this->priceData[$key]['data'][$field[$key]];
455+
if ($data['name'] == 'cust_group') {
456+
$field[$data['name']] = $this->fixture->getDataFieldConfig('tier_price')['source']
457+
->getCustomerGroups()[$priceKey]->getCustomerGroupId();
458+
} else {
459+
$field[$data['name']] = $this->priceData[$key]['data'][$field[$key]];
460+
}
461461
unset($field[$key]);
462462
}
463463
$field['delete'] = '';

dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/TierPrice.xml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@
1212
<item name="price" xsi:type="string">15</item>
1313
<item name="website" xsi:type="string">All Websites [USD]</item>
1414
<item name="price_qty" xsi:type="string">3</item>
15-
<item name="customer_group" xsi:type="string">ALL GROUPS</item>
15+
<item name="customer_group" xsi:type="array">
16+
<item name="dataset" xsi:type="string">ALL_GROUPS</item>
17+
</item>
1618
</field>
1719
<field name="1" xsi:type="array">
1820
<item name="price" xsi:type="string">24</item>
1921
<item name="website" xsi:type="string">All Websites [USD]</item>
2022
<item name="price_qty" xsi:type="string">15</item>
21-
<item name="customer_group" xsi:type="string">ALL GROUPS</item>
23+
<item name="customer_group" xsi:type="array">
24+
<item name="dataset" xsi:type="string">ALL_GROUPS</item>
25+
</item>
2226
</field>
2327
</dataset>
2428

@@ -27,7 +31,9 @@
2731
<item name="price" xsi:type="string">90</item>
2832
<item name="website" xsi:type="string">All Websites [USD]</item>
2933
<item name="price_qty" xsi:type="string">2</item>
30-
<item name="customer_group" xsi:type="string">ALL GROUPS</item>
34+
<item name="customer_group" xsi:type="array">
35+
<item name="dataset" xsi:type="string">ALL_GROUPS</item>
36+
</item>
3137
</field>
3238
</dataset>
3339

@@ -36,7 +42,9 @@
3642
<item name="price" xsi:type="string">80</item>
3743
<item name="website" xsi:type="string">All Websites [USD]</item>
3844
<item name="price_qty" xsi:type="string">2</item>
39-
<item name="customer_group" xsi:type="string">General</item>
45+
<item name="customer_group" xsi:type="array">
46+
<item name="dataset" xsi:type="string">General</item>
47+
</item>
4048
</field>
4149
</dataset>
4250
</repository>

dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Fixture/ConfigurableProduct.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<field name="tax_class_id" is_required="0" group="product-details" source="Magento\Catalog\Test\Fixture\Product\TaxClass" />
6868
<field name="thumbnail" is_required="0" />
6969
<field name="thumbnail_label" is_required="0" />
70-
<field name="tier_price" is_required="0" group="advanced-pricing" repository="Magento\Catalog\Test\Repository\Product\TierPrice" />
70+
<field name="tier_price" is_required="0" group="advanced-pricing" source="Magento\Catalog\Test\Fixture\Product\TierPrice" repository="Magento\Catalog\Test\Repository\Product\TierPrice" />
7171
<field name="updated_at" is_required="1" />
7272
<field name="url_key" is_required="0" group="search-engine-optimization" />
7373
<field name="url_path" is_required="0" />

dev/tests/functional/tests/app/Magento/Customer/Test/Block/Account/AddressesDefault.php

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,75 @@
99
use Magento\Mtf\Client\Locator;
1010

1111
/**
12-
* Addresses default block
12+
* Addresses default block.
1313
*
1414
*/
1515
class AddressesDefault extends Block
1616
{
1717
/**
18-
* Selector for change billing address
18+
* Content of default address block.
19+
*
20+
* @var string
21+
*/
22+
protected $defaultAddressContent = '.block-content';
23+
24+
/**
25+
* Billing address block selector.
26+
*
27+
* @var string
28+
*/
29+
protected $billingAddressBlock = '.box.box-address-billing .box-content';
30+
31+
/**
32+
* Shipping address block selector.
33+
*
34+
* @var string
35+
*/
36+
protected $shippingAddressBlock = '.box.box-address-shipping .box-content';
37+
38+
/**
39+
* Selector for change billing address.
1940
*
2041
* @var string
2142
*/
2243
protected $changeBillingAddressSelector = '.box-address-billing a';
2344

2445
/**
25-
* Click on address book menu item
46+
* Click on address book menu item.
2647
*/
2748
public function goToAddressBook()
2849
{
2950
$this->waitForElementVisible($this->changeBillingAddressSelector, Locator::SELECTOR_CSS);
3051
$this->_rootElement->find($this->changeBillingAddressSelector, Locator::SELECTOR_CSS)->click();
3152
}
53+
54+
/**
55+
* Get block text.
56+
*
57+
* @return string
58+
*/
59+
public function getBlockText()
60+
{
61+
return $this->_rootElement->find($this->defaultAddressContent)->getText();
62+
}
63+
64+
/**
65+
* Returns Default Billing Address Text.
66+
*
67+
* @return string
68+
*/
69+
public function getDefaultBillingAddress()
70+
{
71+
return $this->_rootElement->find($this->billingAddressBlock)->getText();
72+
}
73+
74+
/**
75+
* Returns Default Shipping Address Text.
76+
*
77+
* @return string
78+
*/
79+
public function getDefaultShippingAddress()
80+
{
81+
return $this->_rootElement->find($this->shippingAddressBlock)->getText();
82+
}
3283
}

dev/tests/functional/tests/app/Magento/Customer/Test/Block/Account/Dashboard/Info.php

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,48 +9,54 @@
99
use Magento\Mtf\Block\Block;
1010

1111
/**
12-
* Class Info
13-
* Main block on customer account page
12+
* Main block on customer account page.
1413
*/
1514
class Info extends Block
1615
{
1716
/**
18-
* Css selector for Contact Information Edit Link
17+
* Css selector for Contact Information Edit Link.
1918
*
2019
* @var string
2120
*/
2221
protected $contactInfoEditLink = '.block-dashboard-info .box-information .action.edit';
2322

2423
/**
25-
* Css selector for Contact Information Change Password Link
24+
* Css selector for Contact Information box content.
25+
*
26+
* @var string
27+
*/
28+
protected $contactInfoBoxContent = '.box.box-information .box-content';
29+
30+
/**
31+
* Css selector for Contact Information Change Password Link.
2632
*
2733
* @var string
2834
*/
2935
protected $contactInfoChangePasswordLink = '.block-dashboard-info .box-information .action.change-password';
3036

3137
/**
32-
* Css selector for Contact Information Change Email Link
38+
* Css selector for Contact Information Change Email Link.
3339
*
3440
* @var string
3541
*/
3642
protected $contactInfoChangeEmailLink = '.form-edit-account .fieldset.info .checkbox#change-email';
3743

3844
/**
39-
* Css selector for Contact Information Change Password Checkbox
45+
* Css selector for Contact Information Change Password Checkbox.
4046
*
4147
* @var string
4248
*/
4349
protected $contactInfoChangePasswordCheckbox = '.form-edit-account .fieldset.info .checkbox#change-password';
4450

4551
/**
46-
* Dashboard Welcome block locator
52+
* Dashboard Welcome block locator.
4753
*
4854
* @var string
4955
*/
5056
protected $dashboardWelcome = '.block-dashboard-welcome .block-title';
5157

5258
/**
53-
* Click on Contact Information Edit Link
59+
* Click on Contact Information Edit Link.
5460
*
5561
* @return void
5662
*/
@@ -61,7 +67,7 @@ public function openEditContactInfo()
6167
}
6268

6369
/**
64-
* Click on Contact Information Edit Link
70+
* Click on Contact Information Edit Link.
6571
*
6672
* @return void
6773
*/
@@ -71,7 +77,7 @@ public function openChangePassword()
7177
}
7278

7379
/**
74-
* Get welcome text
80+
* Get welcome text.
7581
*
7682
* @return string
7783
*/
@@ -81,7 +87,7 @@ public function getWelcomeText()
8187
}
8288

8389
/**
84-
* Click on Change Email checkbox
90+
* Click on Change Email checkbox.
8591
*
8692
* @return void
8793
*/
@@ -91,12 +97,22 @@ public function openChangeEmail()
9197
}
9298

9399
/**
94-
* Click on Change Password checkbox
100+
* Click on Change Password checkbox.
95101
*
96102
* @return void
97103
*/
98104
public function checkChangePassword()
99105
{
100106
$this->_rootElement->find($this->contactInfoChangePasswordCheckbox)->click();
101107
}
108+
109+
/**
110+
* Get Contact Information block content.
111+
*
112+
* @return string
113+
*/
114+
public function getContactInfoContent()
115+
{
116+
return $this->_rootElement->find($this->contactInfoBoxContent)->getText();
117+
}
102118
}

0 commit comments

Comments
 (0)