Skip to content

Commit 4e862e5

Browse files
committed
Merge branch '2.4-develop' into ACP2E-2651
2 parents e4c52fc + 59b2921 commit 4e862e5

File tree

27 files changed

+1082
-669
lines changed

27 files changed

+1082
-669
lines changed

app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3SyncZeroByteFilesTest.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@
4444
<!-- Disable AWS S3 Remote Storage -->
4545
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage"/>
4646
</after>
47-
<magentoCLI command="remote-storage:sync" timeout="120" stepKey="syncRemoteStorage"/>
48-
<assertEquals stepKey="assertConfigTest">
49-
<expectedResult type="string">Uploading media files to remote storage.\n- empty.jpg\nEnd of upload.</expectedResult>
47+
<magentoCLI command="remote-storage:sync" timeout="200" stepKey="syncRemoteStorage"/>
48+
<comment userInput="checking remote-storage:sync" stepKey="assertConfigTest"/>
49+
<assertStringContainsString stepKey="checkingRemoteStorageSync">
50+
<expectedResult type="string">Uploading media files to remote storage</expectedResult>
5051
<actualResult type="variable">$syncRemoteStorage</actualResult>
51-
</assertEquals>
52-
52+
</assertStringContainsString>
5353
</test>
5454
</tests>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertCategoryNameIsShownInMenuActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<argument name="categoryName" type="string"/>
1717
</arguments>
1818

19+
<waitForElementVisible selector="{{StorefrontHeaderSection.NavigationCategoryByName(categoryName)}}" stepKey="waitForCatName" time="120"/>
1920
<seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(categoryName)}}"
2021
stepKey="seeCatergoryInStoreFront"/>
2122
</actionGroup>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,17 @@
4242
<click selector="{{StorefrontHeaderSection.mobileMenuToggle}}" stepKey="openSideMenu"/>
4343
<waitForElementClickable selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createParentCategory.name$$)}}" stepKey="waitForCategoryMenuClickable" />
4444
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createParentCategory.name$$)}}" stepKey="expandCategoryMenu"/>
45-
<waitForPageLoad stepKey="waitForSearchResult"/>
45+
<waitForPageLoad stepKey="waitForSearchResult" time="60"/>
4646

4747
<!-- Assert the category expanded successfully -->
4848
<actionGroup ref="StorefrontAssertCategoryNameIsShownInMenuActionGroup" stepKey="verifySubCatMenuItemIsVisibleInTheSidebar">
4949
<argument name="categoryName" value="$$createSubCategory.name$$"/>
5050
</actionGroup>
5151

