Skip to content

Commit 8a53d43

Browse files
Manjusha.SManjusha.S
authored andcommitted
fix
1 parent cc88be0 commit 8a53d43

File tree

8 files changed

+186
-101
lines changed

8 files changed

+186
-101
lines changed

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

Lines changed: 0 additions & 29 deletions
This file was deleted.

app/code/Magento/Catalog/Test/Mftf/Data/CategoryData.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,30 @@
107107
<data key="include_in_menu">true</data>
108108
<var key="parent_id" entityType="category" entityKey="id" />
109109
</entity>
110+
<entity name="Four_nested_categories" type="category">
111+
<data key="name" unique="suffix">FourthLevel</data>
112+
<data key="url_key" unique="suffix">fourthlevel</data>
113+
<data key="name_lwr" unique="suffix">fourthlevel</data>
114+
<data key="is_active">true</data>
115+
<data key="include_in_menu">true</data>
116+
<var key="parent_id" entityType="category" entityKey="id" />
117+
</entity>
118+
<entity name="Five_nested_categories" type="category">
119+
<data key="name" unique="suffix">FifthLevel</data>
120+
<data key="url_key" unique="suffix">fifthlevel</data>
121+
<data key="name_lwr" unique="suffix">fifthlevel</data>
122+
<data key="is_active">true</data>
123+
<data key="include_in_menu">true</data>
124+
<var key="parent_id" entityType="category" entityKey="id" />
125+
</entity>
126+
<entity name="Six_nested_categories" type="category">
127+
<data key="name" unique="suffix">SixthLevel</data>
128+
<data key="url_key" unique="suffix">sixthlevel</data>
129+
<data key="name_lwr" unique="suffix">sixthlevel</data>
130+
<data key="is_active">true</data>
131+
<data key="include_in_menu">true</data>
132+
<var key="parent_id" entityType="category" entityKey="id" />
133+
</entity>
110134
<entity name="CatNotIncludeInMenu" type="category">
111135
<data key="name" unique="suffix">NotInclMenu</data>
112136
<data key="name_lwr" unique="suffix">notinclemenu</data>

app/code/Magento/Catalog/Test/Mftf/Metadata/CategoryMeta.xml

Lines changed: 131 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -5,64 +5,137 @@
55
* See COPYING.txt for license details.
66
*/
77
-->
8-
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
10-
<operation name="CreateCategory" dataType="category" type="create" auth="adminOauth" url="/V1/categories" method="POST">
11-
<contentType>application/json</contentType>
12-
<object key="category" dataType="category">
13-
<field key="parent_id">integer</field>
14-
<field key="name">string</field>
15-
<field key="is_active">boolean</field>
16-
<field key="position">integer</field>
17-
<field key="level">integer</field>
18-
<field key="children">string</field>
19-
<field key="created_at">string</field>
20-
<field key="updated_at">string</field>
21-
<field key="path">string</field>
22-
<field key="include_in_menu">boolean</field>
23-
<array key="available_sort_by">
24-
<value>string</value>
25-
</array>
26-
<field key="extension_attributes">empty_extension_attribute</field>
27-
<array key="custom_attributes">
28-
<value>custom_attribute</value>
29-
</array>
30-
</object>
31-
</operation>
328

