Skip to content

Commit 47d887e

Browse files
authored
Merge pull request #4570 from magento-pangolin/2.3-tests-pr
MFTF team Test Automation from 2.3-test-pr to 2.3-develop branch
2 parents 9fa9149 + 1b13a14 commit 47d887e

File tree

60 files changed

+2653
-6
lines changed

Some content is hidden

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

60 files changed

+2653
-6
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminSystemMessagesSection">
12+
<element name="systemMessagesDropdown" type="button" selector="#system_messages .message-system-action-dropdown"/>
13+
<element name="actionMessageLog" type="button" selector="//*[contains(@class, 'message-system-summary')]/a[contains(text(), '{{textMessage}}')]" parameterized="true"/>
14+
</section>
15+
</sections>

app/code/Magento/Backend/Test/Mftf/Section/AdminSecondaryGridSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<element name="catalogRuleIdentifierSearch" type="input" selector=".col-name .admin__control-text"/>
1515
<element name="searchButton" type="input" selector=".admin__filter-actions [title='Search']"/>
1616
<element name="firstRow" type="block" selector="tr[data-role='row']"/>
17+
<element name="rowByName" type="block" selector="//td[contains(text(), '{{searchingName}}')]" parameterized="true" timeout="30"/>
1718
</section>
1819
</sections>
1920

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminCreateAndEditBundleProductSettingsTest">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Create/Edit bundle product in Admin"/>
15+
<title value="Admin should be able to set/edit other product information when creating/editing a bundle product"/>
16+
<description value="Admin should be able to set/edit other product information when creating/editing a bundle product"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-224"/>
19+
<group value="Catalog"/>
20+
</annotations>
21+
<before>
22+
<!-- Create a Website -->
23+
<createData entity="customWebsite" stepKey="createWebsite"/>
24+
25+
<!-- Create a simple product for a bundle option -->
26+
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/>
27+
28+
<!-- Login as admin -->
29+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
30+
</before>
31+
<after>
32+
<!-- Delete the simple product -->
33+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
34+
35+
<!-- Log out -->
36+
<actionGroup ref="logout" stepKey="logout"/>
37+
</after>
38+
39+
<!-- Create new bundle product -->
40+
<actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createBundleProduct">
41+
<argument name="productType" value="bundle"/>
42+
</actionGroup>
43+
44+
<!-- Fill all main fields -->
45+
<actionGroup ref="fillMainBundleProductForm" stepKey="fillMainProductFields"/>
46+
47+
<!-- Add the bundle option to the product -->
48+
<actionGroup ref="addBundleOptionWithOneProduct" stepKey="addBundleOption">
49+
<argument name="x" value="0"/>
50+
<argument name="n" value="1"/>
51+
<argument name="prodOneSku" value="$$createSimpleProduct.sku$$"/>
52+
<argument name="prodTwoSku" value=""/>
53+
<argument name="optionTitle" value="{{RadioButtonsOption.title}}"/>
54+
<argument name="inputType" value="{{RadioButtonsOption.type}}"/>
55+
</actionGroup>
56+
57+
<!-- Set product in created Website -->
58+
<actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="selectProductInWebsites">
59+
<argument name="website" value="$createWebsite.website[name]$"/>
60+
</actionGroup>
61+
62+
<!-- Set Design settings for the product -->
63+
<actionGroup ref="AdminSetProductDesignSettingsActionGroup" stepKey="setProductDesignSettings">
64+
<argument name="designSettings" value="simpleLumaDesignThreeColumns"/>
65+
</actionGroup>
66+
67+
<!-- Set Gift Options settings for the product -->
68+
<actionGroup ref="AdminSwitchProductGiftMessageStatusActionGroup" stepKey="enableGiftMessageSettings">
69+
<argument name="status" value="1"/>
70+
</actionGroup>
71+
72+
<!-- Save product form -->
73+
<actionGroup ref="saveProductForm" stepKey="clickSaveButton"/>
74+
75+
<!-- Open product page -->
76+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage">
77+
<argument name="productUrl" value="{{BundleProduct.name}}"/>
78+
</actionGroup>
79+
80+
<!-- Assert product Design settings "layout 3 columns" -->
81+
<seeElement selector="{{StorefrontProductPageDesignSection.layoutThreeColumns}}" stepKey="seeDesignChanges"/>
82+
83+
<!-- Assert Gift Option product settings is present -->
84+
<actionGroup ref="StorefrontAddBundleProductFromProductToCartActionGroup" stepKey="addProductToCart">
85+
<argument name="productName" value="{{BundleProduct.name}}"/>
86+
</actionGroup>
87+
<actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openShoppingCart"/>
88+
<actionGroup ref="StorefrontAssertGiftMessageFieldsActionGroup" stepKey="assertGiftMessageFieldsArePresent"/>
89+
90+
<!-- Open created product -->
91+
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct">
92+
<argument name="product" value="BundleProduct"/>
93+
</actionGroup>
94+
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct">
95+
<argument name="product" value="BundleProduct"/>
96+
</actionGroup>
97+
98+
<!-- Assert product in assigned to Website -->
99+
<actionGroup ref="AssertProductIsAssignedToWebsite" stepKey="seeCustomWebsiteIsChecked">
100+
<argument name="website" value="$createWebsite.website[name]$"/>
101+
</actionGroup>
102+
103+
<!-- Edit product in Websites -->
104+
<actionGroup ref="AdminUnassignProductInWebsiteActionGroup" stepKey="uncheckProductInWebsites">
105+
<argument name="website" value="$createWebsite.website[name]$"/>
106+
</actionGroup>
107+
108+
<!-- Edit product Search Engine Optimization settings -->
109+
<actionGroup ref="AdminChangeProductSEOSettingsActionGroup" stepKey="editProductSEOSettings">
110+
<argument name="productName" value="ApiBundleProduct.name"/>
111+
</actionGroup>
112+
113+
<!-- Edit Design settings for the product -->
114+
<actionGroup ref="AdminSetProductDesignSettingsActionGroup" stepKey="editProductDesignSettings"/>
115+
116+
<!-- Edit Gift Option product settings -->
117+
<actionGroup ref="AdminSwitchProductGiftMessageStatusActionGroup" stepKey="disableGiftMessageSettings"/>
118+
119+
<!-- Save product form -->
120+
<actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/>
121+
122+
<!-- Verify Url Key after changing -->
123+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage">
124+
<argument name="productUrl" value="{{ApiBundleProduct.name}}"/>
125+
</actionGroup>
126+
127+
<!-- Assert product design settings "Layout empty" -->
128+
<seeElement selector="{{StorefrontProductPageDesignSection.layoutTwoColumnsLeft}}" stepKey="seeNewDesignChanges"/>
129+
130+
<!-- Assert Gift Option product settings -->
131+
<actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/>
132+
<dontSeeElement selector="{{StorefrontProductCartGiftOptionSection.giftOptions}}" stepKey="dontSeeGiftOptionBtn"/>
133+
134+
<!-- Delete created bundle product -->
135+
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct">
136+
<argument name="product" value="BundleProduct"/>
137+
</actionGroup>
138+
139+
<!-- Delete created Website -->
140+
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite">
141+
<argument name="websiteName" value="$createWebsite.website[name]$"/>
142+
</actionGroup>
143+
</test>
144+
</tests>
145+
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="AdminAssignProductInWebsiteActionGroup">
12+
<arguments>
13+
<argument name="website" type="string"/>
14+
</arguments>
15+
<scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToWebsitesSection"/>
16+
<click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="expandSection"/>
17+
<waitForPageLoad stepKey="waitForPageOpened"/>
18+
<checkOption selector="{{ProductInWebsitesSection.website(website)}}" stepKey="selectWebsite"/>
19+
</actionGroup>
20+
</actionGroups>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="AdminSetProductDesignSettingsActionGroup">
1212
<arguments>
13-
<argument name="designSettings" defaultValue="simpleBlankDesign"/>
13+
<argument name="designSettings" defaultValue="simpleBlankDesignTwoColumnsLeft"/>
1414
</arguments>
1515
<click selector="{{ProductDesignSection.DesignTab}}" stepKey="clickDesignTab"/>
1616
<waitForPageLoad stepKey="waitForTabOpen"/>
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="AdminUnassignProductInWebsiteActionGroup">
12+
<arguments>
13+
<argument name="website" type="string"/>
14+
</arguments>
15+
<scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToWebsitesSection"/>
16+
<click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="expandSection"/>
17+
<waitForPageLoad stepKey="waitForPageOpened"/>
18+
<uncheckOption selector="{{ProductInWebsitesSection.website(website)}}" stepKey="uncheckWebsite"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="StorefrontAddProductReviewActionGroup">
11+
<arguments>
12+
<argument name="review" type="entity" defaultValue="simpleProductReview"/>
13+
</arguments>
14+
<click selector="{{StorefrontProductReviewsSection.reviewsTab}}" stepKey="openReviewTab"/>
15+
<fillField selector="{{StorefrontProductReviewsSection.nicknameField}}" userInput="{{review.nickname}}" stepKey="fillNicknameField"/>
16+
<fillField selector="{{StorefrontProductReviewsSection.summaryField}}" userInput="{{review.title}}" stepKey="fillSummaryField"/>
17+
<fillField selector="{{StorefrontProductReviewsSection.reviewField}}" userInput="{{review.detail}}" stepKey="fillReviewField"/>
18+
<click selector="{{StorefrontProductReviewsSection.submitReview}}" stepKey="clickSubmitReview"/>
19+
<waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" stepKey="waitForSuccessMessage"/>
20+
<see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You submitted your review for moderation." stepKey="seeSuccessMessage"/>
21+
</actionGroup>
22+
</actionGroups>

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,27 @@
343343
<data key="used_for_sort_by">true</data>
344344
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
345345
</entity>
346+
<entity name="productAttributeDropdownTwoOptions" type="ProductAttribute">
347+
<data key="attribute_code" unique="suffix">testattribute</data>
348+
<data key="frontend_input">select</data>
349+
<data key="scope">Global</data>
350+
<data key="is_required">false</data>
351+
<data key="is_unique">false</data>
352+
<data key="is_searchable">true</data>
353+
<data key="is_visible">true</data>
354+
<data key="is_visible_in_advanced_search">true</data>
355+
<data key="is_visible_on_front">true</data>
356+
<data key="is_filterable">true</data>
357+
<data key="is_filterable_in_search">true</data>
358+
<data key="used_in_product_listing">true</data>
359+
<data key="is_used_for_promo_rules">true</data>
360+
<data key="is_comparable">true</data>
361+
<data key="is_used_in_grid">true</data>
362+
<data key="is_visible_in_grid">true</data>
363+
<data key="is_filterable_in_grid">true</data>
364+
<data key="used_for_sort_by">true</data>
365+
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
366+
</entity>
346367
<entity name="VisualSwatchProductAttribute" type="ProductAttribute">
347368
<data key="frontend_input">swatch_visual</data>
348369
<data key="attribute_code" unique="suffix">visual_swatch</data>

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

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,29 @@
88

