Skip to content
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

[MFTF] Added AdminClickGetShippingMethodsAndRatesActionGroup and AdminSelectFixedShippingMethodActionGroup #30779

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
Expand Up @@ -173,10 +173,10 @@
</actionGroup>
<!-- Select shipping method -->
<comment userInput="Select shipping method" stepKey="selectShippingMethod"/>
<click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/>
<waitForPageLoad stepKey="waitForShippingMethods"/>
<click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/>
<waitForPageLoad stepKey="waitForShippingMethodLoad"/>
<actionGroup ref="AdminClickGetShippingMethodsAndRatesActionGroup" stepKey="openShippingMethod"/>
<comment userInput="Adding the comment to replace action for preserving Backward Compatibility" stepKey="waitForShippingMethods"/>
<actionGroup ref="AdminSelectFixedShippingMethodActionGroup" stepKey="chooseShippingMethod"/>
<comment userInput="Adding the comment to replace action for preserving Backward Compatibility" stepKey="waitForShippingMethodLoad"/>
<actionGroup ref="AdminOrderClickSubmitOrderActionGroup" stepKey="clickSubmitOrder" />
<actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="checkOrderSuccessfullyCreated"/>
</test>
Expand Down
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="AdminClickGetShippingMethodsAndRatesActionGroup">
<annotations>
<description>Click 'Get Shipping Methods And Rates' button on the admin create order page.</description>
</annotations>

<click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/>
<waitForPageLoad stepKey="waitForShippingMethods"/>
</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="AdminSelectFixedShippingMethodActionGroup">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be a little bit confusing how exactly this action group selects the "Fixed" shipping method. Maybe it makes sense to name it as AdminSelectFirstShippingMethodActionGroup. What do you think?

Copy link
Contributor Author

@Usik2203 Usik2203 Nov 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @rogyar
This Action Group selectFixedShipping Method not First
Due to this element
<element name="shippingMethod" type="button" selector="//label[contains(text(), 'Fixed')]" timeout="60"/>
https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoicePaymentShippingSection.xml#L19
I think if i will name this action group as AdminSelectFirstShippingMethodActionGroup it will be more confusable because it's not true.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks

<annotations>
<description>Select Fixed Shipping Method on the admin create order page.</description>
</annotations>

<click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/>
<waitForPageLoad stepKey="waitForShippingMethodLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@
<actionGroup ref="SelectBankTransferPaymentMethodActionGroup" stepKey="selectPaymentMethod"/>

<!-- Select shipping method -->
<click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/>
<waitForPageLoad stepKey="waitForShippingMethods"/>
<click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/>
<waitForPageLoad stepKey="waitForShippingMethodLoad"/>
<actionGroup ref="AdminClickGetShippingMethodsAndRatesActionGroup" stepKey="openShippingMethod"/>
<comment userInput="Adding the comment to replace action for preserving Backward Compatibility" stepKey="waitForShippingMethods"/>
<actionGroup ref="AdminSelectFixedShippingMethodActionGroup" stepKey="chooseShippingMethod"/>
<comment userInput="Adding the comment to replace action for preserving Backward Compatibility" stepKey="waitForShippingMethodLoad"/>

<!-- Submit order -->
<actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@
</actionGroup>

<!-- Select shipping method -->
<click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/>
<waitForPageLoad stepKey="waitForShippingMethods"/>
<click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/>
<waitForPageLoad stepKey="waitForShippingMethodLoad"/>
<actionGroup ref="AdminClickGetShippingMethodsAndRatesActionGroup" stepKey="openShippingMethod"/>
<comment userInput="Adding the comment to replace action for preserving Backward Compatibility" stepKey="waitForShippingMethods"/>
<actionGroup ref="AdminSelectFixedShippingMethodActionGroup" stepKey="chooseShippingMethod"/>
<comment userInput="Adding the comment to replace action for preserving Backward Compatibility" stepKey="waitForShippingMethodLoad"/>

<!-- Select cash on delivery payment method -->
<actionGroup ref="SelectCashOnDeliveryPaymentMethodActionGroup" stepKey="selectPaymentMethod"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@
</actionGroup>

<!-- Select shipping method -->
<click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/>
<waitForPageLoad stepKey="waitForShippingMethods"/>
<click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/>
<waitForPageLoad stepKey="waitForShippingMethodLoad"/>
<actionGroup ref="AdminClickGetShippingMethodsAndRatesActionGroup" stepKey="openShippingMethod"/>
<comment userInput="Adding the comment to replace action for preserving Backward Compatibility" stepKey="waitForShippingMethods"/>
<actionGroup ref="AdminSelectFixedShippingMethodActionGroup" stepKey="chooseShippingMethod"/>
<comment userInput="Adding the comment to replace action for preserving Backward Compatibility" stepKey="waitForShippingMethodLoad"/>

<!-- Submit order -->
<actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@

<!-- Select Free Shipping -->
<waitForElementVisible selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="waitForShippingSection"/>
<click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/>
<waitForPageLoad stepKey="waitForShippingMethods"/>
<actionGroup ref="AdminClickGetShippingMethodsAndRatesActionGroup" stepKey="openShippingMethod"/>
<comment userInput="Adding the comment to replace action for preserving Backward Compatibility" stepKey="waitForShippingMethods"/>
<click selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" stepKey="chooseShippingMethod"/>
<waitForPageLoad stepKey="waitForPageToLoad"/>
<actionGroup ref="AdminOrderClickSubmitOrderActionGroup" stepKey="submitOrder" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@
</actionGroup>

<!-- Select shipping method -->
<click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/>
<waitForPageLoad stepKey="waitForShippingMethods"/>
<click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/>
<waitForPageLoad stepKey="waitForShippingMethodLoad"/>
<actionGroup ref="AdminClickGetShippingMethodsAndRatesActionGroup" stepKey="openShippingMethod"/>
<comment userInput="Adding the comment to replace action for preserving Backward Compatibility" stepKey="waitForShippingMethods"/>
<actionGroup ref="AdminSelectFixedShippingMethodActionGroup" stepKey="chooseShippingMethod"/>
<comment userInput="Adding the comment to replace action for preserving Backward Compatibility" stepKey="waitForShippingMethodLoad"/>

<!-- Submit order -->
<actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/>
Expand Down