Skip to content

Commit f16e2dc

Browse files
committed
MTA-3254: Extend delete customer group test
1 parent d9c1aea commit f16e2dc

17 files changed

+128
-124
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/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" />

dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/TierPrice.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
use Magento\Mtf\Repository\RepositoryFactory;
1313

1414
/**
15+
* TierPrice data source.
1516
*
17+
* Data keys:
18+
* - dataset
1619
*/
1720
class TierPrice extends DataSource
1821
{

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -453,9 +453,8 @@ protected function preparePriceFields(array $fields)
453453
foreach ($fields as $priceKey => &$field) {
454454
foreach ($this->priceData as $key => $data) {
455455
if ($data['name'] == 'cust_group') {
456-
$field[$data['name']] =
457-
$this->fixture->getDataFieldConfig('tier_price')['source']->
458-
getCustomerGroups()[$priceKey]->getCustomerGroupId();
456+
$field[$data['name']] = $this->fixture->getDataFieldConfig('tier_price')['source']
457+
->getCustomerGroups()[$priceKey]->getCustomerGroupId();
459458
} else {
460459
$field[$data['name']] = $this->priceData[$key]['data'][$field[$key]];
461460
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@
651651
<item name="is_in_stock" xsi:type="string">In Stock</item>
652652
</field>
653653
<field name="tier_price" xsi:type="array">
654-
<item name="dataset" xsi:type="string">general</item>
654+
<item name="dataset" xsi:type="string">default</item>
655655
</field>
656656
<field name="category_ids" xsi:type="array">
657657
<item name="dataset" xsi:type="string">default_subcategory</item>

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/Constraint/AssertCustomerGroupChangedToDefaultOnCustomerForm.php

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,47 +8,44 @@
88

99
use Magento\Customer\Test\Fixture\CustomerGroup;
1010
use Magento\Customer\Test\Fixture\Customer;
11-
use Magento\Customer\Test\Page\Adminhtml\CustomerIndex;
1211
use Magento\Customer\Test\Page\Adminhtml\CustomerIndexNew;
1312
use Magento\Mtf\Constraint\AbstractConstraint;
1413

1514
/**
16-
* Class AssertCustomerGroupChangedToDefaultOnCustomerForm.
15+
* Assert that customer group is set to default on customer form.
1716
*/
1817
class AssertCustomerGroupChangedToDefaultOnCustomerForm extends AbstractConstraint
1918
{
2019
/**
21-
* Assert that customer group is General on account information page.
20+
* Assert that customer group is set to default on customer form.
2221
*
2322
* @param Customer $customer
24-
* @param CustomerGroup $customerGroup
23+
* @param CustomerGroup $defaultCustomerGroup
2524
* @param CustomerIndexNew $customerIndexNew
26-
* @param CustomerIndex $customerIndex
25+
* @param CustomerIndexNew $customerIndexEdit
2726
* @return void
2827
*/
2928
public function processAssert(
3029
Customer $customer,
31-
CustomerGroup $customerGroup,
30+
CustomerGroup $defaultCustomerGroup,
3231
CustomerIndexNew $customerIndexNew,
33-
CustomerIndex $customerIndex
32+
CustomerIndexNew $customerIndexEdit
3433
) {
35-
$filter = ['email' => $customer->getEmail()];
36-
$customerIndex->open();
37-
$customerIndex->getCustomerGridBlock()->searchAndOpen($filter);
34+
$customerIndexEdit->open(['id' => $customer->getId()]);
3835
$customerFormData = $customerIndexNew->getCustomerForm()->getData();
3936
\PHPUnit_Framework_Assert::assertTrue(
40-
$customerFormData['group_id'] == "General",
41-
"Customer group {$customerGroup->getCustomerGroupCode()} not set to General after group was deleted."
37+
$customerFormData['group_id'] == $defaultCustomerGroup->getCustomerGroupCode(),
38+
"Customer group not set to default after group was deleted."
4239
);
4340
}
4441

4542
/**
46-
* Success assert of customer group set to default on account information page.
43+
* Success assert of customer group set to default on customer form.
4744
*
4845
* @return string
4946
*/
5047
public function toString()
5148
{
52-
return 'Customer group is set to default on account information page.';
49+
return 'Customer group is set to default on customer form.';
5350
}
5451
}

dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupNotOnCartPriceRuleForm.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,25 @@
99
use Magento\Customer\Test\Fixture\CustomerGroup;
1010
use Magento\Mtf\Constraint\AbstractConstraint;
1111
use Magento\SalesRule\Test\Block\Adminhtml\Promo\Quote\Edit\Section\RuleInformation;
12-
use Magento\SalesRule\Test\Page\Adminhtml\PromoQuoteIndex;
1312
use Magento\SalesRule\Test\Page\Adminhtml\PromoQuoteNew;
1413

1514
/**
16-
* Class AssertCustomerGroupNotOnCartPriceRuleForm.
15+
* Assert that customer group is not on cart price rule page.
1716
*/
1817
class AssertCustomerGroupNotOnCartPriceRuleForm extends AbstractConstraint
1918
{
2019
/**
2120
* Assert that customer group is not on cart price rule page.
2221
*
23-
* @param PromoQuoteIndex $promoQuoteIndex
2422
* @param PromoQuoteNew $promoQuoteNew
2523
* @param CustomerGroup $customerGroup
2624
* @return void
2725
*/
2826
public function processAssert(
29-
PromoQuoteIndex $promoQuoteIndex,
3027
PromoQuoteNew $promoQuoteNew,
3128
CustomerGroup $customerGroup
3229
) {
33-
$promoQuoteIndex->open();
34-
$promoQuoteIndex->getGridPageActions()->addNew();
30+
$promoQuoteNew->open();
3531
$promoQuoteNew->getSalesRuleForm()->openSection('rule_information');
3632

3733
/** @var RuleInformation $ruleInformationTab */

dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupNotOnCatalogPriceRuleForm.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,28 @@
66

77
namespace Magento\Customer\Test\Constraint;
88

9-
use Magento\CatalogRule\Test\Page\Adminhtml\CatalogRuleIndex;
109
use Magento\CatalogRule\Test\Page\Adminhtml\CatalogRuleNew;
1110
use Magento\Customer\Test\Fixture\CustomerGroup;
1211
use Magento\Mtf\Constraint\AbstractConstraint;
1312
use Magento\CatalogRule\Test\Block\Adminhtml\Promo\Catalog\Edit\Section\RuleInformation;
1413

1514
/**
16-
* Class AssertCustomerGroupNotOnCatalogPriceRuleForm.
15+
* Assert that customer group is not on catalog price rule page.
1716
*/
1817
class AssertCustomerGroupNotOnCatalogPriceRuleForm extends AbstractConstraint
1918
{
2019
/**
2120
* Assert that customer group is not on catalog price rule page.
2221
*
23-
* @param CatalogRuleIndex $catalogRuleIndex
2422
* @param CatalogRuleNew $catalogRuleNew
2523
* @param CustomerGroup $customerGroup
2624
* @return void
2725
*/
2826
public function processAssert(
29-
CatalogRuleIndex $catalogRuleIndex,
3027
CatalogRuleNew $catalogRuleNew,
3128
CustomerGroup $customerGroup
3229
) {
33-
$catalogRuleIndex->open();
34-
$catalogRuleIndex->getGridPageActions()->addNew();
30+
$catalogRuleNew->open();
3531
$catalogRuleNew->getEditForm()->openSection('rule_information');
3632

3733
/** @var RuleInformation $ruleInformationSection */

dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupNotOnProductForm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use Magento\Mtf\Constraint\AbstractConstraint;
1414

1515
/**
16-
* Class AssertCustomerGroupNotOnProductForm.
16+
* Assert that customer group is not on product form.
1717
*/
1818
class AssertCustomerGroupNotOnProductForm extends AbstractConstraint
1919
{

0 commit comments

Comments
 (0)