Skip to content

Commit 78a85c4

Browse files
committed
Merge branch 'MC-13728-move-mftf-to-core' into cms-team-1-delivery-core
# Conflicts: # app/code/Magento/Cms/Test/Mftf/ActionGroup/CMSActionGroup.xml
2 parents 972aab7 + 8704f0e commit 78a85c4

File tree

13 files changed

+190
-0
lines changed

13 files changed

+190
-0
lines changed

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

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,4 +330,47 @@
330330
</assertEquals>
331331
</actionGroup>
332332

333+
<actionGroup name="expandAdminProductSection">
334+
<arguments>
335+
<argument name="sectionSelector" defaultValue="{{AdminProductContentSection.sectionHeader}}" type="string"/>
336+
<argument name="sectionDependentSelector" defaultValue="{{AdminProductContentSection.sectionHeader}}._show" type="string"/>
337+
</arguments>
338+
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
339+
<waitForElementVisible time="30" selector="{{sectionSelector}}" stepKey="waitForSection"/>
340+
<conditionalClick selector="{{sectionSelector}}" dependentSelector="{{sectionDependentSelector}}" visible="false" stepKey="expandSection"/>
341+
<waitForPageLoad time="30" stepKey="waitForSectionToExpand"/>
342+
</actionGroup>
343+
<actionGroup name="navigateToCreatedProductEditPage">
344+
<arguments>
345+
<argument name="product" defaultValue="_defaultProduct"/>
346+
</arguments>
347+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToAdminProductIndexPage"/>
348+
<waitForPageLoad stepKey="waitForProductIndexPageToLoad"/>
349+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
350+
<waitForPageLoad stepKey="waitForClearFilters"/>
351+
<dontSeeElement selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="dontSeeClearFilters"/>
352+
<click selector="{{AdminProductGridFilterSection.viewDropdown}}" stepKey="openViewBookmarksTab"/>
353+
<click selector="{{AdminProductGridFilterSection.viewBookmark('Default View')}}" stepKey="resetToDefaultGridView"/>
354+
<waitForPageLoad stepKey="waitForResetToDefaultView"/>
355+
<see selector="{{AdminProductGridFilterSection.viewDropdown}}" userInput="Default View" stepKey="seeDefaultViewSelected"/>
356+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/>
357+
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/>
358+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
359+
<waitForPageLoad stepKey="waitForFilterOnGrid"/>
360+
<click selector="{{AdminProductGridSection.selectRowBasedOnName(product.name)}}" stepKey="clickProduct"/>
361+
<waitForPageLoad stepKey="waitForProductEditPageLoad"/>
362+
<waitForElementVisible selector="{{AdminProductFormBundleSection.productSku}}" stepKey="waitForProductSKUField"/>
363+
<seeInField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{product.sku}}" stepKey="seeProductSKU"/>
364+
</actionGroup>
365+
<actionGroup name="addUpSellProductBySku" extends="addRelatedProductBySku">
366+
<click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddUpSellProductsButton}}" stepKey="clickAddRelatedProductButton"/>
367+
<conditionalClick selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
368+
<click selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/>
369+
<fillField selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/>
370+
<click selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
371+
<waitForPageLoad stepKey="waitForPageToLoad"/>
372+
<click selector="{{AdminAddUpSellProductsModalSection.Modal}}{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectProduct"/>
373+
<click selector="{{AdminAddUpSellProductsModalSection.AddSelectedProductsButton}}" stepKey="addRelatedProductSelected"/>
374+
<waitForPageLoad stepKey="waitForPageToLoad1"/>
375+
</actionGroup>
333376
</actionGroups>

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,21 @@
6363
<seeElement selector="{{AdminProductMessagesSection.successMessage}}"
6464
stepKey="waitForSuccessMessage"/>
6565
</actionGroup>
66+
<actionGroup name="saveProductAttribute">
67+
<waitForElementVisible selector="{{AttributePropertiesSection.Save}}" stepKey="waitForSaveButton"/>
68+
<click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSaveButton"/>
69+
<waitForPageLoad stepKey="waitForAttributeToSave"/>
70+
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/>
71+
</actionGroup>
72+
<actionGroup name="confirmChangeInputTypeModal">
73+
<waitForElementVisible selector="{{AdminEditProductAttributesSection.ProductDataMayBeLostConfirmButton}}" stepKey="waitForChangeInputTypeButton"/>
74+
<click selector="{{AdminEditProductAttributesSection.ProductDataMayBeLostConfirmButton}}" stepKey="clickChangeInputTypeButton"/>
75+
<waitForElementNotVisible selector="{{AdminEditProductAttributesSection.ProductDataMayBeLostModal}}" stepKey="waitForChangeInputTypeModalGone"/>
76+
</actionGroup>
77+
<actionGroup name="saveProductAttributeInUse">
78+
<waitForElementVisible selector="{{AttributePropertiesSection.Save}}" stepKey="waitForSaveButton"/>
79+
<click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSaveButton"/>
80+
<waitForPageLoad stepKey="waitForAttributeToSave"/>
81+
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/>
82+
</actionGroup>
6683
</actionGroups>

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,4 +248,15 @@
248248
<waitForLoadingMaskToDisappear stepKey="waitForMaskToDisappear"/>
249249
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial2"/>
250250
</actionGroup>
251+
252+
<actionGroup name="NavigateToAndResetProductGridToDefaultView" extends="resetProductGridToDefaultView">
253+
<amOnPage url="{{AdminProductIndexPage.url}}" before="clickClearFilters" stepKey="goToAdminProductIndexPage"/>
254+
<waitForPageLoad after="goToAdminProductIndexPage" stepKey="waitForProductIndexPageToLoad"/>
255+
</actionGroup>
256+
<actionGroup name="NavigateToAndResetProductAttributeGridToDefaultView">
257+
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/>
258+
<waitForPageLoad stepKey="waitForPageLoad"/>
259+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
260+
<waitForPageLoad stepKey="waitForGridLoad"/>
261+
</actionGroup>
251262
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,27 @@
115115
<data key="used_for_sort_by">true</data>
116116
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
117117
</entity>
118+
<entity name="productAttributeText" type="ProductAttribute">
119+
<data key="attribute_code" unique="suffix">attribute</data>
120+
<data key="frontend_input">text</data>
121+
<data key="scope">global</data>
122+
<data key="is_required">false</data>
123+
<data key="is_unique">false</data>
124+
<data key="is_searchable">false</data>
125+
<data key="is_visible">true</data>
126+
<data key="backend_type">text</data>
127+
<data key="is_wysiwyg_enabled">false</data>
128+
<data key="is_visible_in_advanced_search">false</data>
129+
<data key="is_visible_on_front">true</data>
130+
<data key="is_filterable">false</data>
131+
<data key="is_filterable_in_search">false</data>
132+
<data key="used_in_product_listing">false</data>
133+
<data key="is_used_for_promo_rules">false</data>
134+
<data key="is_comparable">true</data>
135+
<data key="is_used_in_grid">false</data>
136+
<data key="is_visible_in_grid">false</data>
137+
<data key="is_filterable_in_grid">false</data>
138+
<data key="used_for_sort_by">false</data>
139+
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
140+
</entity>
118141
</entities>

