Skip to content

Commit d71a907

Browse files
committed
Add new Action Groups and deprecate old one.
1 parent f004950 commit d71a907

File tree

46 files changed

+1073
-11
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1073
-11
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AddRelatedProductBySkuActionGroup">
12+
<annotations>
13+
<description>Adds the provided Product SKU as a Related Product on the Admin Product creation/edit page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="sku"/>
17+
</arguments>
18+
19+
<!--Scroll up to avoid error-->
20+
<scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" x="0" y="-100" stepKey="scrollTo"/>
21+
<conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedUpSellCrossSell"/>
22+
<click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddRelatedProductsButton}}" stepKey="clickAddRelatedProductButton"/>
23+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
24+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/>
25+
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/>
26+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
27+
<waitForPageLoad stepKey="waitForPageToLoad"/>
28+
<click selector="{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectProduct"/>
29+
<click selector="{{AdminAddRelatedProductsModalSection.AddSelectedProductsButton}}" stepKey="addRelatedProductSelected"/>
30+
<waitForElementNotVisible selector="{{AdminAddRelatedProductsModalSection.AddSelectedProductsButton}}" stepKey="waitForElementNotVisible"/>
31+
</actionGroup>
32+
</actionGroups>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AddUpSellProductBySkuActionGroup" extends="AddRelatedProductBySkuActionGroup">
12+
<annotations>
13+
<description>EXTENDS: AddRelatedProductBySkuActionGroup. Add the provided Product as an Up Sell Product.</description>
14+
</annotations>
15+
16+
<click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddUpSellProductsButton}}" stepKey="clickAddRelatedProductButton"/>
17+
<conditionalClick selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
18+
<click selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/>
19+
<fillField selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/>
20+
<click selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
21+
<waitForPageLoad stepKey="waitForPageToLoad"/>
22+
<click selector="{{AdminAddUpSellProductsModalSection.Modal}}{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectProduct"/>
23+
<click selector="{{AdminAddUpSellProductsModalSection.AddSelectedProductsButton}}" stepKey="addRelatedProductSelected"/>
24+
<waitForPageLoad stepKey="waitForPageToLoad1"/>
25+
</actionGroup>
26+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@
7373
<fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{categoryEntity.name_lwr}}" stepKey="enterURLKey"/>
7474
</actionGroup>
7575

76-
<!-- Save category form -->
76+
<!--
77+
NOTICE: saveCategoryForm is deprecated.
78+
Please use SaveCategoryFormActionGroup instead.
79+
-->
7780
<actionGroup name="saveCategoryForm">
7881
<annotations>
7982
<description>Requires navigation to the Category creation/edit page. Checks that the url contains the AdminCategoryPage url. Saves the Category.</description>
@@ -139,7 +142,10 @@
139142
</assertRegExp>
140143
</actionGroup>
141144

142-
<!-- Action to navigate to Media Gallery. Used in tests to cleanup uploaded images -->
145+
<!--
146+
NOTICE: navigateToMediaGallery is deprecated.
147+
Please use NavigateToMediaGalleryActionGroup instead.
148+
-->
143149
<actionGroup name="navigateToMediaGallery">
144150
<annotations>
145151
<description>Navigates to the category page and Opens the Media Gallery.</description>
@@ -170,7 +176,10 @@
170176
<seeInTitle userInput="{{categoryEntity.name}}" stepKey="seeCategoryNameInTitle"/>
171177
</actionGroup>
172178

173-
<!--Actions to delete category-->
179+
<!--
180+
NOTICE: DeleteCategory is deprecated.
181+
Please use DeleteCategoryActionGroup instead.
182+
-->
174183
<actionGroup name="DeleteCategory">
175184
<annotations>
176185
<description>Navigates to the category page and deletes the specified category.</description>
@@ -321,6 +330,10 @@
321330
<waitForPageLoad stepKey="waitForStoreViewChangeLoad"/>
322331
</actionGroup>
323332

333+
<!--
334+
NOTICE: navigateToCreatedCategory is deprecated.
335+
Please use NavigateToCreatedCategoryActionGroup instead.
336+
-->
324337
<actionGroup name="navigateToCreatedCategory">
325338
<annotations>
326339
<description>Navigates to category page, selects a category by specified category.</description>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,10 @@
251251
<dontSeeElement selector="{{AdminProductImagesSection.imageFile(image.filename)}}" stepKey="seeImage"/>
252252
</actionGroup>
253253

