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>

0 commit comments

Comments
 (0)