Skip to content

Commit 42e5cad

Browse files
AC-8385: MFTF Test Fix
1 parent 6fccd5c commit 42e5cad

9 files changed

+19
-50
lines changed

app/code/Magento/Captcha/Test/Mftf/Test/StorefrontCaptchaOnOnepageCheckoutPyamentTest.xml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@
2121
<group value="storefront_captcha_enabled"/>
2222
</annotations>
2323
<before>
24-
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/>
25-
<actionGroup ref="AdminEnableDisableGuestCheckoutLoginActionGroup" stepKey="EnablingGuestCheckoutLogin">
26-
<argument name="Enable" value="Yes"/>
27-
</actionGroup>
28-
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
24+
<magentoCLI command="config:set checkout/options/enable_guest_checkout_login 1" stepKey="EnablingGuestCheckoutLogin"/>
2925
<!-- Create Simple Product -->
3026
<createData entity="SimpleProduct2" stepKey="createSimpleProduct">
3127
<field key="price">20</field>
@@ -69,10 +65,8 @@
6965
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
7066
<!-- Admin Login, Disable Config settings and Admin Logout -->
7167
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/>
72-
<actionGroup ref="AdminEnableDisableGuestCheckoutLoginActionGroup" stepKey="DisablingGuestCheckoutLogin">
73-
<argument name="Enable" value="No"/>
74-
</actionGroup>
7568
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
69+
<magentoCLI command="config:set checkout/options/enable_guest_checkout_login 0" stepKey="DisablingGuestCheckoutLogin"/>
7670
</after>
7771

7872
<!-- Reindex and flush cache -->

app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CAdminTest.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@
1818
<testCaseId value="MAGETWO-87014"/>
1919
<group value="pr_exclude"/>
2020
</annotations>
21+
<before>
22+
<magentoCLI command="config:set checkout/options/enable_guest_checkout_login 1" stepKey="EnablingGuestCheckoutLogin"/>
23+
</before>
2124
<after>
2225
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
26+
<magentoCLI command="config:set checkout/options/enable_guest_checkout_login 0" stepKey="DisablingGuestCheckoutLogin"/>
2327
</after>
2428

2529
<!--Login to Admin Area-->
2630
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminArea"/>
27-
2831
<!--Admin creates product-->
2932
<!--Create Simple Product-->
3033
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="visitAdminProductPageSimple"/>

app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,15 @@
2020
<group value="mtf_migrated"/>
2121
</annotations>
2222
<before>
23-
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/>
24-
<actionGroup ref="AdminEnableDisableGuestCheckoutLoginActionGroup" stepKey="EnablingGuestCheckoutLogin">
25-
<argument name="Enable" value="Yes"/>
26-
</actionGroup>
27-
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
23+
<magentoCLI command="config:set checkout/options/enable_guest_checkout_login 1" stepKey="EnablingGuestCheckoutLogin"/>
2824
<!-- Create Simple Product -->
2925
<createData entity="SimpleProduct2" stepKey="createSimpleProduct">
3026
<field key="price">560</field>
3127
</createData>
32-
3328
<!-- Create customer -->
3429
<createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/>
3530
</before>
3631
<after>
37-
<actionGroup ref="AdminEnableDisableGuestCheckoutLoginActionGroup" stepKey="DisablingGuestCheckoutLogin">
38-
<argument name="Enable" value="No"/>
39-
</actionGroup>
4032
<!-- Admin log out -->
4133
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
4234

@@ -48,6 +40,7 @@
4840

4941
<!-- Delete customer -->
5042
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
43+
<magentoCLI command="config:set checkout/options/enable_guest_checkout_login 0" stepKey="DisablingGuestCheckoutLogin"/>
5144
</after>
5245

5346
<!-- Add Simple Product to cart -->

app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@
2020
<group value="mtf_migrated"/>
2121
</annotations>
2222
<before>
23-
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/>
24-
<actionGroup ref="AdminEnableDisableGuestCheckoutLoginActionGroup" stepKey="EnablingGuestCheckoutLogin">
25-
<argument name="Enable" value="Yes"/>
26-
</actionGroup>
27-
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
23+
<magentoCLI command="config:set checkout/options/enable_guest_checkout_login 1" stepKey="EnablingGuestCheckoutLogin"/>
2824
<!-- Create Simple Product -->
2925
<createData entity="SimpleProduct2" stepKey="createSimpleProduct">
3026
<field key="price">560</field>
@@ -34,9 +30,6 @@
3430
<createData entity="Customer_DE_UK_US" stepKey="createCustomer"/>
3531
</before>
3632
<after>
37-
<actionGroup ref="AdminEnableDisableGuestCheckoutLoginActionGroup" stepKey="DisablingGuestCheckoutLogin">
38-
<argument name="Enable" value="No"/>
39-
</actionGroup>
4033
<!-- Admin log out -->
4134
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
4235

@@ -48,6 +41,7 @@
4841

4942
<!-- Delete customer -->
5043
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
44+
<magentoCLI command="config:set checkout/options/enable_guest_checkout_login 0" stepKey="DisablingGuestCheckoutLogin"/>
5145
</after>
5246

5347
<!-- Add Simple Product to cart -->

app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@
1818
</annotations>
1919

