Skip to content

Commit 86633a9

Browse files
Merge branch 'ACQE-7706' into ACQE-Version2-functional-mainline-deployment
2 parents 55f1a49 + 4e2abcb commit 86633a9

File tree

21 files changed

+723
-63
lines changed

21 files changed

+723
-63
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
4+
* Copyright 2024 Adobe
5+
* All rights reserved.
56
* See COPYING.txt for license details.
67
*/
78
-->
@@ -43,5 +44,6 @@
4344
<element name="customAttribute" type="text" selector="input.admin__control-text[name='{{var}}']" parameterized="true"/>
4445
<element name="crossSellFilters" type="button" selector="//*[contains(@class, 'crosssell_product')]//button[text()='Filters']"/>
4546
<element name="upSellFilters" type="button" selector="//*[contains(@class, 'upsell_product')]//button[text()='Filters']"/>
47+
<element name="removeFilters" type="button" selector="(//button[contains(@class, 'action-remove')])[1]"/>
4648
</section>
4749
</sections>

app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/StoreFrontDeleteProductImagesAssignedDifferentRolesTest.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,23 @@
6969
</actionGroup>
7070
<!--Save Product After Assigning Roles and Images-->
7171
<actionGroup ref="SaveProductFormActionGroup" stepKey="save"/>
72+
<!--Clean cache-->
73+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="flushCache">
74+
<argument name="tags" value=""/>
75+
</actionGroup>
7276
<!-- Go to the admin grid and see the Thumbnail image -->
7377
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchProductOnProductGridPage">
7478
<argument name="product" value="$$simpleProductOne$$"/>
7579
</actionGroup>
7680
<seeElement selector="{{AdminProductGridSection.productThumbnailBySrc('/adobe-thumb')}}" stepKey="seeThumBImageInGrid"/>
77-
<!-- Go to the product page on StoreFront and see the Base image -->
78-
<amOnPage url="{{StorefrontProductPage.url($simpleProductOne.custom_attributes[url_key]$)}}" stepKey="goToProductPage"/>
79-
<waitForPageLoad stepKey="waitForPageLoad"/>
80-
<seeElement selector="{{StorefrontProductMediaSection.imageFile(TestImageAdobe.filename)}}" stepKey="seeBaseImageOnProductPage"/>
8181
<!-- Go to the category page and see the Small image -->
8282
<amOnPage url="{{StorefrontCategoryPage.url($testCategory.custom_attributes[url_key]$)}}" stepKey="goToCategoryPage"/>
8383
<waitForPageLoad stepKey="waitForPageLoadingToFinish"/>
8484
<seeElement selector="{{StorefrontCategoryProductSection.ProductImageBySrc('/adobe-small')}}" stepKey="seeSmallImageOnCategoryPage"/>
85+
<!-- Go to the product page on StoreFront and see the Base image -->
86+
<amOnPage url="{{StorefrontProductPage.url($simpleProductOne.custom_attributes[url_key]$)}}" stepKey="goToProductPage"/>
87+
<waitForPageLoad stepKey="waitForPageLoad"/>
88+
<seeElement selector="{{StorefrontProductMediaSection.imageFile(TestImageAdobe.filename)}}" stepKey="seeBaseImageOnProductPage"/>
8589
</before>
8690
<after>
8791
<deleteData createDataKey="testCategory" stepKey="deleteCategory"/>

app/code/Magento/CatalogRule/Test/Mftf/Test/CatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2018 Adobe
5+
* All Rights Reserved.
66
*/
77
-->
88

