Skip to content

Commit fb3fa61

Browse files
committed
Merge remote-tracking branch 'origin/2.2-develop' into 2.2-develop-pr63
2 parents f83d58c + 0d99623 commit fb3fa61

File tree

29 files changed

+802
-105
lines changed

29 files changed

+802
-105
lines changed

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

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

99
<pages 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/PageObject.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
1111
<page name="StorefrontProductPage" url="/{{var1}}.html" area="storefront" module="Magento_Catalog" parameterized="true">
1212
<section name="StorefrontBundledSection"/>
1313
</page>

app/code/Magento/Bundle/Test/Mftf/Section/StorefrontProductInfoMainSection.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
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="StorefrontProductInfoMainSection">
1212
<element name="priceFrom" type="text" selector=".product-info-price .price-from"/>
1313
<element name="priceTo" type="text" selector=".product-info-price .price-to"/>
1414
<element name="minPrice" type="text" selector="span[data-price-type='minPrice']"/>
1515
<element name="maxPrice" type="text" selector="span[data-price-type='minPrice']"/>
16+
<element name="productBundleOptionsCheckbox" type="checkbox" selector="//*[@id='product-options-wrapper']//div[@class='fieldset']//label[contains(.,'{{childName}}')]/../input" parameterized="true" timeout="30"/>
1617
</section>
1718
</sections>

app/code/Magento/Catalog/Model/ResourceModel/Category.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,20 @@ public function getProductsPosition($category)
484484
$this->getCategoryProductTable(),
485485
['product_id', 'position']
486486
)->where(
487-
'category_id = :category_id'
487+
"{$this->getTable('catalog_category_product')}.category_id = ?",
488+
$category->getId()
488489
);
490+
$websiteId = $category->getStore()->getWebsiteId();
491+
if ($websiteId) {
492+
$select->join(
493+
['product_website' => $this->getTable('catalog_product_website')],
494+
"product_website.product_id = {$this->getTable('catalog_category_product')}.product_id",
495+
[]
496+
)->where(
497+
'product_website.website_id = ?',
498+
$websiteId
499+
);
500+
}
489501
$bind = ['category_id' => (int)$category->getId()];
490502

491503
return $this->getConnection()->fetchPairs($select, $bind);

app/code/Magento/Catalog/Model/ResourceModel/Category/Flat.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,8 +699,20 @@ public function getProductsPosition($category)
699699
$this->getTable('catalog_category_product'),
700700
['product_id', 'position']
701701
)->where(
702-
'category_id = :category_id'
702+
"{$this->getTable('catalog_category_product')}.category_id = ?",
703+
$category->getId()
703704
);
705+
$websiteId = $category->getStore()->getWebsiteId();
706+
if ($websiteId) {
707+
$select->join(
708+
['product_website' => $this->getTable('catalog_product_website')],
709+
"product_website.product_id = {$this->getTable('catalog_category_product')}.product_id",
710+
[]
711+
)->where(
712+
'product_website.website_id = ?',
713+
$websiteId
714+
);
715+
}
704716
$bind = ['category_id' => (int)$category->getId()];
705717

706718
return $this->getConnection()->fetchPairs($select, $bind);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<arguments>
3535
<argument name="quantity" type="string" defaultValue="1"/>
3636
</arguments>
37-
<waitForElementVisible selector="{{StorefrontProductPageSection.QtyInput}}" time="30" before="addToCart" stepKey="waitQuantityFieldVisible"/>
38-
<fillField selector="{{StorefrontProductPageSection.QtyInput}}" userInput="{{quantity}}" after="waitQuantityFieldVisible" stepKey="fillQuantityField"/>
37+
<waitForElementVisible selector="{{StorefrontProductPageSection.qtyInput}}" time="30" before="addToCart" stepKey="waitQuantityFieldVisible"/>
38+
<fillField selector="{{StorefrontProductPageSection.qtyInput}}" userInput="{{quantity}}" after="waitQuantityFieldVisible" stepKey="fillQuantityField"/>
3939
</actionGroup>
4040
</actionGroups>

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

