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] add ReloadPageActionGroup #30223

Merged
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -29,7 +29,7 @@
<!-- 2. Wait for session to expire. -->
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
<wait time="60" stepKey="waitForSessionLifetime"/>
<reloadPage stepKey="reloadPage"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadPage"/>

<!-- 3. Perform asserts. -->
<seeElement selector="{{AdminLoginFormSection.loginBlock}}" stepKey="assertAdminLoginPageIsAvailable"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<argument name="Customer" value="$$createCustomer$$" />
</actionGroup>
<wait time="60" stepKey="waitForCookieLifetime"/>
<reloadPage stepKey="reloadPage"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadPage"/>

<!-- 5. Perform asserts. -->
<seeElement selector="{{StorefrontPanelHeaderSection.customerLoginLink}}" stepKey="assertAuthorizationLinkIsVisibleOnStoreFront"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@
<waitForElementVisible selector="{{StorefrontCustomerSignInPopupFormSection.captchaField}}" stepKey="seeCaptchaField"/>
<waitForElementVisible selector="{{StorefrontCustomerSignInPopupFormSection.captchaImg}}" stepKey="seeCaptchaImage"/>
<waitForElementVisible selector="{{StorefrontCustomerSignInPopupFormSection.captchaReload}}" stepKey="seeCaptchaReloadButton"/>
<reloadPage stepKey="refreshPage"/>
<waitForPageLoad stepKey="waitForPageLoad2"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="refreshPage"/>
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickCart2"/>
<click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout2"/>
<waitForElementVisible selector="{{StorefrontCustomerSignInPopupFormSection.email}}" stepKey="waitEmailFieldVisible2"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<magentoCLI command="cron:run" stepKey="runCron"/>

<!-- 5. Open category A on Storefront again -->
<reloadPage stepKey="reloadCategoryA"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadCategoryA"/>

<!-- Category A displays product A1 now -->
<see userInput="$$createCategoryA.name$$" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="seeTitleCategoryA1"/>
Expand Down Expand Up @@ -128,7 +128,7 @@
<magentoCLI command="cron:run" stepKey="runCron1"/>

<!-- 9. Open category A on Storefront again -->
<reloadPage stepKey="refreshCategoryAPage"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="refreshCategoryAPage"/>

<!-- Category A is empty now -->
<see userInput="$$createCategoryA.name$$" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="seeOnPageCategoryAName"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@

<!-- Assert single row - no hover state -->
<createData entity="ApiCategoryA" stepKey="createFirstCategoryBlank"/>
<reloadPage stepKey="refreshPage"/>
<waitForPageLoad stepKey="waitForBlankSingleRowAppear"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="refreshPage"/>
<moveMouseOver selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createFirstCategoryBlank.name$$)}}" stepKey="hoverFirstCategoryBlank"/>
<dontSeeElement selector="{{StorefrontNavigationMenuSection.subItemLevelHover('level0')}}" stepKey="assertNoHoverState"/>

Expand Down Expand Up @@ -87,8 +86,7 @@
</createData>

<!-- Several rows. Hover on category without children -->
<reloadPage stepKey="reloadPage"/>
<waitForPageLoad stepKey="waitForBlankSeveralRowsAppear"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadPage"/>
<moveMouseOver selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategoryWithoutChildrenBlank.name$$)}}" stepKey="hoverCategoryWithoutChildren"/>
<dontSeeElement selector="{{StorefrontNavigationMenuSection.itemByNameAndLevel($$createCategoryWithoutChildrenBlank.name$$, 'level0')}}" stepKey="dontSeeChildrenInCategory"/>

Expand Down Expand Up @@ -167,8 +165,7 @@
<createData entity="ApiCategory" stepKey="createFourthCategoryLuma"/>

