Skip to content

Commit 4e63cc4

Browse files
author
Alexander Akimov
authored
Merge pull request #2890 from magento-tsg/2.2-develop-mftf-pr4
[TSG] MFTF for 2.2 (pr4) (2.2.6)
2 parents 7ebf409 + 110bafd commit 4e63cc4

26 files changed

+780
-33
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
<entity name="CustomAttributeProductAttribute" type="custom_attribute">
2424
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
2525
<var key="value" entityKey="value" entityType="ProductAttributeOption"/>
26-
<data key="value">test product attribute</data>
27-
<data key="attribute_code">test_product_attribute</data>
2826
</entity>
2927
<entity name="ApiProductDescription" type="custom_attribute">
3028
<data key="attribute_code">description</data>

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,17 @@
8686
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
8787
<requiredEntity type="custom_attributes">CustomAttributeProductAttribute</requiredEntity>
8888
</entity>
89+
<entity name="SimpleOption" type="product2">
90+
<data key="sku" unique="suffix">SimpleOne</data>
91+
<data key="type_id">simple</data>
92+
<data key="attribute_set_id">4</data>
93+
<data key="name" unique="suffix">SimpleProductOption</data>
94+
<data key="price">10.00</data>
95+
<data key="visibility">4</data>
96+
<data key="status">1</data>
97+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
98+
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
99+
</entity>
89100
<entity name="ProductImage" type="uploadImage">
90101
<data key="title" unique="suffix">Image1</data>
91102
<data key="price">1.00</data>

app/code/Magento/Catalog/Test/Mftf/Page/StorefrontProductPage.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
<section name="StorefrontProductPageSection"/>
1313
<section name="StorefrontProductAdditionalInformationSection"/>
1414
<section name="StorefrontProductMediaSection"/>
15+
<section name="StorefrontProductInfoMainSection"/>
1516
</page>
1617
</pages>

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartSummarySection.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="CheckoutCartSummarySection">
12+
<element name="subtotal" type="text" selector="#cart-totals tr.totals.sub span.price"/>
1213
<element name="proceedToCheckout" type="button" selector=".action.primary.checkout span" timeout="30"/>
13-
<element name="subtotal" type="text" selector="span.price[data-th='Subtotal']"/>
1414
<element name="total" type="text" selector=".amount[data-th='Order Total'] span"/>
15+
<element name="country" type="select" selector="#block-summary select[name='country_id']" timeout="30"/>
16+
<element name="region" type="select" selector="#block-summary select[name='region_id']" timeout="30"/>
17+
<element name="postcode" type="text" selector="#block-summary input[name='postcode']" timeout="30"/>
18+
<element name="estimateShippingAndTax" type="text" selector="#block-shipping-heading" timeout="5"/>
19+
<element name="flatRateShippingMethod" type="radio" selector="#s_method_flatrate_flatrate" timeout="30"/>
1520
</section>
1621
</sections>