Lines changed: 17 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="productAttributeOption1" type="ProductAttributeOption">
1212
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
1313
<data key="label" unique="suffix">option1</data>
@@ -59,4 +59,20 @@
5959
<requiredEntity type="StoreLabel">Option6Store0</requiredEntity>
6060
<requiredEntity type="StoreLabel">Option6Store1</requiredEntity>
6161
</entity>
62+
<entity name="ProductAttributeOption7" type="ProductAttributeOption">
63+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
64+
<data key="label" unique="suffix">Green</data>
65+
<data key="is_default">false</data>
66+
<data key="sort_order">3</data>
67+
<requiredEntity type="StoreLabel">Option7Store0</requiredEntity>
68+
<requiredEntity type="StoreLabel">Option8Store1</requiredEntity>
69+
</entity>
70+
<entity name="ProductAttributeOption8" type="ProductAttributeOption">
71+
<var key="attribute_code" entityKey="attribute_code" entityType="ProductAttribute"/>
72+
<data key="label" unique="suffix">Red</data>
73+
<data key="is_default">false</data>
74+
<data key="sort_order">3</data>
75+
<requiredEntity type="StoreLabel">Option9Store0</requiredEntity>
76+
<requiredEntity type="StoreLabel">Option10Store1</requiredEntity>
77+
</entity>
6278
</entities>

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

Lines changed: 17 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="Option1Store0" type="StoreLabel">
1212
<data key="store_id">0</data>
1313
<data key="label">option1</data>
@@ -56,4 +56,20 @@
5656
<data key="store_id">1</data>
5757
<data key="label">option6</data>
5858
</entity>
59+
<entity name="Option7Store0" type="StoreLabel">
60+
<data key="store_id">0</data>
61+
<data key="label">Green</data>
62+
</entity>
63+
<entity name="Option8Store1" type="StoreLabel">
64+
<data key="store_id">1</data>
65+
<data key="label">Green</data>
66+
</entity>
67+
<entity name="Option9Store0" type="StoreLabel">
68+
<data key="store_id">0</data>
69+
<data key="label">Red</data>
70+
</entity>
71+
<entity name="Option10Store1" type="StoreLabel">
72+
<data key="store_id">1</data>
73+
<data key="label">Red</data>
74+
</entity>
5975
</entities>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +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="StorefrontProductPageSection">
12-
<element name="QtyInput" type="button" selector="input.input-text.qty"/>
12+
<element name="qtyInput" type="button" selector="input.input-text.qty"/>
1313
<element name="addToCartBtn" type="button" selector="button.action.tocart.primary" timeout="30"/>
1414
<element name="successMsg" type="button" selector="div.message-success"/>
1515
<element name="addToWishlist" type="button" selector="a.action.towishlist" timeout="30"/>

app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
</before>
2424
<after>
2525
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
26+
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrderListingFilters"/>
27+
<actionGroup ref="logout" stepKey="logoutAdmin"/>
2628
</after>
2729

2830
<!--Create Simple Product with Custom Options-->
@@ -36,10 +38,9 @@
3638

3739
<!-- Login Customer Storeront -->
3840

39-
<amOnPage url="{{StorefrontCustomerSignInPage.url}}" stepKey="amOnSignInPage"/>
40-
<fillField userInput="$$createCustomer.email$$" selector="{{StorefrontCustomerSignInFormSection.emailField}}" stepKey="fillEmail"/>
41-
<fillField userInput="$$createCustomer.password$$" selector="{{StorefrontCustomerSignInFormSection.passwordField}}" stepKey="fillPassword"/>
42-
<click selector="{{StorefrontCustomerSignInFormSection.signInAccountButton}}" stepKey="clickSignInAccountButton"/>
41+
<actionGroup ref="CustomerLoginOnStorefront" stepKey="loginCustomerOnStorefront">
42+
<argument name="customer" value="$$createCustomer$$"/>
43+
</actionGroup>
4344

4445
<!-- Checking the correctness of displayed prices for user parameters -->
4546

@@ -121,13 +122,11 @@
121122

122123
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/>
123124

