Skip to content

Commit ff4a16a

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into MC-20075
2 parents c25ce09 + 14a4c24 commit ff4a16a

File tree

128 files changed

+6697
-692
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+6697
-692
lines changed

app/code/Magento/Braintree/composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
"magento/module-sales": "*",
2323
"magento/module-ui": "*",
2424
"magento/module-vault": "*",
25-
"magento/module-multishipping": "*"
25+
"magento/module-multishipping": "*",
26+
"magento/module-theme": "*"
2627
},
2728
"suggest": {
28-
"magento/module-checkout-agreements": "*",
29-
"magento/module-theme": "*"
29+
"magento/module-checkout-agreements": "*"
3030
},
3131
"type": "magento2-module",
3232
"license": [
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
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="AdminAssociateBundleProductToWebsitesTest">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Create/Edit bundle product in Admin"/>
15+
<title value="Admin should be able to associate bundle product to websites"/>
16+
<description value="Admin should be able to associate bundle product to websites"/>
17+
<testCaseId value="MC-3344"/>
18+
<severity value="CRITICAL"/>
19+
<group value="bundle"/>
20+
<group value="catalog"/>
21+
</annotations>
22+
<before>
23+
<!-- Configure Store URLs -->
24+
<magentoCLI command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}" stepKey="setAddStoreCodeToUrlsToYes"/>
25+
26+
<!-- Create category -->
27+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
28+
29+
<!-- Create Simple product -->
30+
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/>
31+
32+
<!-- Create Bundle product -->
33+
<createData entity="ApiBundleProductPriceViewRange" stepKey="createBundleProduct">
34+
<requiredEntity createDataKey="createCategory"/>
35+
</createData>
36+
<createData entity="DropDownBundleOption" stepKey="bundleOption">
37+
<requiredEntity createDataKey="createBundleProduct"/>
38+
</createData>
39+
<createData entity="ApiBundleLink" stepKey="createNewBundleLink">
40+
<requiredEntity createDataKey="createBundleProduct"/>
41+
<requiredEntity createDataKey="bundleOption"/>
42+
<requiredEntity createDataKey="createSimpleProduct"/>
43+
</createData>
44+
45+
<!-- Reindex -->
46+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
47+
48+
<!-- Login as admin -->
49+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
50+
51+
<!--Create website-->
52+
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createSecondWebsite">
53+
<argument name="newWebsiteName" value="{{secondCustomWebsite.name}}"/>
54+
<argument name="websiteCode" value="{{secondCustomWebsite.code}}"/>
55+
</actionGroup>
56+
<!-- Create second store -->
57+
<actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createSecondStoreGroup">
58+
<argument name="website" value="{{secondCustomWebsite.name}}"/>
59+
<argument name="storeGroupName" value="{{SecondStoreGroupUnique.name}}"/>
60+
<argument name="storeGroupCode" value="{{SecondStoreGroupUnique.code}}"/>
61+
</actionGroup>
62+
<!-- Create second store view -->
63+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createSecondStoreView">
64+
<argument name="StoreGroup" value="SecondStoreGroupUnique"/>
65+
<argument name="customStore" value="SecondStoreUnique"/>
66+
</actionGroup>
67+
</before>
68+
<after>
69+
<!-- Disabled Store URLs -->
70+
<magentoCLI command="config:set {{StorefrontDisableAddStoreCodeToUrls.path}} {{StorefrontDisableAddStoreCodeToUrls.value}}" stepKey="setAddStoreCodeToUrlsToNo"/>
71+
72+
<!-- Delete simple product -->
73+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
74+
<!-- Delete bundle product -->
75+
<deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/>
76+
77+
<!-- Delete second website -->
78+
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite">
79+
<argument name="websiteName" value="{{secondCustomWebsite.name}}"/>
80+
</actionGroup>
81+
82+
<actionGroup ref="NavigateToAndResetProductGridToDefaultView" stepKey="resetProductGridFilter"/>
83+
84+
<!-- Admin logout -->
85+
<actionGroup ref="logout" stepKey="adminLogout"/>
86+
</after>
87+
88+
<!-- Open product page and assign grouped project to second website -->
89+
<actionGroup ref="filterAndSelectProduct" stepKey="openAdminProductPage">
90+
<argument name="productSku" value="$$createBundleProduct.sku$$"/>
91+
</actionGroup>
92+
<actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="assignProductToSecondWebsite">
93+
<argument name="website" value="{{secondCustomWebsite.name}}"/>
94+
</actionGroup>
95+
<actionGroup ref="AdminUnassignProductInWebsiteActionGroup" stepKey="unassignProductFromDefaultWebsite">
96+
<argument name="website" value="{{_defaultWebsite.name}}"/>
97+
</actionGroup>
98+
<actionGroup ref="saveProductForm" stepKey="saveGroupedProduct"/>
99+
100+
<!-- Assert product is assigned to Second website -->
101+
<actionGroup ref="AssertProductIsAssignedToWebsite" stepKey="seeCustomWebsiteIsChecked">
102+
<argument name="website" value="{{secondCustomWebsite.name}}"/>
103+
</actionGroup>
104+
105+
<!-- Assert product is not assigned to Main website -->
106+
<actionGroup ref="AssertProductIsNotAssignedToWebsite" stepKey="seeMainWebsiteIsNotChecked">
107+
<argument name="website" value="{{_defaultWebsite.name}}"/>
108+
</actionGroup>
109+
110+
<!-- Go to frontend and open product on Main website -->
111+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage">
112+
<argument name="productUrl" value="$$createBundleProduct.custom_attributes[url_key]$$"/>
113+
</actionGroup>
114+
115+
<!-- Assert 404 page -->
116+
<actionGroup ref="StorefrontAssertPageNotFoundErrorOnProductDetailPageActionGroup" stepKey="assertPageNotFoundError">
117+
<argument name="product" value="$$createBundleProduct$$"/>
118+
</actionGroup>
119+
120+
<!-- Assert product is present at Second website -->
121+
<actionGroup ref="StorefrontOpenProductPageUsingStoreCodeInUrlActionGroup" stepKey="openProductPageUsingStoreCodeInUrl">
122+
<argument name="product" value="$$createBundleProduct$$"/>
123+
<argument name="storeView" value="SecondStoreUnique"/>
124+
</actionGroup>
125+
</test>
126+
</tests>

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

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,4 +396,44 @@
396396
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/>
397397
<waitForPageLoad stepKey="waitForPageToLoad1"/>
398398
</actionGroup>
399+
400+
<actionGroup name="AdminCategoryAssignProduct">
401+
<annotations>
402+
<description>Requires navigation to category creation/edit page. Assign products to category - using "Products in Category" tab.</description>
403+
</annotations>
404+
<arguments>
405+
<argument name="productSku" type="string"/>
406+
</arguments>
407+
408+
<conditionalClick selector="{{AdminCategoryBasicFieldSection.productsInCategory}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="false" stepKey="clickOnProductInCategory"/>
409+
<click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickOnResetFilter"/>
410+
<fillField selector="{{AdminCategoryContentSection.productTableColumnSku}}" userInput="{{productSku}}" stepKey="fillSkuFilter"/>
411+
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearchButton"/>
412+
<click selector="{{AdminCategoryContentSection.productTableRow}}" stepKey="selectProductFromTableRow"/>
413+
</actionGroup>
414+
415+
<actionGroup name="DeleteDefaultCategoryChildren">
416+
<annotations>
417+
<description>Deletes all children categories of Default Root Category.</description>
418+
</annotations>
419+
420+
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToAdminCategoryPage"/>
421+
<executeInSelenium function="function ($webdriver) use ($I) {
422+
$children = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::xpath('//ul[contains(@class, \'x-tree-node-ct\')]/li[@class=\'x-tree-node\' and contains(.,
423+
\'{{DefaultCategory.name}}\')]/ul[contains(@class, \'x-tree-node-ct\')]/li//a'));
424+
while (!empty($children)) {
425+
$I->click('//ul[contains(@class, \'x-tree-node-ct\')]/li[@class=\'x-tree-node\' and contains(.,
426+
\'{{DefaultCategory.name}}\')]/ul[contains(@class, \'x-tree-node-ct\')]/li//a');
427+
$I->waitForPageLoad(30);
428+
$I->click('#delete');
429+
$I->waitForElementVisible('aside.confirm .modal-footer button.action-accept');
430+
$I->click('aside.confirm .modal-footer button.action-accept');
431+
$I->waitForPageLoad(30);
432+
$I->waitForElementVisible('#messages div.message-success', 30);
433+
$I->see('You deleted the category.', '#messages div.message-success');
434+
$children = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::xpath('//ul[contains(@class, \'x-tree-node-ct\')]/li[@class=\'x-tree-node\' and contains(.,
435+
\'{{DefaultCategory.name}}\')]/ul[contains(@class, \'x-tree-node-ct\')]/li//a'));
436+
}
437+
}" stepKey="deleteAllChildCategories"/>
438+
</actionGroup>
399439
</actionGroups>

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,14 @@
117117
<data key="is_active">true</data>
118118
<data key="include_in_menu">true</data>
119119
</entity>
120+
<entity name="DefaultCategory" type="category">
121+
<data key="name">Default Category</data>
122+
</entity>
123+
<!-- Category from file "export_import_configurable_product.csv" -->
124+
<entity name="CategoryExportImport" extends="SimpleSubCategory" type="category">
125+
<data key="name">CategoryExportImport</data>
126+
</entity>
127+
<entity name="SubCategoryNonAnchor" extends="SubCategoryWithParent">
128+
<requiredEntity type="custom_attribute">CustomAttributeCategoryNonAnchor</requiredEntity>
129+
</entity>
120130
</entities>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,8 @@
5151
<data key="attribute_code">short_description</data>
5252
<data key="value">Short Fixedtest 555</data>
5353
</entity>
54+
<entity name="CustomAttributeCategoryNonAnchor" type="custom_attribute">
55+
<data key="attribute_code">is_anchor</data>
56+
<data key="value">0</data>
57+
</entity>
5458
</entities>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,8 @@
2020
<data key="store_id">0</data>
2121
<data key="label" unique="suffix">attributeThree</data>
2222
</entity>
23+
<entity name="ProductAttributeFrontendLabelForExportImport" type="FrontendLabel">
24+
<data key="store_id">0</data>
25+
<data key="label">attributeExportImport</data>
26+
</entity>
2327
</entities>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@
1818
<data key="type">image/png</data>
1919
<data key="name" unique="prefix">magento-logo.png</data>
2020
</entity>
21+
<entity name="MagentoLogoImageContentExportImport" extends="MagentoLogoImageContent" type="ImageContent">
22+
<data key="name">magento-logo.png</data>
23+
</entity>
2124
</entities>

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,4 +376,9 @@
376376
<data key="frontend_label">Size</data>
377377
<data key="attribute_code" unique="suffix">size_attr</data>
378378
</entity>
379+
<!-- Product attribute from file "export_import_configurable_product.csv" -->
380+
<entity name="ProductAttributeWithTwoOptionsForExportImport" extends="productAttributeDropdownTwoOptions" type="ProductAttribute">
381+
<data key="attribute_code">attribute</data>
382+
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabelForExportImport</requiredEntity>
383+
</entity>
379384
</entities>

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,9 @@
3030
<data key="disabled">false</data>
3131
<requiredEntity type="ImageContent">MagentoLogoImageContent</requiredEntity>
3232
</entity>
33+
<!-- From file "export_import_configurable_product.csv" -->
34+
<entity name="ApiProductAttributeMediaGalleryForExportImport" extends="ApiProductAttributeMediaGalleryEntryTestImage" type="ProductAttributeMediaGalleryEntry">
35+
<data key="label">Magento Logo</data>
36+
<requiredEntity type="ImageContent">MagentoLogoImageContentExportImport</requiredEntity>
37+
</entity>
3338
</entities>

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,11 @@
8686
<data key="label" unique="suffix">White</data>
8787
<data key="value" unique="suffix">white</data>
8888
</entity>
89+
<!-- Product attribute options from file "export_import_configurable_product.csv" -->
90+
<entity name="ProductAttributeOptionOneForExportImport" extends="productAttributeOption1" type="ProductAttributeOption">
91+
<data key="label">option1</data>
92+
</entity>
93+
<entity name="ProductAttributeOptionTwoForExportImport" extends="productAttributeOption2" type="ProductAttributeOption">
94+
<data key="label">option2</data>
95+
</entity>
8996
</entities>

0 commit comments

Comments
 (0)