app/code/Magento/ConfigurableProduct/Test/Mftf/Data/ConfigurableProductData.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,16 @@
2525
<var key="sku" entityKey="sku" entityType="product" />
2626
<var key="childSku" entityKey="sku" entityType="product2"/>
2727
</entity>
28+
<entity name="ApiConfigurableProduct" type="product">
29+
<data key="sku" unique="suffix">api-configurable-product</data>
30+
<data key="type_id">configurable</data>
31+
<data key="attribute_set_id">4</data>
32+
<data key="visibility">4</data>
33+
<data key="name" unique="suffix">API Configurable Product</data>
34+
<data key="urlKey" unique="suffix">api-configurable-product</data>
35+
<data key="status">1</data>
36+
<data key="quantity">100</data>
37+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
38+
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
39+
</entity>
2840
</entities>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="StorefrontProductInfoMainSection">
12+
<element name="productAttributeTitle" type="text" selector="#product-options-wrapper div[tabindex='0'] label"/>
13+
<element name="productAttributeOptions" type="select" selector="#product-options-wrapper div[tabindex='0'] option"/>
14+
<element name="stockIndication" type="block" selector=".stock" />
15+
</section>
16+
</sections>
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="AdminConfigurableProductOutOfStockTest">
12+
<annotations>
13+
<features value="ConfigurableProduct"/>
14+
<stories value="Product visibility when in stock/out of stock"/>
15+
<title value="Configurable Product goes 'Out of Stock' if all associated Simple Products are 'Out of Stock'"/>
16+
<description value="Configurable Product goes 'Out of Stock' if all associated Simple Products are 'Out of Stock'"/>
17+
<testCaseId value="MAGETWO-79939"/>
18+
<group value="configurableProduct"/>
19+
</annotations>
20+
<before>
21+
<!-- TODO: This should be converted to an actionGroup once MQE-993 is fixed. -->
22+
<!-- Create the category to put the product in -->
23+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
24+
25+
<!-- Create the configurable product based on the data in the /data folder -->
26+
<createData entity="BaseConfigurableProduct" stepKey="createConfigProduct">
27+
<requiredEntity createDataKey="createCategory"/>
28+
</createData>
29+
30+
<!-- Make the configurable product have two options, that are children of the default attribute set -->
31+
<createData entity="productAttributeWithDropdownTwoOptions" stepKey="createConfigProductAttribute"/>
32+
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1">
33+
<requiredEntity createDataKey="createConfigProductAttribute"/>
34+
</createData>
35+
<createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2">
36+
<requiredEntity createDataKey="createConfigProductAttribute"/>
37+
</createData>
38+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
39+
<requiredEntity createDataKey="createConfigProductAttribute"/>
40+
</createData>
41+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1">
42+
<requiredEntity createDataKey="createConfigProductAttribute"/>
43+
</getData>
44+
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2">
45+
<requiredEntity createDataKey="createConfigProductAttribute"/>
46+
</getData>
47+
48+
<!-- Create the 2 children that will be a part of the configurable product -->
49+
<createData entity="SimpleOption" stepKey="createConfigChildProduct1">
50+
<requiredEntity createDataKey="createConfigProductAttribute"/>
51+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
52+
</createData>
53+
<createData entity="SimpleOption" stepKey="createConfigChildProduct2">
54+
<field key="sku">SimpleTwoOption</field>
55+
<requiredEntity createDataKey="createConfigProductAttribute"/>
56+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
57+
</createData>
58+
59+
<!-- Assign the two products to the configurable product -->
60+
<createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption">
61+
<requiredEntity createDataKey="createConfigProduct"/>
62+
<requiredEntity createDataKey="createConfigProductAttribute"/>
63+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
64+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
65+
</createData>
66+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1">
67+
<requiredEntity createDataKey="createConfigProduct"/>
68+
<requiredEntity createDataKey="createConfigChildProduct1"/>
69+
</createData>
70+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2">
71+
<requiredEntity createDataKey="createConfigProduct"/>
72+
<requiredEntity createDataKey="createConfigChildProduct2"/>
73+
</createData>
74+
75+
<!-- log in -->
76+
<actionGroup ref="LoginAsAdmin" stepKey="login"/>
77+
</before>
78+
79+
<after>
80+
<actionGroup ref="logout" stepKey="logout"/>
81+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
82+
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/>
83+
<deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/>
84+
<deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/>
85+
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>
86+
</after>
87+
88+
<!-- Check to make sure that the configurable product shows up as in stock -->
89+
<amOnPage url="/$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="goToConfigProductPage"/>
90+
<waitForPageLoad stepKey="waitForStoreFrontLoad"/>
91+
<see selector="{{StorefrontProductInfoMainSection.stockIndication}}" userInput="IN STOCK" stepKey="lookForOfStock"/>
92+
93+
<!-- Find the first simple product that we just created using the product grid and go to its page-->
94+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
95+
<waitForPageLoad stepKey="waitForAdminProductGridLoad"/>
96+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
97+
<actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct">
98+
<argument name="product" value="$$createConfigChildProduct1$$"/>
99+
</actionGroup>
100+
<waitForPageLoad stepKey="waitForFiltersToBeApplied"/>
101+
<click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProductPage"/>
102+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
103+
104+
<!-- Edit the quantity of the simple first product as 0 -->
105+
<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="0" stepKey="fillProductQuantity"/>
106+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/>
107+
<waitForPageLoad stepKey="waitForProductPageSaved"/>
108+
109+
<!-- Check to make sure that the configurable product shows up as in stock -->
110+
<amOnPage url="/$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="goToConfigProductPage2"/>
111+
<waitForPageLoad stepKey="waitForStoreFrontLoad2"/>
112+
<see selector="{{StorefrontProductInfoMainSection.stockIndication}}" userInput="IN STOCK" stepKey="lookForOutOfStock2"/>
113+
114+
<!-- Find the second simple product that we just created using the product grid and go to its page-->
115+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage2"/>
116+
<waitForPageLoad stepKey="waitForAdminProductGridLoad2"/>
117+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial2"/>
118+
<actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct2">
119+
<argument name="product" value="$$createConfigChildProduct2$$"/>
120+
</actionGroup>
121+
<waitForPageLoad stepKey="waitForFiltersToBeApplied2"/>
122+
<click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProductPage2"/>
123+
<waitForPageLoad stepKey="waitForProductPageLoad2"/>
124+
125+
<!-- Edit the quantity of the second simple product as 0 -->
126+
<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="0" stepKey="fillProductQuantity2"/>
127+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct2"/>
128+
<waitForPageLoad stepKey="waitForProductPageSaved2"/>
129+
130+
<!-- Check to make sure that the configurable product shows up as out of stock -->
131+
<amOnPage url="/$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="goToConfigProductPage3"/>
132+
<waitForPageLoad stepKey="waitForStoreFrontLoad3"/>
133+
<see selector="{{StorefrontProductInfoMainSection.stockIndication}}" userInput="OUT OF STOCK" stepKey="lookForOutOfStock3"/>
134+
</test>
135+
</tests>