124-
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/>
125-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask3"/>
126-
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/>
127-
<fillField selector="{{OrdersGridSection.search}}" userInput="{$grabOrderNumber}" stepKey="fillOrderNum"/>
128-
<click selector="{{OrdersGridSection.submitSearch}}" stepKey="submitSearch"/>
129-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask4"/>
130-
<click selector="{{OrdersGridSection.firstRow}}" stepKey="clickOrderRow"/>
125+
<actionGroup ref="filterOrderGridById" stepKey="filterByOrderId">
126+
<argument name="orderId" value="$grabOrderNumber"/>
127+
</actionGroup>
128+
<click selector="{{AdminDataGridTableSection.firstRow}}" stepKey="clickOrderRow"/>
129+
<waitForPageLoad stepKey="waitForOrderPageOpened"/>
131130

132131
<!-- Checking the correctness of displayed custom options for user parameters on Order -->
133132

@@ -176,6 +175,9 @@
176175
<see selector="{{StorefrontCustomerOrderSection.productCustomOptions($createProduct.name$, ProductOptionDateTime.title, '1/1/18, 1:00 AM')}}" userInput="1/1/18, 1:00 AM" stepKey="seeStorefontOrderProductOptionData1" />
177176
<see selector="{{StorefrontCustomerOrderSection.productCustomOptions($createProduct.name$, ProductOptionTime.title, '1:00 AM')}}" userInput="1:00 AM" stepKey="seeStorefontOrderProductOptionTime1" />
178177

178+
<!-- Logout customer -->
179+
<actionGroup ref="CustomerLogoutStorefrontActionGroup" stepKey="logoutCustomer"/>
180+
179181
<!-- Delete product and category -->
180182