5252
<!-- Open the subcategory and assert it opened successfully -->
53+
<waitForElementClickable selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createSubCategory.name$$)}}" stepKey="waitForSubCategory" time="90"/>
5354
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createSubCategory.name$$)}}" stepKey="openSubCategory"/>
55+
<waitForElementVisible selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="waitForCategoryName" time="90"/>
5456
<see userInput="$$createSubCategory.name$$" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryName"/>
5557
</test>
5658
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="GuestVerifiesTheShipToDetailsOnStorefrontCheckoutPaymentActionGroup">
12+
<annotations>
13+
<description>Guest verifies the Shipping details on storefront checkout payment page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="firstName" type="string" defaultValue="{{CustomerAddressSimple.firstName}}"/>
17+
<argument name="lastName" type="string" defaultValue="{{CustomerAddressSimple.lastName}}"/>
18+
<argument name="street" type="string" defaultValue="{{CustomerAddressSimple.street[0]}}"/>
19+
<argument name="city" type="string" defaultValue="{{CustomerAddressSimple.city}}"/>
20+
<argument name="state" type="string" defaultValue="{{CustomerAddressSimple.state}}"/>
21+
<argument name="postcode" type="string" defaultValue="{{CustomerAddressSimple.postcode}}"/>
22+
<argument name="telephone" type="string" defaultValue="{{CustomerAddressSimple.telephone}}"/>
23+
</arguments>
24+
<waitForText selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{firstName}}" stepKey="assertShipToFirstName" />
25+
<waitForText selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{lastName}}" stepKey="assertShipToLastName" />
26+
<waitForText selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{street}}" stepKey="assertShipToStreet" />
27+
<waitForText selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{city}}" stepKey="assertShipToCity" />
28+
<waitForText selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{state}}" stepKey="assertShipToState" />
29+
<waitForText selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{postcode}}" stepKey="assertShipToPostcode" />
30+
<waitForText selector="{{CheckoutPaymentSection.shipToInformation}}" userInput="{{telephone}}" stepKey="assertShipToTelephone" />
31+
</actionGroup>
32+
</actionGroups>
33+

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@
4848
<element name="ProductOptionsActiveByProductItemName" type="text" selector="//div[@class='product-item-details']//strong[@class='product-item-name'][text()='{{var1}}']//ancestor::div[@class='product-item-details']//div[@class='product options active']" parameterized="true" />
4949
<element name="ProductOptionLinkActiveByProductItemName" type="text" selector="//div[@class='product-item-details']//strong[@class='product-item-name'][text()='{{var1}}']//ancestor::div[@class='product-item-details']//div[@class='product options active']//a[text() = '{{var2}}']" parameterized="true" />
5050
<element name="shipToInformation" type="text" selector="//div[@class='ship-to']//div[@class='shipping-information-content']" />
51-
<element name="shippingMethodInformation" type="text" selector="//div[@class='ship-via']//div[@class='shipping-information-content']" />
51+
<element name="shippingMethodInformation" type="text" selector="//div[@class='ship-via']//div[@class='shipping-information-content']"/>
52+
<element name="editShipToAddress" type="button" selector="//div[@class='ship-to']//button[@class='action action-edit']"/>
53+
<element name="editShippingMethod" type="button" selector="//div[@class='ship-via']//button[@class='action action-edit']"/>
54+
<element name="shippingMethodTitle" type="text" selector="//div[text()='Shipping Methods']"/>
5255
<element name="shippingInformationSection" type="text" selector=".ship-to .shipping-information-content" />
5356
<element name="paymentMethodTitle" type="text" selector=".payment-method-title span" />
5457
<element name="productOptionsByProductItemPrice" type="text" selector="//div[@class='product-item-inner']//div[@class='subtotal']//span[@class='price'][contains(.,'{{price}}')]//ancestor::div[@class='product-item-details']//div[@class='product options']" parameterized="true"/>
@@ -72,5 +75,6 @@
7275
<element name="billingAddressSameAsShippingCashOnDeliveryCheckbox" type="checkbox" selector="#billing-address-same-as-shipping-cashondelivery"/>
7376
<element name="errormessage" type="text" selector="//div[@data-ui-id='checkout-cart-validationmessages-message-error']"/>
7477
<element name="productQuantityInCartBlock" type="text" selector="//div[@class='details-qty']/span[@class='value']" />
78+
<element name="customerAddressAttribute" type="input" selector="//div[@name='billingAddresscheckmo.custom_attributes.{{attribute}}']//input[@name='custom_attributes[{{attribute}}]']" parameterized="true" timeout="30"/>
7579
</section>
7680
</sections>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,6 @@
5555
<element name="selectCountry" type="select" selector="//div[@class='billing-address-form']//select[@name='country_id']"/>
5656
<element name="customerAddressAttribute" type="input" selector="[id*='{{attribute}}']" parameterized="true"/>
5757
<element name="savedAddress" type="text" selector="div[class='shipping-address-item selected-item']"/>
58+
<element name="shippingAddressBox" type="text" selector="//div[@class='shipping-address-item selected-item']" timeout="30"/>
5859
</section>
5960
</sections>
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontVerifyShipToShipMethodContainsSameDataTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="Guest checkout"/>
15+
<title value="Ship To and Shipping Method blocks on Checkout contain actual information according to input data"/>
16+
<description value="Ship To and Shipping Method blocks on Checkout contain actual information according to input data"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-4628"/>
19+
</annotations>
20+
<before>
21+
<!-- Enable free shipping -->
22+
<createData entity="FreeShippingMethodsSettingConfig" stepKey="enableFreeShippingConfig"/>
23+
<!-- create category -->
24+
<createData entity="_defaultCategory" stepKey="createCategory"/>
25+
<!-- create simple product -->
26+
<createData entity="ApiSimpleProduct" stepKey="createProduct">
27+
<requiredEntity createDataKey="createCategory"/>
28+
</createData>
29+
</before>
30+
<after>
31+
<createData entity="DisableFreeShippingConfig" stepKey="disableFreeShippingConfig"/>
32+
<!-- delete category -->
33+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
34+
<!-- delete simple product -->
35+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
36+
</after>
37+
<!-- Go to Storefront as Guest and add product to cart -->
38+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="guestOpenProductPage">
39+
<argument name="product" value="$$createProduct$$"/>
40+
</actionGroup>
41+
<waitForPageLoad stepKey="waitForPageLoadToGetTheStorePageOpen"/>
42+
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addSimpleProductToCartFromStorefront">
43+
<argument name="productName" value="$createProduct.name$"/>
44+
</actionGroup>
45+
<!-- Proceed to Checkout -->
46+
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="guestProceedsToCheckout"/>
47+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappearPostClickingOnCheckout"/>
48+
<!-- verify shipping screen is opened -->
49+
<waitForElement selector="{{CheckoutShippingSection.isShippingStep}}" stepKey="shippingStepIsOpened"/>
50+
<!--Filling shipping information and click next-->
51+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping">
52+
<argument name="shippingMethod" value="Flat Rate"/>
53+
</actionGroup>
54+
<!--Review & Payments step of checkout is opened where Correct Billing address is verified-->
55+
<actionGroup ref="CheckShipToInformationInCheckoutActionGroup" stepKey="verifyShipToInformation">
56+
<argument name="customerVar" value="CustomerEntityOne" />
57+
<argument name="customerAddressVar" value="CustomerAddressSimple" />
58+
</actionGroup>
59+
<!-- Assert Shipping Method = "Flat Rate" -->
60+
<waitForText userInput="Flat Rate - Fixed" selector="{{CheckoutPaymentSection.orderSummaryShippingMethod}}" stepKey="assertShippingMethod"/>
61+
<!-- Reload Page and wait for page to get reload -->
62+
<reloadPage stepKey="refreshPageToVerifyAllInformationIsPresent"/>
63+
<waitForPageLoad stepKey="waitForPageToLoadProperlyToAssertShipToInformationDetails"/>
64+
<!-- Check that "Ship To" block contains correct information -->
65+
<actionGroup ref="GuestVerifiesTheShipToDetailsOnStorefrontCheckoutPaymentActionGroup" stepKey="assertingShipToInformationOnPaymentPage"/>
66+
<!-- Assert Shipping Method = "Flat Rate" -->
67+
<waitForText userInput="Flat Rate - Fixed" selector="{{CheckoutPaymentSection.orderSummaryShippingMethod}}" stepKey="assertShippingMethodAgain"/>
68+
<!-- click on Edit button next to "Ship To" Text -->
69+
<waitForElementVisible selector="{{CheckoutPaymentSection.editShipToAddress}}" stepKey="waitForEditButtonToBeVisible"/>
70+
<click selector="{{CheckoutPaymentSection.editShipToAddress}}" stepKey="clickOnEditButton"/>
71+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShippingSectionAgain">
72+
<argument name="customerVar" value="CustomerEntityOne"/>
73+
<argument name="customerAddressVar" value="CustomerAddressSimple"/>
74+
</actionGroup>
75+
<!-- Check that "Ship To" block contains correct information -->
76+
<actionGroup ref="GuestVerifiesTheShipToDetailsOnStorefrontCheckoutPaymentActionGroup" stepKey="againAssertingShipToInformationOnPaymentPage"/>
77+
<!-- Assert Shipping Method = "Free Shipping" -->
78+
<waitForText userInput="Free Shipping - Free" selector="{{CheckoutPaymentSection.orderSummaryShippingMethod}}" stepKey="assertFreeShippingMethod"/>
79+
<!-- click on Edit button next to "Shipping Method" Text -->
80+
<waitForElementVisible selector="{{CheckoutPaymentSection.editShippingMethod}}" stepKey="waitForEditButtonToVisible"/>
81+
<click selector="{{CheckoutPaymentSection.editShippingMethod}}" stepKey="clickOnEditShippingMethodButton"/>
82+
<!-- Assert that it has scrolled to Shipping Method text -->
83+
<scrollTo selector="{{CheckoutPaymentSection.shippingMethodTitle}}" stepKey="scrollToShippingMethodTitle"/>
84+
<waitForText selector="{{CheckoutPaymentSection.shippingMethodTitle}}" userInput="Shipping Methods" stepKey="assertShippingMethodTitle"/>
85+
</test>
86+
</tests>

