Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 4421098

Browse files
author
Alexander Akimov
authored
Merge pull request #3371 from magento-tsg/2.2-develop-mftf-pr9
[TSG] MFTF for 2.2 (pr9) (2.2.8)
2 parents 1e4a9cb + dba0305 commit 4421098

File tree

46 files changed

+968
-30
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

+968
-30
lines changed
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
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="AdminCreateApiDynamicBundleProductActionGroup">
12+
<arguments>
13+
<argument name="productName" defaultValue="Api Dynamic Bundle Product" type="string"/>
14+
</arguments>
15+
<!--Create 4 simple products-->
16+
<createData entity="SimpleProduct3" stepKey="simpleProduct1">
17+
<field key="price">4.99</field>
18+
</createData>
19+
<createData entity="SimpleProduct3" stepKey="simpleProduct2">
20+
<field key="price">2.89</field>
21+
</createData>
22+
<createData entity="SimpleProduct3" stepKey="simpleProduct3">
23+
<field key="price">7.33</field>
24+
</createData>
25+
<createData entity="SimpleProduct3" stepKey="simpleProduct4">
26+
<field key="price">18.25</field>
27+
</createData>
28+
<!-- Create the bundle product based -->
29+
<createData entity="ApiBundleProduct" stepKey="createBundleProduct">
30+
<field key="name">{{productName}}</field>
31+
</createData>
32+
<createData entity="MultipleSelectOption" stepKey="createBundleOption1_1">
33+
<requiredEntity createDataKey="createBundleProduct"/>
34+
<field key="required">false</field>
35+
</createData>
36+
<createData entity="CheckboxOption" stepKey="createBundleOption1_2">
37+
<requiredEntity createDataKey="createBundleProduct"/>
38+
</createData>
39+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct">
40+
<requiredEntity createDataKey="createBundleProduct"/>
41+
<requiredEntity createDataKey="createBundleOption1_1"/>
42+
<requiredEntity createDataKey="simpleProduct1"/>
43+
</createData>
44+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct2">
45+
<requiredEntity createDataKey="createBundleProduct"/>
46+
<requiredEntity createDataKey="createBundleOption1_1"/>
47+
<requiredEntity createDataKey="simpleProduct2"/>
48+
</createData>
49+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct3">
50+
<requiredEntity createDataKey="createBundleProduct"/>
51+
<requiredEntity createDataKey="createBundleOption1_2"/>
52+
<requiredEntity createDataKey="simpleProduct3"/>
53+
</createData>
54+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct4">
55+
<requiredEntity createDataKey="createBundleProduct"/>
56+
<requiredEntity createDataKey="createBundleOption1_2"/>
57+
<requiredEntity createDataKey="simpleProduct4"/>
58+
</createData>
59+
</actionGroup>
60+
<actionGroup name="AdminCreateApiFixedBundleProductActionGroup">
61+
<arguments>
62+
<argument name="productName" defaultValue="Api Fixed Bundle Product" type="string"/>
63+
</arguments>
64+
<!--Create 4 simple products-->
65+
<createData entity="SimpleProduct3" stepKey="simpleProduct1">
66+
<field key="price">4.99</field>
67+
</createData>
68+
<createData entity="SimpleProduct3" stepKey="simpleProduct2">
69+
<field key="price">2.89</field>
70+
</createData>
71+
<createData entity="SimpleProduct3" stepKey="simpleProduct3">
72+
<field key="price">7.33</field>
73+
</createData>
74+
<createData entity="SimpleProduct3" stepKey="simpleProduct4">
75+
<field key="price">18.25</field>
76+
</createData>
77+
<!-- Create the bundle product based -->
78+
<createData entity="ApiFixedBundleProduct" stepKey="createBundleProduct">
79+
<field key="name">{{productName}}</field>
80+
</createData>
81+
<createData entity="MultipleSelectOption" stepKey="createBundleOption1_1">
82+
<requiredEntity createDataKey="createBundleProduct"/>
83+
<field key="required">false</field>
84+
</createData>
85+
<createData entity="CheckboxOption" stepKey="createBundleOption1_2">
86+
<requiredEntity createDataKey="createBundleProduct"/>
87+
</createData>
88+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct">
89+
<requiredEntity createDataKey="createBundleProduct"/>
90+
<requiredEntity createDataKey="createBundleOption1_1"/>
91+
<requiredEntity createDataKey="simpleProduct1"/>
92+
</createData>
93+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct2">
94+
<requiredEntity createDataKey="createBundleProduct"/>
95+
<requiredEntity createDataKey="createBundleOption1_1"/>
96+
<requiredEntity createDataKey="simpleProduct2"/>
97+
</createData>
98+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct3">
99+
<requiredEntity createDataKey="createBundleProduct"/>
100+
<requiredEntity createDataKey="createBundleOption1_2"/>
101+
<requiredEntity createDataKey="simpleProduct3"/>
102+
</createData>
103+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct4">
104+
<requiredEntity createDataKey="createBundleProduct"/>
105+
<requiredEntity createDataKey="createBundleOption1_2"/>
106+
<requiredEntity createDataKey="simpleProduct4"/>
107+
</createData>
108+
</actionGroup>
109+
</actionGroups>

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
1111
<entity name="ApiBundleProduct" type="product2">
1212
<data key="name" unique="suffix">Api Bundle Product</data>
1313
<data key="sku" unique="suffix">api-bundle-product</data>
@@ -37,4 +37,19 @@
3737
<requiredEntity type="custom_attribute">CustomAttributeDynamicPrice</requiredEntity>
3838
<requiredEntity type="custom_attribute">CustomAttributePriceViewRange</requiredEntity>
3939
</entity>
40+
<entity name="ApiFixedBundleProduct" type="product2">
41+
<data key="name" unique="suffix">Api Fixed Bundle Product</data>
42+
<data key="sku" unique="suffix">api-fixed-bundle-product</data>
43+
<data key="type_id">bundle</data>
44+
<data key="attribute_set_id">4</data>
45+
<data key="price">1.23</data>
46+
<data key="visibility">4</data>
47+
<data key="status">1</data>
48+
<data key="urlKey" unique="suffix">api-fixed-bundle-product</data>
49+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
50+
<requiredEntity type="custom_attribute">ApiProductDescription</requiredEntity>
51+
<requiredEntity type="custom_attribute">ApiProductShortDescription</requiredEntity>
52+
<requiredEntity type="custom_attribute">CustomAttributeFixPrice</requiredEntity>
53+
<requiredEntity type="custom_attribute">CustomAttributePriceView</requiredEntity>
54+
</entity>
4055
</entities>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="navigateToEditProductAttribute">
11+
<arguments>
12+
<argument name="attributeLabel" type="string"/>
13+
</arguments>
14+
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/>
15+
<fillField selector="{{AdminProductAttributeGridSection.gridFilterFrontEndLabel}}" userInput="{{attributeLabel}}" stepKey="navigateToAttributeEditPage1" />
16+
<click selector="{{AdminProductAttributeGridSection.search}}" stepKey="navigateToAttributeEditPage2" />
17+
<click selector="{{AdminProductAttributeGridSection.firstRow}}" stepKey="navigateToAttributeEditPage3" />
18+
</actionGroup>
19+
<actionGroup name="changeUseForPromoRuleConditionsProductAttribute">
20+
<arguments>
21+
<argument name="useForPromoRule" type="string" defaultValue="Yes"/>
22+
</arguments>
23+
<click selector="{{StorefrontPropertiesSection.storefrontPropertiesTab}}" stepKey="clickStoreFrontPropertiesTab"/>
24+
<selectOption selector="{{StorefrontPropertiesSection.useForPromoRuleConditions}}" userInput="{{useForPromoRule}}" stepKey="changeOption"/>
25+
<click selector="{{AttributePropertiesSection.save}}" stepKey="saveAttribute"/>
26+
<see selector="{{AdminMessagesSection.successMessage}}" userInput="You saved the product attribute." stepKey="successMessage"/>
27+
</actionGroup>
28+
</actionGroups>

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<!-- Check the category page -->
1212
<actionGroup name="StorefrontCheckCategoryActionGroup">
1313
<arguments>
@@ -35,4 +35,16 @@
3535
<click selector="{{StorefrontCategoryMainSection.modeListButton}}" stepKey="switchCategoryViewToListMode"/>
3636
<seeElement selector="{{StorefrontCategoryMainSection.categoryTitle}}" stepKey="assertCategoryTitle"/>
3737
</actionGroup>
38+
39+
<!-- Go to storefront category product page by given parameters -->
40+
<actionGroup name="GoToStorefrontCategoryPageByParameters">
41+
<arguments>
42+
<argument name="category" type="string"/>
43+
<argument name="mode" type="string"/>
44+
<argument name="sortBy" type="string" defaultValue="position"/>
45+
<argument name="sort" type="string" defaultValue="asc"/>
46+
</arguments>
47+
<!-- Go to storefront category page -->
48+
<amOnPage url="{{StorefrontCategoryPage.url(category)}}?product_list_mode={{mode}}&amp;product_list_order={{sortBy}}&amp;product_list_dir={{sort}}" stepKey="onCategoryPage"/>
49+
</actionGroup>
3850
</actionGroups>

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@
77
-->
88

