Skip to content

Commit 044d35d

Browse files
Merge pull request #10160 from magento-gl/ACQE-functional-deployment-v4-3
Bengals Functional Mainline deployment PR
2 parents 620b078 + 26ef3a2 commit 044d35d

File tree

8 files changed

+324
-7
lines changed

8 files changed

+324
-7
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@
9393
<click selector="{{StorefrontPanelHeaderSection.notYouLink}}" stepKey="clickNotYouLink"/>
9494
<actionGroup ref="ReloadPageActionGroup" stepKey="waitFormReload"/>
9595
<actionGroup ref="AssertStorefrontDefaultWelcomeMessageActionGroup" stepKey="seeWelcomeMessageForJohnDoeCustomerAfterLogout"/>
96+
97+
<!--Clear cache to ensure fresh price calculation after customer group change-->
98+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCacheToEnsureFreshPriceCalculationAfterCustomerGroupChange">
99+
<argument name="tags" value="full_page block_html"/>
100+
</actionGroup>
101+
96102
<actionGroup ref="AssertStorefrontProductPriceInCategoryPageActionGroup" stepKey="assertProductPriceInCategoryPageAfterLogout">
97103
<argument name="categoryUrl" value="$createCategory.custom_attributes[url_key]$"/>
98104
<argument name="productName" value="$createProduct.name$"/>
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 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="AdminVoidSalesOrderPlacedWithPayPalStandardTest">
12+
<annotations>
13+
<features value="PayPal"/>
14+
<stories value="PayPal Standard"/>
15+
<title value="Void a Sales Order placed with PayPal Standard"/>
16+
<description value="Place an order with PayPal Standard payment method and void the order from admin. Validate order status, transaction details, and comments history."/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-5375"/>
19+
<group value="paypalStandard"/>
20+
<group value="3rd_party_integration"/>
21+
<group value="pr_exclude"/>
22+
</annotations>
23+
<before>
24+
<!-- Login to admin -->
25+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
26+
<!-- Create simple product -->
27+
<createData entity="simpleProductWithoutCategory" stepKey="createProduct">
28+
<field key="price">10</field>
29+
</createData>
30+
<!-- Create US customer -->
31+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
32+
</before>
33+
<after>
34+
<!-- Customer logout -->
35+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
36+
<!-- Clean up created data -->
37+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
38+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
39+
<!-- Admin logout -->
40+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
41+
</after>
42+
<!-- Step 1: Navigate to StoreFront -->
43+
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/>
44+
<!-- Login as customer -->
45+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomerLogin">
46+
<argument name="Customer" value="$$createCustomer$$"/>
47+
</actionGroup>
48+
<!-- Add product to cart -->
49+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart">
50+
<argument name="product" value="$$createProduct$$"/>
51+
</actionGroup>
52+
<!-- Proceed to checkout -->
53+
<actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="goToCheckout"/>
54+
<!-- Proceed to payment step -->
55+
<actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/>
56+
<!-- Select PayPal Standard payment method -->
57+
<actionGroup ref="AdminSelectPaypalStandardPaymentInPaymentPageActionGroup" stepKey="selectPaypalStandardPaymentAndClickOnContinueButton"/>
58+
<!-- Login to PayPal and complete payment -->
59+
<actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="loginToPayPal"/>
60+
<actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="confirmPaymentAndGoBackToMagento"/>
61+
<!-- Wait for order success page and grab order number -->
62+
<waitForElementVisible selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="waitForOrderNumberToBeGrabbed"/>
63+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>
64+
<!-- Step 2: Go to Sales > Orders (Admin) -->
65+
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPage"/>
66+
<!-- Filter orders by the created order ID -->
67+
<actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGrid">
68+
<argument name="orderId" value="$grabOrderNumber"/>
69+
</actionGroup>
70+
<!-- Step 3: Open the Order from preconditions -->
71+
<actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/>
72+
<!-- Verify order details and totals -->
73+
<actionGroup ref="AdminAssertTotalsOnOrderViewPageActionGroup" stepKey="checkOrderTotals">
74+
<argument name="subtotal" value="$10.00"/>
75+
<argument name="shippingAndHandling" value="$5.00"/>
76+
<argument name="grandTotal" value="$15.00"/>
77+
</actionGroup>
78+
<!-- Verify initial order status is Processing -->
79+
<actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="checkInitialOrderStatus">
80+
<argument name="status" value="Processing"/>
81+
</actionGroup>
82+
<!-- Step 4: Click Void button -->
83+
<!-- Step 5: Click OK button and verify success message -->
84+
<actionGroup ref="AdminVoidPendingOrderActionGroup" stepKey="voidPendingOrder"/>
85+
<!-- Step 6: Observe order data -->
86+
<!-- Verify order status remains Processing -->
87+
<actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="checkOrderStatusAfterVoid">
88+
<argument name="status" value="Processing"/>
89+
</actionGroup>
90+
<!-- Grab transaction ID for validation -->
91+
<waitForElementVisible selector="{{AdminOrderPaymentInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForGrabLastTransactionID"/>
92+
<grabTextFrom selector="{{AdminOrderPaymentInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabLastTransactionID"/>
93+
<!-- Verify void authorization message in comments history -->
94+
<actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistory"/>
95+
<!-- Verify void authorization message with amount and transaction ID in comments -->
96+
<waitForText selector="{{AdminOrderCommentsTabSection.authorizationNotes('Voided authorization')}}" userInput="{{BillingAgreement.amount_note}} Transaction ID: &quot;$grabLastTransactionID&quot;" stepKey="seeVoidAuthorizationMessageWithAmount"/>
97+
<!-- Verify transactions tab shows both authorization and void transactions -->
98+
<actionGroup ref="AdminOpenTransactionsTabActionGroup" stepKey="openTransactionTypeHasAuthorization">
99+
<argument name="transactionType" value="authorization"/>
100+
</actionGroup>
101+
<waitForText selector="{{AdminTransactionsGridSection.transactionData('Is Closed')}}" userInput="Yes" stepKey="seeIfClosedHeaderIsSetAsYesForAuthorization"/>
102+
<!-- Navigate back to order details -->
103+
<waitForElementClickable selector="{{AdminProductFormActionSection.backButton}}" stepKey="waitForBackButtonToBeClicked"/>
104+
<click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackButton"/>
105+
<!-- Verify void transaction -->
106+
<actionGroup ref="AdminOpenTransactionsTabActionGroup" stepKey="openTransactionTypeHasVoid">
107+
<argument name="transactionType" value="void"/>
108+
</actionGroup>
109+
<waitForText selector="{{AdminTransactionsGridSection.transactionData('Is Closed')}}" userInput="Yes" stepKey="seeIfClosedHeaderIsSetAsYesForVoid"/>
110+
</test>
111+
</tests>

