Skip to content

Commit e570cfd

Browse files
author
Vadim Zubovich
committed
Merge branch 'MTO-60-new' of git.epam.com:magn-fat/magn-fat-ce into iteration2-pr-new
# Conflicts: # dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.xml # dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/FillBillingInformationStep.php # dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/FillShippingAddressStep.php
2 parents ed11742 + 9085dc9 commit e570cfd

File tree

4 files changed

+44
-16
lines changed

4 files changed

+44
-16
lines changed

dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* 14. Perform assertions.
3434
*
3535
* @group One_Page_Checkout
36-
* @ZephyrId MAGETWO-27485, MAGETWO-12412, MAGETWO-12429
36+
* @ZephyrId MAGETWO-27485, MAGETWO-12412, MAGETWO-12429, MAGETWO-42598, MAGETWO-42599
3737
* @ZephyrId MAGETWO-12444, MAGETWO-12848, MAGETWO-12849, MAGETWO-12850
3838
* @ZephyrId MAGETWO-42547
3939
*/

dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@
200200
<data name="tag" xsi:type="string">stable:no</data>
201201
<data name="products/0" xsi:type="string">catalogProductSimple::simple_with_tier_price_and_order_qty_3</data>
202202
<data name="customer/dataset" xsi:type="string">default</data>
203-
<data name="checkoutMethod" xsi:type="string">guest</data>
204-
<data name="shippingAddress/dataset" xsi:type="string">UK_address</data>
203+
<data name="checkoutMethod" xsi:type="string">login</data>
204+
<data name="shippingAddress/dataset" xsi:type="string">UK_address_without_email</data>
205205
<data name="billingAddress/dataset" xsi:type="string">UK_address_2_without_email</data>
206206
<data name="shipping/shipping_service" xsi:type="string">Flat Rate</data>
207207
<data name="shipping/shipping_method" xsi:type="string">Fixed</data>
@@ -212,6 +212,7 @@
212212
<data name="configData" xsi:type="string">banktransfer_specificcountry_gb</data>
213213
<constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage" />
214214
<constraint name="Magento\Checkout\Test\Constraint\AssertMinicartEmpty" />
215+
<constraint name="Magento\Customer\Test\Constraint\AssertCustomerDefaultAddressFrontendAddressBook" />
215216
<constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" />
216217
</variation>
217218
<variation name="OnePageCheckoutTestVariation10" summary="One Page Checkout with all product types">
@@ -232,6 +233,7 @@
232233
</data>
233234
<data name="payment/method" xsi:type="string">checkmo</data>
234235
<data name="configData" xsi:type="string">checkmo</data>
236+
<constraint name="Magento\Customer\Test\Constraint\AssertCustomerDefaultAddressFrontendAddressBook" />
235237
<constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" />
236238
</variation>
237239
<variation name="OnePageCheckoutUsingSingInLink" summary="Login during checkout using 'Sign In' link" ticketId="MAGETWO-42547">

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

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66

77
namespace Magento\Customer\Test\Constraint;
88

9+
use Magento\Customer\Test\Block\Address\Renderer;
910
use Magento\Customer\Test\Fixture\Address;
10-
use Magento\Customer\Test\Page\CustomerAccountIndex;
1111
use Magento\Customer\Test\Page\CustomerAccountAddress;
12+
use Magento\Customer\Test\Page\CustomerAccountIndex;
1213
use Magento\Mtf\Constraint\AbstractConstraint;
1314

1415
/**
@@ -20,25 +21,32 @@ class AssertCustomerDefaultAddressFrontendAddressBook extends AbstractConstraint
2021
* Asserts that Default Billing Address and Default Shipping Address equal to data from fixture.
2122
*
2223
* @param CustomerAccountIndex $customerAccountIndex
23-
* @param CustomerAccountAddress $customerAccountAddress
24-
* @param Address $address
24+
* @param CustomerAccountAddress $customerAddress
25+
* @param Address|null $shippingAddress
26+
* @param Address|null $billingAddress
2527
* @return void
2628
*/
2729
public function processAssert(
2830
CustomerAccountIndex $customerAccountIndex,
29-
CustomerAccountAddress $customerAccountAddress,
30-
Address $address
31+
CustomerAccountAddress $customerAddress,
32+
Address $shippingAddress,
33+
Address $billingAddress = null
3134
) {
35+
$customerAccountIndex->open();
3236
$customerAccountIndex->getAccountMenuBlock()->openMenuItem('Address Book');
33-
$addressRenderer = $this->objectManager->create(
34-
\Magento\Customer\Test\Block\Address\Renderer::class,
35-
['address' => $address, 'type' => 'html']
36-
);
37-
$addressToVerify = $addressRenderer->render();
37+
38+
$shippingAddressRendered = $this->createAddressRenderer($shippingAddress)->render();
39+
$validated =
40+
$shippingAddressRendered == $customerAddress->getDefaultAddressBlock()->getDefaultShippingAddress();
41+
42+
if (null !== $billingAddress) {
43+
$billingAddressRendered = $customerAddress->getDefaultAddressBlock()->getDefaultBillingAddress();
44+
$validated =
45+
$validated && ($billingAddressRendered == $this->createAddressRenderer($billingAddress)->render());
46+
}
3847

3948
\PHPUnit_Framework_Assert::assertTrue(
40-
$addressToVerify == $customerAccountAddress->getDefaultAddressBlock()->getDefaultBillingAddress()
41-
&& $addressToVerify == $customerAccountAddress->getDefaultAddressBlock()->getDefaultShippingAddress(),
49+
$validated,
4250
'Customer default address on address book tab is not matching the fixture.'
4351
);
4452
}
@@ -52,4 +60,18 @@ public function toString()
5260
{
5361
return 'Default billing and shipping address form is correct.';
5462
}
63+
64+
/**
65+
* Instantiate Renderer object.
66+
*
67+
* @param Address $address
68+
* @return Renderer
69+
*/
70+
private function createAddressRenderer(Address $address)
71+
{
72+
return $this->objectManager->create(
73+
Renderer::class,
74+
['address' => $address, 'type' => 'html']
75+
);
76+
}
5577
}

dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ public function test(
156156
$this->customerAddressEdit->getEditForm()->fill($address);
157157
$this->customerAddressEdit->getEditForm()->saveAddress();
158158

159-
return ['customer' => $this->prepareCustomer($customer, $initialCustomer)];
159+
return [
160+
'customer' => $this->prepareCustomer($customer, $initialCustomer),
161+
'shippingAddress' => $address,
162+
'billingAddress' => $address
163+
];
160164
}
161165
}

0 commit comments

Comments
 (0)