99
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
1111
<entity name="ProductAttributeFrontendLabel" type="FrontendLabel">
1212
<data key="store_id">0</data>
1313
<data key="label" unique="suffix">attribute</data>
1414
</entity>
15+
<entity name="ProductAttributeFrontendLabelThree" type="FrontendLabel">
16+
<data key="store_id">0</data>
17+
<data key="label" unique="suffix">attributeThree</data>
18+
</entity>
1519
</entities>

app/code/Magento/Catalog/Test/Mftf/Metadata/product-meta.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
1111
<operation name="CreateProduct" dataType="product" type="create" auth="adminOauth" url="/V1/products" method="POST">
1212
<contentType>application/json</contentType>
1313
<object dataType="product" key="product">

app/code/Magento/Catalog/Test/Mftf/Metadata/product_link-meta.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@
77
-->
88

99
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
1111
<operation name="CreateProductLink" dataType="product_link" type="create">
1212
<field key="sku">string</field>
1313
<field key="link_type">string</field>
1414
<field key="linked_product_sku">string</field>
1515
<field key="linked_product_type">string</field>
1616
<field key="position">integer</field>
17-
<array key="extension_attributes">
18-
<value>product_link_extension_attribute</value>
19-
</array>
17+
<object key="extension_attributes" dataType="product_link_extension_attribute">
18+
<field key="qty">integer</field>
19+
</object>
2020
</operation>
2121
<operation name="UpdateProductLink" dataType="product_link" type="update">
2222
<field key="sku">string</field>
2323
<field key="link_type">string</field>
2424
<field key="linked_product_sku">string</field>
2525
<field key="linked_product_type">string</field>
2626
<field key="position">integer</field>
27-
<array key="extension_attributes">
28-
<value>product_link_extension_attribute</value>
29-
</array>
27+
<object key="extension_attributes" dataType="product_link_extension_attribute">
28+
<field key="qty">integer</field>
29+
</object>
3030
</operation>
3131
</operations>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
11+
<operation name="CreateProductLinks" dataType="product_links" type="create" auth="adminOauth" url="/V1/products/{sku}/links" method="POST">
12+
<contentType>application/json</contentType>
13+
<array key="items">
14+
<value>product_link</value>
15+
</array>
16+
</operation>
17+
</operations>

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@
77
-->
88

