Skip to content

Commit 920bc4a

Browse files
committed
Merge branch 'MC-31497' of github.com:magento-honey-badgers/magento2ce into MC-31497
2 parents a662656 + e731518 commit 920bc4a

File tree

34 files changed

+950
-152
lines changed

34 files changed

+950
-152
lines changed

app/code/Magento/Backend/Block/Store/Switcher.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,8 @@ public function getCurrentWebsiteName()
473473
return $website->getName();
474474
}
475475
}
476+
477+
return '';
476478
}
477479

478480
/**
@@ -489,6 +491,8 @@ public function getCurrentStoreGroupName()
489491
return $group->getName();
490492
}
491493
}
494+
495+
return '';
492496
}
493497

494498
/**
@@ -505,6 +509,8 @@ public function getCurrentStoreName()
505509
return $store->getName();
506510
}
507511
}
512+
513+
return '';
508514
}
509515

510516
/**
@@ -590,7 +596,7 @@ public function getHintHtml()
590596
class="admin__field-tooltip-action action-help"><span>%s</span></a></span></div>';
591597
$title = $this->escapeHtmlAttr(__('What is this?'));
592598
$span= $this->escapeHtml(__('What is this?'));
593-
sprintf($html, $this->escapeUrl($url), $title, $span);
599+
$html = sprintf($html, $this->escapeUrl($url), $title, $span);
594600
}
595601
return $html;
596602
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="AdminSetUseInSearchValueForProductAttributeActionGroup">
11+
<annotations>
12+
<description>Set 'Use In Search' value for product attribute</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="useInSearchValue" type="string" defaultValue="Yes"/>
16+
</arguments>
17+
18+
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
19+
<click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStorefrontPropertiesTab"/>
20+
<waitForElementVisible selector="{{AdvancedAttributePropertiesSection.UseInSearch}}" stepKey="waitForUseInSearchElementVisible"/>
21+
<selectOption selector="{{AdvancedAttributePropertiesSection.UseInSearch}}" userInput="{{useInSearchValue}}" stepKey="setUseInSearchValue"/>
22+
</actionGroup>
23+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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="AssertStorefrontProductControlsAreNotVisibleWithoutHoverActionGroup">
11+
<annotations>
12+
<description>Validate that the Product Controls Are Not Visible On Category Page Without Hover on Product</description>
13+
</annotations>
14+
15+
<dontSeeElement selector="{{StorefrontCategoryMainSection.addToCartButtonProductInfoHover}}" stepKey="assertAddToCartButtonElementIsNotVisible"/>
16+
<dontSeeElement selector="{{StorefrontCategoryMainSection.addToWishListIconProductInfoHover}}" stepKey="assertAddToWishListIconIsNotVisible"/>
17+
<dontSeeElement selector="{{StorefrontCategoryMainSection.addToCompareIconProductInfoHover}}" stepKey="assertAddToCompareIconIsNotVisible"/>
18+
</actionGroup>
19+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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="AssertStorefrontProductControlsAreVisibleOnHoverActionGroup">
11+
<annotations>
12+
<description>Validate that the Product Controls Are Visible on Category Page on Hover on Product</description>
13+
</annotations>
14+
15+
<seeElement selector="{{StorefrontCategoryMainSection.addToCartButtonProductInfoHover}}" stepKey="assertAddToCartButtonElementIsVisible"/>
16+
<seeElement selector="{{StorefrontCategoryMainSection.addToWishListIconProductInfoHover}}" stepKey="assertAddToWishListIconIsVisible"/>
17+
<seeElement selector="{{StorefrontCategoryMainSection.addToCompareIconProductInfoHover}}" stepKey="assertAddToCompareIconIsVisible"/>
18+
</actionGroup>
19+
</actionGroups>
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertStorefrontProductIsPresentOnCategoryPageActionGroup">
12+
<annotations>
13+
<description>Validate that the provided Product is present and has correct name on a Category page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="productName" type="string" defaultValue="{{ApiSimpleOne.name}}"/>
17+
</arguments>
18+
19+
<waitForElementVisible selector="{{StorefrontCategoryProductSection.ProductTitleByName(productName)}}" stepKey="assertProductName"/>
20+
</actionGroup>
21+
</actionGroups>
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+
<actionGroup name="AssertStorefrontProductPriceInCategoryPageActionGroup">
12+
<annotations>
13+
<description>Goes to Storefront Category page for the provided Category. Validates that the Product price is present and correct.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="categoryUrl" type="string" defaultValue="{{SimpleRootSubCategory.url_key}}"/>
17+
<argument name="productName" type="string" defaultValue="{{productWithHTMLEntityOne.name}}"/>
18+
<argument name="productPrice" type="string" defaultValue="{{productWithHTMLEntityOne.price}}"/>
19+
</arguments>
20+
21+
<amOnPage url="{{StorefrontCategoryPage.url(categoryUrl)}}" stepKey="navigateToCategoryPage"/>
22+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
23+
<see userInput="{{productPrice}}" selector="{{StorefrontCategoryProductSection.ProductPriceByName(productName)}}" stepKey="assertProductPrice"/>
24+
</actionGroup>
25+
</actionGroups>
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertStorefrontProductSpecialPriceInCategoryPageActionGroup" extends="AssertStorefrontProductPriceInCategoryPageActionGroup">
12+
<annotations>
13+
<description>Goes to Storefront Category page for the provided Category. Validates that the Product price and special price are correct.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="productSpecialPrice" type="string" defaultValue="{{updateVirtualProductSpecialPrice.special_price}}"/>
17+
</arguments>
18+
19+
<see userInput="{{productSpecialPrice}}" selector="{{StorefrontCategoryProductSection.ProductCatalogRuleSpecialPriceTitleByName(productName)}}" after="assertProductPrice" stepKey="assertProductSpecialPrice"/>
20+
</actionGroup>
21+
</actionGroups>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080

8181
<actionGroup name="AssertProductOnCategoryPageActionGroup" extends="StorefrontCheckCategorySimpleProduct">
8282
<annotations>
83-
<description>EXTENDS:StorefrontCheckCategorySimpleProduct. Removes 'AssertProductPrice', 'moveMouseOverProduct', 'AssertAddToCart'</description>
83+
<description>DEPRECATED Use AssertStorefrontProductIsPresentOnCategoryPageActionGroup. EXTENDS:StorefrontCheckCategorySimpleProduct. Removes 'AssertProductPrice', 'moveMouseOverProduct', 'AssertAddToCart'</description>
8484
</annotations>
8585
<remove keyForRemoval="AssertProductPrice"/>
8686
<remove keyForRemoval="moveMouseOverProduct"/>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
<element name="ProductItemInfo" type="button" selector=".product-item-info"/>
1818
<element name="specifiedProductItemInfo" type="button" selector="//a[@class='product-item-link'][contains(text(), '{{var1}}')]" parameterized="true"/>
1919
<element name="AddToCartBtn" type="button" selector="button.action.tocart.primary"/>
20+
<element name="addToCartButtonProductInfoHover" type="button" selector=".product-item-info:hover button.action.tocart.primary" timeout="30"/>
21+
<element name="addToWishListIconProductInfoHover" type="button" selector=".product-item-info:hover a.action.towishlist" timeout="30"/>
22+
<element name="addToCompareIconProductInfoHover" type="button" selector=".product-item-info:hover a.action.tocompare" timeout="30"/>
2023
<element name="addToCartProductBySku" type="button" selector="//form[@data-product-sku='{{productSku}}']//button[contains(@class, 'tocart')]" parameterized="true" />
2124
<element name="SuccessMsg" type="button" selector="div.message-success"/>
2225
<element name="productCount" type="text" selector="#toolbar-amount"/>
@@ -27,6 +30,7 @@
2730
<element name="productLink" type="text" selector="a.product-item-link" timeout="30"/>
2831
<element name="productLinkByHref" type="text" selector="a.product-item-link[href$='{{var1}}.html']" parameterized="true"/>
2932
<element name="productPrice" type="text" selector=".price-final_price"/>
33+
<element name="productPriceByName" type="text" selector="//a[contains(text(), '{{productName}}')]//ancestor::div[contains(@class, 'product-item-info')]//span[contains(@class, 'price')]" parameterized="true"/>
3034
<element name="categoryImage" type="text" selector=".category-image"/>
3135
<element name="emptyProductMessage" type="block" selector=".message.info.empty>div"/>
3236
<element name="lineProductName" type="text" selector=".products.list.items.product-items li:nth-of-type({{line}}) .product-item-link" timeout="30" parameterized="true"/>

app/code/Magento/CatalogGraphQl/Model/Resolver/Products/FilterArgument/ProductEntityAttributesForAst.php

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
*/
1818
class ProductEntityAttributesForAst implements FieldEntityAttributesInterface
1919
{
20+
private const PRODUCT_BASE_TYPE = 'SimpleProduct';
21+
22+
private const PRODUCT_FILTER_INPUT = 'ProductAttributeFilterInput';
23+
2024
/**
2125
* @var ConfigInterface
2226
*/
@@ -51,9 +55,9 @@ public function __construct(
5155
*/
5256
public function getEntityAttributes() : array
5357
{
54-
$productTypeSchema = $this->config->getConfigElement('SimpleProduct');
58+
$productTypeSchema = $this->config->getConfigElement(self::PRODUCT_BASE_TYPE);
5559
if (!$productTypeSchema instanceof Type) {
56-
throw new \LogicException(__("SimpleProduct type not defined in schema."));
60+
throw new \LogicException(__(self::PRODUCT_BASE_TYPE . " type not defined in schema."));
5761
}
5862

5963
$fields = [];
@@ -69,6 +73,9 @@ public function getEntityAttributes() : array
6973
}
7074
}
7175

76+
$productAttributeFilterFields = $this->getProductAttributeFilterFields();
77+
$fields = array_merge($fields, $productAttributeFilterFields);
78+
7279
foreach ($this->additionalAttributes as $attributeName) {
7380
$fields[$attributeName] = [
7481
'type' => 'String',
@@ -78,4 +85,24 @@ public function getEntityAttributes() : array
7885

7986
return $fields;
8087
}
88+
89+
/**
90+
* Get fields from ProductAttributeFilterInput
91+
*
92+
* @return array
93+
*/
94+
private function getProductAttributeFilterFields()
95+
{
96+
$filterFields = [];
97+
98+
$productAttributeFilterSchema = $this->config->getConfigElement(self::PRODUCT_FILTER_INPUT);
99+
$productAttributeFilterFields = $productAttributeFilterSchema->getFields();
100+
foreach ($productAttributeFilterFields as $filterField) {
101+
$filterFields[$filterField->getName()] = [
102+
'type' => 'String',
103+
'fieldName' => $filterField->getName(),
104+
];
105+
}
106+
return $filterFields;
107+
}
81108
}

0 commit comments

Comments
 (0)