diff --git a/app/code/Magento/Inventory/Test/Acceptance/ActionGroup/AssignSourceToProductActionGroup.xml b/app/code/Magento/Inventory/Test/Acceptance/ActionGroup/AssignSourceToProductActionGroup.xml new file mode 100644 index 000000000000..55de9a75bb92 --- /dev/null +++ b/app/code/Magento/Inventory/Test/Acceptance/ActionGroup/AssignSourceToProductActionGroup.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/code/Magento/Inventory/Test/Acceptance/ActionGroup/AssignSourceToStockActionGroup.xml b/app/code/Magento/Inventory/Test/Acceptance/ActionGroup/AssignSourceToStockActionGroup.xml new file mode 100644 index 000000000000..d506158615aa --- /dev/null +++ b/app/code/Magento/Inventory/Test/Acceptance/ActionGroup/AssignSourceToStockActionGroup.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/code/Magento/Inventory/Test/Acceptance/Page/AdminSourceSelectionPage.xml b/app/code/Magento/Inventory/Test/Acceptance/Page/AdminSourceSelectionPage.xml new file mode 100644 index 000000000000..cc352380479d --- /dev/null +++ b/app/code/Magento/Inventory/Test/Acceptance/Page/AdminSourceSelectionPage.xml @@ -0,0 +1,16 @@ + + + + + +
+
+
+ + diff --git a/app/code/Magento/Inventory/Test/Acceptance/Section/AdminItemsOrderedSection.xml b/app/code/Magento/Inventory/Test/Acceptance/Section/AdminItemsOrderedSection.xml new file mode 100644 index 000000000000..7a251d2d5b7c --- /dev/null +++ b/app/code/Magento/Inventory/Test/Acceptance/Section/AdminItemsOrderedSection.xml @@ -0,0 +1,31 @@ + + + + +
+ + + + + + +
+
diff --git a/app/code/Magento/Inventory/Test/Acceptance/Section/AdminSelectSourceSection.xml b/app/code/Magento/Inventory/Test/Acceptance/Section/AdminSelectSourceSection.xml new file mode 100644 index 000000000000..ffc12756faf8 --- /dev/null +++ b/app/code/Magento/Inventory/Test/Acceptance/Section/AdminSelectSourceSection.xml @@ -0,0 +1,14 @@ + + + + +
+ +
+
diff --git a/app/code/Magento/Inventory/Test/Acceptance/Section/AdminSourceSelectionControlsSection.xml b/app/code/Magento/Inventory/Test/Acceptance/Section/AdminSourceSelectionControlsSection.xml new file mode 100644 index 000000000000..ce4640ad4e5e --- /dev/null +++ b/app/code/Magento/Inventory/Test/Acceptance/Section/AdminSourceSelectionControlsSection.xml @@ -0,0 +1,17 @@ + + + + +
+ + + + +
+
diff --git a/app/code/Magento/Inventory/Test/Acceptance/Test/AdminCreatePartialShipmentForOrderWithSimpleProductFromCustomSourceTest.xml b/app/code/Magento/Inventory/Test/Acceptance/Test/AdminCreatePartialShipmentForOrderWithSimpleProductFromCustomSourceTest.xml new file mode 100644 index 000000000000..db0599fab919 --- /dev/null +++ b/app/code/Magento/Inventory/Test/Acceptance/Test/AdminCreatePartialShipmentForOrderWithSimpleProductFromCustomSourceTest.xml @@ -0,0 +1,173 @@ + + + + + + + + + + <description value="You should be able to create partial shipment from Custom Source."/> + <testCaseId value="1138"/> + <severity value="CRITICAL"/> + <group value="msi"/> + </annotations> + + <before> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <createData entity="SimpleSubCategory" stepKey="createCategory"/> + <createData entity="FullSource1" stepKey="createSource"/> + <createData entity="BasicMsiStock1" stepKey="createStock"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + + <!-- Assign Source and Sales Channel to Stock--> + <amOnPage url="{{AdminManageStockPage.url}}" stepKey="navigateToStockListPage"/> + <waitForPageLoad time="30" stepKey="waitForStockGridLoad"/> + <actionGroup ref="searchAdminDataGridByKeyword" stepKey="searchCustomStockByName"> + <argument name="keyword" value="$$createStock.stock[name]$$"/> + </actionGroup> + <click selector="{{AdminGridRow.editByValue($$createStock.stock[name]$$)}}" stepKey="clickEditCustomStock"/> + <waitForPageLoad time="30" stepKey="waitForStockEditPageLoad"/> + <selectOption selector="{{AdminEditStockSalesChannelsSection.websites}}" userInput="Main Website" + stepKey="selectWebsiteAsSalesChannelForCustomStock"/> + <click selector="{{AdminEditStockSourcesSection.assignSources}}" stepKey="clickOnAssignSources"/> + <actionGroup ref="searchAdminDataGridByKeyword" stepKey="searchCustomSourceByName"> + <argument name="keyword" value="$$createSource.source[name]$$"/> + </actionGroup> + <click selector="{{AdminGridRow.checkboxByValue($$createSource.source[name]$$)}}" + stepKey="selectCustomSourceForCustomStock"/> + <click selector="{{AdminManageSourcesGridControls.done}}" stepKey="clickOnDoneCustomSourceAssignment"/> + <click selector="{{AdminGridMainControls.saveAndContinue}}" stepKey="saveCustomStock"/> + + <!-- Create Product --> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnTheProductGridPage"/> + <waitForPageLoad time="30" stepKey="waitForProductGridLoad"/> + <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropDown"/> + <click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/> + <actionGroup ref="FillMainProductFormInMultiSourceMode" stepKey="fillSimpleProductMain"> + <argument name="product" value="SimpleMsiProduct"/> + </actionGroup> + <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" + parameterArray="[$$createCategory.name$$]" requiredAction="true" + stepKey="searchAndSelectCategory"/> + <click selector="{{AdminProductSourcesSection.assignSources}}" stepKey="assignSourcesToProduct"/> + <conditionalClick selector="{{AdminGridFilterControls.clearAll}}" + dependentSelector="{{AdminManageSourcesGridFilterControls.dropDown}}" visible="true" + stepKey="clearTheFiltersIfPresent"/> + <actionGroup ref="searchAdminDataGridByKeyword" stepKey="searchSourceByKeyword"> + <argument name="keyword" value="$$createSource.source[name]$$"/> + </actionGroup> + <waitForPageLoad time="5" stepKey="waitForAdminDataGridLoad"/> + <click selector="{{AdminAssignSourcesSlideOutGridSection.checkboxByCode($$createSource.source[source_code]$$)}}" + stepKey="clickOnCheckbox"/> + <click selector="{{AdminAssignSourcesSlideOutSection.done}}" stepKey="clickOnDone"/> + <fillField selector="{{AdminProductSourcesGrid.rowQty('0')}}" userInput="{{SimpleMsiProduct.quantity}}" + stepKey="fillSourceQtyField"/> + <actionGroup ref="AdminFormSaveAndClose" stepKey="saveAndClose"/> + </before> + + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <amOnPage url="{{AdminManageSourcePage.url}}" stepKey="navigateToSourceList"/> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" + dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" + stepKey="clearSourcesFilter"/> + <actionGroup ref="AdminGridFilterSearchResultsByInput" stepKey="filterCustomSourceBySourceCode"> + <argument name="selector" value="AdminManageSourcesGridFilterControls.code"/> + <argument name="value" value="{{FullSource1.source_code}}"/> + </actionGroup> + <click selector="{{AdminGridRow.editByValue($$createSource.source[source_code]$$)}}" + stepKey="clickEditCustomSource"/> + <waitForPageLoad time="30" stepKey="waitForCustomSourceEditPageLoad"/> + <click selector="{{AdminEditSourceGeneralSection.isEnabledLabel}}" stepKey="disableCustomSource"/> + <actionGroup ref="AdminFormSaveAndClose" stepKey="saveAndCloseCustomSource"/> + <amOnPage url="{{AdminManageStockPage.url}}" stepKey="navigateToStockListPage"/> + <waitForPageLoad time="30" stepKey="waitForStockListPageLoad"/> + <actionGroup ref="searchAdminDataGridByKeyword" stepKey="searchDefaultStockByName"> + <argument name="keyword" value="_defaultStock.name"/> + </actionGroup> + <click selector="{{AdminGridRow.editByValue(_defaultStock.name)}}" stepKey="clickEditDefaultStock"/> + <waitForPageLoad time="30" stepKey="waitFroDefaultStockEditPageLoad"/> + <selectOption selector="{{AdminEditStockSalesChannelsSection.websites}}" userInput="Main Website" + stepKey="selectDefaultWebsiteAsSalesChannelForDefaultStock"/> + <click selector="{{AdminGridMainControls.saveAndContinue}}" stepKey="saveDefaultStock"/> + <actionGroup ref="logout" stepKey="logoutFromAdminArea"/> + </after> + + <!-- Login as Customer and add Product to Cart--> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategory"/> + <waitForPageLoad time="30" stepKey="waitForCategoryPageLoad"/> + <click selector="{{StorefrontCategoryMainSection.specifiedProductItemInfo(SimpleMsiProduct.name)}}" + stepKey="openProductPage"/> + <waitForAjaxLoad stepKey="waitForImageLoader"/> + <fillField selector="{{StorefrontProductPageSection.qtyInput}}" userInput="5" stepKey="fillQuantity"/> + <click selector="{{StorefrontProductPageSection.addToCartBtn}}" stepKey="addToCart"/> + <waitForElementVisible selector="{{StorefrontProductPageSection.successMsg}}" time="30" + stepKey="waitForProductAdded"/> + + <!-- Place Order --> + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> + <conditionalClick selector="{{CheckoutPaymentSection.cartItemsArea}}" + dependentSelector="{{CheckoutPaymentSection.cartItemsArea}}" visible="true" + stepKey="exposeMiniCart"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskForCartItem"/> + <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="checkMoneyOrderPayment"/> + <waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/> + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> + + <!-- Source Selection --> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPageToCreateShipment"/> + <waitForLoadingMaskToDisappear stepKey="waitForOrdersPageToCreateShipmentLoaded"/> + <fillField selector="{{AdminOrdersGridSection.search}}" userInput="{$grabOrderNumber}" + stepKey="searchOrderNum"/> + <click selector="{{AdminOrdersGridSection.submitSearch}}" stepKey="submitSearch"/> + <waitForLoadingMaskToDisappear stepKey="waitForSearchApplied"/> + <click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/> + <click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShip"/> + <waitForLoadingMaskToDisappear stepKey="waitForShipmentPageLoaded"/> + + <fillField selector="{{AdminShipmentItemsSection.itemQtyToShip('1')}}" userInput="3" stepKey="ship3Items"/> + <click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="submitShipment"/> + + <!-- Verify Shipment created correctly" --> + <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The shipment has been created." stepKey="seeShipmentCreateSuccess"/> + <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Processing" stepKey="seeOrderStatus"/> + <see selector="{{AdminOrderItemsOrderedSection.itemStatus('1')}}" userInput="Partial" stepKey="seeItemStatus"/> + <see selector="{{AdminOrderItemsOrderedSection.itemQty('1')}}" userInput="Ordered 5" stepKey="seeOrderedQuantity"/> + <see selector="{{AdminOrderItemsOrderedSection.itemQty('1')}}" userInput="Shipped 3" stepKey="seeShippedQuantity"/> + + <!-- Verify Shipment is present in "Shipments" tab of Order --> + <click selector="{{AdminOrderDetailsOrderViewSection.shipments}}" stepKey="clickOrderShipmentsTab"/> + <waitForLoadingMaskToDisappear stepKey="waitToSeeShipmentCreated"/> + <seeElement selector="{{AdminOrderShipmentsTabSection.gridRow('1')}}" stepKey="seeShipmentInGrid"/> + + <!-- Verify Source Quantities and Salable Quantity are Correct--> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndexToFinalCheck"/> + <waitForPageLoad time="30" stepKey="waitFoProductIndexPageLoad"/> + + <actionGroup ref="AdminGridFilterSearchResultsByInput" stepKey="filterSearchResultsToFinalCheck"> + <argument name="selector" value="AdminProductGridFilterSection.skuFilter"/> + <argument name="value" value="{{SimpleMsiProduct.sku}}"/> + </actionGroup> + + <see selector="{{AdminGridRow.rowOne}}" userInput="{{SimpleMsiProduct.name}}" stepKey="seeProductNameInGrid"/> + <see selector="{{AdminGridRow.rowOne}}" userInput="{{SimpleMsiProduct.sku}}" stepKey="seeProductSkuInGrid"/> + <see selector="{{AdminGridRow.rowOne}}" userInput="{{SimpleMsiProduct.price}}" stepKey="seeProductPriceInGrid"/> + <see selector="{{AdminGridRow.rowOne}}" userInput="$$createSource.source[name]$$ : 97" stepKey="seeProductQuantityInGrid"/> + <see selector="{{AdminGridRow.rowOne}}" userInput="$$createStock.stock[name]$$ : 95" stepKey="seeProductSalableQuantityInGrid"/> + <see selector="{{AdminGridRow.rowOne}}" userInput="Enabled" stepKey="seeProductStatusInGrid"/> + <see selector="{{AdminGridRow.rowOne}}" userInput="Main Website" stepKey="seeProductWebsiteInGrid"/> + </test> +</tests> diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Shipping/Section/AdminShipmentItemsSection.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Shipping/Section/AdminShipmentItemsSection.xml index 562ad729fe7f..4df50c4d47cc 100644 --- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Shipping/Section/AdminShipmentItemsSection.xml +++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Shipping/Section/AdminShipmentItemsSection.xml @@ -9,11 +9,11 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> <section name="AdminShipmentItemsSection"> - <element name="itemName" type="text" selector=".order-shipment-table tbody:nth-of-type({{row}}) .col-product .product-title" parameterized="true"/> - <element name="itemSku" type="text" selector=".order-shipment-table tbody:nth-of-type({{row}}) .col-product .product-sku-block" parameterized="true"/> - <element name="itemQty" type="text" selector=".order-shipment-table tbody:nth-of-type({{row}}) .col-ordered-qty .qty-table" parameterized="true"/> - <element name="itemQtyToShip" type="input" selector=".order-shipment-table tbody:nth-of-type({{row}}) .col-qty input.qty-item"/> + <element name="itemName" type="text" selector=".order-shipment-table tbody tr:nth-of-type({{row}}) .col-product .product-title" parameterized="true"/> + <element name="itemSku" type="text" selector=".order-shipment-table tbody tr:nth-of-type({{row}}) .col-product .product-sku-block" parameterized="true"/> + <element name="itemQty" type="text" selector=".order-shipment-table tbody tr:nth-of-type({{row}}) .col-ordered-qty .qty-table" parameterized="true"/> + <element name="itemQtyToShip" type="input" selector=".order-shipment-table tbody tr:nth-of-type({{row}}) .col-qty input.qty-item" parameterized="true"/> <element name="nameColumn" type="text" selector=".order-shipment-table .col-product .product-title"/> <element name="skuColumn" type="text" selector=".order-shipment-table .col-product .product-sku-block"/> </section> -</sections> \ No newline at end of file +</sections>