2020
<before>
21-
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/>
22-
<actionGroup ref="AdminEnableDisableGuestCheckoutLoginActionGroup" stepKey="EnablingGuestCheckoutLogin">
23-
<argument name="Enable" value="Yes"/>
24-
</actionGroup>
21+
<magentoCLI command="config:set checkout/options/enable_guest_checkout_login 1" stepKey="EnablingGuestCheckoutLogin"/>
2522
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
2623
<createData entity="defaultSimpleProduct" stepKey="simpleProduct">
2724
<field key="price">10.00</field>
@@ -104,13 +101,11 @@
104101
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/>
105102
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteProductAttribute"/>
106103
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
107-
<actionGroup ref="AdminEnableDisableGuestCheckoutLoginActionGroup" stepKey="DisablingGuestCheckoutLogin">
108-
<argument name="Enable" value="No"/>
109-
</actionGroup>
110104
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
111105

112106
<!-- Reindex invalidated indices after product attribute has been created/deleted -->
113107
<magentoCron groups="index" stepKey="reindexInvalidatedIndices"/>
108+
<magentoCLI command="config:set checkout/options/enable_guest_checkout_login 0" stepKey="DisablingGuestCheckoutLogin"/>
114109
</after>
115110

116111
<!--Open Product page in StoreFront and assert product and price range -->

app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerLoginDuringCheckoutTest.xml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@
1919
<group value="OnePageCheckout"/>
2020
</annotations>
2121
<before>
22+
<magentoCLI command="config:set checkout/options/enable_guest_checkout_login 1" stepKey="EnablingGuestCheckoutLogin"/>
2223
<!-- Create simple product -->
2324
<createData entity="SimpleProduct2" stepKey="createProduct"/>
2425

2526
<!-- Login as admin -->
2627
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
27-
<actionGroup ref="AdminEnableDisableGuestCheckoutLoginActionGroup" stepKey="EnablingGuestCheckoutLogin">
28-
<argument name="Enable" value="Yes"/>
29-
</actionGroup>
3028
</before>
3129
<after>
3230
<!-- Delete simple product -->
@@ -42,12 +40,9 @@
4240
<actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer">
4341
<argument name="customerEmail" value="CustomerEntityOne.email"/>
4442
</actionGroup>
45-
4643
<!-- Logout admin -->
47-
<actionGroup ref="AdminEnableDisableGuestCheckoutLoginActionGroup" stepKey="DisablingGuestCheckoutLogin">
48-
<argument name="Enable" value="No"/>
49-
</actionGroup>
5044
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
45+
<magentoCLI command="config:set checkout/options/enable_guest_checkout_login 0" stepKey="DisablingGuestCheckoutLogin"/>
5146
</after>
5247
<!-- Go to Storefront as Guest and create new account -->
5348
<actionGroup ref="StorefrontOpenCustomerAccountCreatePageActionGroup" stepKey="openCreateAccountPage"/>

app/code/Magento/Customer/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
</skip>
2424
</annotations>
2525
<before>
26+
<magentoCLI command="config:set checkout/options/enable_guest_checkout_login 1" stepKey="EnablingGuestCheckoutLogin"/>
2627
<resetCookie userInput="PHPSESSID" stepKey="resetCookieForCart"/>
2728
<actionGroup ref="AdminLoginActionGroup" after="resetCookieForCart" stepKey="loginAsAdmin"/>
2829
</before>
@@ -32,6 +33,7 @@
3233
<actionGroup ref="DeleteCustomerFromAdminActionGroup" stepKey="deleteCustomerFromAdmin"/>
3334
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/>
3435
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
36+
<magentoCLI command="config:set checkout/options/enable_guest_checkout_login 0" stepKey="DisablingGuestCheckoutLogin"/>
3537
</after>
3638
<!-- Step 0: User signs up an account -->
3739
<comment userInput="Start of signing up user account" stepKey="startOfSigningUpUserAccount" />

app/code/Magento/Quote/Model/QuoteAddressValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
class QuoteAddressValidator
2626
{
2727
private const XML_CHECKOUT_CONFIG_VALUE = 'checkout/async';
28-
2928
/**
3029
* @var AddressRepositoryInterface
3130
*/
@@ -168,6 +167,7 @@ public function validateForCart(CartInterface $cart, AddressInterface $address):
168167
if ((!$this->deploymentConfig->get(self::XML_CHECKOUT_CONFIG_VALUE)) && $cart->getCustomerIsGuest()) {
169168
$this->doValidateForGuestQuoteAddress($address, $cart);
170169
}
170+
171171
$this->doValidate($address, $cart->getCustomerIsGuest() ? null : (int) $cart->getCustomer()->getId());
172172
}
173173

app/code/Magento/Sales/Test/Mftf/Test/StorefrontCreateOrderWithDifferentAddressesTest.xml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,16 @@
1515
<group value="sales"/>
1616
</annotations>
1717
<before>
18-
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
19-
<actionGroup ref="AdminEnableDisableGuestCheckoutLoginActionGroup" stepKey="EnablingGuestCheckoutLogin">
20-
<argument name="Enable" value="Yes"/>
21-
</actionGroup>
22-
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
18+
<magentoCLI command="config:set checkout/options/enable_guest_checkout_login 1" stepKey="EnablingGuestCheckoutLogin"/>
2319
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/>
2420
<createData entity="Customer_UK_US" stepKey="createCustomer"/>
2521
</before>
2622
<after>
2723
<deleteData createDataKey="createCustomer" stepKey="deleteCreateCustomer"/>
2824
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
29-
30-
<actionGroup ref="AdminEnableDisableGuestCheckoutLoginActionGroup" stepKey="DisablingGuestCheckoutLogin">
31-
<argument name="Enable" value="No"/>
32-
</actionGroup>
3325
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
3426
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
27+
<magentoCLI command="config:set checkout/options/enable_guest_checkout_login 0" stepKey="DisablingGuestCheckoutLogin"/>
3528
</after>
3629

3730
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="navigateToProductPage">

0 commit comments

Comments
 (0)