Skip to content

Commit 6b7755c

Browse files
author
Mariana Lashch
committed
Merge branch '2.3-develop' of github.com:magento/magento2ce into port-96379
2 parents 3e20d5e + 0502433 commit 6b7755c

File tree

44 files changed

+2153
-156
lines changed

Some content is hidden

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

44 files changed

+2153
-156
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminSlideOutDialogSection">
12+
<element name="closeButton" type="button" selector=".modal-slide._show [data-role='closeBtn']" timeout="30"/>
13+
<element name="cancelButton" type="button" selector="//*[contains(@class, 'modal-slide') and contains(@class, '_show')]//*[contains(@class, 'page-actions')]//button[normalize-space(.)='Cancel']" timeout="30"/>
14+
<element name="doneButton" type="button" selector="//*[contains(@class, 'modal-slide') and contains(@class, '_show')]//*[contains(@class, 'page-actions')]//button[normalize-space(.)='Done']" timeout="30"/>
15+
<element name="saveButton" type="button" selector="//*[contains(@class, 'modal-slide') and contains(@class, '_show')]//*[contains(@class, 'page-actions')]//button[normalize-space(.)='Save']" timeout="30"/>
16+
</section>
17+
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontMessagesSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
<section name="StorefrontMessagesSection">
1212
<element name="success" type="text" selector="div.message-success.success.message"/>
1313
<element name="error" type="text" selector="div.message-error.error.message"/>
14+
<element name="noticeMessage" type="text" selector="div.message-notice"/>
1415
</section>
1516
</sections>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@
151151
<!--Create new order-->
152152
<actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="CreateNewOrder">
153153
<argument name="customer" value="Simple_US_Customer"/>
154+
<argument name="storeView" value="customStoreView"/>
154155
</actionGroup>
155-
<click selector="{{OrdersGridSection.website('secondStoreView')}}" stepKey="ClickToSelectStore"/>
156-
<waitForPageLoad stepKey="waitForPageOpened"/>
156+
157157
<click selector="{{OrdersGridSection.addProducts}}" stepKey="clickToAddProduct"/>
158158
<waitForPageLoad stepKey="waitForProductsOpened"/>
159159
<!--TEST CASE #1-->

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
<section name="StorefrontCheckoutPaymentMethodSection">
1212
<element name="billingAddress" type="text" selector=".checkout-billing-address"/>
1313
<element name="checkPaymentMethodByName" type="radio" selector="//div[@id='checkout-payment-method-load']//div[@class='payment-method']//label//span[contains(., '{{methodName}}')]/../..//input" parameterized="true"/>
14+
<element name="billingAddressSameAsShipping" type="checkbox" selector=".payment-method._active [name='billing-address-same-as-shipping']"/>
1415
</section>
1516
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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="StorefrontShoppingCartCheckCustomerDefaultShippingAddressForVirtualQuoteTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="Estimator in Shopping cart must be pre-filled by Customer default shipping address for virtual quote"/>
15+
<title value="Estimator in Shopping cart must be pre-filled by Customer default shipping address for virtual quote"/>
16+
<description value="Estimator in Shopping cart must be pre-filled by Customer default shipping address for virtual quote"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MAGETWO-46795"/>
19+
<group value="checkout"/>
20+
</annotations>
21+
<before>
22+
<createData entity="_defaultCategory" stepKey="createCategory"/>
23+
<createData entity="defaultVirtualProduct" stepKey="createVirtualProduct">
24+
<requiredEntity createDataKey="createCategory"/>
25+
</createData>
26+
<createData entity="Simple_US_Customer_CA" stepKey="createCustomer">
27+
<field key="group_id">1</field>
28+
</createData>
29+
</before>
30+
<after>
31+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
32+
<deleteData createDataKey="createVirtualProduct" stepKey="deleteVirtualProduct"/>
33+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
34+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
35+
</after>
36+
<!-- Steps -->
37+
<!-- Step 1: Go to Storefront as Customer -->
38+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin">
39+
<argument name="Customer" value="$$createCustomer$$" />
40+
</actionGroup>
41+
<!-- Step 2: Add virtual product to cart -->
42+
<amOnPage url="{{StorefrontProductPage.url($$createVirtualProduct.custom_attributes[url_key]$)}}" stepKey="amOnPage"/>
43+
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart">
44+
<argument name="product" value="$$createVirtualProduct$$"/>
45+
<argument name="productCount" value="1"/>
46+
</actionGroup>
47+
<!-- Step 3: Go to Shopping Cart -->
48+
<actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingcart"/>
49+
<!-- Step 4: Open Estimate Tax section -->
50+
<click selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" stepKey="openEstimateTaxSection"/>
51+
<see selector="{{CheckoutCartSummarySection.country}}" userInput="{{US_Address_CA.country_id}}" stepKey="checkCountry"/>
52+
<see selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{US_Address_CA.state}}" stepKey="checkState"/>
53+
<scrollTo selector="{{CheckoutCartSummarySection.postcode}}" stepKey="scrollToPostCodeField"/>
54+
<grabValueFrom selector="{{CheckoutCartSummarySection.postcode}}" stepKey="grabTextPostCode"/>
55+
<assertEquals message="Customer postcode is invalid" stepKey="checkCustomerPostcode">
56+
<expectedResult type="string">{{US_Address_CA.postcode}}</expectedResult>
57+
<actualResult type="variable">grabTextPostCode</actualResult>
58+
</assertEquals>
59+
</test>
60+
</tests>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="DefaultWebUrlOptionsConfig" type="web_url_use_store">
12+
<requiredEntity type="url_use_store_value">DefaultConfigWebUrlOptions</requiredEntity>
13+
</entity>
14+
<entity name="DefaultConfigWebUrlOptions" type="url_use_store_value">
15+
<data key="value">0</data>
16+
</entity>
17+
18+
<entity name="EnableWebUrlOptionsConfig" type="web_url_use_store">
19+
<requiredEntity type="url_use_store_value">WebUrlOptionsYes</requiredEntity>
20+
</entity>
21+
<entity name="WebUrlOptionsYes" type="url_use_store_value">
22+
<data key="value">1</data>
23+
</entity>
24+
</entities>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
10+
<operation name="WebUrlOptionsConfig" dataType="web_url_use_store" type="create" auth="adminFormKey" url="/admin/system_config/save/section/web/"
11+
method="POST" successRegex="/messages-message-success/" returnRegex="">
12+
<object key="groups" dataType="web_url_use_store">
13+
<object key="url" dataType="web_url_use_store">
14+
<object key="fields" dataType="web_url_use_store">
15+
<object key="use_store" dataType="url_use_store_value">
16+
<field key="value">string</field>
17+
</object>
18+
</object>
19+
</object>
20+
</object>
21+
</operation>
22+
</operations>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="CustomerAccountSharingDefault" type="customer_account_sharing_config">
12+
<requiredEntity type="account_share_scope_value">CustomerAccountSharingPerWebsite</requiredEntity>
13+
</entity>
14+
<entity name="CustomerAccountSharingPerWebsite" type="account_share_scope_value">
15+
<data key="value">1</data>
16+
</entity>
17+
18+
<entity name="CustomerAccountSharingGlobal" type="customer_account_sharing_config">
19+
<requiredEntity type="account_share_scope_value">GlobalCustomerAccountSharing</requiredEntity>
20+
</entity>
21+
<entity name="GlobalCustomerAccountSharing" type="account_share_scope_value">
22+
<data key="value">0</data>
23+
</entity>
24+
</entities>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
9+
<operation name="CustomerAccountShareConfig" dataType="customer_account_sharing_config" type="create" auth="adminFormKey" url="/admin/system_config/save/section/customer/"
10+
successRegex="/messages-message-success/" returnRegex="" method="POST">
11+
<object key="groups" dataType="customer_account_sharing_config">
12+
<object key="account_share" dataType="customer_account_sharing_config">
13+
<object key="fields" dataType="customer_account_sharing_config">
14+
<object key="scope" dataType="account_share_scope_value">
15+
<field key="value">string</field>
16+
</object>
17+
</object>
18+
</object>
19+
</object>
20+
</operation>
21+
</operations>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\CustomerGraphQl\Model\Customer\Address;
9+
10+
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
11+
12+
/**
13+
* Customer address create data validator
14+
*/
15+
class CustomerAddressCreateDataValidator
16+
{
17+
/**
18+
* @var GetAllowedAddressAttributes
19+
*/
20+
private $getAllowedAddressAttributes;
21+
22+
/**
23+
* @param GetAllowedAddressAttributes $getAllowedAddressAttributes
24+
*/
25+
public function __construct(GetAllowedAddressAttributes $getAllowedAddressAttributes)
26+
{
27+
$this->getAllowedAddressAttributes = $getAllowedAddressAttributes;
28+
}
29+
30+
/**
31+
* Validate customer address create data
32+
*
33+
* @param array $addressData
34+
* @return void
35+
* @throws GraphQlInputException
36+
*/
37+
public function validate(array $addressData): void
38+
{
39+
$attributes = $this->getAllowedAddressAttributes->execute();
40+
$errorInput = [];
41+
42+
foreach ($attributes as $attributeName => $attributeInfo) {
43+
if ($attributeInfo->getIsRequired()
44+
&& (!isset($addressData[$attributeName]) || empty($addressData[$attributeName]))
45+
) {
46+
$errorInput[] = $attributeName;
47+
}
48+
}
49+
50+
if ($errorInput) {
51+
throw new GraphQlInputException(
52+
__('Required parameters are missing: %1', [implode(', ', $errorInput)])
53+
);
54+
}
55+
}
56+
}

0 commit comments

Comments
 (0)