app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeSetData.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,10 @@
1414
<data key="attributeGroupId">7</data>
1515
<data key="sortOrder">0</data>
1616
</entity>
17+
<entity name="AddToDefaultSetSortOrder1" type="ProductAttributeSet">
18+
<var key="attributeCode" entityKey="attribute_code" entityType="ProductAttribute"/>
19+
<data key="attributeSetId">4</data>
20+
<data key="attributeGroupId">7</data>
21+
<data key="sortOrder">1</data>
22+
</entity>
1723
</entities>

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,4 +519,13 @@
519519
<data key="filename">magento3</data>
520520
<data key="file_extension">jpg</data>
521521
</entity>
522+
<entity name="ProductShortDescription" type="ProductAttribute">
523+
<data key="attribute_code">short_description</data>
524+
</entity>
525+
<entity name="AddToDefaultSetTopOfContentSection" type="ProductAttributeSet">
526+
<var key="attributeCode" entityKey="attribute_code" entityType="ProductAttribute"/>
527+
<data key="attributeSetId">4</data>
528+
<data key="attributeGroupId">13</data>
529+
<data key="sortOrder">0</data>
530+
</entity>
522531
</entities>

app/code/Magento/Catalog/Test/Mftf/Section/AdminEditProductAttributesSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
<element name="AttributeDescription" type="text" selector="#description"/>
1919
<element name="ChangeAttributeDescriptionToggle" type="checkbox" selector="#toggle_description"/>
2020
<element name="Save" type="button" selector="button[title=Save]" timeout="30"/>
21+
<element name="ProductDataMayBeLostModal" type="button" selector="//aside[contains(@class,'_show')]//header[contains(.,'Product data may be lost')]"/>
22+
<element name="ProductDataMayBeLostConfirmButton" type="button" selector="//aside[contains(@class,'_show')]//button[.='Change Input Type']"/>
2123
<element name="defaultLabel" type="text" selector="//td[contains(text(), '{{attributeName}}')]/following-sibling::td[contains(@class, 'col-frontend_label')]" parameterized="true"/>
2224
</section>
2325
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductRelatedUpSellCrossSellSection.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminProductFormRelatedUpSellCrossSellSection">
1212
<element name="AddRelatedProductsButton" type="button" selector="button[data-index='button_related']" timeout="30"/>
13+
<element name="AddUpSellProductsButton" type="button" selector="button[data-index='button_upsell']" timeout="30"/>
1314
<element name="relatedProductSectionText" type="text" selector=".fieldset-wrapper.admin__fieldset-section[data-index='related']"/>
1415
<element name="upSellProductSectionText" type="text" selector=".fieldset-wrapper.admin__fieldset-section[data-index='upsell']"/>
1516
<element name="crossSellProductSectionText" type="text" selector=".fieldset-wrapper.admin__fieldset-section[data-index='crosssell']"/>
@@ -18,4 +19,8 @@
1819
<element name="selectedRelatedProduct" type="block" selector="//span[@data-index='name']"/>
1920
<element name="removeRelatedProduct" type="button" selector="//span[text()='Related Products']//..//..//..//span[text()='{{productName}}']//..//..//..//..//..//button[@class='action-delete']" parameterized="true"/>
2021
</section>
22+
<section name="AdminAddUpSellProductsModalSection">
23+
<element name="Modal" type="button" selector=".product_form_product_form_related_upsell_modal"/>
24+
<element name="AddSelectedProductsButton" type="button" selector="//aside[contains(@class, 'product_form_product_form_related_upsell_modal')]//button/span[contains(text(), 'Add Selected Products')]" timeout="30"/>
25+
</section>
2126
</sections>