app/code/Magento/CustomerGraphQl/Model/Customer/GetAttributesForm.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,6 @@ public function execute(string $formCode): ?array
4242
{
4343
$attributes = [];
4444
foreach ($this->entity->getAttributes($formCode) as $attribute) {
45-
// region_id and country_id returns large datasets that is also not related between each other and
46-
// not filterable. DirectoryGraphQl contains queries that allow to retrieve this information in a
47-
// meaningful way
48-
if ($attribute->getAttributeCode() === 'region_id' || $attribute->getAttributeCode() === 'country_id') {
49-
continue;
50-
}
5145
$attributes[] = ['entity_type' => $this->type, 'attribute_code' => $attribute->getAttributeCode()];
5246
}
5347
return $attributes;

app/code/Magento/EavGraphQl/Model/Output/GetAttributeData.php

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
<?php
2-
32
/**
43
* Copyright © Magento, Inc. All rights reserved.
54
* See COPYING.txt for license details.
65
*/
7-
86
declare(strict_types=1);
97

108
namespace Magento\EavGraphQl\Model\Output;
@@ -24,12 +22,19 @@ class GetAttributeData implements GetAttributeDataInterface
2422
*/
2523
private EnumLookup $enumLookup;
2624

25+
/**
26+
* @var array
27+
*/
28+
private array $skipOptionsForAttributeCodes;
29+
2730
/**
2831
* @param EnumLookup $enumLookup
32+
* @param array $skipOptionsForAttributeCodes
2933
*/
30-
public function __construct(EnumLookup $enumLookup)
34+
public function __construct(EnumLookup $enumLookup, array $skipOptionsForAttributeCodes = [])
3135
{
3236
$this->enumLookup = $enumLookup;
37+
$this->skipOptionsForAttributeCodes = $skipOptionsForAttributeCodes;
3338
}
3439

3540
/**
@@ -91,7 +96,7 @@ private function getFrontendInput(AttributeInterface $attribute): string
9196
*/
9297
private function getOptions(AttributeInterface $attribute): array
9398
{
94-
if (!$attribute->getOptions()) {
99+
if (!$attribute->getOptions() || $this->skipOptions($attribute)) {
95100
return [];
96101
}
97102
return array_filter(
@@ -133,4 +138,18 @@ private function isDefault(mixed $value, mixed $defaultValue): bool
133138

134139
return in_array($value, explode(',', $defaultValue));
135140
}
141+
142+
/**
143+
* Skip attributes options for region_id and country_id
144+
*
145+
* Attributes region_id and country_id returns large datasets that is also not related between each other and
146+
* not filterable. DirectoryGraphQl contains queries that allow to retrieve this information in a meaningful way
147+
*
148+
* @param AttributeInterface $attribute
149+
* @return bool
150+
*/
151+
private function skipOptions(AttributeInterface $attribute): bool
152+
{
153+
return in_array($attribute->getAttributeCode(), $this->skipOptionsForAttributeCodes);
154+
}
136155
}

app/code/Magento/EavGraphQl/etc/di.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,12 @@
99
<type name="Magento\Eav\Model\Entity\Attribute">
1010
<plugin name="entityAttributeChangePlugin" type="Magento\EavGraphQl\Plugin\Eav\AttributePlugin" />
1111
</type>
12+
<type name="Magento\EavGraphQl\Model\Output\GetAttributeData">
13+
<arguments>
14+
<argument name="skipOptionsForAttributeCodes" xsi:type="array">
15+
<item name="region_id" xsi:type="string">region_id</item>
16+
<item name="country_id" xsi:type="string">country_id</item>
17+
</argument>
18+
</arguments>
19+
</type>
1220
</config>

0 commit comments

Comments
 (0)