33-
<operation name="UpdateCategory" dataType="category" type="update" auth="adminOauth" url="/V1/categories/{id}" method="PUT">
34-
<contentType>application/json</contentType>
35-
<object key="category" dataType="category">
36-
<field key="id">integer</field>
37-
<field key="parent_id">integer</field>
38-
<field key="name">string</field>
39-
<field key="is_active">boolean</field>
40-
<field key="position">integer</field>
41-
<field key="level">integer</field>
42-
<field key="children">string</field>
43-
<field key="created_at">string</field>
44-
<field key="updated_at">string</field>
45-
<field key="path">string</field>
46-
<array key="available_sort_by">
47-
<value>string</value>
48-
</array>
49-
<field key="include_in_menu">boolean</field>
50-
<field key="extension_attributes">empty_extension_attribute</field>
51-
<array key="custom_attributes">
52-
<value>custom_attribute</value>
53-
</array>
54-
</object>
55-
</operation>
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminRefundWithDiscountGifCardAndStoreCreditTest">
12+
<annotations>
13+
<features value="Testing refund of order for 100$ when 60$ was paid with virtual money (Discount+GiftCard+StoreCredit) and 40$ was paid with offline payment."/>
14+
<stories value="TestingRefundofOrderWithVirtualMoney"/>
15+
<title value="TestingRefundofOrderWithVirtualMoney"/>
16+
<description value="Testing refund of order for 100$ when 60$ was paid with virtual money (Discount+GiftCard+StoreCredit) and 40$ was paid with offline payment."/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="AC-5669"/>
19+
</annotations>
20+
<before>
21+
<!--Create Category-->
22+
<createData entity="_defaultCategory" stepKey="testCategory"/>
23+
<!-- Create SimpleProductwithPrice100 -->
24+
<createData entity="SimpleProduct_100" stepKey="simpleProductOne">
25+
<requiredEntity createDataKey="testCategory"/>
26+
</createData>
27+
<!-- Assign SimpleProductOne to Category -->
28+
<createData entity="AssignProductToCategory" stepKey="assignSimpleProductOneToTestCategory">
29+
<requiredEntity createDataKey="testCategory"/>
30+
<requiredEntity createDataKey="simpleProductOne"/>
31+
</createData>
32+
<!-- Create a cart price rule with coupon-->
33+
<createData entity="SalesRuleSpecificCouponWithThirtyPercentDiscount" stepKey="createCartPriceRule"/>
34+
<createData entity="SimpleSalesRuleCoupon" stepKey="createCouponForCartPriceRule">
35+
<requiredEntity createDataKey="createCartPriceRule"/>
36+
</createData>
37+
</before>
38+
<after>
39+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
40+
<deleteData createDataKey="testCategory" stepKey="deleteCategory"/>
41+
<deleteData createDataKey="simpleProductOne" stepKey="deleteProduct"/>
42+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
43+
<deleteData createDataKey="createCartPriceRule" stepKey="deleteCartPriceRule"/>
44+
</after>
45+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
46+
<amOnPage url="{{AdminStoresConfigurationGiftCardAccountGeneralSettingsPage.url}}" stepKey="amOnGiftCardAccountGeneralSettingsPage"/>
47+
<!-- Hit Generate to generate a new pool of gift card accounts -->
48+
<click selector="{{AdminGiftCardAccountGeneralSettingsSection.generate}}" stepKey="clickGenerateNewCodePoolButton"/>
49+
<waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitPopupAppears"/>
50+
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="acceptPopup"/>
51+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" time="60" stepKey="waitCodePoolGeneratedSuccessMessage"/>
52+
<see selector="{{AdminMessagesSection.success}}" userInput="New code pool was generated." stepKey="seeSuccessMessage"/>
53+
<!-- Marketing > Gift Card accounts > Gift Account grid, click Add gift card account -->
54+
<actionGroup ref="AddGiftCardAccountActionGroup" stepKey="addGiftCardAmount">
55+
<argument name="website" value="Main Website" />
56+
<argument name="balanceAmount" value="10" />
57+
</actionGroup>
58+
<grabTextFrom selector="{{AdminGiftCardAccountGridSection.giftCardCode}}" stepKey="grabGiftCardCode2"/>
5659