@@ -96,6 +96,7 @@
9696
<argument name="categoryUrl" value="$createCategory.custom_attributes[url_key]$"/>
9797
<argument name="productName" value="$createProduct.name$"/>
9898
</actionGroup>
99+
<waitForPageLoad time="30" stepKey="waitFormReload"/>
99100
<dontSeeElement selector="{{StorefrontCategoryProductSection.ProductCatalogRuleSpecialPriceTitleByName($createProduct.name$)}}" stepKey="dontSeeSpecialPrice"/>
100101
</test>
101102
</tests>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
<element name="shippingMethodFreeShippingLabel" type="text" selector="#label_carrier_freeshipping_freeshipping"/>
3838
<element name="shippingDHLErrorMessage" type="text" selector="#checkout-shipping-method-load .table-checkout-shipping-method tr.row-error .error div"/>
3939
<element name="smartPostShippingMethod" type="radio" selector="#checkout-shipping-method-load input[value='fedex_SMART_POST']"/>
40+
<element name="groundShippingMethod" type="radio" selector="#checkout-shipping-method-load input[value='fedex_FEDEX_GROUND']"/>
4041
<element name="shippingMethodDhlExpressEasyLabel" type="text" selector="#label_method_8_dhl"/>
4142
<element name="shippingMethodFedexLabel" type="text" selector="#label_carrier_null_fedex"/>
4243
<element name="smartPostFedexPrice" type="text" selector="//tr[td[@id='label_carrier_SMART_POST_fedex']]//td[contains(@class, 'col-price')]//span[contains(@class, 'price') and contains(@data-bind, 'price_excl_tax')]"/>

app/code/Magento/CheckoutAgreements/Test/Mftf/Data/TermData.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,12 @@
104104
<data key="checkboxText" unique="suffix">test_checkbox</data>
105105
<data key="content" unique="suffix">TestMessage</data>
106106
</entity>
107+
<entity name="manualHtmlTerm" type="term">
108+
<data key="name" unique="suffix">Test HTML Condition</data>
109+
<data key="isActive">Enabled</data>
110+
<data key="isHtml">HTML</data>
111+
<data key="mode">Manually</data>
112+
<data key="checkboxText">&lt;mark&gt;Marked Terms and Conditions link for Additional sore View&lt;/mark&gt;</data>
113+
<data key="content">&lt;ul&gt;&lt;li&gt;&lt;b&gt;bold text&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;i&gt;italic text&lt;/i&gt;&lt;/li&gt;&lt;/ul&gt;</data>
114+
</entity>
107115
</entities>

