Skip to content

Commit 311a015

Browse files
Merge remote-tracking branch 'remotes/github/2.3-develop' into MAGETWO-72172-v2
2 parents e3b4a38 + db0dce6 commit 311a015

File tree

41 files changed

+1562
-310
lines changed

Some content is hidden

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

41 files changed

+1562
-310
lines changed

app/code/Magento/Backend/view/adminhtml/requirejs-config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
var config = {
77
map: {
88
'*': {
9-
'mediaUploader': 'Magento_Backend/js/media-uploader'
9+
'mediaUploader': 'Magento_Backend/js/media-uploader',
10+
'mage/translate': 'Magento_Backend/js/translate'
1011
}
1112
}
1213
};
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
/* eslint-disable strict */
7+
(function (factory) {
8+
if (typeof define === 'function' && define.amd) {
9+
define([
10+
'jquery',
11+
'mage/mage'
12+
], factory);
13+
} else {
14+
factory(jQuery);
15+
}
16+
}(function ($) {
17+
$.extend(true, $, {
18+
mage: {
19+
translate: (function () {
20+
/**
21+
* Key-value translations storage
22+
* @type {Object}
23+
* @private
24+
*/
25+
var _data = {};
26+
27+
/**
28+
* Add new translation (two string parameters) or several translations (object)
29+
*/
30+
this.add = function () {
31+
if (arguments.length > 1) {
32+
_data[arguments[0]] = arguments[1];
33+
} else if (typeof arguments[0] === 'object') {
34+
$.extend(_data, arguments[0]);
35+
}
36+
};
37+
38+
/**
39+
* Make a translation with parsing (to handle case when _data represents tuple)
40+
* @param {String} text
41+
* @return {String}
42+
*/
43+
this.translate = function (text) {
44+
return _data[text] ? _data[text] : text;
45+
};
46+
47+
return this;
48+
}())
49+
}
50+
});
51+
$.mage.__ = $.proxy($.mage.translate.translate, $.mage.translate);
52+
53+
return $.mage.__;
54+
}));

app/code/Magento/CatalogGraphQl/Model/Resolver/Product/PriceRange.php

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,16 @@ public function resolve(
6262
$product = $value['model'];
6363
$product->unsetData('minimal_price');
6464

65-
return [
66-
'minimum_price' => $this->getMinimumProductPrice($product, $store),
67-
'maximum_price' => $this->getMaximumProductPrice($product, $store)
68-
];
65+
$requestedFields = $info->getFieldSelection(10);
66+
$returnArray = [];
67+
68+
if (isset($requestedFields['minimum_price'])) {
69+
$returnArray['minimum_price'] = $this->getMinimumProductPrice($product, $store);
70+
}
71+
if (isset($requestedFields['maximum_price'])) {
72+
$returnArray['maximum_price'] = $this->getMaximumProductPrice($product, $store);
73+
}
74+
return $returnArray;
6975
}
7076