<!-- Single row. No hover state -->
<reloadPage stepKey="reload"/>
<waitForPageLoad stepKey="waitForLumaSingleRowAppear"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="reload"/>
<dontSeeElement selector="{{StorefrontNavigationMenuSection.itemByNameAndLevel($$createFirstCategoryLuma.name$$, 'level0')}}" stepKey="noHoverStateInFirstCategory"/>
<dontSeeElement selector="{{StorefrontNavigationMenuSection.itemByNameAndLevel($$createSecondCategoryLuma.name$$, 'level0')}}" stepKey="noHoverStateInSecondCategory"/>
<dontSeeElement selector="{{StorefrontNavigationMenuSection.itemByNameAndLevel($$createThirdCategoryLuma.name$$, 'level0')}}" stepKey="noHoverStateThirdCategory"/>
Expand Down Expand Up @@ -203,8 +200,7 @@
<createData entity="ApiCategory" stepKey="createEighthCategoryLuma"/>

<!-- Several rows. Hover on Category without children -->
<reloadPage stepKey="refresh"/>
<waitForPageLoad stepKey="waitForLumaSeveralRowsAppear"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="refresh"/>
<moveMouseOver selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createFifthCategoryLuma.name$$)}}" stepKey="hoverOnCategoryWithoutChildren"/>
<dontSeeElement selector="{{StorefrontNavigationMenuSection.itemByNameAndLevel($$createFifthCategoryLuma.name$$, 'level0')}}" stepKey="dontSeeSubcategoriesInCategory"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="guestGoToCheckoutFromMinicart" />
<selectOption stepKey="selectCounty" selector="{{CheckoutShippingSection.country}}" userInput="{{UK_Address.country_id}}"/>
<waitForPageLoad stepKey="waitFormToReload"/>
<reloadPage stepKey="refreshPage"/>
<waitForPageLoad stepKey="waitFormToReload1"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="refreshPage"/>
<fillField selector="{{CheckoutShippingSection.email}}" userInput="{{CustomerEntityOne.email}}" stepKey="enterEmail"/>
<fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{CustomerEntityOne.firstname}}" stepKey="enterFirstName"/>
<fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{CustomerEntityOne.lastname}}" stepKey="enterLastName"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@

<!-- Back to the Checkout and refresh the page -->
<switchToPreviousTab stepKey="switchToPreviousTab"/>
<reloadPage stepKey="refreshPage"/>
<waitForPageLoad stepKey="waitPageReload"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="refreshPage"/>

<!-- Payment step is opened after refreshing -->
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSection"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@
<actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields">
<argument name="address" value="US_Address_NY_Default_Shipping"/>
</actionGroup>
<reloadPage stepKey="reloadThePage"/>
<waitForPageLoad stepKey="waitForPageToReload"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadThePage"/>
<waitForText selector="{{CheckoutCartSummarySection.taxAmount}}" userInput="$9.60" time="90" stepKey="waitForTaxAmount"/>

<!--Select Free Shipping and proceed to checkout -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappearAfterFlatRateSelection"/>
<see selector="{{CheckoutCartSummarySection.total}}" userInput="15" stepKey="assertOrderTotalField"/>
<!-- 5. Refresh browser page (F5) -->
<reloadPage stepKey="reloadPage"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

We still may consider this change as BiC (there might be extensions with before/after references to this step key). The common (a little bit dirty but still common) practice, in this case, will be replacing the old action with a comment that has the same stepKey. Example is below

<comment userInput="Adding comment to replace reload action and preserve Backward Compatibility" stepKey="waitForPageLoad" />

Hope it makes sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @rogyar
Done
Thank you for advice.

<actionGroup ref="ReloadPageActionGroup" stepKey="reloadPage"/>
<actionGroup ref="StorefrontAssertCartEstimateShippingAndTaxActionGroup" stepKey="assertCartEstimateShippingAndTaxAfterPageReload"/>
<actionGroup ref="StorefrontAssertCartShippingMethodSelectedActionGroup" stepKey="assertFlatRateShippingMethodIsChecked">
<argument name="carrierCode" value="flatrate"/>
Expand All @@ -71,8 +70,7 @@
<!-- 9. Fill other fields -->
<actionGroup ref="StorefrontFillGuestShippingInfoActionGroup" stepKey="fillOtherFieldsInCheckoutShippingSection"/>
<!-- 10. Refresh browser page(F5) -->
<reloadPage stepKey="reloadCheckoutPage"/>
<waitForPageLoad stepKey="waitForCheckoutPageLoad"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadCheckoutPage"/>
<actionGroup ref="StorefrontAssertGuestShippingInfoActionGroup" stepKey="assertGuestShippingPersistedInfoAfterReloadingCheckoutShippingPage"/>
<actionGroup ref="StorefrontAssertCheckoutShippingMethodSelectedActionGroup" stepKey="assertFreeShippingShippingMethodIsChecked">
<argument name="shippingMethod" value="Free Shipping"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@
<closeTab stepKey="closeTab"/>

