Skip to content

Commit 2d38ea4

Browse files
committed
Merge remote-tracking branch 'origin/2.2-develop' into MC-17754
2 parents 7adc109 + 9399b3d commit 2d38ea4

File tree

47 files changed

+1112
-149
lines changed

Some content is hidden

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

47 files changed

+1112
-149
lines changed

app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminAccountActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="AdminAccountSetInterfaceLocaleActionGroup">
1212
<arguments>
13-
<argument name="localeName" type="string"/>
13+
<argument name="localeName" defaultValue="en_US" type="string"/>
1414
</arguments>
1515
<!-- Navigate to admin System Account Page-->
1616
<amOnPage url="{{AdminSystemAccountPage.url}}" stepKey="openAdminSystemAccountPage"/>

app/code/Magento/Braintree/view/frontend/requirejs-config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
var config = {
77
map: {
88
'*': {
9-
braintreeClient: 'https://js.braintreegateway.com/web/3.44.1/js/client.min.js',
10-
braintreeHostedFields: 'https://js.braintreegateway.com/web/3.44.1/js/hosted-fields.min.js',
11-
braintreePayPal: 'https://js.braintreegateway.com/web/3.44.1/js/paypal-checkout.min.js',
12-
braintree3DSecure: 'https://js.braintreegateway.com/web/3.44.1/js/three-d-secure.min.js',
13-
braintreeDataCollector: 'https://js.braintreegateway.com/web/3.44.1/js/data-collector.min.js'
9+
braintreeClient: 'https://js.braintreegateway.com/web/3.48.0/js/client.min.js',
10+
braintreeHostedFields: 'https://js.braintreegateway.com/web/3.48.0/js/hosted-fields.min.js',
11+
braintreePayPal: 'https://js.braintreegateway.com/web/3.48.0/js/paypal-checkout.min.js',
12+
braintree3DSecure: 'https://js.braintreegateway.com/web/3.48.0/js/three-d-secure.min.js',
13+
braintreeDataCollector: 'https://js.braintreegateway.com/web/3.48.0/js/data-collector.min.js'
1414
}
1515
},
1616
paths: {

app/code/Magento/Braintree/view/frontend/web/js/view/payment/3d-secure.js

Lines changed: 42 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ define([
4141
braintreeAdapter.getApiClient()
4242
.then(function (clientInstance) {
4343
return braintree3DSecure.create({
44+
version: 2, // Will use 3DS 2 whenever possible
4445
client: clientInstance
4546
});
4647
})
@@ -49,6 +50,7 @@ define([
4950
promise.resolve(self.threeDSecureInstance);
5051
})
5152
.catch(function (err) {
53+
fullScreenLoader.stopLoader();
5254
promise.reject(err);
5355
});
5456

@@ -84,30 +86,55 @@ define([
8486
var self = this,
8587
totalAmount = quote.totals()['base_grand_total'],
8688
billingAddress = quote.billingAddress(),
89+
shippingAddress = quote.shippingAddress(),
8790
options = {
8891
amount: totalAmount,
8992
nonce: context.paymentPayload.nonce,
90-
91-
/**
92-
* Adds iframe to page
93-
* @param {Object} err
94-
* @param {Object} iframe
95-
*/
96-
addFrame: function (err, iframe) {
97-
self.createModal($(iframe));
98-
fullScreenLoader.stopLoader();
99-
self.modal.openModal();
93+
billingAddress: {
94+
givenName: billingAddress.firstname,
95+
surname: billingAddress.lastname,
96+
phoneNumber: billingAddress.telephone,
97+
streetAddress: billingAddress.street[0],
98+
extendedAddress: billingAddress.street[1],
99+
locality: billingAddress.city,
100+
region: billingAddress.regionCode,
101+
postalCode: billingAddress.postcode,
102+
countryCodeAlpha2: billingAddress.countryId
100103
},
101104

102105
/**
103-
* Removes iframe from page
106+
* Will be called after receiving ThreeDSecure response, before completing the flow.
107+
*
108+
* @param {Object} data - ThreeDSecure data to consume before continuing
109+
* @param {Function} next - callback to continue flow
104110
*/
105-
removeFrame: function () {
106-
self.modal.closeModal();
111+
onLookupComplete: function (data, next) {
112+
next();
113+
}
114+
};
115+
116+
if (context.paymentPayload.details) {
117+
options.bin = context.paymentPayload.details.bin;
118+
}
119+
120+
if (shippingAddress) {
121+
options.additionalInformation = {
122+
shippingGivenName: shippingAddress.firstname,
123+
shippingSurname: shippingAddress.lastname,
124+
shippingPhone: shippingAddress.telephone,
125+
shippingAddress: {
126+
streetAddress: shippingAddress.street[0],
127+
extendedAddress: shippingAddress.street[1],
128+
locality: shippingAddress.city,
129+
region: shippingAddress.regionCode,
130+
postalCode: shippingAddress.postcode,
131+
countryCodeAlpha2: shippingAddress.countryId
107132
}
108133
};
134+
}
109135

110136
if (!this.isAmountAvailable(totalAmount) || !this.isCountryAvailable(billingAddress.countryId)) {
137+
self.state = $.Deferred();
111138
self.state.resolve();
112139

113140
return self.state.promise();
@@ -118,6 +145,7 @@ define([
118145
.then(function () {
119146
self.threeDSecureInstance.verifyCard(options, function (err, payload) {
120147
if (err) {
148+
fullScreenLoader.stopLoader();
121149
self.state.reject(err.message);
122150

123151
return;
@@ -129,6 +157,7 @@ define([
129157
context.paymentPayload.nonce = payload.nonce;
130158
self.state.resolve();
131159
} else {
160+
fullScreenLoader.stopLoader();
132161
self.state.reject($t('Please try again with another form of payment.'));
133162
}
134163
});
@@ -141,42 +170,6 @@ define([
141170
return self.state.promise();
142171
},
143172

144-
/**
145-
* Creates modal window
146-
*
147-
* @param {Object} $context
148-
* @private
149-
*/
150-
createModal: function ($context) {
151-
var self = this,
152-
options = {
153-
clickableOverlay: false,
154-
buttons: [],
155-
modalCloseBtnHandler: self.cancelFlow.bind(self),
156-
keyEventHandlers: {
157-
escapeKey: self.cancelFlow.bind(self)
158-
}
159-
};
160-
161-
// adjust iframe styles
162-
$context.attr('width', '100%');
163-
self.modal = Modal(options, $context);
164-
},
165-
166-
/**
167-
* Cancels 3D Secure flow
168-
*
169-
* @private
170-
*/
171-
cancelFlow: function () {
172-
var self = this;
173-
174-
self.threeDSecureInstance.cancelVerifyCard(function () {
175-
self.modal.closeModal();
176-
self.state.reject();
177-
});
178-
},
179-
180173
/**
181174
* Checks minimal amount for 3D Secure activation
182175
*

app/code/Magento/Bundle/Test/Mftf/Section/StorefrontCategoryProductSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontCategoryProductSection">
1212
<element name="priceToByProductId" type="text" selector="div[data-product-id='{{id}}'] .price-to" parameterized="true"/>
1313
<element name="priceFromByProductId" type="text" selector="div[data-product-id='{{id}}'] .price-from" parameterized="true"/>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
<!-- Assign Image role in admin product page -->
12+
<actionGroup name="AdminAssignImageRolesActionGroup">
13+
<arguments>
14+
<argument name="image"/>
15+
</arguments>
16+
<conditionalClick selector="{{AdminProductImagesSection.productImagesToggleState('closed')}}" dependentSelector="{{AdminProductImagesSection.productImagesToggleState('open')}}" visible="false" stepKey="clickSectionImage"/>
17+
<click selector="{{AdminProductImagesSection.imageFile(image.fileName)}}" stepKey="clickProductImage"/>
18+
<waitForElementVisible selector="{{AdminProductImagesSection.altText}}" stepKey="seeAltTextSection"/>
19+
<checkOption selector="{{AdminProductImagesSection.roleImage('Base')}}" stepKey="checkRoleBase"/>
20+
<checkOption selector="{{AdminProductImagesSection.roleImage('Small')}}" stepKey="checkRoleSmall"/>
21+
<checkOption selector="{{AdminProductImagesSection.roleImage('Thumbnail')}}" stepKey="checkRoleThumbnail"/>
22+
<checkOption selector="{{AdminProductImagesSection.roleImage('Swatch')}}" stepKey="checkRoleSwatch"/>
23+
<click selector="{{AdminSlideOutDialogSection.closeButton}}" stepKey="clickCloseButton"/>
24+
</actionGroup>
25+
</actionGroups>

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

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<arguments>
3636
<argument name="product" defaultValue="_defaultProduct"/>
3737
</arguments>
38+
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
3839
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/>
3940
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductSku"/>
4041
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/>
@@ -283,4 +284,50 @@
283284
</arguments>
284285
<amOnPage url="{{AdminProductEditPage.url(productId)}}" stepKey="goToProduct"/>
285286
</actionGroup>
287+
288+
<!-- Change any product data product description You should be on product page -->
289+
<actionGroup name="AdminChangeProductDescriptionActionGroup">
290+
<arguments>
291+
<argument name="description" type="string"/>
292+
</arguments>
293+
<conditionalClick selector="{{AdminProductContentSection.sectionHeader}}" dependentSelector="{{AdminProductContentSection.sectionHeader}}" visible="true" stepKey="openDescriptionDropDown"/>
294+
<fillField selector="{{AdminProductContentSection.descriptionTextArea}}" userInput="{{description}}" stepKey="fillLongDescription"/>
295+
</actionGroup>
296+
<!-- Change any product data product short description You should be on product page -->
297+
<actionGroup name="AdminChangeProductShortDescriptionActionGroup" extends="AdminChangeProductDescriptionActionGroup">
298+
<remove keyForRemoval="fillLongDescription"/>
299+
<fillField selector="{{AdminProductContentSection.shortDescriptionTextArea}}" userInput="{{description}}" stepKey="fillShortDescription"/>
300+
</actionGroup>
301+
302+
<!-- This action group simply navigates to the product catalog page -->
303+
<actionGroup name="AdminGoToProductCatalogPage">
304+
<comment userInput="actionGroup:GoToProductCatalogPage" stepKey="actionGroupComment"/>
305+
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPage"/>
306+
<waitForPageLoad stepKey="waitForPageToLoad"/>
307+
</actionGroup>
308+
309+
<!-- You are on product Edit Page -->
310+
<!-- Assert checkbox available for website in Product In Websites -->
311+
<actionGroup name="AdminAssertWebsiteIsAvailableInProductWebsites">
312+
<arguments>
313+
<argument name="website" type="string"/>
314+
</arguments>
315+
<scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToProductInWebsitesSection"/>
316+
<conditionalClick selector="{{ProductInWebsitesSection.sectionHeader}}" dependentSelector="{{ProductInWebsitesSection.sectionHeaderOpened}}" visible="false" stepKey="expandProductWebsitesSection"/>
317+
<seeElement selector="{{ProductInWebsitesSection.website(website)}}" stepKey="seeCheckboxForWebsite"/>
318+
</actionGroup>
319+
320+
<!-- You are on product Edit Page -->
321+
<!-- Assert checkbox not available for website in Product In Websites -->
322+
<actionGroup name="AdminAssertWebsiteIsNotAvailableInProductWebsites" extends="AdminAssertWebsiteIsAvailableInProductWebsites">
323+
<remove keyForRemoval="seeCheckboxForWebsite"/>
324+
<dontSeeElement selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="dontSeeCheckboxForWebsite"/>
325+
</actionGroup>
326+
327+
<!-- You are on product Edit Page -->
328+
<!-- Assert checkbox Is checked for website in Product In Websites -->
329+
<actionGroup name="AdminAssertProductIsAssignedToWebsite" extends="AdminAssertWebsiteIsAvailableInProductWebsites">
330+
<remove keyForRemoval="seeCheckboxForWebsite"/>
331+
<seeCheckboxIsChecked selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="seeCustomWebsiteIsChecked"/>
332+
</actionGroup>
286333
</actionGroups>

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,15 @@
9191
<seeInTitle userInput="{{subCategory.name}}" stepKey="assertCategoryNameInTitle"/>
9292
<see userInput="{{subCategory.name}}" selector="{{StorefrontCategoryMainSection.categoryTitle}}" stepKey="assertCategoryName"/>
9393
</actionGroup>
94+
<!-- Assert product store view image in storefront category page -->
95+
<actionGroup name="AssertStorefrontActiveImageCategoryActionGroup">
96+
<arguments>
97+
<argument name="category"/>
98+
<argument name="product"/>
99+
<argument name="image" type="string"/>
100+
</arguments>
101+
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName(category.name)}}" stepKey="openCategoryPage"/>
102+
<waitForPageLoad time="30" stepKey="waitForCategoryPage"/>
103+
<seeElement selector="{{StorefrontCategoryProductSection.ProductImageByNameAndSrc(product.name, image)}}" stepKey="seeImage"/>
104+
</actionGroup>
94105
</actionGroups>

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,11 @@
3434
<seeElement selector="{{StorefrontProductMediaSection.imageFile(image)}}" stepKey="seeImage"/>
3535
<see userInput="{{price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeProductPrice"/>
3636
</actionGroup>
37+
<!-- Assert image Store View in storefront product page -->
38+
<actionGroup name="AssertStorefrontActiveImageProductActionGroup">
39+
<arguments>
40+
<argument name="image" type="string"/>
41+
</arguments>
42+
<seeElement selector="{{StorefrontProductMediaSection.productImageActive(image)}}" stepKey="seeActiveImage"/>
43+
</actionGroup>
3744
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,4 +324,13 @@
324324
<data key="weight">1</data>
325325
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
326326
</entity>
327+
<entity name="Magento3" type="image">
328+
<data key="title" unique="suffix">Magento3</data>
329+
<data key="price">1.00</data>
330+
<data key="file_type">Upload File</data>
331+
<data key="shareable">Yes</data>
332+
<data key="file">magento3.jpg</data>
333+
<data key="filename">magento3</data>
334+
<data key="file_extension">jpg</data>
335+
</entity>
327336
</entities>

app/code/Magento/Catalog/Test/Mftf/Page/AdminProductCreatePage.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
1111
<page name="AdminProductCreatePage" url="catalog/product/new/set/{{set}}/type/{{type}}/" area="admin" module="Magento_Catalog" parameterized="true">
1212
<section name="AdminProductFormSection"/>
1313
<section name="AdminProductFormActionSection"/>
@@ -18,6 +18,7 @@
1818
<section name="AdminProductCustomizableOptionsSection" />
1919
<section name="AdminAddProductsToOptionPanelSection" />
2020
<section name="AdminProductFormAdvancedPricingSection"/>
21+
<section name="AdminProductContentSection"/>
2122
<section name="AdminProductCustomizableOptionsImportModalSection"/>
2223
</page>
2324
</pages>

0 commit comments

Comments
 (0)