app/code/Magento/CheckoutAgreements/Test/Mftf/Section/StorefrontCheckoutAgreementsSection.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,9 @@
2323
<element name="automaticCheckoutAgreementLink" type="button" selector="//input[starts-with(@id,'{{paymentName}}')]/..//following-sibling::div//button//span" parameterized="true"/>
2424
<element name="checkoutAgreement" type="button" selector="(//*[@class='checkout-agreements fieldset']//button/span[text()='{{agreement}}'])[4]" parameterized="true"/>
2525
<element name="checkoutAgreementContent" type="button" selector=".//*[@class='modal-popup agreements-modal modal-slide _inner-scroll _show']//div[@class='checkout-agreements-item-content']"/>
26+
<element name="checkoutAgreementBoldContentMessage" type="text" selector=".checkout-agreements-item-content > ul > li > b"/>
27+
<element name="checkoutAgreementItalicContentMessage" type="text" selector=".checkout-agreements-item-content > ul > li > i"/>
28+
<element name="mageError" type="text" selector="//div[@class='mage-error']"/>
29+
<element name="agreementMarkedText" type="button" selector="div.checkout-agreements-block > div > div > div > label > button > span"/>
2630
</section>
2731
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
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="StorefrontAssertTermsAndConditionsIsPresentedOnStorefrontWithShowContentAsHtmlTest">
12+
<annotations>
13+
<features value="CheckoutAgreements"/>
14+
<stories value="Verify that Terms and Conditions is presented on Storefront with Show Content as Html."/>
15+
<title value="Verify Terms and Conditions with Show Content as Html"/>
16+
<description value="The testcase intends to Verify that Terms and Conditions is presented on Storefront with Show Content as Html."/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-4605"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
22+
<createData entity="SimpleProduct" stepKey="createSimpleProduct"/>
23+
<actionGroup ref="AdminEnableTermsAndConditionsConfigurationActionGroup" stepKey="EnableTermsAndConditions"/>
24+
<!-- Create Additional store view -->
25+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView">
26+
<argument name="customStore" value="customStore"/>
27+
</actionGroup>
28+
</before>
29+
<after>
30+
<!--Delete created data-->
31+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
32+
<!--Delete custom store view -->
33+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteCustomStoreView">
34+
<argument name="customStore" value="customStore"/>
35+
</actionGroup>
36+
<actionGroup ref="AdminTermsConditionsOpenGridActionGroup" stepKey="openTermsGridToDelete"/>
37+
<actionGroup ref="AdminDeleteAllTermConditionsActionGroup" stepKey="deleteAllTerms"/>
38+
<actionGroup ref="AdminDisableTermsAndConditionsConfigurationActionGroup" stepKey="DisableTermsAndConditions"/>
39+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logOutOfAdmin"/>
40+
</after>
41+
<!-- Open New Terms And Conditions Page-->
42+
<actionGroup ref="AdminTermsConditionsOpenNewTermPageActionGroup" stepKey="openNewTerm"/>
43+
<!-- Fill the Required Details-->
44+
<actionGroup ref="AdminFillTermsAndConditionsCustomStoreViewActionGroup" stepKey="fillNewTerm">
45+
<argument name="term" value="manualHtmlTerm"/>
46+
<argument name="storeView" value="{{customStore.name}}"/>
47+
</actionGroup>
48+
<!-- Save Details-->
49+
<actionGroup ref="AdminTermsConditionsSaveTermActionGroup" stepKey="saveFilledTerm"/>
50+
<!-- Switch StoreView -->
51+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="amOnStoreFrontHomePage"/>
52+
<actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToCustomStoreView">
53+
<argument name="storeView" value="customStore"/>
54+
</actionGroup>
55+
<!--Add product to cart.-->
56+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart">
57+
<argument name="product" value="$createSimpleProduct$"/>
58+
</actionGroup>
59+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCheckoutCartPage"/>
60+
<actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/>
61+
<!--Filling shipping information and click next-->
62+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping">
63+
<argument name="shippingMethod" value="Flat Rate"/>
64+
<argument name="customerVar" value="Simple_US_Customer_NY"/>
65+
<argument name="customerAddressVar" value="US_Address_NY"/>
66+
</actionGroup>
67+
<!--Check-box with text for Terms and Condition is present-->
68+
<waitForElement selector="{{StorefrontCheckoutAgreementsSection.agreementMarkedText(manualHtmlTerm.checkboxText)}}" stepKey="seeTermTextInCheckoutIsPresent"/>
69+
<click selector="{{StorefrontCheckoutAgreementsSection.agreementMarkedText}}" stepKey="ClickOnTermsAndConditionsLink"/>
70+
<waitForElement selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementBoldContentMessage('bold text')}}" stepKey="verifyBoldTextMessage"/>
71+
<waitForElement selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementItalicContentMessage('italic text')}}" stepKey="verifyItalicTextMessage"/>
72+
<waitForElementClickable selector="{{StorefrontCheckoutAgreementsSection.close}}" stepKey="waitForCloseToBeClickable"/>
73+
<click selector="{{StorefrontCheckoutAgreementsSection.close}}" stepKey="ClickOnClose"/>
74+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/>
75+
<actionGroup ref="StorefrontClickPlaceOrderButtonActionGroup" stepKey="clickPlacePurchaseOrder"/>
76+
<waitForText selector="{{StorefrontCheckoutAgreementsSection.mageError}}" userInput="This is a required field." stepKey="verifyErrorMessage"/>
77+
<checkOption selector="{{StorefrontCheckoutAgreementsSection.checkoutAgreementCheckbox}}" stepKey="seeTermInCheckout"/>
78+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="againClickPlacePurchaseOrder"/>
79+
<waitForText selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="seeSuccessTitle"/>
80+
<waitForText selector="{{CheckoutSuccessMainSection.orderNumberText}}" userInput="Your order # is: " stepKey="seeOrderNumber"/>
81+
</test>
82+
</tests>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="CmsNewPagePageActionsSection">
12-
<element name="savePage" type="button" selector="#save_and_close" timeout="160"/>
12+
<element name="savePage" type="button" selector="#save_and_close" timeout="500"/>
1313
<element name="reset" type="button" selector="#reset"/>
1414
<element name="saveAndContinueEdit" type="button" selector="#save-button" timeout="120"/>
1515
<element name="saveAndDuplicate" type="button" selector="#save_and_duplicate" timeout="10"/>

