AdminOrderActionGroup.xml 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  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. <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  9. xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
  10. <!--Navigate to create order page (New Order -> Create New Customer)-->
  11. <actionGroup name="navigateToNewOrderPageNewCustomer">
  12. <arguments>
  13. <argument name="storeView" defaultValue="_defaultStore"/>
  14. </arguments>
  15. <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/>
  16. <waitForPageLoad stepKey="waitForIndexPageLoad"/>
  17. <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/>
  18. <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/>
  19. <click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/>
  20. <click selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" stepKey="selectDefaultStoreView"/>
  21. <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/>
  22. </actionGroup>
  23. <!--Navigate to create order page (New Order -> Create New Customer)-->
  24. <actionGroup name="navigateToNewOrderPageNewCustomerSingleStore">
  25. <arguments>
  26. <argument name="storeView" defaultValue="_defaultStore"/>
  27. </arguments>
  28. <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/>
  29. <waitForPageLoad stepKey="waitForIndexPageLoad"/>
  30. <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/>
  31. <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/>
  32. <click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/>
  33. <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/>
  34. </actionGroup>
  35. <!--Navigate to create order page (New Order -> Select Customer)-->
  36. <actionGroup name="navigateToNewOrderPageExistingCustomer">
  37. <arguments>
  38. <argument name="customer"/>
  39. <argument name="storeView" defaultValue="_defaultStore"/>
  40. </arguments>
  41. <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/>
  42. <waitForPageLoad stepKey="waitForIndexPageLoad"/>
  43. <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/>
  44. <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/>
  45. <waitForPageLoad stepKey="waitForCustomerGridLoad"/>
  46. <!--Clear grid filters-->
  47. <conditionalClick selector="{{AdminOrderCustomersGridSection.resetButton}}" dependentSelector="{{AdminOrderCustomersGridSection.resetButton}}" visible="true" stepKey="clearExistingCustomerFilters"/>
  48. <fillField userInput="{{customer.email}}" selector="{{AdminOrderCustomersGridSection.emailInput}}" stepKey="filterEmail"/>
  49. <click selector="{{AdminOrderCustomersGridSection.apply}}" stepKey="applyFilter"/>
  50. <waitForPageLoad stepKey="waitForFilteredCustomerGridLoad"/>
  51. <click selector="{{AdminOrderCustomersGridSection.firstRow}}" stepKey="clickOnCustomer"/>
  52. <waitForPageLoad stepKey="waitForCreateOrderPageLoad" />
  53. <!-- Select store view if appears -->
  54. <conditionalClick selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" dependentSelector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" visible="true" stepKey="selectStoreViewIfAppears"/>
  55. <waitForPageLoad stepKey="waitForCreateOrderPageLoadAfterStoreSelect" />
  56. <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/>
  57. </actionGroup>
  58. <!--Navigate to New Order Page for existing Customer And Store-->
  59. <actionGroup name="NavigateToNewOrderPageExistingCustomerAndStoreActionGroup" extends="navigateToNewOrderPageExistingCustomer" >
  60. <arguments>
  61. <argument name="storeView" defaultValue="_defaultStore"/>
  62. </arguments>
  63. <click selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" stepKey="selectStoreView" after="waitForCreateOrderPageLoad"/>
  64. <waitForPageLoad stepKey="waitForLoad" after="selectStoreView"/>
  65. </actionGroup>
  66. <!--Check the required fields are actually required-->
  67. <actionGroup name="checkRequiredFieldsNewOrderForm">
  68. <seeElement selector="{{AdminOrderFormAccountSection.requiredGroup}}" stepKey="seeCustomerGroupRequired"/>
  69. <seeElement selector="{{AdminOrderFormAccountSection.requiredEmail}}" stepKey="seeEmailRequired"/>
  70. <clearField selector="{{AdminOrderFormAccountSection.email}}" stepKey="clearEmailField"/>
  71. <clearField selector="{{AdminOrderFormBillingAddressSection.FirstName}}" stepKey="clearFirstNameField"/>
  72. <clearField selector="{{AdminOrderFormBillingAddressSection.LastName}}" stepKey="clearLastNameField"/>
  73. <clearField selector="{{AdminOrderFormBillingAddressSection.StreetLine1}}" stepKey="clearStreetField"/>
  74. <clearField selector="{{AdminOrderFormBillingAddressSection.City}}" stepKey="clearCityField"/>
  75. <selectOption selector="{{AdminOrderFormBillingAddressSection.Country}}" userInput="United States" stepKey="selectUSCountry"/>
  76. <selectOption selector="{{AdminOrderFormBillingAddressSection.State}}" userInput="Please select" stepKey="selectNoState"/>
  77. <clearField selector="{{AdminOrderFormBillingAddressSection.PostalCode}}" stepKey="clearPostalCodeField"/>
  78. <clearField selector="{{AdminOrderFormBillingAddressSection.Phone}}" stepKey="clearPhoneField"/>
  79. <seeElement selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="seeShippingMethodNotSelected"/>
  80. <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="trySubmitOrder"/>
  81. <see selector="{{AdminOrderFormBillingAddressSection.emailError}}" userInput="This is a required field." stepKey="seeThatEmailIsRequired"/>
  82. <see selector="{{AdminOrderFormBillingAddressSection.firstNameError}}" userInput="This is a required field." stepKey="seeFirstNameRequired"/>
  83. <see selector="{{AdminOrderFormBillingAddressSection.lastNameError}}" userInput="This is a required field." stepKey="seeLastNameRequired"/>
  84. <see selector="{{AdminOrderFormBillingAddressSection.streetAddressError}}" userInput="This is a required field." stepKey="seeStreetRequired"/>
  85. <see selector="{{AdminOrderFormBillingAddressSection.cityError}}" userInput="This is a required field." stepKey="seeCityRequired"/>
  86. <see selector="{{AdminOrderFormBillingAddressSection.stateError}}" userInput="This is a required field." stepKey="seeStateRequired"/>
  87. <see selector="{{AdminOrderFormBillingAddressSection.postalCodeError}}" userInput="This is a required field." stepKey="seePostalCodeRequired"/>
  88. <see selector="{{AdminOrderFormBillingAddressSection.phoneError}}" userInput="This is a required field." stepKey="seePhoneRequired"/>
  89. <see selector="{{AdminOrderFormPaymentSection.shippingError}}" userInput="This is a required field." stepKey="seeShippingMethodRequired"/>
  90. </actionGroup>
  91. <!--Add a simple product to order-->
  92. <actionGroup name="addSimpleProductToOrder">
  93. <arguments>
  94. <argument name="product" defaultValue="_defaultProduct"/>
  95. </arguments>
  96. <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/>
  97. <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilter"/>
  98. <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearch"/>
  99. <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/>
  100. <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectProduct"/>
  101. <fillField selector="{{AdminOrderFormItemsSection.rowQty('1')}}" userInput="1" stepKey="fillProductQty"/>
  102. <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/>
  103. <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/>
  104. <wait time="5" stepKey="waitForOptionsToLoad"/>
  105. </actionGroup>
  106. <!--Add configurable product to order -->
  107. <actionGroup name="addConfigurableProductToOrder">
  108. <arguments>
  109. <argument name="product"/>
  110. <argument name="attribute"/>
  111. <argument name="option"/>
  112. </arguments>
  113. <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/>
  114. <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterConfigurable"/>
  115. <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchConfigurable"/>
  116. <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/>
  117. <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectConfigurableProduct"/>
  118. <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_label)}}" stepKey="waitForConfigurablePopover"/>
  119. <wait time="2" stepKey="waitForOptionsToLoad"/>
  120. <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_label)}}"
  121. userInput="{{option.name}}" stepKey="selectionConfigurableOption"/>
  122. <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/>
  123. <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/>
  124. <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/>
  125. </actionGroup>
  126. <!--Add configurable product to order -->
  127. <actionGroup name="addConfigurableProductToOrderFromAdmin" extends="addConfigurableProductToOrder">
  128. <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" stepKey="waitForConfigurablePopover"/>
  129. <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}"
  130. userInput="{{option.label}}" stepKey="selectionConfigurableOption"/>
  131. </actionGroup>
  132. <actionGroup name="configureOrderedConfigurableProduct">
  133. <arguments>
  134. <argument name="attribute"/>
  135. <argument name="option"/>
  136. <argument name="quantity" type="string"/>
  137. </arguments>
  138. <click selector="{{AdminOrderFormItemsSection.configure}}" stepKey="clickConfigure"/>
  139. <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" stepKey="waitForConfigurablePopover"/>
  140. <wait time="2" stepKey="waitForOptionsToLoad"/>
  141. <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}"
  142. userInput="{{option.label}}" stepKey="selectionConfigurableOption"/>
  143. <fillField selector="{{AdminOrderFormConfigureProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/>
  144. <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/>
  145. </actionGroup>
  146. <!--Add bundle product to order -->
  147. <actionGroup name="addBundleProductToOrder">
  148. <arguments>
  149. <argument name="product"/>
  150. <argument name="quantity" type="string" defaultValue="1"/>
  151. </arguments>
  152. <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/>
  153. <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterBundle"/>
  154. <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchBundle"/>
  155. <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/>
  156. <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectBundleProduct"/>
  157. <waitForElementVisible selector="{{AdminOrderFormBundleProductSection.quantity}}" stepKey="waitForBundleOptionLoad"/>
  158. <wait time="2" stepKey="waitForOptionsToLoad"/>
  159. <fillField selector="{{AdminOrderFormBundleProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/>
  160. <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/>
  161. <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/>
  162. <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/>
  163. </actionGroup>
  164. <!--Add bundle product to order and check product price in the grid-->
  165. <actionGroup name="addBundleProductToOrderAndCheckPriceInGrid" extends="addBundleProductToOrder">
  166. <arguments>
  167. <argument name="price" type="string"/>
  168. </arguments>
  169. <grabTextFrom selector="{{AdminOrderFormItemsSection.rowPrice('1')}}" stepKey="grabProductPriceFromGrid" after="clickOk"/>
  170. <assertEquals stepKey="assertProductPriceInGrid" message="Bundle product price in grid should be equal {{price}}" after="grabProductPriceFromGrid">
  171. <expectedResult type="string">{{price}}</expectedResult>
  172. <actualResult type="variable">grabProductPriceFromGrid</actualResult>
  173. </assertEquals>
  174. </actionGroup>
  175. <!--Add downloadable product to order -->
  176. <actionGroup name="addDownloadableProductToOrder">
  177. <arguments>
  178. <argument name="product"/>
  179. <argument name="link"/>
  180. <argument name="quantity" defaultValue="1" type="string"/>
  181. </arguments>
  182. <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/>
  183. <waitForPageLoad time="30" stepKey="waitForPageLoad1"/>
  184. <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterDownloadable"/>
  185. <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchDownloadable"/>
  186. <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/>
  187. <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectDownloadableProduct"/>
  188. <waitForElementVisible selector="{{AdminOrderFormDownloadableProductSection.optionSelect(link.title)}}" stepKey="waitForLinkLoad"/>
  189. <click selector="{{AdminOrderFormDownloadableProductSection.optionSelect(link.title)}}" stepKey="selectLink"/>
  190. <fillField selector="{{AdminOrderFormDownloadableProductSection.quantity}}" userInput="{{quantity}}" stepKey="setQuantity"/>
  191. <click selector="{{AdminOrderFormDownloadableProductSection.ok}}" stepKey="confirmConfiguration"/>
  192. <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/>
  193. <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/>
  194. </actionGroup>
  195. <!--Add grouped product option to order -->
  196. <actionGroup name="addGroupedProductOptionToOrder">
  197. <arguments>
  198. <argument name="product"/>
  199. <argument name="option"/>
  200. <argument name="quantity" type="string" defaultValue="1"/>
  201. </arguments>
  202. <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/>
  203. <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterGrouped"/>
  204. <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchGrouped"/>
  205. <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/>
  206. <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectGroupedProduct"/>
  207. <waitForElementVisible selector="{{AdminOrderFormGroupedProductSection.optionQty(option.sku)}}" stepKey="waitForGroupedOptionLoad"/>
  208. <wait time="2" stepKey="waitForOptionsToLoad"/>
  209. <fillField selector="{{AdminOrderFormGroupedProductSection.optionQty(option.sku)}}" userInput="{{quantity}}" stepKey="fillOptionQuantity"/>
  210. <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/>
  211. <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/>
  212. <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/>
  213. </actionGroup>
  214. <!--Fill customer billing address-->
  215. <actionGroup name="fillOrderCustomerInformation">
  216. <arguments>
  217. <argument name="customer"/>
  218. <argument name="address"/>
  219. </arguments>
  220. <fillField selector="{{AdminOrderFormBillingAddressSection.FirstName}}" userInput="{{customer.firstname}}" stepKey="fillFirstName"/>
  221. <fillField selector="{{AdminOrderFormBillingAddressSection.LastName}}" userInput="{{customer.lastname}}" stepKey="fillLastName"/>
  222. <fillField selector="{{AdminOrderFormBillingAddressSection.StreetLine1}}" userInput="{{address.street[0]}}" stepKey="fillStreetLine1"/>
  223. <fillField selector="{{AdminOrderFormBillingAddressSection.City}}" userInput="{{address.city}}" stepKey="fillCity"/>
  224. <selectOption selector="{{AdminOrderFormBillingAddressSection.Country}}" userInput="{{address.country_id}}" stepKey="fillCountry"/>
  225. <selectOption selector="{{AdminOrderFormBillingAddressSection.State}}" userInput="{{address.state}}" stepKey="fillState"/>
  226. <fillField selector="{{AdminOrderFormBillingAddressSection.PostalCode}}" userInput="{{address.postcode}}" stepKey="fillPostalCode"/>
  227. <fillField selector="{{AdminOrderFormBillingAddressSection.Phone}}" userInput="{{address.telephone}}" stepKey="fillPhone"/>
  228. </actionGroup>
  229. <!--Select flat rate shipping method-->
  230. <actionGroup name="orderSelectFlatRateShipping">
  231. <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/>
  232. <waitForPageLoad stepKey="waitForJavascriptToFinish"/>
  233. <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods"/>
  234. <waitForElementVisible selector="{{AdminOrderFormPaymentSection.flatRateOption}}" stepKey="waitForShippingOptions"/>
  235. <selectOption selector="{{AdminOrderFormPaymentSection.flatRateOption}}" userInput="flatrate_flatrate" stepKey="checkFlatRate"/>
  236. </actionGroup>
  237. <!--Select free shipping method-->
  238. <actionGroup name="orderSelectFreeShipping">
  239. <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/>
  240. <waitForPageLoad stepKey="waitForJavascriptToFinish"/>
  241. <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods"/>
  242. <waitForElementVisible selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" stepKey="waitForShippingOptions"/>
  243. <selectOption selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" userInput="freeshipping_freeshipping" stepKey="checkFreeShipping"/>
  244. </actionGroup>
  245. <!--Check that customer information is correct in order-->
  246. <actionGroup name="verifyBasicOrderInformation">
  247. <arguments>
  248. <argument name="customer"/>
  249. <argument name="shippingAddress"/>
  250. <argument name="billingAddress"/>
  251. <argument name="customerGroup" defaultValue="GeneralCustomerGroup"/>
  252. </arguments>
  253. <see selector="{{AdminOrderDetailsInformationSection.customerName}}" userInput="{{customer.firstname}}" stepKey="seeCustomerName"/>
  254. <see selector="{{AdminOrderDetailsInformationSection.customerEmail}}" userInput="{{customer.email}}" stepKey="seeCustomerEmail"/>
  255. <see selector="{{AdminOrderDetailsInformationSection.customerGroup}}" userInput="{{customerGroup.code}}" stepKey="seeCustomerGroup"/>
  256. <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.street[0]}}" stepKey="seeBillingAddressStreet"/>
  257. <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.city}}" stepKey="seeBillingAddressCity"/>
  258. <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country_id}}" stepKey="seeBillingAddressCountry"/>
  259. <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.postcode}}" stepKey="seeBillingAddressPostcode"/>
  260. <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.street[0]}}" stepKey="seeShippingAddressStreet"/>
  261. <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.city}}" stepKey="seeShippingAddressCity"/>
  262. <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/>
  263. <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/>
  264. </actionGroup>
  265. <!--Verify order information-->
  266. <actionGroup name="verifyCreatedOrderInformation">
  267. <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the order." stepKey="seeSuccessMessage"/>
  268. <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderPendingStatus" after="seeSuccessMessage"/>
  269. <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId" after="seeOrderPendingStatus"/>
  270. <assertNotEmpty actual="$getOrderId" stepKey="assertOrderIdIsNotEmpty" after="getOrderId"/>
  271. </actionGroup>
  272. <!--Check for product in order items list-->
  273. <actionGroup name="seeProductInItemsOrdered">
  274. <arguments>
  275. <argument name="product"/>
  276. </arguments>
  277. <see selector="{{AdminOrderItemsOrderedSection.productSkuColumn}}" userInput="{{product.sku}}" stepKey="seeSkuInItemsOrdered"/>
  278. </actionGroup>
  279. <actionGroup name="CreateOrderInStoreActionGroup">
  280. <arguments>
  281. <argument name="product"/>
  282. <argument name="customer"/>
  283. <argument name="storeView"/>
  284. </arguments>
  285. <amOnPage stepKey="navigateToNewOrderPage" url="{{AdminOrderCreatePage.url}}"/>
  286. <click stepKey="chooseCustomer" selector="{{AdminOrdersGridSection.customerInOrdersSection(customer.firstname)}}"/>
  287. <waitForPageLoad stepKey="waitForStoresPageOpened"/>
  288. <click stepKey="chooseStore" selector="{{AdminOrderStoreScopeTreeSection.storeForOrder(storeView.name)}}"/>
  289. <scrollToTopOfPage stepKey="scrollToTop"/>
  290. <waitForPageLoad stepKey="waitForStoreToAppear"/>
  291. <click selector="{{OrdersGridSection.addProducts}}" stepKey="clickOnAddProducts"/>
  292. <waitForPageLoad stepKey="waitForProductsListForOrder"/>
  293. <click selector="{{AdminOrdersGridSection.productForOrder(product.sku)}}" stepKey="chooseTheProduct"/>
  294. <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="addSelectedProductToOrder"/>
  295. <waitForPageLoad stepKey="waitForProductAddedInOrder"/>
  296. <click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/>
  297. <waitForPageLoad stepKey="waitForShippingMethods"/>
  298. <click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/>
  299. <waitForPageLoad stepKey="waitForShippingMethodsThickened"/>
  300. <click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitOrder"/>
  301. <see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/>
  302. </actionGroup>
  303. <actionGroup name="CreateOrderInStoreChoosingPaymentMethodActionGroup">
  304. <arguments>
  305. <argument name="product"/>
  306. <argument name="customer"/>
  307. <argument name="storeView"/>
  308. </arguments>
  309. <amOnPage stepKey="navigateToNewOrderPage" url="{{AdminOrderCreatePage.url}}"/>
  310. <click stepKey="chooseCustomer" selector="{{AdminOrdersGridSection.customerInOrdersSection(customer.firstname)}}"/>
  311. <waitForPageLoad stepKey="waitForStoresPageOpened"/>
  312. <click stepKey="chooseStore" selector="{{AdminOrderStoreScopeTreeSection.storeForOrder(storeView.name)}}"/>
  313. <scrollToTopOfPage stepKey="scrollToTop"/>
  314. <click selector="{{OrdersGridSection.addProducts}}" stepKey="clickOnAddProducts"/>
  315. <waitForPageLoad stepKey="waitForProductsListForOrder"/>
  316. <click selector="{{AdminOrdersGridSection.productForOrder(product.sku)}}" stepKey="chooseTheProduct"/>
  317. <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="addSelectedProductToOrder"/>
  318. <waitForPageLoad stepKey="waitForProductAddedInOrder"/>
  319. <click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/>
  320. <waitForPageLoad stepKey="waitForShippingMethods"/>
  321. <click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/>
  322. <waitForPageLoad stepKey="waitForShippingMethodsThickened"/>
  323. <waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/>
  324. <conditionalClick selector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" dependentSelector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" visible="true" stepKey="checkCheckMoneyOption"/>
  325. <click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitOrder"/>
  326. <see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/>
  327. </actionGroup>
  328. <!--Cancel order that is in pending status-->
  329. <actionGroup name="cancelPendingOrder">
  330. <arguments>
  331. <argument name="orderStatus" type="string" defaultValue="Canceled"/>
  332. </arguments>
  333. <click selector="{{AdminOrderDetailsMainActionsSection.cancel}}" stepKey="clickCancelOrder"/>
  334. <waitForElement selector="{{AdminConfirmationModalSection.message}}" stepKey="waitForCancelConfirmation"/>
  335. <see selector="{{AdminConfirmationModalSection.message}}" userInput="Are you sure you want to cancel this order?" stepKey="seeConfirmationMessage"/>
  336. <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmOrderCancel"/>
  337. <see selector="{{AdminMessagesSection.success}}" userInput="You canceled the order." stepKey="seeCancelSuccessMessage"/>
  338. <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="{{orderStatus}}" stepKey="seeOrderStatusCanceled"/>
  339. </actionGroup>
  340. <!--Select Check Money payment method-->
  341. <actionGroup name="SelectCheckMoneyPaymentMethod">
  342. <waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/>
  343. <conditionalClick selector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" dependentSelector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" visible="true" stepKey="checkCheckMoneyOption"/>
  344. </actionGroup>
  345. <!-- Create Order -->
  346. <actionGroup name="CreateOrderActionGroup">
  347. <arguments>
  348. <argument name="product"/>
  349. <argument name="customer"/>
  350. </arguments>
  351. <amOnPage stepKey="navigateToNewOrderPage" url="{{AdminOrderCreatePage.url}}"/>
  352. <click stepKey="chooseCustomer" selector="{{AdminOrdersGridSection.customerInOrdersSection(customer.firstname)}}"/>
  353. <waitForPageLoad stepKey="waitForStoresPageOpened"/>
  354. <click selector="{{OrdersGridSection.addProducts}}" stepKey="clickOnAddProducts"/>
  355. <waitForPageLoad stepKey="waitForProductsListForOrder"/>
  356. <click selector="{{AdminOrdersGridSection.productForOrder(product.sku)}}" stepKey="chooseTheProduct"/>
  357. <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="addSelectedProductToOrder"/>
  358. <waitForPageLoad stepKey="waitForProductAddedInOrder"/>
  359. <click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/>
  360. <waitForPageLoad stepKey="waitForShippingMethods"/>
  361. <click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/>
  362. <waitForPageLoad stepKey="waitForShippingMethodsThickened"/>
  363. <click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitOrder"/>
  364. <see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/>
  365. </actionGroup>
  366. </actionGroups>