Skip to content

Commit 852af4e

Browse files
authored
Merge pull request #5364 from magento-tsg/2.3-develop-pr112
[TSG] TESTs Fixes for 2.3 (pr112) (2.3-develop)
2 parents ab6e459 + 317a0d5 commit 852af4e

File tree

22 files changed

+720
-7
lines changed

22 files changed

+720
-7
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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="AdminSetUseInSearchValueForProductAttributeActionGroup">
11+
<annotations>
12+
<description>Set 'Use In Search' value for product attribute</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="useInSearchValue" type="string" defaultValue="Yes"/>
16+
</arguments>
17+
18+
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
19+
<click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStorefrontPropertiesTab"/>
20+
<waitForElementVisible selector="{{AdvancedAttributePropertiesSection.UseInSearch}}" stepKey="waitForUseInSearchElementVisible"/>
21+
<selectOption selector="{{AdvancedAttributePropertiesSection.UseInSearch}}" userInput="{{useInSearchValue}}" stepKey="setUseInSearchValue"/>
22+
</actionGroup>
23+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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="AssertStorefrontProductControlsAreNotVisibleWithoutHoverActionGroup">
11+
<annotations>
12+
<description>Validate that the Product Controls Are Not Visible On Category Page Without Hover on Product</description>
13+
</annotations>
14+
15+
<dontSeeElement selector="{{StorefrontCategoryMainSection.addToCartButtonProductInfoHover}}" stepKey="assertAddToCartButtonElementIsNotVisible"/>
16+
<dontSeeElement selector="{{StorefrontCategoryMainSection.addToWishListIconProductInfoHover}}" stepKey="assertAddToWishListIconIsNotVisible"/>
17+
<dontSeeElement selector="{{StorefrontCategoryMainSection.addToCompareIconProductInfoHover}}" stepKey="assertAddToCompareIconIsNotVisible"/>
18+
</actionGroup>
19+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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="AssertStorefrontProductControlsAreVisibleOnHoverActionGroup">
11+
<annotations>
12+
<description>Validate that the Product Controls Are Visible on Category Page on Hover on Product</description>
13+
</annotations>
14+
15+
<seeElement selector="{{StorefrontCategoryMainSection.addToCartButtonProductInfoHover}}" stepKey="assertAddToCartButtonElementIsVisible"/>
16+
<seeElement selector="{{StorefrontCategoryMainSection.addToWishListIconProductInfoHover}}" stepKey="assertAddToWishListIconIsVisible"/>
17+
<seeElement selector="{{StorefrontCategoryMainSection.addToCompareIconProductInfoHover}}" stepKey="assertAddToCompareIconIsVisible"/>
18+
</actionGroup>
19+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="AssertStorefrontProductIsPresentOnCategoryPageActionGroup">
12+
<annotations>
13+
<description>Validate that the provided Product is present and has correct name on a Category page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="productName" type="string" defaultValue="{{ApiSimpleOne.name}}"/>
17+
</arguments>
18+
19+
<waitForElementVisible selector="{{StorefrontCategoryProductSection.ProductTitleByName(productName)}}" stepKey="assertProductName"/>
20+
</actionGroup>
21+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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="AssertStorefrontProductPriceInCategoryPageActionGroup">
12+
<annotations>
13+
<description>Goes to Storefront Category page for the provided Category. Validates that the Product price is present and correct.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="categoryUrl" type="string" defaultValue="{{SimpleRootSubCategory.url_key}}"/>
17+
<argument name="productName" type="string" defaultValue="{{productWithHTMLEntityOne.name}}"/>
18+
<argument name="productPrice" type="string" defaultValue="{{productWithHTMLEntityOne.price}}"/>
19+
</arguments>
20+
21+
<amOnPage url="{{StorefrontCategoryPage.url(categoryUrl)}}" stepKey="navigateToCategoryPage"/>
22+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
23+
<see userInput="{{productPrice}}" selector="{{StorefrontCategoryProductSection.ProductPriceByName(productName)}}" stepKey="assertProductPrice"/>
24+
</actionGroup>
25+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="AssertStorefrontProductSpecialPriceInCategoryPageActionGroup" extends="AssertStorefrontProductPriceInCategoryPageActionGroup">
12+
<annotations>
13+
<description>Goes to Storefront Category page for the provided Category. Validates that the Product price and special price are correct.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="productSpecialPrice" type="string" defaultValue="{{updateVirtualProductSpecialPrice.special_price}}"/>
17+
</arguments>
18+
19+
<see userInput="{{productSpecialPrice}}" selector="{{StorefrontCategoryProductSection.ProductCatalogRuleSpecialPriceTitleByName(productName)}}" after="assertProductPrice" stepKey="assertProductSpecialPrice"/>
20+
</actionGroup>
21+
</actionGroups>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080