7177
/**
@@ -80,8 +86,9 @@ private function getMinimumProductPrice(SaleableInterface $product, StoreInterfa
8086
$priceProvider = $this->priceProviderPool->getProviderByProductType($product->getTypeId());
8187
$regularPrice = $priceProvider->getMinimalRegularPrice($product)->getValue();
8288
$finalPrice = $priceProvider->getMinimalFinalPrice($product)->getValue();
83-
84-
return $this->formatPrice($regularPrice, $finalPrice, $store);
89+
$minPriceArray = $this->formatPrice($regularPrice, $finalPrice, $store);
90+
$minPriceArray['model'] = $product;
91+
return $minPriceArray;
8592
}
8693

8794
/**
@@ -96,8 +103,9 @@ private function getMaximumProductPrice(SaleableInterface $product, StoreInterfa
96103
$priceProvider = $this->priceProviderPool->getProviderByProductType($product->getTypeId());
97104
$regularPrice = $priceProvider->getMaximalRegularPrice($product)->getValue();
98105
$finalPrice = $priceProvider->getMaximalFinalPrice($product)->getValue();
99-
100-
return $this->formatPrice($regularPrice, $finalPrice, $store);
106+
$maxPriceArray = $this->formatPrice($regularPrice, $finalPrice, $store);
107+
$maxPriceArray['model'] = $product;
108+
return $maxPriceArray;
101109
}
102110

103111
/**

app/code/Magento/CatalogGraphQl/etc/schema.graphqls

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ type Price @doc(description: "Price is deprecated, replaced by ProductPrice. The
2121
adjustments: [PriceAdjustment] @deprecated(reason: "Price is deprecated, use ProductPrice.") @doc(description: "An array that provides information about tax, weee, or weee_tax adjustments.")
2222
}
2323

24-
type PriceAdjustment @doc(description: "The PricedAdjustment object defines the amount of money to apply as an adjustment, the type of adjustment to apply, and whether the item is included or excluded from the adjustment.") {
24+
type PriceAdjustment @doc(description: "PriceAdjustment is deprecated. Taxes will be included or excluded in the price. The PricedAdjustment object defines the amount of money to apply as an adjustment, the type of adjustment to apply, and whether the item is included or excluded from the adjustment.") {
2525
amount: Money @doc(description: "The amount of the price adjustment and its currency code.")
26-
code: PriceAdjustmentCodesEnum @doc(description: "Indicates whether the adjustment involves tax, weee, or weee_tax.")
27-
description: PriceAdjustmentDescriptionEnum @doc(description: "Indicates whether the entity described by the code attribute is included or excluded from the adjustment.")
26+
code: PriceAdjustmentCodesEnum @deprecated(reason: "PriceAdjustment is deprecated.") @doc(description: "Indicates whether the adjustment involves tax, weee, or weee_tax.")
27+
description: PriceAdjustmentDescriptionEnum @deprecated(reason: "PriceAdjustment is deprecated.") @doc(description: "Indicates whether the entity described by the code attribute is included or excluded from the adjustment.")
2828
}
2929

30-
enum PriceAdjustmentCodesEnum @doc(description: "Note: This enumeration contains values defined in modules other than the Catalog module.") {
30+
enum PriceAdjustmentCodesEnum @doc(description: "PriceAdjustment.code is deprecated. This enumeration contains values defined in modules other than the Catalog module.") {
3131
}
3232

33-
enum PriceAdjustmentDescriptionEnum @doc(description: "This enumeration states whether a price adjustment is included or excluded.") {
33+
enum PriceAdjustmentDescriptionEnum @doc(description: "PriceAdjustmentDescriptionEnum is deprecated. This enumeration states whether a price adjustment is included or excluded.") {
3434
INCLUDED
3535
EXCLUDED
3636
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="AssertStorefrontCheckoutSuccessActionGroup">
12+
<annotations>
13+
<description>Verifies if the order is placed successfully on the 'one page checkout' page.</description>
14+
</annotations>
15+
<waitForElement selector="{{CheckoutSuccessMainSection.successTitle}}" stepKey="waitForLoadSuccessPageTitle"/>
16+
<waitForElement selector="{{CheckoutSuccessMainSection.success}}" time="30" stepKey="waitForLoadSuccessPage"/>
17+
<seeElement selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="seeOrderLink"/>
18+
</actionGroup>
19+
</actionGroups>
20+

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<element name="cartItemsAreaActive" type="textarea" selector="div.block.items-in-cart.active" timeout="30"/>
3232
<element name="checkMoneyOrderPayment" type="radio" selector="input#checkmo.radio" timeout="30"/>
3333
<element name="placeOrder" type="button" selector=".payment-method._active button.action.primary.checkout" timeout="30"/>
34-
<element name="paymentSectionTitle" type="text" selector="//*[@id='checkout-payment-method-load']//div[text()='Payment Method']" />
34+
<element name="paymentSectionTitle" type="text" selector="//*[@id='checkout-payment-method-load']//div[@data-role='title']" />
3535
<element name="orderSummarySubtotal" type="text" selector="//tr[@class='totals sub']//span[@class='price']" />
3636
<element name="orderSummaryShippingTotal" type="text" selector="//tr[@class='totals shipping excl']//span[@class='price']" />
3737
<element name="orderSummaryShippingMethod" type="text" selector="//tr[@class='totals shipping excl']//span[@class='value']" />
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminAddImageToCMSBlockContent">
11+
<arguments>
12+
<argument name="image" type="entity" defaultValue="MagentoLogo"/>
13+
</arguments>
14+
<click selector="{{TinyMCESection.InsertImage}}" stepKey="clickAddImageButton"/>
15+
<waitForElementVisible selector="{{MediaGallerySection.Browse}}" stepKey="waitForBrowseImage"/>
16+
<click selector="{{MediaGallerySection.Browse}}" stepKey="clickBrowseImage"/>
17+
<waitForElementVisible selector="{{MediaGallerySection.StorageRootArrow}}" stepKey="waitForAttacheFiles"/>
18+
<waitForLoadingMaskToDisappear stepKey="waitForStorageRootLoadingMaskDisappear"/>
19+
<click selector="{{MediaGallerySection.StorageRootArrow}}" stepKey="clickRoot"/>
20+
<waitForPageLoad stepKey="waitForPageLoad"/>
21+
<attachFile selector="{{MediaGallerySection.BrowseUploadImage}}" userInput="{{image.file}}" stepKey="attachLogo"/>
22+
<waitForElementVisible selector="{{MediaGallerySection.InsertFile}}" stepKey="waitForAddSelected"/>
23+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskDisappear"/>
24+
<click selector="{{MediaGallerySection.InsertFile}}" stepKey="clickAddSelected"/>
25+
<waitForElementVisible selector="{{MediaGallerySection.OkBtn}}" stepKey="waitForOkButton"/>
26+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear2"/>
27+
<click selector="{{MediaGallerySection.OkBtn}}" stepKey="clickOk"/>
28+
</actionGroup>
29+
</actionGroups>

app/code/Magento/Cms/Test/Mftf/Section/CmsNewBlockBlockActionsSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
</section>
2525
<section name="BlockContentSection">
2626
<element name="TextArea" type="input" selector="#cms_block_form_content"/>
27+
<element name="image" type="file" selector="#tinymce img"/>
28+
<element name="contentIframe" type="iframe" selector="cms_block_form_content_ifr"/>
2729
</section>
2830
<section name="CmsBlockBlockActionSection">
2931
<element name="deleteBlock" type="button" selector="#delete" timeout="30"/>
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminMediaGalleryPopupUploadImagesWithoutErrorTest">
11+
<annotations>
12+
<features value="Cms"/>
13+
<stories value="Spinner is Always Displayed on Media Gallery popup"/>
14+
<title value="Media Gallery popup upload images without error"/>
15+
<description value="Media Gallery popup upload images without error"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="MC-18962"/>
18+
<useCaseId value="MC-18709"/>
19+
<group value="Cms"/>
20+
</annotations>
21+
<before>
22+
<!--Enable WYSIWYG options-->
23+
<comment userInput="Enable WYSIWYG options" stepKey="commentEnableWYSIWYG"/>
24+
<magentoCLI command="config:set cms/wysiwyg/enabled enabled" stepKey="enableWYSIWYGEditor"/>
25+
<magentoCLI command="config:set cms/wysiwyg/editor 'TinyMCE 4'" stepKey="setValueWYSIWYGEditor"/>
26+
<!--Create block-->
27+
<comment userInput="Create block" stepKey="commentCreateBlock"/>
28+
<createData entity="Sales25offBlock" stepKey="createBlock"/>
29+
<actionGroup ref="LoginActionGroup" stepKey="login"/>
30+
</before>
31+
<after>
32+
<!--Disable WYSIWYG options-->
33+
<comment userInput="Disable WYSIWYG options" stepKey="commentDisableWYSIWYG"/>
34+
<magentoCLI command="config:set cms/wysiwyg/enabled disabled" stepKey="disableWYSIWYG"/>
35+
<deleteData createDataKey="createBlock" stepKey="deleteBlock" />
36+
<actionGroup ref="logout" stepKey="logout"/>
37+
</after>
38+
<!--Open created block page and add image-->
39+
<comment userInput="Open create block page and add image" stepKey="commentOpenBlockPage"/>
40+
<actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage1">
41+
<argument name="CMSBlockPage" value="$$createBlock$$"/>
42+
</actionGroup>
43+
<actionGroup ref="AdminAddImageToCMSBlockContent" stepKey="addImage">
44+
<argument name="image" value="TestImageNew"/>
45+
</actionGroup>
46+
<click selector="{{BlockWYSIWYGSection.ShowHideBtn}}" stepKey="clickShowHideBtnFirstTime"/>
47+
<click selector="{{BlockWYSIWYGSection.ShowHideBtn}}" stepKey="clickShowHideBtnSecondTime"/>
48+
<waitForPageLoad stepKey="waitForPageLoad"/>
49+
<!--Switch to content frame and click on image-->
50+
<comment userInput="Switch to content frame and click on image" stepKey="commentSwitchToIframe"/>
51+
<switchToIFrame selector="{{BlockContentSection.contentIframe}}" stepKey="switchToContentFrame"/>
52+
<click selector="{{BlockContentSection.image}}" stepKey="clickImage"/>
53+
<switchToIFrame stepKey="switchBack"/>
54+
<!--Add image second time and assert-->
55+
<comment userInput="Add image second time and assert" stepKey="commentAddImageAndAssert"/>
56+
<actionGroup ref="AdminAddImageToCMSBlockContent" stepKey="addImageSecondTime">
57+
<argument name="image" value="MagentoLogo"/>
58+
</actionGroup>
59+
<switchToIFrame selector="{{BlockContentSection.contentIframe}}" stepKey="switchToContentFrameSecondTime"/>
60+
<seeElement selector="{{BlockContentSection.image}}" stepKey="seeImageElement"/>
61+
</test>
62+
</tests>

0 commit comments

Comments
 (0)