Skip to content

Commit 1f7eace

Browse files
committed
MFTF test.
1 parent 92fd06b commit 1f7eace

File tree

3 files changed

+134
-0
lines changed

3 files changed

+134
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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="StorefrontNotAssertDownloadableProductLinkInCustomerAccountActionGroup">
12+
<annotations>
13+
<description>Goes to the Storefront Customer Dashboard page. Clicks on 'My Downloadable Products'. Validates that the provided Downloadable Product is present and Downloadable link not exist.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="product"/>
17+
</arguments>
18+
19+
<amOnPage url="{{StorefrontCustomerDashboardPage.url}}" stepKey="goToMyAccountPage"/>
20+
<click selector="{{StorefrontCustomerSidebarSection.sidebarTab('My Downloadable Products')}}" stepKey="clickDownloadableProducts"/>
21+
<waitForPageLoad stepKey="waitForDownloadableProductsPageLoad"/>
22+
<seeElement selector="{{StorefrontCustomerDownloadableProductsSection.productName(product.name)}}" stepKey="seeStorefrontDownloadableProductsProductName"/>
23+
<dontSeeElement selector="{{StorefrontCustomerDownloadableProductsSection.downloadableLink}}" stepKey="dontSeeStorefrontMyDownloadableProductsLink"/>
24+
25+
</actionGroup>
26+
</actionGroups>

app/code/Magento/Downloadable/Test/Mftf/Section/StorefrontCustomerDownloadableProductsSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontCustomerDownloadableProductsSection">
1212
<element name="productName" type="text" selector="//table[@id='my-downloadable-products-table']//strong[contains(@class, 'product-name') and normalize-space(.)='{{productName}}']" parameterized="true"/>
13+
<element name="downloadableLink" type="button" selector="//table[@id='my-downloadable-products-table']//a[contains(@class, 'download')]"/>
1314
</section>
1415
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
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="StorefrontAccountDownloadableProductLinkAfterPartialRefundTest">
11+
<annotations>
12+
<features value="Catalog"/>
13+
<stories value="Customer Account Downloadable Products Link"/>
14+
<title value="My Account Downloadable Product Link after Partially Refunded"/>
15+
<description value="Verify that Downloadable product is not available in My Download Products tab after it has been partially refunded."/>
16+
<severity value="CRITICAL"/>
17+
<group value="Downloadable"/>
18+
</annotations>
19+
20+
<before>
21+
<magentoCLI stepKey="addDownloadableDomain" command="downloadable:domains:add example.com static.magento.com"/>
22+
<magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/>
23+
24+
<createData entity="ApiCategory" stepKey="createCategory"/>
25+
<createData entity="ApiSimpleProduct" stepKey="createSimpleProduct">
26+
<requiredEntity createDataKey="createCategory"/>
27+
</createData>
28+
<createData entity="ApiDownloadableProduct" stepKey="createDownloadableProduct"/>
29+
<createData entity="downloadableLink1" stepKey="addDownloadableLink1">
30+
<requiredEntity createDataKey="createDownloadableProduct"/>
31+
</createData>
32+
33+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
34+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
35+
36+
<createData entity="Simple_US_Customer_Multiple_Addresses" stepKey="createCustomer"/>
37+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="signIn">
38+
<argument name="Customer" value="$$createCustomer$$"/>
39+
</actionGroup>
40+
</before>
41+
42+
<after>
43+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
44+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
45+
46+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
47+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
48+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
49+
<deleteData createDataKey="createDownloadableProduct" stepKey="deleteDownloadableProduct"/>
50+
51+
<magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove example.com static.magento.com"/>
52+
<magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/>
53+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
54+
</after>
55+
56+
<actionGroup ref="StorefrontAddSimpleProductToShoppingCartActionGroup" stepKey="addSimpleProductToCart">
57+
<argument name="product" value="$$createSimpleProduct$$"/>
58+
</actionGroup>
59+
60+
<amOnPage url="{{StorefrontProductPage.url($$createDownloadableProduct.custom_attributes[url_key]$$)}}" stepKey="OpenStoreFrontProductPage"/>
61+
<waitForPageLoad stepKey="waitForPageToLoad"/>
62+
63+
<actionGroup ref="StorefrontAddToCartCustomOptionsProductPageActionGroup" stepKey="addToTheCart">
64+
<argument name="productName" value="$$createDownloadableProduct.name$$"/>
65+
</actionGroup>
66+
67+
<actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/>
68+
<click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="clickProceedToCheckout"/>
69+
<waitForPageLoad stepKey="waitForProceedToCheckout"/>
70+
<waitForElementVisible selector="{{CheckoutShippingSection.shipHereButton(UK_Not_Default_Address.street[0])}}" stepKey="waitForShipHereVisible"/>
71+
<click selector="{{CheckoutShippingSection.shipHereButton(UK_Not_Default_Address.street[0])}}" stepKey="clickShipHere"/>
72+
<click selector="{{CheckoutShippingGuestInfoSection.next}}" stepKey="clickNext"/>
73+
<waitForPageLoad stepKey="waitForShipmentPageLoad"/>
74+
<checkOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="selectPaymentSolution"/>
75+
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/>
76+
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrderButton"/>
77+
<seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced"/>
78+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>
79+
80+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
81+
82+
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/>
83+
<actionGroup ref="SearchAdminDataGridByKeywordActionGroup" stepKey="searchOrder">
84+
<argument name="keyword" value="$grabOrderNumber"/>
85+
</actionGroup>
86+
<actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/>
87+
88+
<actionGroup ref="AdminCreateInvoiceActionGroup" stepKey="createCreditMemo"/>
89+
90+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder">
91+
<argument name="orderId" value="{$grabOrderNumber}"/>
92+
</actionGroup>
93+
94+
<actionGroup ref="AdminOpenAndFillCreditMemoRefundActionGroup" stepKey="fillCreditMemoRefund">
95+
<argument name="itemQtyToRefund" value="0"/>
96+
<argument name="rowNumber" value="1"/>
97+
</actionGroup>
98+
99+
<click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickRefundOffline"/>
100+
<waitForPageLoad stepKey="waitForResultPage"/>
101+
102+
<actionGroup ref="StorefrontNotAssertDownloadableProductLinkInCustomerAccountActionGroup" stepKey="dontSeeStorefrontMyAccountDownloadableProductsLink">
103+
<argument name="product" value="$$createDownloadableProduct$$"/>
104+
</actionGroup>
105+
106+
</test>
107+
</tests>

0 commit comments

Comments
 (0)