99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AttributePropertiesSection">
1212
<element name="AdvancedProperties" type="button" selector="#advanced_fieldset-wrapper"/>
1313
<element name="Save" type="button" selector="#save"/>
1414
</section>
15+
<section name="StorefrontPropertiesSection">
16+
<element name="storefrontPropertiesTab" selector="#product_attribute_tabs_front" type="button" timeout="30"/>
17+
<element name="useForPromoRuleConditions" type="select" selector="#is_used_for_promo_rules"/>
18+
</section>
1519
</sections>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<element name="gridFilterFrontEndLabel" type="input" selector="#attributeGrid_filter_frontend_label"/>
1515
<element name="search" type="button" selector="button[data-action=grid-filter-apply]" timeout="30"/>
1616
<element name="resetFilter" type="button" selector="button[data-action='grid-filter-reset']" timeout="30"/>
17-
<element name="firstRow" type="button" selector="//*[@id='attributeGrid_table']/tbody/tr[1]"/>
17+
<element name="firstRow" type="button" selector="//*[@id='attributeGrid_table']/tbody/tr[1]" timeout="30"/>
1818
<element name="attributeCodeFilterInput" type="input" selector=".admin__data-grid-filters input[name='attribute_code']"/>
1919
<element name="filterByAttributeCode" type="input" selector="#attributeGrid_filter_attribute_code"/>
2020
</section>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<element name="valueRequired" type="select" selector="#is_required"/>
1515
<element name="advancedProperties" type="button" selector="#advanced_fieldset-wrapper"/>
1616
<element name="defaultValue" type="input" selector="#default_value_text"/>
17-
<element name="save" type="button" selector="#save"/>
17+
<element name="save" type="button" selector="#save" timeout="30"/>
1818
<element name="saveAndEdit" type="button" selector="#save_and_edit_button"/>
1919
<element name="checkIfTabOpen" selector="//div[@id='advanced_fieldset-wrapper' and not(contains(@class,'opened'))]" type="button"/>
2020
</section>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontCategoryMainSection">
1212
<element name="modeListButton" type="button" selector="#mode-list" timeout="10"/>
1313
<element name="categoryTitle" type="text" selector="#page-title-heading span"/>
@@ -21,5 +21,6 @@
2121
<element name="productsList" type="text" selector="//ol[@class='products list items product-items']"/>
2222
<element name="categoryPageProductImagePlaceholderSmall" type="text" selector=".products-grid img[src*='placeholder/small_image.jpg']"/>
2323
<element name="categoryPageProductImage" type="text" selector=".products-grid img[src*='/{{var1}}']" parameterized="true"/>
24+
<element name="categoryPageProductName" type="text" selector=".products.list.items.product-items li:nth-of-type({{line}}) .product-item-link" timeout="30" parameterized="true"/>
2425
</section>
2526
</sections>