app/code/Magento/Review/Test/Mftf/ActionGroup/AdminDeleteReviewsByUserNicknameActionGroup.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
/**
4-
* Copyright 2019 Adobe
5-
* All Rights Reserved.
6-
*/
3+
/**
4+
* Copyright 2019 Adobe
5+
* All Rights Reserved.
6+
*/
77
-->
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
@@ -18,6 +18,8 @@
1818
<click selector="{{AdminReviewGridSection.submit}}" stepKey="clickSubmit"/>
1919
<waitForElementVisible selector="{{AdminReviewGridSection.acceptModal}}" stepKey="waitForModalPopUp"/>
2020
<click selector="{{AdminReviewGridSection.acceptModal}}" stepKey="confirmProductDelete"/>
21+
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
22+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessageVisible"/>
2123
<see selector="{{AdminMessagesSection.success}}" userInput="record(s) have been deleted." stepKey="seeSuccessMessage"/>
2224
</actionGroup>
2325
</actionGroups>

app/code/Magento/Review/Test/Mftf/Test/StorefrontVerifyMultipleProductRatingsOnCategoryPageTest.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,11 @@
5252
</after>
5353

5454
<!-- Go to frontend and make a user account and login with it -->
55-
<actionGroup ref="SignUpNewUserFromStorefrontActionGroup" stepKey="signUpNewUser">
56-
<argument name="Customer" value="CustomerEntityOne"/>
55+
<actionGroup ref="StorefrontOpenCustomerAccountCreatePageActionGroup" stepKey="openCreateAccountPage"/>
56+
<actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="fillCreateAccountForm">
57+
<argument name="customer" value="CustomerEntityOne"/>
5758
</actionGroup>
59+
<actionGroup ref="StorefrontClickCreateAnAccountCustomerAccountCreationFormActionGroup" stepKey="submitCreateAccountForm"/>
5860
<!-- Go to the first product view page -->
5961
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage1">
6062
<argument name="productUrl" value="$$createProduct1.custom_attributes[url_key]$$"/>