99
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11-
<entity name="simpleBlankDesign" type="product">
11+
<entity name="simpleBlankDesignTwoColumnsLeft" type="product">
1212
<data key="custom_design">Magento Blank</data>
1313
<data key="page_layout">2 columns with left bar</data>
1414
<data key="options_container">Product Info Column</data>
1515
</entity>
16-
<entity name="simpleLumaDesign" type="product">
16+
<entity name="simpleLumaDesignEmpty" type="product">
1717
<data key="custom_design">Magento Luma</data>
1818
<data key="page_layout">Empty</data>
1919
<data key="options_container">Block after Info Column</data>
2020
</entity>
21+
<entity name="simpleLumaDesignThreeColumns" type="product">
22+
<data key="custom_design">Magento Luma</data>
23+
<data key="page_layout">3 columns</data>
24+
<data key="options_container">Block after Info Column</data>
25+
</entity>
26+
<entity name="simpleBlankDesignOneColumn" type="product">
27+
<data key="custom_design">Magento Blank</data>
28+
<data key="page_layout">1 column</data>
29+
<data key="options_container">Product Info Column</data>
30+
</entity>
31+
<entity name="simpleLumaDesignTwoColumnsRight" type="product">
32+
<data key="custom_design">Magento Luma</data>
33+
<data key="page_layout">2 columns with right bar</data>
34+
<data key="options_container">Block after Info Column</data>
35+
</entity>
2136
</entities>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<element name="checkIfTabOpen" selector="//div[@id='advanced_fieldset-wrapper' and not(contains(@class,'opened'))]" type="button"/>
2525
<element name="useInLayeredNavigation" type="select" selector="#is_filterable"/>
2626
<element name="addSwatch" type="button" selector="#add_new_swatch_text_option_button"/>
27-
<element name="dropdownAddOptions" type="button" selector="#add_new_option_button"/>
27+
<element name="dropdownAddOptions" type="button" selector="#add_new_option_button" timeout="30"/>
2828
<!-- Manage Options nth child-->
2929
<element name="dropdownNthOptionIsDefault" type="checkbox" selector="tbody[data-role='options-container'] tr:nth-child({{var}}) .input-radio" parameterized="true"/>
3030
<element name="dropdownNthOptionAdmin" type="textarea" selector="tbody[data-role='options-container'] tr:nth-child({{var}}) td:nth-child(3) input" parameterized="true"/>

0 commit comments

Comments
 (0)