Skip to content

Commit beea7ec

Browse files
committed
MC-5373: Product couldn't be pulled to CMS Page when it was assigned to a specific website
Add/upgrade action groups in CatalogProductActionGroup
1 parent 021ae1f commit beea7ec

File tree

1 file changed

+73
-6
lines changed

1 file changed

+73
-6
lines changed

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/CatalogProductActionGroup.xml

Lines changed: 73 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,80 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="openPageBuilderForAttribute">
1212
<arguments>
13-
<argument name="attributeCode" type="string"/>
13+
<argument name="attributeCode" defaultValue="description" type="string"/>
1414
<argument name="section" defaultValue="PageBuilderProductAttribute"/>
15+
<argument name="pageBuilderArea" defaultValue="" type="string"/>
1516
</arguments>
16-
<!-- Opening Page Builder for attribute -->
1717
<comment userInput="Opening Page Builder for attribute" stepKey="commentOpeningPageBuilder"/>
18-
<waitForElementVisible selector="{{section.PageBuilderBtn(attributeCode)}}" stepKey="seePagebuilderBtn"/>
19-
<click selector="{{section.PageBuilderBtn(attributeCode)}}" stepKey="enablePageBuilder"/>
20-
<waitForElementVisible selector="{{PageBuilderPanel.layoutGroup}}" stepKey="waiForPageBuilderVisible" />
18+
<waitForElementVisible selector="{{section.PageBuilderBtn(attributeCode)}}" stepKey="waitForPageBuilderButton"/>
19+
<click selector="{{section.PageBuilderBtn(attributeCode)}}" stepKey="clickOpenPageBuilder"/>
20+
<waitForPageLoad stepKey="waitForPageBuilderToOpen"/>
21+
<waitForElementVisible selector="{{pageBuilderArea}}{{PageBuilderPanel.layoutGroup}}" stepKey="waiForPageBuilderVisible"/>
2122
</actionGroup>
22-
</actionGroups>
23+
<actionGroup name="expandAdminProductSection">
24+
<!-- This goes in CE repo -->
25+
<arguments>
26+
<argument name="sectionSelector" defaultValue="{{AdminProductContentSection.sectionHeader}}" type="string"/>
27+
<argument name="sectionDependentSelector" defaultValue="{{AdminProductContentSection.sectionHeader}}._show" type="string"/>
28+
</arguments>
29+
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
30+
<waitForElementVisible time="30" selector="{{sectionSelector}}" stepKey="waitForSection"/>
31+
<conditionalClick selector="{{sectionSelector}}" dependentSelector="{{sectionDependentSelector}}" visible="false" stepKey="expandSection"/>
32+
<waitForPageLoad time="30" stepKey="waitForSectionToExpand"/>
33+
</actionGroup>
34+
<actionGroup name="navigateToCreatedProductEditPage">
35+
<!-- This goes in CE repo -->
36+
<arguments>
37+
<argument name="product" defaultValue="_defaultProduct"/>
38+
</arguments>
39+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToAdminProductIndexPage"/>
40+
<waitForPageLoad stepKey="waitForProductIndexPageToLoad"/>
41+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
42+
<waitForPageLoad stepKey="waitForClearFilters"/>
43+
<dontSeeElement selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="dontSeeClearFilters"/>
44+
<click selector="{{AdminProductGridFilterSection.viewDropdown}}" stepKey="openViewBookmarksTab"/>
45+
<click selector="{{AdminProductGridFilterSection.viewBookmark('Default View')}}" stepKey="resetToDefaultGridView"/>
46+
<waitForPageLoad stepKey="waitForResetToDefaultView"/>
47+
<see selector="{{AdminProductGridFilterSection.viewDropdown}}" userInput="Default View" stepKey="seeDefaultViewSelected"/>
48+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/>
49+
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/>
50+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
51+
<waitForPageLoad stepKey="waitForFilterOnGrid"/>
52+
<click selector="{{AdminProductGridSection.selectRowBasedOnName(product.name)}}" stepKey="clickProduct"/>
53+
<waitForPageLoad stepKey="waitForProductEditPageLoad"/>
54+
<waitForElementVisible selector="{{AdminProductFormBundleSection.productSku}}" stepKey="waitForProductSKUField"/>
55+
<seeInField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{product.sku}}" stepKey="seeProductSKU"/>
56+
</actionGroup>
57+
<actionGroup name="NavigateToAndResetProductGridToDefaultView" extends="resetProductGridToDefaultView">
58+
<!-- This goes in CE repo -->
59+
<amOnPage url="{{AdminProductIndexPage.url}}" before="clickClearFilters" stepKey="goToAdminProductIndexPage"/>
60+
<waitForPageLoad after="goToAdminProductIndexPage" stepKey="waitForProductIndexPageToLoad"/>
61+
</actionGroup>
62+
<actionGroup name="saveProductAttribute">
63+
<!-- This goes in CE repo -->
64+
<waitForElementVisible selector="{{AttributePropertiesSection.Save}}" stepKey="waitForSaveButton"/>
65+
<click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSaveButton"/>
66+
<waitForPageLoad stepKey="waitForAttributeToSave"/>
67+
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/>
68+
</actionGroup>
69+
<actionGroup name="confirmChangeInputTypeModal">
70+
<!-- This goes in CE repo -->
71+
<waitForElementVisible selector="{{AdminEditProductAttributesSection.ProductDataMayBeLostConfirmButton}}" stepKey="waitForChangeInputTypeButton"/>
72+
<click selector="{{AdminEditProductAttributesSection.ProductDataMayBeLostConfirmButton}}" stepKey="clickChangeInputTypeButton"/>
73+
<waitForElementNotVisible selector="{{AdminEditProductAttributesSection.ProductDataMayBeLostModal}}" stepKey="waitForChangeInputTypeModalGone"/>
74+
</actionGroup>
75+
<actionGroup name="saveProductAttributeInUse">
76+
<!-- This goes in CE repo -->
77+
<waitForElementVisible selector="{{AttributePropertiesSection.Save}}" stepKey="waitForSaveButton"/>
78+
<click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSaveButton"/>
79+
<waitForPageLoad stepKey="waitForAttributeToSave"/>
80+
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/>
81+
</actionGroup>
82+
<actionGroup name="NavigateToAndResetProductAttributeGridToDefaultView">
83+
<!-- This goes in CE repo -->
84+
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/>
85+
<waitForPageLoad stepKey="waitForPageLoad"/>
86+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
87+
<waitForPageLoad stepKey="waitForGridLoad"/>
88+
</actionGroup>
89+
</actionGroups>

0 commit comments

Comments
 (0)