app/code/Magento/Sales/Test/Mftf/Section/AdminOrderStatusGridSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<element name="resetFilter" type="button" selector="//div[contains(concat(' ',normalize-space(@class),' '),' action-reset ')]" timeout="30"/>
1919
<element name="search" type="button" selector="[data-action='grid-filter-apply']" timeout="30"/>
2020
<element name="gridCell" type="text" selector="//tr['{{row}}']//td[count(//div[contains(concat(' ',normalize-space(@class),' '),' admin__data-grid-wrap ')]//tr//th[contains(., '{{cellName}}')]/preceding-sibling::th) +1 ]" parameterized="true" timeout="30"/>
21+
<element name="gridStatusCell" type="text" selector="//table[@id='sales_order_status_grid_table']/tbody/tr[{{row}}]/td[{{cellName}}]" parameterized="true" timeout="30"/>
2122
<element name="stateCodeAndTitleDataColumn" type="input" selector="[data-role=row] [data-column=state]"/>
2223
<element name="unassign" type="text" selector="[data-role=row] [data-column=unassign] a" />
2324
</section>

app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
<argument name="statusLabel" value="{{defaultOrderStatus.label}}"/>
111111
<argument name="statusCode" value="{{defaultOrderStatus.status}}"/>
112112
</actionGroup>
113-
<see selector="{{AdminOrderStatusGridSection.gridCell('1', 'State Code and Title')}}" userInput="new[{{defaultOrderStatus.label}}]" stepKey="seeOrderStatusInOrderGrid"/>
113+
<see selector="{{AdminOrderStatusGridSection.gridStatusCell('1', '1')}}" userInput="{{defaultOrderStatus.label}}" stepKey="seeOrderStatusInOrderGrid"/>
114114