57-
<operation name="DeleteCategory" dataType="category" type="delete" auth="adminOauth" url="/V1/categories/{id}" method="DELETE">
58-
<contentType>application/json</contentType>
59-
</operation>
60+
<!--Create Customer-->
61+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
62+
<!-- Add Customer Balance-->
63+
<actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="openCustomerEditPage">
64+
<argument name="customerId" value="$$createCustomer.id$$"/>
65+
</actionGroup>
66+
<!--Add Balance 20-->
67+
<actionGroup ref="UpdateCustomerStoreCreditBalanceAdminActionGroup" stepKey="updateStoreCreditFromAdmin">
68+
<argument name="storeCredit" value="20" />
69+
</actionGroup>
70+
<!--Enable Free Shipping-->
71+
<actionGroup ref="CliEnableFreeShippingMethodActionGroup" stepKey="enableFreeShipping"/>
72+
<!-- Login to Store Front-->
73+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStoreFront">
74+
<argument name="Customer" value="$createCustomer$"/>
75+
</actionGroup>
76+
<!--Go to product page-->
77+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductFromCategory">
78+
<argument name="productUrlKey" value="$simpleProductOne.custom_attributes[url_key]$"/>
79+
</actionGroup>
80+
<!--Add Product to Shopping Cart-->
81+
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage">
82+
<argument name="productName" value="$simpleProductOne.name$"/>
83+
</actionGroup>
84+
<!--Go to Checkout-->
85+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
86+
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="setShippingMethodFreeShipping">
87+
<argument name="shippingMethodName" value="Free Shipping"/>
88+
</actionGroup>
89+
<actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="clickNextButton"/>
90+
<!-- Checkout select Check/Money Order payment -->
91+
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/>
92+
<!-- Click Apply Discount Code: section is expanded. Input promo code, apply and see success message -->
93+
<actionGroup ref="StorefrontApplyDiscountCodeActionGroup" stepKey="applyCoupon">
94+
<argument name="discountCode" value="$createCouponForCartPriceRule.code$"/>
95+
</actionGroup>
96+
<wait time="10" stepKey="waitTenSeconds"/>
97+
<!-- Step 4: Click Apply Gift Card -->
98+
<click selector="{{StorefrontApplyGiftCardAccountSection.openApplyGiftCardSection}}" stepKey="openApplyGiftCardSection"/>
99+
<!-- Step 5: Input %GCA_code% in field -->
100+
<fillField selector="{{StorefrontApplyGiftCardAccountSection.giftCardCodeField}}" userInput="{$grabGiftCardCode2}" stepKey="inputGCACodeField2"/>
101+
<click selector="{{StorefrontApplyGiftCardAccountSection.applyGiftCardButton}}" stepKey="clickApplyGiftCardButton"/>
102+
<waitForPageLoad stepKey="waitForPageLoad4"/>
103+
<click selector="{{CheckoutStoreCreditSection.useStoreCredit}}" stepKey="clickUseStoreCredit"/>
104+
<!--Click Place Order button-->
105+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/>
106+
<!--GrabOrderLink-->
107+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="grabOrderNumber"/>
108+
<!--OpenOrder From Admin Page-->
109+
<actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="filterOrdersGridById">
110+
<argument name="entityId" value="{$grabOrderNumber}"/>
111+
</actionGroup>
112+
<!--Create Invoice for this Order-->
113+
<actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="createInvoice"/>
114+
<actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/>
115+
<waitForPageLoad stepKey="waitForPageLoad"/>
116+
<!--Make Invoice and Ship the Order-->
117+
<click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipButton"/>
118+
<waitForPageLoad stepKey="waitForPageLoad2"/>
119+
<actionGroup ref="SubmitShipmentIntoOrderActionGroup" stepKey="submitShipmentForSbmecondOrder"/>
120+
<!-- Wait up to 30 seconds for the current page to fully load before continuing. -->
121+
<waitForPageLoad stepKey="waitForPageLoad3"/>
122+
<!--Open Credit memo Page-->
123+
<click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="clickCreditMemoButton"/>
124+
<!--Check refund GrandTotal-->
125+
<see selector="{{AdminCreditMemoTotalSection.grandTotal}}" userInput="40" stepKey="seeGrandTotalinCreditMemo"/>
126+
<!--Create Credit Memo-->
127+
<click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickRefundOffline"/>
128+
<!--Assert refund in Credit Memo Tab -->
129+
<click selector="{{AdminOrderDetailsOrderViewSection.creditMemos}}" stepKey="clickCreditMemoTab"/>
130+
<waitForPageLoad stepKey="waitForTabLoad"/>
131+
<grabTextFrom selector="{{AdminCreditMemosGridSection.memoId}}" stepKey="grabMemoId"/>
132+
<assertNotEmpty stepKey="assertMemoIdIsNotEmpty" after="grabMemoId">
133+
<actualResult type="const">$grabMemoId</actualResult>
134+
</assertNotEmpty>
135+
<click selector="{{AdminCreditMemosGridSection.memoId}}" stepKey="clickView"/>
136+
<waitForPageLoad stepKey="waitForCreditMemo"/>
137+
<scrollTo selector="{{AdminCreditMemoViewTotalSection.subtotal}}" stepKey="scrollToTotal"/>
138+
<see selector="{{AdminCreditMemoViewTotalSection.grandTotal}}" userInput="40" stepKey="seeGrandTotal"/>
139+
</test>
140+
</tests>
60141

