|
5 | 5 | * See COPYING.txt for license details.
|
6 | 6 | */
|
7 | 7 | -->
|
| 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> |
8 | 32 |
|
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"/> |
| 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> |
59 | 56 |
|
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> |
| 57 | + <operation name="DeleteCategory" dataType="category" type="delete" auth="adminOauth" url="/V1/categories/{id}" method="DELETE"> |
| 58 | + <contentType>application/json</contentType> |
| 59 | + </operation> |
141 | 60 |
|
| 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> |
0 commit comments