115115
<!-- Create order and grab order id -->
116116
<actionGroup ref="AdminNavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer">
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
9+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="ContentAclResource" type="acl_resource">
12+
<data key="resourceId">Magento_Backend::content_anchor</data>
13+
<data key="resourceTitle">Content</data>
14+
</entity>
15+
<entity name="CategoriesAclResource" type="acl_resource">
16+
<data key="resourceId">Magento_Catalog::categories_anchor</data>
17+
<data key="resourceTitle">Categories</data>
18+
</entity>
19+
<entity name="SalesRuleAclResource" type="acl_resource">
20+
<data key="resourceId">Magento_SalesRule::quote_anchor</data>
21+
<data key="resourceTitle">Cart Price Rules</data>
22+
</entity>
23+
<entity name="CatalogAclResource" type="acl_resource">
24+
<data key="resourceId">Magento_Catalog::catalog_anchor</data>
25+
<data key="resourceTitle">Catalog</data>
26+
</entity>
27+
<entity name="SalesAclResource" type="acl_resource">
28+
<data key="resourceId">Magento_Sales::sales_anchor</data>
29+
<data key="resourceTitle">Sales</data>
30+
</entity>
31+
<entity name="CustomersAclResource" type="acl_resource">
32+
<data key="resourceId">Magento_Customer::customer_anchor</data>
33+
<data key="resourceTitle">Customers</data>
34+
</entity>
35+
<entity name="MarketingAclResource" type="acl_resource">
36+
<data key="resourceId">Magento_Backend::marketing_anchor</data>
37+
<data key="resourceTitle">Marketing</data>
38+
</entity>
39+
<entity name="ReportsAclResource" type="acl_resource">
40+
<data key="resourceId">Magento_Reports::report_anchor</data>
41+
<data key="resourceTitle">Reports</data>
42+
</entity>
43+
<entity name="StoresAclResource" type="acl_resource">
44+
<data key="resourceId">Magento_Backend::stores_anchor</data>
45+
<data key="resourceTitle">Stores</data>
46+
</entity>
47+
<entity name="SystemAclResource" type="acl_resource">
48+
<data key="resourceId">Magento_Backend::system_anchor</data>
49+
<data key="resourceTitle">System</data>
50+
</entity>
51+
</entities>
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
<?php
2+
/**
3+
* Copyright 2025 Adobe
4+
* All Rights Reserved.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Sales\Model\Order\Email\Sender;
9+
10+
use Magento\Catalog\Test\Fixture\Product as ProductFixture;
11+
use Magento\Checkout\Test\Fixture\PlaceOrder as PlaceOrderFixture;
12+
use Magento\Checkout\Test\Fixture\SetBillingAddress as SetBillingAddressFixture;
13+
use Magento\Checkout\Test\Fixture\SetDeliveryMethod as SetDeliveryMethodFixture;
14+
use Magento\Checkout\Test\Fixture\SetGuestEmail as SetGuestEmailFixture;
15+
use Magento\Checkout\Test\Fixture\SetPaymentMethod as SetPaymentMethodFixture;
16+
use Magento\Checkout\Test\Fixture\SetShippingAddress as SetShippingAddressFixture;
17+
use Magento\Framework\Exception\LocalizedException;
18+
use Magento\Framework\Mail\EmailMessageInterface;
19+
use Magento\Quote\Test\Fixture\AddProductToCart as AddProductToCartFixture;
20+
use Magento\Quote\Test\Fixture\GuestCart as GuestCartFixture;
21+
use Magento\Sales\Api\CreditmemoManagementInterface;
22+
use Magento\Sales\Api\CreditmemoRepositoryInterface;
23+
use Magento\Sales\Model\Order\CreditmemoFactory;
24+
use Magento\Sales\Test\Fixture\Invoice as InvoiceFixture;
25+
use Magento\TestFramework\Fixture\Config;
26+
use Magento\TestFramework\Fixture\DataFixture;
27+
use Magento\TestFramework\Fixture\DataFixtureStorageManager;
28+
use Magento\TestFramework\Helper\Bootstrap;
29+
use Magento\TestFramework\Mail\Template\TransportBuilderMock;
30+
use PHPUnit\Framework\TestCase;
31+
32+
/**
33+
* Test credit memo creation for offline payment with async email notification.
34+
*
35+
*/
36+
class CreditmemoAsyncEmailTest extends TestCase
37+
{
38+
/**
39+
* @var CreditmemoFactory
40+
*/
41+
private $creditmemoFactory;
42+
43+
/**
44+
* @var CreditmemoManagementInterface
45+
*/
46+
private $creditmemoManagement;
47+
48+
/**
49+
* @var CreditmemoSender
50+
*/
51+
private $creditmemoSender;
52+
53+
/**
54+
* @var TransportBuilderMock
55+
*/
56+
private $transportBuilder;
57+
58+
/**
59+
* @var array
60+
*/
61+
private $sentEmails = [];
62+
63+
/**
64+
* @inheritdoc
65+
*/
66+
protected function setUp(): void
67+
{
68+
$objectManager = Bootstrap::getObjectManager();
69+
$this->creditmemoFactory = $objectManager->get(CreditmemoFactory::class);
70+
$this->creditmemoManagement = $objectManager->get(CreditmemoManagementInterface::class);
71+
$this->creditmemoSender = $objectManager->get(CreditmemoSender::class);
72+
$this->transportBuilder = $objectManager->get(TransportBuilderMock::class);
73+
$this->sentEmails = [];
74+
// Capture sent emails
75+
$this->transportBuilder->setOnMessageSentCallback(
76+
function (EmailMessageInterface $message) {
77+
$this->sentEmails[] = $message;
78+
}
79+
);
80+
}
81+
82+
/**
83+
* Test: Create Credit Memo for Offline Payment Methods with Async Email Notification
84+
*
85+
* @return void
86+
* @throws LocalizedException
87+
*/
88+
#[
89+
Config('payment/checkmo/active', '1'),
90+
Config('carriers/flatrate/active', '1'),
91+
Config('sales_email/general/async_sending', '1'),
92+
Config('sales_email/creditmemo/enabled', '1'),
93+
DataFixture(ProductFixture::class, as: 'product'),
94+
DataFixture(GuestCartFixture::class, as: 'cart'),
95+
DataFixture(AddProductToCartFixture::class, ['cart_id' => '$cart.id$', 'product_id' => '$product.id$']),
96+
DataFixture(SetBillingAddressFixture::class, ['cart_id' => '$cart.id$']),
97+
DataFixture(SetShippingAddressFixture::class, ['cart_id' => '$cart.id$']),
98+
DataFixture(SetGuestEmailFixture::class, ['cart_id' => '$cart.id$']),
99+
DataFixture(SetDeliveryMethodFixture::class, ['cart_id' => '$cart.id$']),
100+
DataFixture(SetPaymentMethodFixture::class, ['cart_id' => '$cart.id$', 'method' => 'checkmo']),
101+
DataFixture(PlaceOrderFixture::class, ['cart_id' => '$cart.id$'], 'order'),
102+
DataFixture(InvoiceFixture::class, ['order_id' => '$order.id$'], 'invoice'),
103+
]
104+
public function testCreateCreditmemoWithAsyncEmailNotification(): void
105+
{
106+
$fixtures = DataFixtureStorageManager::getStorage();
107+
$order = $fixtures->get('order');
108+
$this->assertNotNull($order->getId(), 'Order should exist');
109+
$this->assertTrue($order->hasInvoices(), 'Order should have invoice');
110+
$this->assertEquals('checkmo', $order->getPayment()->getMethod());
111+
$creditmemo = $this->creditmemoFactory->createByOrder($order);
112+
$creditmemoRepository = Bootstrap::getObjectManager()->get(CreditmemoRepositoryInterface::class);
113+
$creditmemoRepository->save($creditmemo);
114+
$creditmemo->setSendEmail(true);
115+
$creditmemoRepository->save($creditmemo);
116+
$this->assertCount(
117+
0,
118+
$this->sentEmails,
119+
'Email should NOT be sent immediately in async mode'
120+
);
121+
$this->assertEmpty(
122+
$creditmemo->getEmailSent(),
123+
'EmailSent should be empty until async process sends it'
124+
);
125+
$creditmemoEmailCron = Bootstrap::getObjectManager()->get('SalesCreditmemoSendEmailsCron');
126+
$creditmemoEmailCron->execute();
127+
$this->assertCount(1, $this->sentEmails, 'One refund email should be sent');
128+
$email = $this->sentEmails[0];
129+
$this->assertInstanceOf(EmailMessageInterface::class, $email);
130+
$this->assertStringContainsString(
131+
'Credit memo',
132+
$email->getSubject(),
133+
'Email subject should contain "Credit memo"'
134+
);
135+
}
136+
137+
/**
138+
* @inheritdoc
139+
*/
140+
protected function tearDown(): void
141+
{
142+
$this->sentEmails = [];
143+
}
144+
}

0 commit comments

Comments
 (0)