app/code/Magento/Cms/Test/Mftf/ActionGroup/CMSActionGroup.xml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,43 @@
8383
<amOnPage url="{{page}}" stepKey="goToStorefront"/>
8484
<waitForPageLoad stepKey="waitForPageLoad"/>
8585
</actionGroup>
86+
<actionGroup name="navigateToStorefrontForCreatedPage">
87+
<arguments>
88+
<argument name="page" type="string"/>
89+
</arguments>
90+
<amOnPage url="{{page}}" stepKey="goToStorefront"/>
91+
<waitForPageLoad stepKey="waitForPageLoad"/>
92+
</actionGroup>
93+
<actionGroup name="saveCMSBlock">
94+
<waitForElementVisible selector="{{CmsNewBlockBlockActionsSection.savePage}}" stepKey="waitForSaveButton"/>
95+
<click selector="{{CmsNewBlockBlockActionsSection.savePage}}" stepKey="clickSaveButton"/>
96+
<waitForPageLoad stepKey="waitForPageLoad"/>
97+
<see userInput="You saved the block." stepKey="seeSuccessfulSaveMessage"/>
98+
</actionGroup>
99+
<actionGroup name="saveAndContinueEditCmsPage">
100+
<waitForElementVisible time="10" selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="waitForSaveAndContinueVisibility"/>
101+
<click selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="clickSaveAndContinueEditCmsPage"/>
102+
<waitForPageLoad stepKey="waitForCmsPageLoad"/>
103+
<waitForElementVisible time="1" selector="{{CmsNewPagePageActionsSection.cmsPageTitle}}" stepKey="waitForCmsPageSaveButton"/>
104+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/>
105+
</actionGroup>
106+
<actionGroup name="saveCmsPage">
107+
<waitForElementVisible selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="waitForSplitButton"/>
108+
<click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/>
109+
<waitForElementVisible selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="waitForSaveCmsPage"/>
110+
<click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSaveCmsPage"/>
111+
<waitForElementVisible time="1" selector="{{CmsPagesPageActionsSection.addNewPageButton}}" stepKey="waitForCmsPageSaveButton"/>
112+
<see userInput="You saved the page." selector="{{CmsPagesPageActionsSection.savePageSuccessMessage}}" stepKey="assertSavePageSuccessMessage"/>
113+
</actionGroup>
114+
<actionGroup name="setLayout">
115+
<arguments>
116+
<argument name="designSection"/>
117+
<argument name="layoutOption"/>
118+
</arguments>
119+
<waitForElementVisible selector="{{designSection.DesignTab}}" stepKey="waitForDesignTabVisible"/>
120+
<conditionalClick selector="{{designSection.DesignTab}}" dependentSelector="{{designSection.LayoutDropdown}}" visible="false" stepKey="clickOnDesignTab"/>
121+
<waitForPageLoad stepKey="waitForPageLoadDesignTab"/>
122+
<waitForElementVisible selector="{{designSection.LayoutDropdown}}" stepKey="waitForLayoutDropDown" />
123+
<selectOption selector="{{designSection.LayoutDropdown}}" userInput="{{layoutOption}}" stepKey="selectLayout"/>
124+
</actionGroup>
86125
</actionGroups>

