Skip to content

Commit 7a3ee17

Browse files
author
Alexander Akimov
authored
Merge pull request #3648 from magento-tsg/2.2-develop-mftf-pr13
[TSG] MFTF for 2.2 (pr13) (2.2-develop)
2 parents b10cee9 + 7757a26 commit 7a3ee17

16 files changed

+277
-14
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
<element name="save" type="button" selector="#save" timeout="30"/>
1313
<element name="delete" type="button" selector="#delete"/>
1414
<element name="add" type="button" selector="#add" timeout="30"/>
15+
<element name="back" type="button" selector="#back" timeout="30"/>
1516
</section>
1617
</sections>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
*/
77
-->
88

9-
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1011
<section name="AdminMessagesSection">
1112
<element name="test" type="input" selector=".test"/>
1213
<element name="success" type="text" selector="#messages div.message-success"/>
1314
<element name="successMessageByIndex" type="text" selector=".message.message-success.success:nth-of-type({{n}})>div" parameterized="true"/>
1415
<element name="error" type="text" selector="#messages div.message-error"/>
16+
<element name="notice" type="text" selector=".message.message-notice.notice"/>
1517
</section>
1618
</sections>

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@
5252
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial2"/>
5353
</actionGroup>
5454

55+
<actionGroup name="DeleteProductByName" extends="deleteProductUsingProductGrid">
56+
<arguments>
57+
<argument name="product" type="string"/>
58+
</arguments>
59+
<remove keyForRemoval="fillProductSkuFilter"/>
60+
<fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product}}" stepKey="fillProductSkuFilter" after="openProductFilters"/>
61+
<remove keyForRemoval="seeProductSkuInGrid"/>
62+
<see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="{{product}}" stepKey="seeProductNameInGrid" after="clickApplyFilters"/>
63+
</actionGroup>
64+
5565
<!--Disabled a product by filtering grid and using change status action-->
5666
<actionGroup name="ChangeStatusProductUsingProductGridActionGroup">
5767
<arguments>

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

Lines changed: 8 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
<actionGroup name="SearchForProductOnBackendActionGroup">
1212
<arguments>
1313
<argument name="product" defaultValue="product"/>
@@ -19,4 +19,11 @@
1919
<fillField stepKey="fillSkuFieldOnFiltersSection" userInput="{{product.sku}}" selector="{{AdminProductFiltersSection.SkuInput}}"/>
2020
<click stepKey="clickApplyFiltersButton" selector="{{AdminProductFiltersSection.Apply}}"/>
2121
</actionGroup>
22+
<actionGroup name="SearchForProductOnBackendByNameActionGroup" extends="SearchForProductOnBackendActionGroup">
23+
<arguments>
24+
<argument name="productName" type="string"/>
25+
</arguments>
26+
<remove keyForRemoval="fillSkuFieldOnFiltersSection"/>
27+
<fillField userInput="{{productName}}" selector="{{AdminProductFiltersSection.NameInput}}" after="cleanFiltersIfTheySet" stepKey="fillNameFieldOnFiltersSection"/>
28+
</actionGroup>
2229
</actionGroups>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
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="AdminProductGridSection">
12+
<element name="productRowBySku" type="block" selector="//div[@id='container']//tr//td[count(../../..//th[./*[.='SKU']]/preceding-sibling::th) + 1][./*[.='{{sku}}']]" parameterized="true" />
1213
<element name="loadingMask" type="text" selector=".admin__data-grid-loading-mask[data-component*='product_listing']"/>
1314
<element name="columnHeader" type="button" selector="//div[@data-role='grid-wrapper']//table[contains(@class, 'data-grid')]/thead/tr/th[contains(@class, 'data-grid-th')]/span[text() = '{{label}}']" parameterized="true" timeout="30"/>
1415
<element name="productGridElement1" type="input" selector="#addselector" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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="StorefrontShoppingCartCheckCustomerDefaultShippingAddressForVirtualQuoteTest">
12+
<annotations>
13+
<features value="Checkout"/>
14+
<stories value="Checkout via the Storefront"/>
15+
<title value="Estimator in Shopping cart must be pre-filled by Customer default shipping address for virtual quote"/>
16+
<description value="Estimator in Shopping cart must be pre-filled by Customer default shipping address for virtual quote"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MAGETWO-78596"/>
19+
<group value="checkout"/>
20+
</annotations>
21+
<before>
22+
<createData entity="VirtualProduct" stepKey="createVirtualProduct"/>
23+
<createData entity="Customer_With_Different_Default_Billing_Shipping_Addresses" stepKey="createCustomer"/>
24+
</before>
25+
<after>
26+
<actionGroup ref="CustomerLogoutStorefrontActionGroup" stepKey="customerLogout"/>
27+
<deleteData createDataKey="createVirtualProduct" stepKey="deleteVirtualProduct"/>
28+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
29+
</after>
30+
<!-- Steps -->
31+
<!-- Step 1: Go to Storefront as Customer -->
32+
<actionGroup ref="CustomerLoginOnStorefront" stepKey="customerLogin">
33+
<argument name="customer" value="$$createCustomer$$" />
34+
</actionGroup>
35+
<!-- Step 2: Add virtual product to cart -->
36+
<amOnPage url="{{StorefrontProductPage.url($$createVirtualProduct.custom_attributes[url_key]$)}}" stepKey="amOnPage"/>
37+
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart">
38+
<argument name="product" value="$$createVirtualProduct$$"/>
39+
<argument name="productCount" value="1"/>
40+
</actionGroup>
41+
<!-- Step 3: Go to Shopping Cart -->
42+
<actionGroup ref="StorefrontViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingcart"/>
43+
<!-- Step 4: Open Estimate Tax section -->
44+
<click selector="{{StorefrontCheckoutCartSummarySection.estimateShippingAndTax}}" stepKey="openEstimateTaxSection"/>
45+
<seeOptionIsSelected selector="{{StorefrontCheckoutCartSummarySection.country}}" userInput="{{US_Address_CA.country}}" stepKey="checkCountry"/>
46+
<seeOptionIsSelected selector="{{StorefrontCheckoutCartSummarySection.region}}" userInput="{{US_Address_CA.state}}" stepKey="checkState"/>
47+
<scrollTo selector="{{StorefrontCheckoutCartSummarySection.postcode}}" stepKey="scrollToPostCodeField"/>
48+
<grabValueFrom selector="{{StorefrontCheckoutCartSummarySection.postcode}}" stepKey="grabTextPostCode"/>
49+
<assertEquals message="Customer postcode is invalid" stepKey="checkCustomerPostcode">
50+
<expectedResult type="string">{{US_Address_CA.postcode}}</expectedResult>
51+
<actualResult type="variable">grabTextPostCode</actualResult>
52+
</assertEquals>
53+
</test>
54+
</tests>