8181
<actionGroup name="AssertProductOnCategoryPageActionGroup" extends="StorefrontCheckCategorySimpleProduct">
8282
<annotations>
83-
<description>EXTENDS:StorefrontCheckCategorySimpleProduct. Removes 'AssertProductPrice', 'moveMouseOverProduct', 'AssertAddToCart'</description>
83+
<description>DEPRECATED Use AssertStorefrontProductIsPresentOnCategoryPageActionGroup. EXTENDS:StorefrontCheckCategorySimpleProduct. Removes 'AssertProductPrice', 'moveMouseOverProduct', 'AssertAddToCart'</description>
8484
</annotations>
8585
<remove keyForRemoval="AssertProductPrice"/>
8686
<remove keyForRemoval="moveMouseOverProduct"/>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
<element name="ProductItemInfo" type="button" selector=".product-item-info"/>
1818
<element name="specifiedProductItemInfo" type="button" selector="//a[@class='product-item-link'][contains(text(), '{{var1}}')]" parameterized="true"/>
1919
<element name="AddToCartBtn" type="button" selector="button.action.tocart.primary"/>
20+
<element name="addToCartButtonProductInfoHover" type="button" selector=".product-item-info:hover button.action.tocart.primary" timeout="30"/>
21+
<element name="addToWishListIconProductInfoHover" type="button" selector=".product-item-info:hover a.action.towishlist" timeout="30"/>
22+
<element name="addToCompareIconProductInfoHover" type="button" selector=".product-item-info:hover a.action.tocompare" timeout="30"/>
2023
<element name="addToCartProductBySku" type="button" selector="//form[@data-product-sku='{{productSku}}']//button[contains(@class, 'tocart')]" parameterized="true" />
2124
<element name="SuccessMsg" type="button" selector="div.message-success"/>
2225
<element name="productCount" type="text" selector="#toolbar-amount"/>
@@ -27,6 +30,7 @@
2730
<element name="productLink" type="text" selector="a.product-item-link" timeout="30"/>
2831
<element name="productLinkByHref" type="text" selector="a.product-item-link[href$='{{var1}}.html']" parameterized="true"/>
2932
<element name="productPrice" type="text" selector=".price-final_price"/>
33+
<element name="productPriceByName" type="text" selector="//a[contains(text(), '{{productName}}')]//ancestor::div[contains(@class, 'product-item-info')]//span[contains(@class, 'price')]" parameterized="true"/>
3034
<element name="categoryImage" type="text" selector=".category-image"/>
3135
<element name="emptyProductMessage" type="block" selector=".message.info.empty>div"/>
3236
<element name="lineProductName" type="text" selector=".products.list.items.product-items li:nth-of-type({{line}}) .product-item-link" timeout="30" parameterized="true"/>

