Skip to content

Commit

Permalink
ENGCOM-6564: MFTF: Extract Action Groups to separate files - magento/…
Browse files Browse the repository at this point in the history
…module-ui #26323
  • Loading branch information
lenaorobei authored Jan 16, 2020
2 parents 8bed303 + e1e0567 commit fc53e16
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<waitForPageLoad stepKey="waitForSimpleProductPageLoad"/>
<!--Save and duplicated the product once-->
<comment userInput="Save and duplicated the product once" stepKey="commentSaveAndDuplicateProduct"/>
<actionGroup ref="AdminFormSaveAndDuplicate" stepKey="saveAndDuplicateProductFormFirstTime"/>
<actionGroup ref="AdminFormSaveAndDuplicateActionGroup" stepKey="saveAndDuplicateProductFormFirstTime"/>
<conditionalClick selector="{{AdminProductSEOSection.sectionHeader}}" dependentSelector="{{AdminProductSEOSection.urlKeyInput}}" visible="false" stepKey="openSEOSection"/>
<grabValueFrom selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="grabDuplicatedProductUrlKey"/>
<assertContains expected="$$createSimpleProduct.custom_attributes[url_key]$$" actual="$grabDuplicatedProductUrlKey" stepKey="assertDuplicatedProductUrlKey"/>
Expand All @@ -65,7 +65,7 @@
<comment userInput="Save and duplicated the product second time" stepKey="commentSaveAndDuplicateProduct1"/>
<amOnPage url="{{AdminProductEditPage.url($$createSimpleProduct.id$$)}}" stepKey="goToProductEditPage1"/>
<waitForPageLoad stepKey="waitForSimpleProductPageLoad2"/>
<actionGroup ref="AdminFormSaveAndDuplicate" stepKey="saveAndDuplicateProductFormSecondTime"/>
<actionGroup ref="AdminFormSaveAndDuplicateActionGroup" stepKey="saveAndDuplicateProductFormSecondTime"/>
<conditionalClick selector="{{AdminProductSEOSection.sectionHeader}}" dependentSelector="{{AdminProductSEOSection.urlKeyInput}}" visible="false" stepKey="openProductSEOSection"/>
<waitForElementVisible selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="waitForUrlKeyField"/>
<grabValueFrom selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="grabSecondDuplicatedProductUrlKey"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@
<argument name="product" value="$$createSimpleProduct$$"/>
</actionGroup>
<!--Save and duplicated the product once-->
<actionGroup ref="AdminFormSaveAndDuplicate" stepKey="saveAndDuplicateProductForm1"/>
<actionGroup ref="AdminFormSaveAndDuplicateActionGroup" stepKey="saveAndDuplicateProductForm1"/>
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct2">
<argument name="product" value="$$createSimpleProduct$$"/>
</actionGroup>
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct2">
<argument name="product" value="$$createSimpleProduct$$"/>
</actionGroup>
<!--Save and duplicated the product second time-->
<actionGroup ref="AdminFormSaveAndDuplicate" stepKey="saveAndDuplicateProductForm2"/>
<actionGroup ref="AdminFormSaveAndDuplicateActionGroup" stepKey="saveAndDuplicateProductForm2"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct2">
<argument name="product" value="$$product2$$"/>
</actionGroup>
<actionGroup ref="AdminFormSaveAndClose" stepKey="saveAndCloseProduct"/>
<actionGroup ref="AdminFormSaveAndCloseActionGroup" stepKey="saveAndCloseProduct"/>
<waitForPageLoad stepKey="waitForPageLoad1"/>
<seeInField selector="{{AdminDataGridPaginationSection.currentPage}}" userInput="2" stepKey="seeOnSecondPageOrderGrid"/>
</test>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<actionGroup ref="FilterProductGridBySetNewFromDateActionGroup" stepKey="filterProductGridToCheckSetAsNewColumn"/>
<click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnFirstRowProductGrid"/>
<waitForPageLoad stepKey="waitForProductEditPageToLoad"/>
<actionGroup ref="AdminFormSaveAndClose" stepKey="saveAndCloseProductForm"/>
<actionGroup ref="AdminFormSaveAndCloseActionGroup" stepKey="saveAndCloseProductForm"/>
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="expandFilters"/>
<seeInField selector="{{AdminProductGridFilterSection.newFromDateFilter}}" userInput="05/16/2018" stepKey="checkForNewFromDate"/>
<click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="openColumnsDropdown2"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
<waitForElementVisible selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="waitForProductEnableSlider"/>
<click selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="enableProductForSecondStoreView"/>
<seeCheckboxIsChecked selector="{{AdminProductFormSection.productStatus}}" stepKey="seeThatProductIsEnabled"/>
<actionGroup ref="AdminFormSaveAndClose" stepKey="enabledConfigProductSecondStore"/>
<actionGroup ref="AdminFormSaveAndCloseActionGroup" stepKey="enabledConfigProductSecondStore"/>