app/code/Magento/Cms/Test/Mftf/Data/CmsPageData.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,13 @@
8686
<data key="content">1&lt;br/&gt;2&lt;br/&gt;3&lt;br/&gt;4&lt;br/&gt;5&lt;br/&gt;6&lt;br/&gt;7&lt;br/&gt;8&lt;br/&gt;9&lt;br/&gt;10&lt;br/&gt;11&lt;br/&gt;12&lt;br/&gt;13&lt;br/&gt;14&lt;br/&gt;15&lt;br/&gt;16&lt;br/&gt;17&lt;br/&gt;18&lt;br/&gt;19&lt;br/&gt;20&lt;br/&gt;line21&lt;br/&gt;22&lt;br/&gt;23&lt;br/&gt;24&lt;br/&gt;25&lt;br/&gt;26&lt;br/&gt;line27&lt;br/&gt;2&lt;br/&gt;3&lt;br/&gt;4&lt;br/&gt;5</data>
8787
<data key="identifier" unique="suffix">test-page-</data>
8888
</entity>
89+
<entity name="_emptyCmsPage" type="cms_page">
90+
<data key="title" unique="suffix">Test CMS Page</data>
91+
<data key="identifier" unique="suffix">test-page-</data>
92+
</entity>
93+
<entity name="_emptyCmsBlock" type="block">
94+
<data key="title" unique="suffix">Test CMS Block</data>
95+
<data key="identifier" unique="suffix" >block</data>
96+
<data key="active">true</data>
97+
</entity>
8998
</entities>

0 commit comments

Comments
 (0)