61-
<operation name="AssignProductToCategory" dataType="category_product_link" type="create" auth="adminOauth" url="/V1/categories/{id}/products" method="POST">
62-
<contentType>application/json</contentType>
63-
<object key="productLink" dataType="category_product_link">
64-
<field key="sku">string</field>
65-
<field key="category_id">string</field>
66-
</object>
67-
</operation>
68-
</operations>

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,5 @@
1111
<section name="AdminCategoryProductsSection">
1212
<element name="sectionHeader" type="button" selector="div[data-index='assign_products'] .fieldset-wrapper-title" timeout="30"/>
1313
<element name="sectionBody" type="button" selector="div[data-index='assign_products'] .admin__fieldset-wrapper-content" timeout="30"/>
14-
<element name="addProducts" type="button" selector="//button[@class='action-default scalable secondary add-products']"/>
15-
<element name="filtersButton" type="button" selector="//div[@class='data-grid-filters-actions-wrap']//button"/>
16-
<element name="clearAllButton" type="button" selector="//button[contains(text(),'Clear all')]"/>
17-
<element name="downArrow" type="button" selector="//button[@class='action-multicheck-toggle']"/>
18-
<element name="selectAllOnThisPage" type="select" selector="//span[contains(text(),'Select All on This Page')]"/>
19-
<element name="saveAndClose" type="button" selector="//button[@name='add_products_save_button']"/>
20-
<element name="subCategoryProductCount" type="text" selector="//div[@class='tree-holder']//span[contains(text(),'SimpleSubCategory') and contains(text(),'({{productCount}})')]" parameterized="true"/>
21-
<element name="defaultCategoryProductCount" type="text" selector="//div[@class='tree-holder']//span[contains(text(),'Default Category') and contains(text(),'({{productCount}})')]" parameterized="true"/>
2214
</section>
2315
</sections>

app/code/Magento/Cms/Test/Mftf/ActionGroup/AdminUpdateWidgetsOfCatalogProductLinkActionGroup.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,10 @@
1414
<arguments>
1515
<argument name="WidgetTitle" type="string" defaultValue="Catalog B Product Link"/>
1616
</arguments>
17-
1817
<click selector="{{CmsNewWidgetOptionsSection.FirstWidget}}" stepKey="clickFirstWidgetSelect"/>
1918
<waitForPageLoad stepKey="wait2"/>
20-
2119
<clearField selector="{{CmsNewWidgetStoreforntPropertiesSection.WidgetTitle}}" stepKey="clearWidgetTitle"/>
2220
<fillField selector="{{CmsNewWidgetStoreforntPropertiesSection.WidgetTitle}}" userInput="{{WidgetTitle}}" stepKey="fillFieldTitle"/>
23-
2421
<click selector="{{CmsNewWidgetOptionsSection.WidgetOptions}}" stepKey="clickButton23"/>
2522
<waitForPageLoad stepKey="wait3"/>
2623
<click selector="{{CmsNewWidgetOptionsSection.SelectProduct}}" stepKey="clickSelectProductButton1"/>
@@ -29,8 +26,6 @@
2926
<waitForPageLoad stepKey="wait5"/>
3027
<click selector="{{CmsNewWidgetOptionsSection.SaveWidget}}" stepKey="clickSaveWidgetButton2"/>
3128
<waitForPageLoad stepKey="wait6"/>
32-
3329
<magentoCLI command="cache:flush" stepKey="cleanCache"/>
34-
3530
</actionGroup>
3631
</actionGroups>

app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection/CmsNewWidgetUpdateLayoutSection.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,9 @@
1212
<element name="DisplayOn" type="button" selector="#widget_instance\[0\]\[page_group\]"/>
1313
<element name="Container" type="button" selector="#all_pages_0 > table > tbody > tr > td:nth-child(1) > div > div > select"/>
1414
<element name="Template" type="button" selector="#all_pages_0 > table > tbody > tr > td:nth-child(2) > div > div > select"/>
15+
<element name="SpecificCategories" type="button" selector="//input[@id='specific_anchor_categories_0']"/>
16+
<element name="CategoryChooserButton" type="button" selector="//*[@id='anchor_categories_ids_0']/p/a[1]/img"/>
17+
<element name="BranchCat" type="button" selector="//a/span[contains(text(),'{{var}}')]/../..//img[@class='x-tree-ec-icon x-tree-elbow-end-plus']" parameterized="true"/>
18+
<element name="CountAllNestedCat" type="button" selector="//*[@class='x-tree-ec-icon x-tree-elbow-end-minus' or @class='x-tree-ec-icon x-tree-elbow-end']"/>
1519
</section>
1620
</sections>

app/code/Magento/Cms/Test/Mftf/Test/AdminAddUpdateDeleteWidgetOfTypeCatalogProductLinkTypeTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<argument name="WidgetType" value="Catalog Product Link"/>
4040
<argument name="WidgetTheme" value="Magento Luma"/>
4141
<argument name="WidgetTitle" value="NewWidget"/>
42-
<argument name="AssigntoStoreViews" value="All Store Views"/>
42+
<argument name="AssignToStoreViews" value="All Store Views"/>
4343
<argument name="WidgetDisplayOn" value="All Pages"/>
4444
<argument name="Container" value="Main Content Area"/>
4545
<argument name="Template" value="Product Link Block Template"/>

0 commit comments

Comments
 (0)