<!--Check price-->
<reloadPage stepKey="reloadPage"/>
<waitForPageLoad stepKey="waitForCheckoutPageReload"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadPage"/>
<conditionalClick selector="{{CheckoutPaymentSection.cartItemsArea}}" dependentSelector="{{CheckoutPaymentSection.cartItemsAreaActive}}" visible="false" stepKey="openItemProductBlock1"/>
<see userInput="$120.00" selector="{{CheckoutPaymentSection.orderSummarySubtotal}}" stepKey="checkSummarySubtotal1"/>
<see userInput="$120.00" selector="{{CheckoutPaymentSection.productItemPriceByName($$createSimpleProduct.name$$)}}" stepKey="checkItemPrice1"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@
<argument name="attributeType" value="{{colorProductAttribute.input_type}}"/>
<argument name="scope" value="Global"/>
</actionGroup>
<reloadPage stepKey="reloadPage"/>
<waitForPageLoad stepKey="waitForProductPageReload"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadPage"/>
<click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurations"/>
<waitForPageLoad stepKey="waitForFilters"/>
<actionGroup ref="CreateOptionsForAttributeActionGroup" stepKey="createOptions">
Expand Down Expand Up @@ -142,8 +141,7 @@
<argument name="attributeType" value="{{productAttributeColor.input_type}}"/>
<argument name="scope" value="Global"/>
</actionGroup>
<reloadPage stepKey="reloadDuplicatedProductPage"/>
<waitForPageLoad stepKey="waitForDuplicatedProductReload"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadDuplicatedProductPage"/>
<click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="createConfigurationsDuplicatedProduct"/>
<waitForElementVisible selector="{{AdminGridSelectRows.multicheckDropdown}}" stepKey="waitForCreateConfigurationsPageLoad"/>
<click selector="{{AdminGridSelectRows.multicheckDropdown}}" stepKey="openMulticheckDropdown"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
<argument name="indices" value=""/>
</actionGroup>
<reloadPage stepKey="reloadPage"/>
<waitForPageLoad stepKey="waitForLoad2"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadPage"/>
<click selector="{{AdminCustomerFiltersSection.filtersButton}}" stepKey="openFilter"/>
<fillField userInput="{{CustomerEntityOne.email}}" selector="{{AdminCustomerFiltersSection.emailInput}}" stepKey="filterEmail"/>
<click selector="{{AdminCustomerFiltersSection.apply}}" stepKey="applyFilter"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,8 @@

<!-- 5. Open admin tab with page with products. Reload this page twice. -->
<switchToPreviousTab stepKey="switchToPreviousTab"/>
<reloadPage stepKey="reloadAdminCatalogPageFirst"/>
<waitForPageLoad stepKey="waitForReloadFirst"/>
<reloadPage stepKey="reloadAdminCatalogPageSecond"/>
<waitForPageLoad stepKey="waitForReloadSecond"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadAdminCatalogPageFirst"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadAdminCatalogPageSecond"/>

<seeInTitle userInput="Products / Inventory / Catalog / Magento Admin" stepKey="seeAdminProductsPageTitle"/>
<see userInput="Products" selector="{{AdminHeaderSection.pageTitle}}" stepKey="seeAdminProductsPageHeader"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@
<actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/>
<!--Reset cookies and refresh the page-->
<resetCookie userInput="PHPSESSID" stepKey="resetCookieForCart"/>
<reloadPage stepKey="reloadPage"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadPage"/>
<!--Check product exists in cart-->
<see userInput="$$createProduct.name$$" stepKey="ProductExistsInCart"/>
</test>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@
<closeTab stepKey="closeTab"/>
<!-- Check cart -->
<wait time="60" stepKey="waitForCartToBeUpdated"/>
<reloadPage stepKey="reloadPage"/>
<waitForPageLoad stepKey="waitForCheckoutPageReload"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadPage"/>
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickMiniCart"/>
<dontSeeElement selector="{{StorefrontMinicartSection.quantity}}" stepKey="dontSeeCartItem"/>
<!-- Add simple product to shopping cart -->
Expand All @@ -151,8 +150,7 @@
<closeTab stepKey="closeTab2"/>
<!--Check cart-->
<wait time="60" stepKey="waitForCartToBeUpdated2"/>
<reloadPage stepKey="reloadPage2"/>
<waitForPageLoad stepKey="waitForCheckoutPageReload2"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadPage2"/>
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickMiniCart2"/>
<dontSeeElement selector="{{StorefrontMinicartSection.quantity}}" stepKey="dontSeeCartItem2"/>
</test>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@
<argument name="consumerName" value="{{AdminCodeGeneratorMessageConsumerData.consumerName}}"/>
<argument name="maxMessages" value="{{AdminCodeGeneratorMessageConsumerData.messageLimit}}"/>
</actionGroup>
<reloadPage stepKey="refreshPage"/>
<waitForPageLoad stepKey="waitFormToReload1"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="refreshPage"/>
<click selector="{{AdminCartPriceRulesFormSection.manageCouponCodesHeader}}" stepKey="expandCouponSection2"/>

<!-- Assert coupon codes grid header is correct -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@
<argument name="consumerName" value="{{AdminCodeGeneratorMessageConsumerData.consumerName}}"/>
<argument name="maxMessages" value="{{AdminCodeGeneratorMessageConsumerData.messageLimit}}"/>
</actionGroup>
<reloadPage stepKey="refreshPage"/>
<waitForPageLoad stepKey="waitFormToReload1"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="refreshPage"/>
<conditionalClick selector="{{AdminCartPriceRulesFormSection.manageCouponCodesHeader}}"
dependentSelector="{{AdminCartPriceRulesFormSection.manageCouponCodesHeader}}" visible="true"
stepKey="clickManageCouponCodes2"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@
</actionGroup>

<!-- Verify swatch tooltips are not visible -->
<reloadPage stepKey="refreshPage"/>
<waitForPageLoad stepKey="waitForPageReload"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="refreshPage"/>
<moveMouseOver selector="{{StorefrontProductInfoMainSection.nthSwatchOption('1')}}" stepKey="hoverDisabledSwatch"/>
<wait time="1" stepKey="waitForTooltip2"/>
<dontSeeElement selector="{{StorefrontProductInfoMainSection.swatchOptionTooltip}}" stepKey="swatchTooltipNotVisible"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@
</actionGroup>

<!-- 3. Go to storefront and click on cart button on the top -->
<reloadPage stepKey="reloadPage"/>
<waitForPageLoad stepKey="waitForReload"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadPage"/>
<actionGroup ref="StorefrontOpenMiniCartActionGroup" stepKey="openMiniCart"/>

<!-- Check button "Proceed to Checkout". There must be red borders and "book" icons on labels that can be translated. -->
Expand Down Expand Up @@ -490,8 +489,7 @@
<resetCookie userInput="mage-translation-file-version" stepKey="resetTranslationFileVersion"/>

<!-- Reload page after full clear -->
<reloadPage stepKey="reloadPageAfterFullClean"/>
<waitForPageLoad stepKey="waitForPageLoadAfterFullClean"/>
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadPageAfterFullClean"/>

<!-- Add product to cart and go through Checkout process like you did in steps ##3-6 and check translation you maid. -->
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProductPage1">
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="ReloadPageActionGroup">
<annotations>
<description>Reload page and wait for page load.</description>
</annotations>

<reloadPage stepKey="reloadPage"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>
</actionGroups>