<!--go to admin and open product edit page to enable child product for second store view -->
<amOnPage url="{{AdminProductEditPage.url($$createConfigProduct.id$$)}}" stepKey="goToProductEditPage2"/>
Expand All @@ -154,7 +154,7 @@
<click selector="{{AdminProductFormConfigurationsSection.enableProductBtn}}" stepKey="clickEnableChildProduct1"/>
<click selector="{{AdminProductFormConfigurationsSection.actionsBtn('2')}}" stepKey="clickToExpandActionsForSecondVariation2"/>
<click selector="{{AdminProductFormConfigurationsSection.enableProductBtn}}" stepKey="clickEnableChildProduct2"/>
<actionGroup ref="AdminFormSaveAndClose" stepKey="saveAll"/>
<actionGroup ref="AdminFormSaveAndCloseActionGroup" stepKey="saveAll"/>

<!-- assert second store view storefront category list page -->
<amOnPage url="/second_store_view/" stepKey="amOnsecondStoreFront1"/>
Expand All @@ -168,7 +168,7 @@
<waitForPageLoad stepKey="waitChild1EditPageToLoad"/>
<click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="openProduct1InWebsitesSection"/>
<click selector="{{ProductInWebsitesSection.website('Second Website')}}" stepKey="selectSecondWebsite1"/>
<actionGroup ref="AdminFormSaveAndClose" stepKey="saveUpdatedChild1Again"/>
<actionGroup ref="AdminFormSaveAndCloseActionGroup" stepKey="saveUpdatedChild1Again"/>

<!--go to admin again and open child product1 and enable for second store view-->
<amOnPage url="{{AdminProductEditPage.url($$createConfigChildProduct1.id$$)}}" stepKey="goToProduct1EditPage"/>
Expand All @@ -180,14 +180,14 @@
<see userInput="Second Store View" selector="{{AdminMainActionsSection.storeSwitcher}}" stepKey="seeNewStoreViewNameP1"/>
<waitForElementVisible selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="waitForProductEnableSliderP1"/>
<seeCheckboxIsChecked selector="{{AdminProductFormSection.productStatus}}" stepKey="seeThatProduct1IsEnabled"/>
<actionGroup ref="AdminFormSaveAndClose" stepKey="save2UpdatedChild1"/>
<actionGroup ref="AdminFormSaveAndCloseActionGroup" stepKey="save2UpdatedChild1"/>

<!--go to admin and open child product2 edit page and assign it to the second website -->
<amOnPage url="{{AdminProductEditPage.url($$createConfigChildProduct2.id$$)}}" stepKey="goToProduct2EditPage"/>
<waitForPageLoad stepKey="waitChild2EditPageToLoad"/>
<click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="openProduct2InWebsitesSection"/>
<click selector="{{ProductInWebsitesSection.website('Second Website')}}" stepKey="selectSecondWebsite2"/>
<actionGroup ref="AdminFormSaveAndClose" stepKey="saveUpdatedChild2"/>
<actionGroup ref="AdminFormSaveAndCloseActionGroup" stepKey="saveUpdatedChild2"/>

