Skip to content

[MFTF] AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup adding #34261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: 2.4-develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">

<actionGroup name="AdminClickCreateOrderOnEditCustomerPageActionGroup">
<annotations>
<description>Clicks on 'Create Order' on the Edit Customer page.</description>
</annotations>

<click selector="{{AdminCustomerMainActionsSection.createOrderBtn}}" stepKey="clickCreateOrder"/>
<waitForPageLoad stepKey="waitForPageLoaded"/>

</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup">
<annotations>
<description>Asserts product in Items Ordered Grid on Create Order page</description>
</annotations>
<arguments>
<argument name="index" type="string"/>
<argument name="attribute" type="string"/>
<argument name="value" type="string"/>
</arguments>

<see selector="{{AdminCustomerCreateNewOrderSection.gridCell(index, attribute)}}" userInput="{{value}}" stepKey="seeProductAttribute"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminClickConfigureForRecentlyViewedProductActionGroup">
<annotations>
<description>Clicks the "Configure" button for a Product in Recently Viewed Product section on Create Order Page</description>
</annotations>
<arguments>
<argument name="productName" type="string"/>
</arguments>

<click selector="{{AdminCustomerActivitiesRecentlyViewedSection.addToOrderConfigure(productName)}}" stepKey="clickConfigureProduct"/>

</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminClickOkOnConfigureProductSlidingModalActionGroup">
<annotations>
<description>Clicks the "Ok" button on the "Configure Product" sliding modal on the Create Order page</description>
</annotations>

<click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkButton"/>
<waitForPageLoad stepKey="waitForAddingConfiguredProduct"/>

</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminSelectDropdownOptionOnConfigureProductSlidingModalActionGroup">
<annotations>
<description>Selects a required option in dropdown on the "Configure Product" Sliding Modal</description>
</annotations>
<arguments>
<argument name="optionName" type="string"/>
</arguments>

<selectOption selector="{{AdminOrderFormConfigureProductSection.selectOption}}" userInput="{{optionName}}" stepKey="selectOption"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,25 @@
<actionGroup ref="AdminClickUpdateChangesOnCreateOrderPageActionGroup" stepKey="clickUpdateChangesBtn"/>

<!-- Assert products in items ordered grid -->
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Product')}}" userInput="$$createFirstConfigProduct.name$$" stepKey="seeFirstProductName"/>
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Price')}}" userInput="$123.00" stepKey="seeFirstProductPrice"/>
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('2', 'Product')}}" userInput="$$createSecondConfigProduct.name$$" stepKey="seeSecondProductName"/>
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('2', 'Price')}}" userInput="$123.00" stepKey="seeSecondProductPrice"/>
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeFirstProductName">
<argument name="index" value="1"/>
<argument name="attribute" value="Product"/>
<argument name="value" value="$$createFirstConfigProduct.name$$"/>
</actionGroup>
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeFirstProductPrice">
<argument name="index" value="1"/>
<argument name="attribute" value="Price"/>
<argument name="value" value="$123.00"/>
</actionGroup>
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeSecondProductName">
<argument name="index" value="2"/>
<argument name="attribute" value="Product"/>
<argument name="value" value="$$createSecondConfigProduct.name$$"/>
</actionGroup>
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeSecondProductPrice">
<argument name="index" value="2"/>
<argument name="attribute" value="Price"/>
<argument name="value" value="$123.00"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,15 @@
<actionGroup ref="AdminClickUpdateChangesOnCreateOrderPageActionGroup" stepKey="clickUpdateChangesBtn"/>

<!-- Assert product in items ordered grid -->
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Product')}}" userInput="$$createConfigProduct.name$$" stepKey="seeProductName"/>
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Price')}}" userInput="$123.00" stepKey="seeProductPrice"/>
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeProductName">
<argument name="index" value="1"/>
<argument name="attribute" value="Product"/>
<argument name="value" value="$$createConfigProduct.name$$"/>
</actionGroup>
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeProductPrice">
<argument name="index" value="1"/>
<argument name="attribute" value="Price"/>
<argument name="value" value="$123.00"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,15 @@
<actionGroup ref="AdminClickUpdateChangesOnCreateOrderPageActionGroup" stepKey="clickUpdateChangesBtn"/>

<!-- Assert product in items ordered grid -->
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Product')}}" userInput="$$createProduct.name$$" stepKey="seeProductName"/>
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Price')}}" userInput="$$createProduct.price$$" stepKey="seeProductPrice"/>
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeProductName">
<argument name="index" value="1"/>
<argument name="attribute" value="Product"/>
<argument name="value" value="$$createProduct.name$$"/>
</actionGroup>
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeProductPrice">
<argument name="index" value="1"/>
<argument name="attribute" value="Price"/>
<argument name="value" value="$$createProduct.price$$"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,19 @@
<group value="mtf_migrated"/>
</annotations>
<before>
<!-- Login as admin -->
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

<!-- Create customer -->
<createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/>

<!-- Create category -->
<createData entity="SimpleSubCategory" stepKey="createCategory"/>

<!-- Create simple products -->
<createData entity="SimpleProduct2" stepKey="createFirstProduct">
<field key="price">755.00</field>
</createData>
<createData entity="SimpleProduct2" stepKey="createSecondProduct">
<field key="price">756.00</field>
</createData>

<!-- Create Bundle product -->
<createData entity="BundleProductPriceViewRange" stepKey="createBundleProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>
Expand All @@ -54,63 +49,65 @@
<requiredEntity createDataKey="createBundleOption"/>
<requiredEntity createDataKey="createSecondProduct"/>
</createData>
<!-- Change configuration -->

<magentoCLI command="config:set reports/options/enabled 1" stepKey="enableReportModule"/>

<comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/>
</before>
<after>
<!-- Admin logout -->
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>

<!-- Customer logout -->
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>

<!-- Delete customer -->
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>

<!-- Delete created product data -->
<deleteData createDataKey="createBundleProduct" stepKey="deleteProduct"/>
<deleteData createDataKey="createFirstProduct" stepKey="deleteFirstProduct"/>
<deleteData createDataKey="createSecondProduct" stepKey="deleteSecondProduct"/>

<!-- Delete category -->
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>

<!-- Change configuration -->
<magentoCLI command="config:set reports/options/enabled 0" stepKey="disableReportModule"/>
</after>

<!-- Login as customer -->
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer">
<argument name="Customer" value="$$createCustomer$$"/>
</actionGroup>

<!-- Go to created product page -->
<amOnPage url="{{StorefrontProductPage.url($$createBundleProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage"/>
<waitForPageLoad stepKey="waitForProductPageLoad"/>
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage">
<argument name="productUrlKey" value="$$createBundleProduct.custom_attributes[url_key]$$"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForProductPageLoad"/>

<!-- Search and open customer -->
<actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="openCustomerEditPage">
<argument name="customerId" value="$createCustomer.id$"/>
</actionGroup>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterCreatedCustomer"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickEditButton"/>

<!-- Click create order -->
<click selector="{{AdminCustomerMainActionsSection.createOrderBtn}}" stepKey="clickCreateOrder"/>
<actionGroup ref="AdminClickCreateOrderOnEditCustomerPageActionGroup" stepKey="clickCreateOrder"/>

<actionGroup ref="AdminClickConfigureForRecentlyViewedProductActionGroup" stepKey="configureProduct">
<argument name="productName" value="$$createBundleProduct.name$$"/>
</actionGroup>
<actionGroup ref="AdminSelectDropdownOptionOnConfigureProductSlidingModalActionGroup" stepKey="selectProductOption">
<argument name="optionName" value="$$createFirstProduct.name$$"/>
</actionGroup>

<!-- Add configure to bundle product -->
<click selector="{{AdminCustomerActivitiesRecentlyViewedSection.addToOrderConfigure($$createBundleProduct.name$$)}}" stepKey="configureProduct"/>
<click selector="{{AdminCustomerActivitiesConfigureSection.dropdownProductSelection($$createFirstProduct.name$$)}}" stepKey="selectProductOption"/>
<click selector="{{AdminCustomerActivitiesConfigureSection.okButton}}" stepKey="clickOkBtn"/>
<waitForPageLoad stepKey="waitForAddingConfigure"/>
<actionGroup ref="AdminClickOkOnConfigureProductSlidingModalActionGroup" stepKey="clickOkBtn"/>
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForAddingConfigure"/>

<!-- Click 'Update Changes' -->
<actionGroup ref="AdminClickUpdateChangesOnCreateOrderPageActionGroup" stepKey="clickUpdateChangesBtn"/>

<!-- Assert products in items ordered grid -->
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Product')}}" userInput="$$createBundleProduct.name$$" stepKey="seeProductName"/>
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Price')}}" userInput="$755.00" stepKey="seeProductPrice"/>
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeProductName">
<argument name="index" value="1"/>
<argument name="attribute" value="Product"/>
<argument name="value" value="$$createBundleProduct.name$$"/>
</actionGroup>
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeProductPrice">
<argument name="index" value="1"/>
<argument name="attribute" value="Price"/>
<argument name="value" value="$755.00"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,15 @@
<actionGroup ref="AdminClickUpdateChangesOnCreateOrderPageActionGroup" stepKey="clickUpdateChangesBtn"/>

<!-- Assert products in items ordered grid -->
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Product')}}" userInput="$$createConfigProduct.name$$" stepKey="seeProductName"/>
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Price')}}" userInput="$123.00" stepKey="seeProductPrice"/>
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeProductName">
<argument name="index" value="1"/>
<argument name="attribute" value="Product"/>
<argument name="value" value="$$createConfigProduct.name$$"/>
</actionGroup>
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeProductPrice">
<argument name="index" value="1"/>
<argument name="attribute" value="Price"/>
<argument name="value" value="$123.00"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,25 @@
<actionGroup ref="AdminClickUpdateChangesOnCreateOrderPageActionGroup" stepKey="clickUpdateChangesBtn"/>

<!-- Assert products in items ordered grid -->
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Product')}}" userInput="$$createFirstSimpleProduct.name$$" stepKey="seeFirstProductName"/>
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Price')}}" userInput="$$createFirstSimpleProduct.price$$" stepKey="seeFirstProductPrice"/>
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('2', 'Product')}}" userInput="$$createSecondSimpleProduct.name$$" stepKey="seeSecondProductName"/>
<see selector="{{AdminCustomerCreateNewOrderSection.gridCell('2', 'Price')}}" userInput="$$createSecondSimpleProduct.price$$" stepKey="seeSecondProductPrice"/>
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeFirstProductName">
<argument name="index" value="1"/>
<argument name="attribute" value="Product"/>
<argument name="value" value="$$createFirstSimpleProduct.name$$"/>
</actionGroup>
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeFirstProductPrice">
<argument name="index" value="1"/>
<argument name="attribute" value="Price"/>
<argument name="value" value="$$createFirstSimpleProduct.price$$"/>
</actionGroup>
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeSecondProductName">
<argument name="index" value="2"/>
<argument name="attribute" value="Product"/>
<argument name="value" value="$$createSecondSimpleProduct.name$$"/>
</actionGroup>
<actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeSecondProductPrice">
<argument name="index" value="2"/>
<argument name="attribute" value="Price"/>
<argument name="value" value="$$createSecondSimpleProduct.price$$"/>
</actionGroup>
</test>
</tests>