app/code/Magento/Paypal/Test/Mftf/Test/AdminConfigPaymentsStandardTest.xml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
66
*/
77
-->
88
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -23,6 +23,8 @@
2323
<createData entity="SimpleProduct" stepKey="simpleProduct">
2424
<requiredEntity createDataKey="simpleCategory"/>
2525
</createData>
26+
<!-- Create customer -->
27+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
2628
<!-- Login -->
2729
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
2830
<!--Config PayPal Standard-->
@@ -34,6 +36,7 @@
3436
<after>
3537
<deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/>
3638
<deleteData createDataKey="simpleCategory" stepKey="deleteCategory"/>
39+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
3740
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
3841
</after>
3942
<actionGroup ref="AdminEnablePaypalStandardPaylaterActionGroup" stepKey="enablePaypalStandard"/>
@@ -46,7 +49,9 @@
4649
<argument name="tags" value="config full_page"/>
4750
</actionGroup>
4851
<!--Navigate to Storefront-->
49-
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/>
52+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="goToStoreFront">
53+
<argument name="Customer" value="$createCustomer$"/>
54+
</actionGroup>
5055
<actionGroup ref="AssertStorefrontPaypalPaylaterActionGroup" stepKey="verifyPaylaterInStorefrontCategoryPage"/>
5156
<!--Disable Paypal Standard-->
5257
<magentoCLI command="config:set {{DisablePaypalPayStandard.path}} {{DisablePaypalPayStandard.value}}" stepKey="disablePayPalStandard"/>
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<?php
2+
/**
3+
* Copyright 2025 Adobe
4+
* All Rights Reserved.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Persistent\Model;
9+
10+
use Magento\Framework\Exception\LocalizedException;
11+
use Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot;
12+
use Magento\Store\Api\Data\StoreInterface;
13+
use Magento\Store\Model\StoreManagerInterface;
14+
use Magento\Persistent\Model\ResourceModel\ExpiredPersistentQuotesCollection;
15+
use Magento\Quote\Model\QuoteRepository;
16+
use Psr\Log\LoggerInterface;
17+
use Exception;
18+
19+
/**
20+
* Cleaning expired persistent quotes from the cron
21+
*/
22+
class CleanExpiredPersistentQuotes
23+
{
24+
/**
25+
* @param StoreManagerInterface $storeManager
26+
* @param ExpiredPersistentQuotesCollection $expiredPersistentQuotesCollection
27+
* @param QuoteRepository $quoteRepository
28+
* @param Snapshot $snapshot
29+
* @param LoggerInterface $logger
30+
* @param int $batchSize
31+
*/
32+
public function __construct(
33+
private readonly StoreManagerInterface $storeManager,
34+
private readonly ExpiredPersistentQuotesCollection $expiredPersistentQuotesCollection,
35+
private readonly QuoteRepository $quoteRepository,
36+
private readonly Snapshot $snapshot,
37+
private readonly LoggerInterface $logger,
38+
private readonly int $batchSize
39+
) {
40+
}
41+
42+
/**
43+
* Execute the cron job
44+
*
45+
* @param int $websiteId
46+
* @return void
47+
* @throws LocalizedException
48+
*/
49+
public function execute(int $websiteId): void
50+
{
51+
$stores = $this->storeManager->getWebsite($websiteId)->getStores();
52+
foreach ($stores as $store) {
53+
$this->processStoreQuotes($store);
54+
}
55+
}
56+
57+
/**
58+
* Process store quotes in batches
59+
*
60+
* @param StoreInterface $store
61+
* @return void
62+
*/
63+
private function processStoreQuotes(StoreInterface $store): void
64+
{
65+
$lastProcessedId = $count = 0;
66+
67+
while (true) {
68+
$quotesToProcess = $this->expiredPersistentQuotesCollection
69+
->getExpiredPersistentQuotes($store, $lastProcessedId, $this->batchSize);
70+
71+
if (!$quotesToProcess->count()) {
72+
break;
73+
}
74+
75+
foreach ($quotesToProcess as $quote) {
76+
$count++;
77+
try {
78+
$this->quoteRepository->delete($quote);
79+
$lastProcessedId = (int)$quote->getId();
80+
} catch (Exception $e) {
81+
$this->logger->error(sprintf(
82+
'Unable to delete expired quote (ID: %s): %s',
83+
$quote->getId(),
84+
(string)$e
85+
));
86+
}
87+
if ($count % $this->batchSize === 0) {
88+
$this->snapshot->clear($quote);
89+
}
90+
$quote->clearInstance();
91+
unset($quote);
92+
}
93+
94+
$quotesToProcess->clear();
95+
unset($quotesToProcess);
96+
}
97+
}
98+
}

0 commit comments

Comments
 (0)