254-
<!--Fill fields for simple product in a category in Admin-->
254+
<!--
255+
NOTICE: FillAdminSimpleProductForm is deprecated.
256+
Please use FillAdminSimpleProductFormActionGroup instead.
257+
-->
255258
<actionGroup name="FillAdminSimpleProductForm">
256259
<annotations>
257260
<description>Goes to the Admin Product grid page. Clicks on Add. Fills the provided Product details (Name, SKU, Price, Quantity, Category and URL). Clicks on Save. Validates that the Product details are present and correct.</description>
@@ -383,7 +386,10 @@
383386
<see selector="{{element}}" userInput="{{expectedText}}" stepKey="assertText"/>
384387
</actionGroup>
385388

386-
<!--Related products-->
389+
<!--
390+
NOTICE: addRelatedProductBySku is deprecated.
391+
Please use AddRelatedProductBySkuActionGroup instead.
392+
-->
387393
<actionGroup name="addRelatedProductBySku">
388394
<annotations>
389395
<description>Adds the provided Product SKU as a Related Product on the Admin Product creation/edit page.</description>
@@ -643,6 +649,10 @@
643649
<click selector="{{AdminProductFormSection.done}}" stepKey="clickOnDoneAdvancedCategory"/>
644650
</actionGroup>
645651

652+
<!--
653+
NOTICE: expandAdminProductSection is deprecated.
654+
Please use ExpandAdminProductSectionActionGroup instead.
655+
-->
646656
<actionGroup name="expandAdminProductSection">
647657
<annotations>
648658
<description>Expand the provided Section Selector based on the provided dependant Section Selector.</description>
@@ -658,6 +668,10 @@
658668
<waitForPageLoad time="30" stepKey="waitForSectionToExpand"/>
659669
</actionGroup>
660670

671+
<!--
672+
NOTICE: navigateToCreatedProductEditPage is deprecated.
673+
Please use NavigateToCreatedProductEditPageActionGroup instead.
674+
-->
661675
<actionGroup name="navigateToCreatedProductEditPage">
662676
<annotations>
663677
<description>Goes to the Admin Product grid page. Filters the Product grid based on the provided Product details (SKU). Edits the provided Product. Validates that the Product SKU is present and correct.</description>
@@ -685,6 +699,10 @@
685699
<seeInField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{product.sku}}" stepKey="seeProductSKU"/>
686700
</actionGroup>
687701

702+
<!--
703+
NOTICE: addUpSellProductBySku is deprecated.
704+
Please use AddUpSellProductBySkuActionGroup instead.
705+
-->
688706
<actionGroup name="addUpSellProductBySku" extends="addRelatedProductBySku">
689707
<annotations>
690708
<description>EXTENDS: addRelatedProductBySku. Add the provided Product as an Up Sell Product.</description>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<!--
12+
NOTICE: navigateToCreatedProductAttribute is deprecated.
13+
Please use NavigateToCreatedProductAttributeActionGroup instead.
14+
-->
1115
<actionGroup name="navigateToCreatedProductAttribute">
1216
<annotations>
1317
<description>Goes to the Product Attributes grid page. Filters the grid based on the provided Product Attribute. Clicks on the 1st row.</description>
@@ -184,6 +188,11 @@
184188
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/>
185189
</actionGroup>
186190

191+
<!--
192+
NOTICE: deleteProductAttributeByLabel is deprecated.
193+
Please use deleteProductAttributeByLabelActionGroup instead.
194+
-->
195+
187196
<actionGroup name="deleteProductAttributeByLabel">
188197
<annotations>
189198
<description>Goes to the Admin Product Attributes grid page. Filters the grid for the provided Product Attribute (Label). Deletes the Product Attribute from the grid. Validates that the Success Message is present.</description>
@@ -254,6 +263,10 @@
254263
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/>
255264
</actionGroup>
256265

266+
<!--
267+
NOTICE: saveProductAttribute is deprecated.
268+
Please use SaveProductAttributeActionGroup instead.
269+
-->
257270
<actionGroup name="saveProductAttribute">
258271
<annotations>
259272
<description>Clicks on Save. Validates that the Success Message is present.</description>
@@ -265,6 +278,10 @@
265278
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/>
266279
</actionGroup>
267280

281+
<!--
282+
NOTICE: confirmChangeInputTypeModal is deprecated.
283+
Please use ConfirmChangeInputTypeModalActionGroup instead.
284+
-->
268285
<actionGroup name="confirmChangeInputTypeModal">
269286
<annotations>
270287
<description>Clicks on the Confirm button for the 'Product Data My Be Lost' modal.</description>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,10 @@
387387
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial2"/>
388388
</actionGroup>
389389