app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
<data key="state">California</data>
6868
<data key="postcode">90230</data>
6969
<data key="country_id">US</data>
70+
<data key="country">United States</data>
7071
<data key="default_billing">Yes</data>
7172
<data key="default_shipping">Yes</data>
7273
<requiredEntity type="region">RegionCA</requiredEntity>
@@ -104,4 +105,12 @@
104105
<data key="country">United Kingdom</data>
105106
<data key="telephone">444-44-444-44</data>
106107
</entity>
108+
<entity name="US_Default_Billing_Address_TX" type="address" extends="US_Address_TX">
109+
<data key="default_billing">false</data>
110+
<data key="default_shipping">true</data>
111+
</entity>
112+
<entity name="US_Default_Shipping_Address_CA" type="address" extends="US_Address_CA">
113+
<data key="default_billing">true</data>
114+
<data key="default_shipping">false</data>
115+
</entity>
107116
</entities>

app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,16 @@
7474
<data key="website_id">0</data>
7575
<requiredEntity type="address">US_Address_NY</requiredEntity>
7676
</entity>
77+
<entity name="Customer_With_Different_Default_Billing_Shipping_Addresses" type="customer">
78+
<data key="group_id">1</data>
79+
<data key="email" unique="prefix">[email protected]</data>
80+
<data key="firstname">John</data>
81+
<data key="lastname">Doe</data>
82+
<data key="fullname">John Doe</data>
83+
<data key="password">pwdTest123!</data>
84+
<data key="store_id">0</data>
85+
<data key="website_id">0</data>
86+
<requiredEntity type="address">US_Default_Billing_Address_TX</requiredEntity>
87+
<requiredEntity type="address">US_Default_Shipping_Address_CA</requiredEntity>
88+
</entity>
7789
</entities>
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+
<!--Search grid with keyword search-->
12+
<actionGroup name="AdminFilterCartPriceRuleActionGroup">
13+
<arguments>
14+
<argument name="ruleName"/>
15+
</arguments>
16+
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
17+
<fillField selector="{{AdminCartPriceRulesSection.filterByNameInput}}" userInput="{{ruleName}}" stepKey="filterByName"/>
18+
<click selector="{{AdminCartPriceRulesSection.searchButton}}" stepKey="doFilter"/>
19+
</actionGroup>
20+
</actionGroups>

app/code/Magento/Store/Test/Mftf/Data/StoreData.xml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* See COPYING.txt for license details.
66
*/
77
-->
8-
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
8+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
99
<entity name="_defaultStore" type="store">
1010
<data key="name">Default Store View</data>
1111
<data key="code">default</data>
@@ -39,6 +39,24 @@
3939
<data key="store_type">store</data>
4040
<requiredEntity type="storeGroup">customStoreGroup</requiredEntity>
4141
</entity>
42+
<entity name="CustomStoreENNotUnique" type="store">
43+
<data key="name">EN</data>
44+
<data key="code">en</data>
45+
<data key="is_active">1</data>
46+
<data key="store_id">null</data>
47+
<data key="store_action">add</data>
48+
<data key="store_type">store</data>
49+
<requiredEntity type="storeGroup">customStoreGroup</requiredEntity>
50+
</entity>
51+
<entity name="CustomStoreNLNotUnique" type="store">
52+
<data key="name">NL</data>
53+
<data key="code">nl</data>
54+
<data key="is_active">1</data>
55+
<data key="store_id">null</data>
56+
<data key="store_action">add</data>
57+
<data key="store_type">store</data>
58+
<requiredEntity type="storeGroup">customStoreGroup</requiredEntity>
59+
</entity>
4260
<entity name="secondStore" type="store">
4361
<data key="name">Second Store View</data>
4462
<data key="code">second_store_view</data>

0 commit comments

Comments
 (0)