<!--go to admin again and open child product2 and enable for second store view-->
<amOnPage url="{{AdminProductEditPage.url($$createConfigChildProduct2.id$$)}}" stepKey="goToProduct2EditPage2"/>
Expand All @@ -199,7 +199,7 @@
<see userInput="Second Store View" selector="{{AdminMainActionsSection.storeSwitcher}}" stepKey="seeNewStoreViewNameP2"/>
<waitForElementVisible selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="waitForProductEnableSliderP2"/>
<seeCheckboxIsChecked selector="{{AdminProductFormSection.productStatus}}" stepKey="seeThatProduct2IsEnabled"/>
<actionGroup ref="AdminFormSaveAndClose" stepKey="save2UpdatedChild2"/>
<actionGroup ref="AdminFormSaveAndCloseActionGroup" stepKey="save2UpdatedChild2"/>

<!-- assert storefront category list page -->
<amOnPage url="/second_store_view/" stepKey="amOnsecondStoreFront"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/>
<!--Duplicate the product-->
<comment userInput="Duplicate the product" stepKey="commentDuplicateProduct"/>
<actionGroup ref="AdminFormSaveAndDuplicate" stepKey="saveAndDuplicateProductForm"/>
<actionGroup ref="AdminFormSaveAndDuplicateActionGroup" stepKey="saveAndDuplicateProductForm"/>
<click selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="clickEnableProduct"/>
<fillField selector="{{AdminProductFormSection.productName}}" userInput="$$createConfigProduct.name$$-Updated" stepKey="fillProductName"/>
<selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="1" stepKey="selectInStock"/>
Expand Down
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="AdminFormSaveAndCloseActionGroup">
<annotations>
<description>Clicks on 'Save and Close'. Validates that the Success Message is present.</description>
</annotations>

<click selector="{{AdminProductFormActionSection.saveArrow}}" stepKey="openSaveDropDown"/>
<click selector="{{AdminProductFormActionSection.saveAndClose}}" stepKey="clickOnSaveAndClose"/>
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveMessageSuccess"/>
</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="AdminFormSaveAndDuplicateActionGroup">
<annotations>
<description>Clicks on 'Save and Duplicate'. Validates that the Success Message is present and correct.</description>
</annotations>

<click selector="{{AdminProductFormActionSection.saveArrow}}" stepKey="openSaveDropDown"/>
<click selector="{{AdminProductFormActionSection.saveAndDuplicate}}" stepKey="clickOnSaveAndDuplicate"/>
<see selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveSuccess" userInput="You saved the product."/>
<see selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertDuplicateSuccess" userInput="You duplicated the product."/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminFormSaveAndClose">
<annotations>
<description>Clicks on 'Save and Close'. Validates that the Success Message is present.</description>
Expand All @@ -17,7 +17,6 @@
<click selector="{{AdminProductFormActionSection.saveAndClose}}" stepKey="clickOnSaveAndClose"/>
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveMessageSuccess"/>
</actionGroup>

<actionGroup name="AdminFormSaveAndDuplicate">
<annotations>
<description>Clicks on 'Save and Duplicate'. Validates that the Success Message is present and correct.</description>
Expand All @@ -27,5 +26,5 @@
<click selector="{{AdminProductFormActionSection.saveAndDuplicate}}" stepKey="clickOnSaveAndDuplicate"/>
<see selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveSuccess" userInput="You saved the product."/>
<see selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertDuplicateSuccess" userInput="You duplicated the product."/>
</actionGroup>
</actionGroup>
</actionGroups>

0 comments on commit fc53e16

Please sign in to comment.