Skip to content

Commit

Permalink
AdminCreateInvoiceTest deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnaAPak committed Nov 23, 2020
1 parent 3e46731 commit d157d42
Show file tree
Hide file tree
Showing 2 changed files with 127 additions and 34 deletions.
96 changes: 62 additions & 34 deletions app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,54 +12,82 @@
<annotations>
<features value="Sales"/>
<stories value="Create an Invoice via the Admin"/>
<title value="Admin should be able to create an invoice"/>
<title value="DEPRECATED. Admin should be able to create an invoice"/>
<description value="Admin should be able to create an invoice"/>
<severity value="MAJOR"/>
<testCaseId value="MAGETWO-72096"/>
<group value="sales"/>
<skip>
<issueID value="DEPRECATED">Use AdminInvoiceOrderTest instead</issueID>
</skip>
</annotations>

<before>
<before>
<createData entity="_defaultCategory" stepKey="createCategory"/>
<createData entity="_defaultProduct" stepKey="createSimpleProductApi">
<createData entity="_defaultProduct" stepKey="createProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>
<createData entity="GuestCart" stepKey="createGuestCart"/>
<createData entity="SimpleCartItem" stepKey="addCartItem">
<requiredEntity createDataKey="createGuestCart"/>
<requiredEntity createDataKey="createSimpleProductApi"/>
</createData>
<createData entity="GuestAddressInformation" stepKey="addGuestOrderAddress">
<requiredEntity createDataKey="createGuestCart"/>
</createData>
<updateData createDataKey="createGuestCart" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformation">
<requiredEntity createDataKey="createGuestCart"/>
</updateData>
</before>

<after>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<deleteData createDataKey="createSimpleProductApi" stepKey="deleteSimpleProductApi"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
<deleteData createDataKey="createCategory" stepKey="deleteProduct1"/>
<deleteData createDataKey="createProduct" stepKey="deleteCategory1"/>
</after>

<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/>

<actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="openOrder">
<argument name="entity_id" value="$createGuestCart.return$"/>
</actionGroup>

<actionGroup ref="AdminCreateInvoiceActionGroup" stepKey="createInvoice"/>
<!-- todo: Create an order via the api instead of driving the browser -->
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onCategoryPage"/>
<waitForPageLoad stepKey="waitForPageLoad1"/>
<moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverProduct"/>
<actionGroup ref="StorefrontClickAddToCartButtonActionGroup" stepKey="addToCart"/>
<waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="waitForProductAdded"/>
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickCart"/>
<click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/>
<waitForPageLoad stepKey="waitForPageLoad2"/>
<fillField selector="{{CheckoutShippingGuestInfoSection.email}}" userInput="{{CustomerEntityOne.email}}" stepKey="enterEmail"/>
<fillField selector="{{CheckoutShippingGuestInfoSection.firstName}}" userInput="{{CustomerEntityOne.firstname}}" stepKey="enterFirstName"/>
<fillField selector="{{CheckoutShippingGuestInfoSection.lastName}}" userInput="{{CustomerEntityOne.lastname}}" stepKey="enterLastName"/>
<fillField selector="{{CheckoutShippingGuestInfoSection.street}}" userInput="{{CustomerAddressSimple.street[0]}}" stepKey="enterStreet"/>
<fillField selector="{{CheckoutShippingGuestInfoSection.city}}" userInput="{{CustomerAddressSimple.city}}" stepKey="enterCity"/>
<selectOption selector="{{CheckoutShippingGuestInfoSection.region}}" userInput="{{CustomerAddressSimple.state}}" stepKey="selectRegion"/>
<fillField selector="{{CheckoutShippingGuestInfoSection.postcode}}" userInput="{{CustomerAddressSimple.postcode}}" stepKey="enterPostcode"/>
<fillField selector="{{CheckoutShippingGuestInfoSection.telephone}}" userInput="{{CustomerAddressSimple.telephone}}" stepKey="enterTelephone"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/>
<click selector="{{CheckoutShippingMethodsSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask2"/>
<actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/>
<!-- Checkout select Check/Money Order payment -->
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/>
<waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/>
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/>
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/>
<!-- end todo -->

<actionGroup ref="FilterInvoiceGridByOrderIdWithCleanFiltersActionGroup" stepKey="filterInvoiceGridByOrderId">
<argument name="orderId" value="$createGuestCart.return$"/>
</actionGroup>