app/code/Magento/Tax/Test/Mftf/Data/TaxConfigData.xml

Lines changed: 22 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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
1111
<entity name="TaxConfig" type="tax_config_state">
1212
<!-- Calculation settings -->
1313
<requiredEntity type="algorithm">TaxCalculationMethodBasedOn</requiredEntity>
@@ -110,6 +110,27 @@
110110
<entity name="DisplayZeroTaxSubtotalSales" type="zero_taxSales">
111111
<data key="value">1</data>
112112
</entity>
113+
<entity name="Tax_Config_CA" type="tax_config_state">
114+
<!-- Default Tax Destination Calculation -->
115+
<requiredEntity type="country">CountryUS</requiredEntity>
116+
<requiredEntity type="region">Region_CA</requiredEntity>
117+
<requiredEntity type="postcode">AllPostCode</requiredEntity>
118+
<!-- Shopping Cart Display Settings -->
119+
<requiredEntity type="grandtotalCart">IncludeTaxInOrderTotalCart</requiredEntity>
120+
<requiredEntity type="full_summaryCart">DisplayFullTaxSummaryCart</requiredEntity>
121+
<requiredEntity type="zero_taxCart">DisplayZeroTaxSubtotalCart</requiredEntity>
122+
</entity>
123+
124+
<entity name="Tax_Config_NY" type="tax_config_state">
125+
<!-- Default Tax Destination Calculation -->
126+
<requiredEntity type="country">CountryUS</requiredEntity>
127+
<requiredEntity type="region">Region_NY</requiredEntity>
128+
<requiredEntity type="postcode">AllPostCode</requiredEntity>
129+
<!-- Shopping Cart Display Settings -->
130+
<requiredEntity type="grandtotalCart">IncludeTaxInOrderTotalCart</requiredEntity>
131+
<requiredEntity type="full_summaryCart">DisplayFullTaxSummaryCart</requiredEntity>
132+
<requiredEntity type="zero_taxCart">DisplayZeroTaxSubtotalCart</requiredEntity>
133+
</entity>
113134
<!-- Set default settings -->
114135
<entity name="DefaultTaxConfig" type="tax_config_default">
115136
<requiredEntity type="taxTotalFlagZero">DefaultTotalFlagZero</requiredEntity>
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+
<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">
11+
<entity name="Region_NY" type="region">
12+
<data key="value">43</data>
13+
</entity>
14+
<entity name="Region_CA" type="region">
15+
<data key="value">12</data>
16+
</entity>
17+
</entities>

app/code/Magento/Tax/Test/Mftf/Data/TaxRuleData.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
9+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
1010
<entity name="SimpleTaxRule" type="taxRule">
1111
<data key="code" unique="suffix">TaxRule</data>
1212
<data key="position">0</data>

0 commit comments

Comments
 (0)