Skip to content

[MFTF] StorefrontReorderAsGuestCustomerTest refactoring #33549

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

Merged
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
14 changes: 14 additions & 0 deletions app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -443,4 +443,18 @@
<requiredEntity type="address">UK_With_State_Default_Billing</requiredEntity>
<requiredEntity type="address">US_Address_NY_Default_Shipping</requiredEntity>
</entity>
<entity name="Simple_USTX_Customer" type="customer">
<data key="group_id">1</data>
<data key="default_billing">true</data>
<data key="default_shipping">true</data>
<data key="email" unique="prefix">[email protected]</data>
<data key="firstname">John</data>
<data key="lastname">Buyer</data>
<data key="fullname">John Buyer</data>
<data key="password">pwdTest123!</data>
<data key="store_id">0</data>
<data key="website_id">0</data>
<data key="group">General</data>
<requiredEntity type="address">BillingAddressTX</requiredEntity>
</entity>
</entities>
4 changes: 4 additions & 0 deletions app/code/Magento/Quote/Test/Mftf/Data/GuestCartData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@
<requiredEntity type="payment_method">PaymentMethodCheckMoneyOrder</requiredEntity>
<requiredEntity type="billing_address">BillingAddressTX</requiredEntity>
</entity>

<entity name="OrderId" type="orderId">
<var key="order_id" entityKey="return" entityType="orderId"/>
</entity>
</entities>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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="StorefrontClickContinueOnOrdersAndReturnsPageActionGroup">
<annotations>
<description>Clicks the "Continue" button on the "Orders and Returns" page</description>
</annotations>

<click selector="{{StorefrontGuestOrderSearchSection.continue}}" stepKey="clickContinue"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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="StorefrontClickReorderOnGuestOrderViewPageActionGroup">
<annotations>
<description>Clicks the "Reorder" link on the Guest Order View page</description>
</annotations>

<click selector="{{StorefrontGuestOrderViewSection.reorder}}" stepKey="clickReorderLink"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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="StorefrontOpenOrdersAndReturnsPageActionGroup">
<annotations>
<description>Opens the "Orders and Returns" page</description>
</annotations>

<amOnPage url="{{StorefrontGuestOrderSearchPage.url}}" stepKey="goToOrdersAndReturnsPage"/>
<waitForPageLoad stepKey="waiForOrdersAndReturnsPage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?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="StorefrontReorderAsGuestCustomerTest">
<annotations>
<stories value="Reorder"/>
<title value="Make reorder as guest on Frontend1"/>
<description value="Make reorder as guest on Frontend"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-34465"/>
<group value="sales"/>
</annotations>
<before>
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
<createData entity="SimpleProduct" stepKey="createSimpleProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>
<createData entity="GuestCart" stepKey="createGuestCart"/>
<createData entity="SimpleCartItem" stepKey="addCartItem">
<requiredEntity createDataKey="createGuestCart"/>
<requiredEntity createDataKey="createSimpleProduct"/>
</createData>
<createData entity="GuestAddressInformation" stepKey="addGuestOrderAddress">
<requiredEntity createDataKey="createGuestCart"/>
</createData>
<updateData createDataKey="createGuestCart" entity="GuestOrderPaymentMethod" stepKey="sendGuestPaymentInformation">
<requiredEntity createDataKey="createGuestCart"/>
</updateData>
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
</before>
<after>
<actionGroup ref="AdminLogoutActionGroup" stepKey="LogoutAsAdmin"/>
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
</after>

<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="onOrderPage"/>
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/>
<grabTextFrom selector="{{AdminOrdersGridSection.orderIdByIncrementId($createGuestCart.return$)}}" stepKey="getOrderId"/>

<actionGroup ref="StorefrontOpenOrdersAndReturnsPageActionGroup" stepKey="goToOrdersAndReturnsPage"/>
<actionGroup ref="StorefrontFillOrdersAndReturnsFormTypeZipActionGroup" stepKey="fillOrder">
<argument name="orderNumber" value="$getOrderId"/>
<argument name="customer" value="Simple_USTX_Customer"/>
<argument name="address" value="BillingAddressTX"/>
</actionGroup>
<actionGroup ref="StorefrontClickContinueOnOrdersAndReturnsPageActionGroup" stepKey="clickContinue"/>
<actionGroup ref="StorefrontClickReorderOnGuestOrderViewPageActionGroup" stepKey="clickReorder"/>

<seeElement selector="{{CheckoutCartProductSection.ProductLinkByName($$createSimpleProduct.name$$)}}" stepKey="seeProductInCart"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@
-->
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="StorefrontReorderAsGuestTest">
<test name="StorefrontReorderAsGuestTest" deprecated="Use StorefrontReorderAsGuestCustomerTest instead">
<annotations>
<stories value="Reorder"/>
<title value="Make reorder as guest on Frontend"/>
<title value="DEPRECATED. Make reorder as guest on Frontend"/>
<description value="Make reorder as guest on Frontend"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-34465"/>
<group value="sales"/>
<skip>
<issueId value="DEPRECATED">Use StorefrontReorderAsGuestCustomerTest instead</issueId>
</skip>
</annotations>
<before>
<!--Create simple product.-->
Expand Down