Skip to content

Commit a96ad14

Browse files
committed
Merge branch '2.4-develop' of https://github.com/adobe-commerce-tier-4/magento2ce into ACP2E-4231
2 parents 2360507 + 59ff8f4 commit a96ad14

File tree

3 files changed

+57
-5
lines changed

3 files changed

+57
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<element name="asLowAsLabel" type="input" selector="//strong[@id='block-related-heading']/following::span[@class='price-label'][1]"/>
3737
<element name="asLowAsLabelAgain" type="input" selector="//strong[@id='block-related-heading']/following::span[@class='price-label'][2]"/>
3838
<element name="specialPriceValue" type="text" selector="//span[@class='special-price']//span[@class='price']"/>
39-
<element name="mapPrice" type="text" selector="//div[@class='price-box price-final_price']//span[contains(@class, 'price-msrp_price')]"/>
39+
<element name="mapPrice" type="text" selector="//div[@class='price-box price-final_price']//span[contains(@class, 'price-msrp_price')]//span"/>
4040
<element name="clickForPriceLink" type="text" selector="//div[@class='price-box price-final_price']//a[contains(text(), 'Click for price')]"/>
4141
<element name="addReviewLink" type="text" selector="//div[@class='reviews-actions']//a[@class='action add']"/>
4242
<element name="fptPrice" type="text" selector=".//*[@class='weee']/span"/>

app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductMSRPCovertTest.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
6-
*/
3+
/**
4+
* Copyright 2020 Adobe
5+
* All Rights Reserved.
6+
*/
77
-->
8+
89
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
910
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1011
<test name="StorefrontConfigurableProductMSRPCovertTest">
@@ -112,6 +113,7 @@
112113
</actionGroup>
113114

114115
<selectOption selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" userInput="$$getConfigAttributeOption1.value$$" stepKey="selectFirstOption"/>
116+
<waitForAjaxLoad stepKey="waitForAjaxload"/>
115117
<waitForElement selector="{{StorefrontProductInfoMainSection.mapPrice}}" stepKey="waitForLoad"/>
116118
<grabTextFrom selector="{{StorefrontProductInfoMainSection.mapPrice}}" stepKey="grabProductMapPrice"/>
117119
<assertNotEquals stepKey="assertProductMapPrice">
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
/**
3+
* Copyright 2025 Adobe
4+
* All Rights Reserved.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace Magento\GraphQl\Catalog;
10+
11+
use Magento\Catalog\Model\Product\Visibility;
12+
use Magento\Catalog\Test\Fixture\Product as ProductFixture;
13+
use Magento\TestFramework\Fixture\DataFixture;
14+
use Magento\TestFramework\TestCase\GraphQlAbstract;
15+
16+
class ProductVisibilitySearchTest extends GraphQlAbstract
17+
{
18+
/**
19+
* Verify that a product with "Catalog Only" visibility
20+
* is not returned in GraphQL product search results.
21+
*/
22+
#[DataFixture(
23+
ProductFixture::class,
24+
['price' => 1, 'name' => 'API_TEST', 'visibility' => Visibility::VISIBILITY_IN_CATALOG],
25+
'prod1'
26+
)]
27+
public function testProductNotReturnedWhenVisibilityIsCatalogOnly(): void
28+
{
29+
$query = <<<'QUERY'
30+
query {
31+
products(
32+
search: "API"
33+
filter: { price: { from: "1" } }
34+
) {
35+
items {
36+
name
37+
sku
38+
}
39+
}
40+
}
41+
QUERY;
42+
43+
$response = $this->graphQlQuery($query);
44+
$this->assertArrayNotHasKey('errors', $response);
45+
$this->assertEmpty(
46+
$response['products']['items'],
47+
'Expected no products to be returned when product is set to Catalog-only visibility.'
48+
);
49+
}
50+
}

0 commit comments

Comments
 (0)