app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CatalogPriceRuleActionGroup.xml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<!-- action group to create a new catalog price rule giving a catalogRule entity -->
1212
<actionGroup name="CreateCatalogPriceRule">
1313
<arguments>
@@ -56,4 +56,16 @@
5656
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear2"/>
5757
<see userInput="You deleted the rule." stepKey="verifyRuleIsDeleted"/>
5858
</actionGroup>
59+
<!--Add Catalog Rule Condition With product SKU-->
60+
<actionGroup name="newCatalogPriceRuleByUIWithConditionIsSKU" extends="CreateCatalogPriceRule">
61+
<arguments>
62+
<argument name="productSku" type="string"/>
63+
</arguments>
64+
<click selector="{{AdminCatalogPriceRuleSection.conditionsTab}}" after="discardSubsequentRules" stepKey="openConditionsTab"/>
65+
<click selector="{{AdminCatalogPriceRuleConditionsSection.newCondition}}" after="openConditionsTab" stepKey="addNewCondition"/>
66+
<selectOption selector="{{AdminCatalogPriceRuleConditionsSection.conditionSelect('1')}}" userInput="Magento\CatalogRule\Model\Rule\Condition\Product|sku" after="addNewCondition" stepKey="selectTypeCondition"/>
67+
<click selector="{{AdminCatalogPriceRuleConditionsSection.targetEllipsis('1')}}" after="selectTypeCondition" stepKey="clickEllipsis"/>
68+
<fillField selector="{{AdminCatalogPriceRuleConditionsSection.targetInput('1', '1')}}" userInput="{{productSku}}" after="clickEllipsis" stepKey="fillProductSku"/>
69+
<click selector="{{AdminCatalogPriceRuleConditionsSection.applyButton('1', '1')}}" after="fillProductSku" stepKey="clickApply"/>
70+
</actionGroup>
5971
</actionGroups>

0 commit comments

Comments
 (0)