app/code/Magento/CatalogRule/Test/Mftf/Test/CatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@
1212
<annotations>
1313
<features value="Persistent"/>
1414
<stories value="Check the price"/>
15-
<title value="Verify that Catalog Price Rule and Customer Group Membership are persisted under long-term cookie"/>
15+
<title value="DEPRECATED. Verify that Catalog Price Rule and Customer Group Membership are persisted under long-term cookie"/>
1616
<description value="Verify that Catalog Price Rule and Customer Group Membership are persisted under long-term cookie"/>
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MAGETWO-69455"/>
1919
<group value="persistent"/>
20+
<skip>
21+
<issueId value="DEPRECATED">Use StorefrontCatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest instead</issueId>
22+
</skip>
2023
</annotations>
2124
<before>
2225
<createData entity="PersistentConfigEnabled" stepKey="enablePersistent"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
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="StorefrontCatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest">
12+
<annotations>
13+
<features value="Persistent"/>
14+
<stories value="Check the price"/>
15+
<title value="Verify that Catalog Price Rule and Customer Group Membership are persisted under long-term cookie"/>
16+
<description value="Verify that Catalog Price Rule and Customer Group Membership are persisted under long-term cookie"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-13607"/>
19+
<group value="persistent"/>
20+
</annotations>
21+
<before>
22+
<createData entity="PersistentConfigSettings" stepKey="enablePersistent"/>
23+
<createData entity="_defaultCategory" stepKey="createCategory"/>
24+
<createData entity="productWithHTMLEntityOne" stepKey="createProduct">
25+
<requiredEntity createDataKey="createCategory"/>
26+
</createData>
27+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
28+
29+
<!--Delete all Catalog Price Rule if exist-->
30+
<actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/>
31+
<actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteAllCatalogPriceRule"/>
32+
33+
<!--Create Catalog Rule-->
34+
<actionGroup ref="AdminOpenNewCatalogPriceRuleFormPageActionGroup" stepKey="startCreatingFirstPriceRule"/>
35+
<actionGroup ref="AdminCatalogPriceRuleFillMainInfoActionGroup" stepKey="fillMainInfoForFirstPriceRule">
36+
<argument name="groups" value="'General'"/>
37+
</actionGroup>
38+
<actionGroup ref="AdminFillCatalogRuleConditionActionGroup" stepKey="createCatalogPriceRule">
39+
<argument name="conditionValue" value="$createCategory.id$"/>
40+
</actionGroup>
41+
<actionGroup ref="AdminCatalogPriceRuleFillActionsActionGroup" stepKey="fillActionsForThirdPriceRule"/>
42+
<actionGroup ref="AdminCatalogPriceRuleSaveAndApplyActionGroup" stepKey="clickSaveAndApplyRule"/>
43+
44+
<!-- Perform reindex -->
45+
<magentoCLI command="indexer:reindex" arguments="catalogrule_rule" stepKey="reindex"/>
46+
</before>
47+
<after>
48+
<createData entity="PersistentConfigDefault" stepKey="setDefaultPersistentState"/>
49+
<createData entity="PersistentLogoutClearEnabled" stepKey="persistentLogoutClearEnabled"/>
50+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
51+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
52+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
53+
<!-- Delete the rule -->
54+
<actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteAllCatalogPriceRule"/>
55+
<actionGroup ref="logout" stepKey="logout"/>
56+
</after>
57+
58+
<!--Go to category and check price-->
59+
<actionGroup ref="AssertStorefrontProductPriceInCategoryPageActionGroup" stepKey="assertProductPriceInCategoryPage">
60+
<argument name="categoryUrl" value="$createCategory.custom_attributes[url_key]$"/>
61+
<argument name="productName" value="$createProduct.name$"/>
62+
</actionGroup>
63+
64+
<!--Login to storefront from customer and check price-->
65+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="logInFromCustomer">
66+
<argument name="Customer" value="$createCustomer$"/>
67+
</actionGroup>
68+
<actionGroup ref="AssertCustomerWelcomeMessageActionGroup" stepKey="seeWelcomeMessageForJohnDoeCustomer">
69+
<argument name="customerFullName" value="{{Simple_Customer_Without_Address.fullname}}"/>
70+
</actionGroup>
71+
72+
<!--Go to category and check special price-->
73+
<actionGroup ref="AssertStorefrontProductSpecialPriceInCategoryPageActionGroup" stepKey="assertProductSpecialPriceInCategoryPage">
74+
<argument name="categoryUrl" value="$createCategory.custom_attributes[url_key]$"/>
75+
<argument name="productName" value="$createProduct.name$"/>
76+
</actionGroup>
77+
78+
79+
<!--Click *Sign Out*-->
80+
<actionGroup ref="StorefrontSignOutActionGroup" stepKey="storefrontSignOut"/>
81+
<actionGroup ref="StorefrontAssertPersistentCustomerWelcomeMessageActionGroup" stepKey="seeWelcomeForJohnDoeCustomer">
82+
<argument name="customerFullName" value="{{Simple_Customer_Without_Address.fullname}}"/>
83+
</actionGroup>
84+
85+
<!--Go to category and check special price-->
86+
<actionGroup ref="AssertStorefrontProductSpecialPriceInCategoryPageActionGroup" stepKey="assertProductSpecialPriceInCategoryPageAfterLogout">
87+
<argument name="categoryUrl" value="$createCategory.custom_attributes[url_key]$"/>
88+
<argument name="productName" value="$createProduct.name$"/>
89+
</actionGroup>
90+
91+
<!--Click the *Not you?* link and check the price for Simple Product-->
92+
<click selector="{{StorefrontPanelHeaderSection.notYouLink}}" stepKey="clickNotYouLink"/>
93+
<actionGroup ref="AssertStorefrontDefaultWelcomeMessageActionGroup" stepKey="seeWelcomeMessageForJohnDoeCustomerAfterLogout"/>
94+
<actionGroup ref="AssertStorefrontProductPriceInCategoryPageActionGroup" stepKey="assertProductPriceInCategoryPageAfterLogout">
95+
<argument name="categoryUrl" value="$createCategory.custom_attributes[url_key]$"/>
96+
<argument name="productName" value="$createProduct.name$"/>
97+
</actionGroup>
98+
<dontSeeElement selector="{{StorefrontCategoryProductSection.ProductCatalogRuleSpecialPriceTitleByName($createProduct.name$)}}" stepKey="dontSeeSpecialPrice"/>
99+
</test>
100+
</tests>

0 commit comments

Comments
 (0)