390+
<!--
391+
NOTICE: NavigateToAndResetProductGridToDefaultView is deprecated.
392+
Please use NavigateToAndResetProductGridToDefaultViewActionGroup instead.
393+
-->
390394
<actionGroup name="NavigateToAndResetProductGridToDefaultView" extends="resetProductGridToDefaultView">
391395
<annotations>
392396
<description>EXTENDS: resetProductGridToDefaultView. Adds an action to go to the Admin Products grid page.</description>
@@ -396,6 +400,10 @@
396400
<waitForPageLoad after="goToAdminProductIndexPage" stepKey="waitForProductIndexPageToLoad"/>
397401
</actionGroup>
398402

403+
<!--
404+
NOTICE: NavigateToAndResetProductAttributeGridToDefaultView is deprecated.
405+
Please use NavigateToAndResetProductAttributeGridToDefaultViewActionGroup instead.
406+
-->
399407
<actionGroup name="NavigateToAndResetProductAttributeGridToDefaultView">
400408
<annotations>
401409
<description>Goes to the Product Attributes grid. Clicks on 'Clear Filters'.</description>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="ConfirmChangeInputTypeModalActionGroup">
12+
<annotations>
13+
<description>Clicks on the Confirm button for the 'Product Data My Be Lost' modal.</description>
14+
</annotations>
15+
16+
<waitForElementVisible selector="{{AdminEditProductAttributesSection.ProductDataMayBeLostConfirmButton}}" stepKey="waitForChangeInputTypeButton"/>
17+
<click selector="{{AdminEditProductAttributesSection.ProductDataMayBeLostConfirmButton}}" stepKey="clickChangeInputTypeButton"/>
18+
<waitForElementNotVisible selector="{{AdminEditProductAttributesSection.ProductDataMayBeLostModal}}" stepKey="waitForChangeInputTypeModalGone"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="DeleteCategoryActionGroup">
12+
<annotations>
13+
<description>Navigates to the category page and deletes the specified category.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="categoryEntity" defaultValue="_defaultCategory"/>
17+
</arguments>
18+
19+
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="goToCategoryPage"/>
20+
<waitForPageLoad time="60" stepKey="waitForCategoryPageLoad"/>
21+
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryEntity.name)}}" stepKey="clickCategoryLink"/>
22+
<click selector="{{AdminCategoryMainActionsSection.DeleteButton}}" stepKey="clickDelete"/>
23+
<waitForElementVisible selector="{{AdminCategoryModalSection.message}}" stepKey="waitForConfirmationModal"/>
24+
<see selector="{{AdminCategoryModalSection.message}}" userInput="Are you sure you want to delete this category?" stepKey="seeDeleteConfirmationMessage"/>
25+
<click selector="{{AdminCategoryModalSection.ok}}" stepKey="confirmDelete"/>
26+
<waitForPageLoad time="60" stepKey="waitForDeleteToFinish"/>
27+
<see selector="You deleted the category." stepKey="seeDeleteSuccess"/>
28+
<click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="expandToSeeAllCategories"/>
29+
<dontSee selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryEntity.name)}}" stepKey="dontSeeCategoryInTree"/>
30+
</actionGroup>
31+
</actionGroups>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="DeleteProductAttributeByLabelActionGroup">
12+
<annotations>
13+
<description>Goes to the Admin Product Attributes grid page. Filters the grid for the provided Product Attribute (Label). Deletes the Product Attribute from the grid. Validates that the Success Message is present.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="ProductAttribute"/>
17+
</arguments>
18+
19+
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/>
20+
<fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttribute.default_label}}" stepKey="setAttributeCode"/>
21+
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/>
22+
<click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/>
23+
<waitForPageLoad stepKey="waitForPageLoad"/>
24+
<click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="deleteAttribute"/>
25+
<click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOnDeleteButton"/>
26+
<waitForPageLoad stepKey="waitForPageLoad1"/>
27+
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/>
28+
</actionGroup>
29+
</actionGroups>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="ExpandAdminProductSectionActionGroup">
12+
<annotations>
13+
<description>Expand the provided Section Selector based on the provided dependant Section Selector.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="sectionSelector" defaultValue="{{AdminProductContentSection.sectionHeader}}" type="string"/>
17+
<argument name="sectionDependentSelector" defaultValue="{{AdminProductContentSection.sectionHeaderShow}}" type="string"/>
18+
</arguments>
19+
20+
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
21+
<waitForElementVisible time="30" selector="{{sectionSelector}}" stepKey="waitForSection"/>
22+
<conditionalClick selector="{{sectionSelector}}" dependentSelector="{{sectionDependentSelector}}" visible="false" stepKey="expandSection"/>
23+
<waitForPageLoad time="30" stepKey="waitForSectionToExpand"/>
24+
</actionGroup>
25+
</actionGroups>

0 commit comments

Comments
 (0)