181183
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,16 @@
6868
<fillField selector="{{AdminCatalogPriceRuleConditionsSection.targetInput('1', '1')}}" userInput="{{productSku}}" after="clickEllipsis" stepKey="fillProductSku"/>
6969
<click selector="{{AdminCatalogPriceRuleConditionsSection.applyButton('1', '1')}}" after="fillProductSku" stepKey="clickApply"/>
7070
</actionGroup>
71+
<!--Add Catalog Rule Condition With Category-->
72+
<actionGroup name="newCatalogPriceRuleByUIWithConditionIsCategory" extends="CreateCatalogPriceRule">
73+
<arguments>
74+
<argument name="categoryId" type="string"/>
75+
</arguments>
76+
<click selector="{{AdminCatalogPriceRuleSection.conditionsTab}}" after="discardSubsequentRules" stepKey="openConditionsTab"/>
77+
<click selector="{{AdminCatalogPriceRuleConditionsSection.newCondition}}" after="openConditionsTab" stepKey="addNewCondition"/>
78+
<selectOption selector="{{AdminCatalogPriceRuleConditionsSection.conditionSelect('1')}}" userInput="Magento\CatalogRule\Model\Rule\Condition\Product|category_ids" after="addNewCondition" stepKey="selectTypeCondition"/>
79+
<click selector="{{AdminCatalogPriceRuleConditionsSection.targetEllipsis('1')}}" after="selectTypeCondition" stepKey="clickEllipsis"/>
80+
<fillField selector="{{AdminCatalogPriceRuleConditionsSection.targetInput('1', '1')}}" userInput="{{categoryId}}" after="clickEllipsis" stepKey="fillCategoryId"/>
81+
<click selector="{{AdminCatalogPriceRuleConditionsSection.applyButton('1', '1')}}" after="fillCategoryId" stepKey="clickApply"/>
82+
</actionGroup>
7183
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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="MAGETWO-76169"/>
19+
<group value="persistent"/>
20+
</annotations>
21+
<before>
22+
<createData entity="PersistentConfigEnabled" stepKey="enablePersistent"/>
23+
<createData entity="PersistentLogoutClearDisabled" stepKey="persistentLogoutClearDisable"/>
24+
<createData entity="_defaultCategory" stepKey="createCategory"/>
25+
<createData entity="_defaultProduct" stepKey="createProduct">
26+
<requiredEntity createDataKey="createCategory"/>
27+
<field key="price">50</field>
28+
</createData>
29+
<createData entity="Simple_US_Customer" stepKey="createCustomer">
30+
<field key="group_id">1</field>
31+
</createData>
32+
33+
<actionGroup ref="LoginAsAdmin" stepKey="login"/>
34+
<!--Create Catalog Rule-->
35+
<actionGroup ref="newCatalogPriceRuleByUIWithConditionIsCategory" stepKey="createCatalogPriceRule">
36+
<argument name="catalogRule" value="CustomCatalogRule"/>
37+
<argument name="categoryId" value="$$createCategory.id$$"/>
38+
</actionGroup>
39+
<click selector="{{AdminCatalogPriceRuleGridSection.applyRulesButton}}" stepKey="clickApplyRules"/>
40+
41+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
42+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
43+
</before>
44+
<after>
45+
<!-- Delete the rule -->
46+
<actionGroup ref="RemoveCatalogPriceRule" stepKey="deletePriceRule">
47+
<argument name="ruleName" value="CustomCatalogRule.name" />
48+
</actionGroup>
49+
<actionGroup ref="logout" stepKey="logout"/>
50+
<createData entity="PersistentConfigDefault" stepKey="setDefaultPersistentState"/>
51+
<createData entity="PersistentLogoutClearEnabled" stepKey="persistentLogoutClearEnabled"/>
52+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
53+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
54+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
55+
</after>
56+
57+
<!--Go to category and check price-->
58+
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onStorefrontCategoryPage"/>
59+
<see selector="{{StorefrontCategoryProductSection.ProductPriceByName($$createProduct.name$$)}}" userInput="$$createProduct.price$$" stepKey="checkPriceSimpleProduct"/>
60+
61+
<!--Login to storfront from customer and check price-->
62+
<actionGroup ref="CustomerLoginOnStorefront" stepKey="logInFromCustomer">
63+
<argument name="customer" value="$$createCustomer$$"/>
64+
</actionGroup>
65+
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onStorefrontCategoryPage2"/>
66+
<see userInput="Welcome, $$createCustomer.firstname$$ $$createCustomer.lastname$$!" selector="{{StorefrontPanelHeaderSection.welcomeMessage}}" stepKey="homeCheckWelcome"/>
67+
<see selector="{{StorefrontCategoryProductSection.ProductPriceByName($$createProduct.name$$)}}" userInput="45.00" stepKey="checkPriceSimpleProduct2"/>
68+
69+
<!--Click *Sign Out* and check the price of the Simple Product-->
70+
<actionGroup ref="CustomerLogoutStorefrontActionGroup" stepKey="storefrontSignOut"/>
71+
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onStorefrontCategoryPage3"/>
72+
<see userInput="Welcome, $$createCustomer.firstname$$ $$createCustomer.lastname$$!" selector="{{StorefrontPanelHeaderSection.welcomeMessage}}" stepKey="homeCheckWelcome2"/>
73+
<seeElement selector="{{StorefrontPanelHeaderSection.notYouLink}}" stepKey="checkLinkNotYou"/>
74+
<see selector="{{StorefrontCategoryProductSection.ProductPriceByName($$createProduct.name$$)}}" userInput="45.00" stepKey="checkPriceSimpleProduct3"/>
75+
76+
<!--Click the *Not you?* link and check the price for Simple Product-->
77+
<click selector="{{StorefrontPanelHeaderSection.notYouLink}}" stepKey="clickNext"/>
78+
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="onStorefrontCategoryPage4"/>
79+
<see userInput="Default welcome msg!" selector="{{StorefrontPanelHeaderSection.welcomeMessage}}" stepKey="homeCheckWelcome3"/>
80+
<see selector="{{StorefrontCategoryProductSection.ProductPriceByName($$createProduct.name$$)}}" userInput="$$createProduct.price$$" stepKey="checkPriceSimpleProduct4"/>
81+
</test>
82+
</tests>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,6 @@
3939
<element name="newAddressSelect" type="select" selector=".payment-method._active select[name*='billing_address_id']"/>
4040
<element name="goToShipping" type="button" selector="#checkout>ul>li.opc-progress-bar-item._complete>span"/>
4141
<element name="orderSummarySubtotal" type="text" selector=".totals.sub span" />
42+
<element name="billingAddressSameAsShipping" type="checkbox" selector=".payment-method._active [name='billing-address-same-as-shipping']"/>
4243
</section>
4344
</sections>

0 commit comments

Comments
 (0)