<actionGroup ref="AdminSelectFirstGridRowActionGroup" stepKey="openInvoiceFromGrid"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/>

<actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="checkIfOrderStatusIsProcessing">
<argument name="status" value="Processing"/>
</actionGroup>
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask3"/>
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/>
<fillField selector="{{AdminOrdersGridSection.search}}" userInput="{$grabOrderNumber}" stepKey="searchOrderNum"/>
<click selector="{{AdminOrdersGridSection.submitSearch}}" stepKey="submitSearch"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask4"/>

<actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/>
<actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoice"/>
<actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/>
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeSuccessMessage"/>
<click selector="{{AdminOrderDetailsOrderViewSection.invoices}}" stepKey="clickInvoices"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask5" />
<see selector="{{AdminOrderDetailsInvoicesSection.content}}" userInput="{$grabOrderNumber}" stepKey="seeInvoice1"/>
<see selector="{{AdminOrderDetailsInvoicesSection.content}}" userInput="John Doe" stepKey="seeInvoice2"/>
<click selector="{{AdminOrderDetailsOrderViewSection.information}}" stepKey="clickInformation"/>
<waitForLoadingMaskToDisappear stepKey="waitForOrderInformationTabLoadingMask"/>
<see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Processing" stepKey="seeOrderStatus"/>
<amOnPage url="{{AdminInvoicesPage.url}}" stepKey="goToInvoices"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask6" />
<actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridInitial"/>
<click selector="{{AdminInvoicesGridSection.filter}}" stepKey="clickFilters"/>
<fillField selector="{{AdminInvoicesFiltersSection.orderNum}}" userInput="{$grabOrderNumber}" stepKey="searchOrderNum2"/>
<click selector="{{AdminInvoicesFiltersSection.applyFilters}}" stepKey="clickApplyFilters"/>
<click selector="{{AdminInvoicesGridSection.firstRow}}" stepKey="clickInvoice2"/>
<see selector="{{AdminInvoiceDetailsInformationSection.orderStatus}}" userInput="Processing" stepKey="seeOrderStatus2"/>
</test>
</tests>
</tests>
65 changes: 65 additions & 0 deletions app/code/Magento/Sales/Test/Mftf/Test/AdminInvoiceOrderTest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminInvoiceOrderTest">
<annotations>
<features value="Sales"/>
<stories value="Create an Invoice via the Admin"/>
<title value="Admin should be able to create an invoice"/>
<description value="Admin should be able to create an invoice"/>
<severity value="MAJOR"/>
<testCaseId value="MAGETWO-72096"/>
<group value="sales"/>
</annotations>

<before>
<createData entity="_defaultCategory" stepKey="createCategory"/>
<createData entity="_defaultProduct" stepKey="createSimpleProductApi">
<requiredEntity createDataKey="createCategory"/>
</createData>
<createData entity="GuestCart" stepKey="createGuestCart"/>
<createData entity="SimpleCartItem" stepKey="addCartItem">
<requiredEntity createDataKey="createGuestCart"/>
<requiredEntity createDataKey="createSimpleProductApi"/>
</createData>
<createData entity="GuestAddressInformation" stepKey="addGuestOrderAddress">
<requiredEntity createDataKey="createGuestCart"/>
</createData>
<updateData createDataKey="createGuestCart" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformation">
<requiredEntity createDataKey="createGuestCart"/>
</updateData>
</before>

<after>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<deleteData createDataKey="createSimpleProductApi" stepKey="deleteSimpleProductApi"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
</after>

<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/>

<actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="openOrder">
<argument name="entity_id" value="$createGuestCart.return$"/>
</actionGroup>

<actionGroup ref="AdminCreateInvoiceActionGroup" stepKey="createInvoice"/>

<actionGroup ref="FilterInvoiceGridByOrderIdWithCleanFiltersActionGroup" stepKey="filterInvoiceGridByOrderId">
<argument name="orderId" value="$createGuestCart.return$"/>
</actionGroup>

<actionGroup ref="AdminSelectFirstGridRowActionGroup" stepKey="openInvoiceFromGrid"/>

<actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="checkIfOrderStatusIsProcessing">
<argument name="status" value="Processing"/>
</actionGroup>

</test>
</tests>

0 comments on commit d157d42

Please sign in to comment.