Skip to content

Commit e186d98

Browse files
committed
Merge branch 'B2B-1654' into foxes-pr
2 parents 3ab3e6b + 7891195 commit e186d98

12 files changed

+680
-2
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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="AdminAwsS3ImportBundleProductTest" extends="AdminImportBundleProductTest">
12+
<annotations>
13+
<features value="AwsS3"/>
14+
<stories value="Import Products"/>
15+
<title value="S3 - Import Bundle Product"/>
16+
<description value="Imports a .csv file containing a bundle product. Verifies that product is imported
17+
successfully and can be purchased."/>
18+
<severity value="MAJOR"/>
19+
<group value="importExport"/>
20+
<group value="Bundle"/>
21+
<group value="remote_storage_aws_s3"/>
22+
<skip>
23+
<issueId value="MC-39280"/>
24+
</skip>
25+
</annotations>
26+
27+
<before>
28+
<!-- Enable AWS S3 Remote Storage -->
29+
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" before="createImportCategory"/>
30+
</before>
31+
32+
<after>
33+
<!-- Disable AWS S3 Remote Storage -->
34+
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logoutFromAdmin"/>
35+
</after>
36+
</test>
37+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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="AdminAssertBundleProductGeneralInfoOnEditPageActionGroup" extends="AdminAssertProductInfoOnEditPageActionGroup">
12+
<annotations>
13+
<description>Verifies the general data on the Edit product details page in admin for a bundle product.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="dynamicSku" defaultValue="true" type="string"/>
17+
<argument name="dynamicPrice" defaultValue="true" type="string"/>
18+
<argument name="dynamicWeight" defaultValue="true" type="string"/>
19+
</arguments>
20+
<executeJS function="return document.querySelector(&quot;{{AdminProductFormSection.attributeSet}}&quot;).innerText" stepKey="seeProductAttributeSet"/>
21+
<assertEquals stepKey="assertProductAttributeSet" after="seeProductAttributeSet">
22+
<actualResult type="variable">seeProductAttributeSet</actualResult>
23+
<expectedResult type="string">{{productAttributeSet}}</expectedResult>
24+
</assertEquals>
25+
<executeJS function="return document.querySelector(&quot;{{AdminProductFormBundleSection.dynamicSkuInput}}&quot;).checked.toString()" stepKey="dynamicSkuCheckedValue" after="seeProductSku"/>
26+
<assertEquals stepKey="assertDynamicSku" after="dynamicSkuCheckedValue">
27+
<actualResult type="variable">dynamicSkuCheckedValue</actualResult>
28+
<expectedResult type="string">{{dynamicSku}}</expectedResult>
29+
</assertEquals>
30+
<executeJS function="return document.querySelector(&quot;{{AdminProductFormBundleSection.dynamicPriceInput}}&quot;).checked.toString()" stepKey="dynamicPriceCheckedValue" after="seeProductPrice"/>
31+
<assertEquals stepKey="assertDynamicPrice" after="dynamicPriceCheckedValue">
32+
<actualResult type="variable">dynamicPriceCheckedValue</actualResult>
33+
<expectedResult type="string">{{dynamicPrice}}</expectedResult>
34+
</assertEquals>
35+
<executeJS function="return document.querySelector(&quot;{{AdminProductFormBundleSection.dynamicWeightInput}}&quot;).checked.toString()" stepKey="dynamicWeightCheckedValue" after="seeProductWeight"/>
36+
<assertEquals stepKey="assertDynamicWeight" after="dynamicWeightCheckedValue">
37+
<actualResult type="variable">dynamicWeightCheckedValue</actualResult>
38+
<expectedResult type="string">{{dynamicWeight}}</expectedResult>
39+
</assertEquals>
40+
</actionGroup>
41+
</actionGroups>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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="AdminVerifyBundleProductOptionActionGroup">
12+
<annotations>
13+
<description>Verify bundle option data for the specified option index on the Edit Product page in admin for
14+
a Bundle product.</description>
15+
</annotations>
16+
<arguments>
17+
<argument name="optionTitle" defaultValue="{{DropDownBundleOption.title}}" type="string"/>
18+
<argument name="inputType" defaultValue="{{DropDownBundleOption.type}}" type="string"/>
19+
<argument name="required" defaultValue="{{DropDownBundleOption.required}}" type="string"/>
20+
<argument name="numberOfProducts" defaultValue="1" type="string"/>
21+
<argument name="index" defaultValue="1" type="string"/>
22+
</arguments>
23+
<executeJS function="return ({{index}}-1).toString()" stepKey="indexMinusOne"/>
24+
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle({$indexMinusOne})}}" stepKey="waitForOptionTitle"/>
25+
<seeInField userInput="{{optionTitle}}" selector="{{AdminProductFormBundleSection.bundleOptionXTitle({$indexMinusOne})}}" stepKey="seeOptionTitle"/>
26+
<seeOptionIsSelected userInput="{{inputType}}" selector="{{AdminProductFormBundleSection.bundleOptionXInputType({$indexMinusOne})}}" stepKey="seeOptionType"/>
27+
<executeJS function="return document.querySelector(&quot;{{AdminProductFormBundleSection.bundleOptionXRequired({$indexMinusOne})}}&quot;).checked.toString()" stepKey="optionRequiredValue"/>
28+
<assertEquals stepKey="assertOptionRequiredValue">
29+
<actualResult type="variable">optionRequiredValue</actualResult>
30+
<expectedResult type="string">{{required}}</expectedResult>
31+
</assertEquals>
32+
<seeNumberOfElements userInput="{{numberOfProducts}}" selector="{{AdminProductFormBundleSection.bundleOptionXAllProductRows(index)}}" stepKey="seeNumberOfProductsInOption"/>
33+
</actionGroup>
34+
</actionGroups>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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="AdminVerifyProductInBundleProductOptionActionGroup">
12+
<annotations>
13+
<description>Verify product data for the specified product row in a bundle option in the Bundle Items
14+
section on the Edit Product page in admin for a Bundle product.</description>
15+
</annotations>
16+
<arguments>
17+
<argument name="isDefault" defaultValue="true" type="string"/>
18+
<argument name="name" defaultValue="{{_defaultProduct.name}}" type="string"/>
19+
<argument name="sku" defaultValue="{{_defaultProduct.sku}}" type="string"/>
20+
<argument name="defaultQuantity" defaultValue="1" type="string"/>
21+
<argument name="userDefined" defaultValue="false" type="string"/>
22+
<argument name="optionIndex" defaultValue="1" type="string"/>
23+
<argument name="productIndex" defaultValue="1" type="string"/>
24+
</arguments>
25+
<executeJS function="return ({{optionIndex}}-1).toString()" stepKey="optionIndexMinusOne"/>
26+
<executeJS function="return ({{productIndex}}-1).toString()" stepKey="productIndexMinusOne"/>
27+
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXProductYIsDefault({$optionIndexMinusOne}, {$productIndexMinusOne})}}" stepKey="waitForIsDefault"/>
28+
<executeJS function="return document.querySelector(&quot;{{AdminProductFormBundleSection.bundleOptionXProductYIsDefault({$optionIndexMinusOne}, {$productIndexMinusOne})}}&quot;).checked.toString()" stepKey="isDefaultValue"/>
29+
<assertEquals stepKey="assertIsDefaultValue">
30+
<actualResult type="variable">isDefaultValue</actualResult>
31+
<expectedResult type="string">{{isDefault}}</expectedResult>
32+
</assertEquals>
33+
<see userInput="{{name}}" selector="{{AdminProductFormBundleSection.bundleOptionXProductYName(optionIndex, productIndex)}}" stepKey="seeName"/>
34+
<see userInput="{{sku}}" selector="{{AdminProductFormBundleSection.bundleOptionXProductYSku(optionIndex, productIndex)}}" stepKey="seeSku"/>
35+
<seeInField userInput="{{defaultQuantity}}" selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity({$optionIndexMinusOne}, {$productIndexMinusOne})}}" stepKey="seeDefaultQuantity"/>
36+
<executeJS function="return document.querySelector(&quot;{{AdminProductFormBundleSection.bundleOptionXProductYUserDefined({$optionIndexMinusOne}, {$productIndexMinusOne})}}&quot;).checked.toString()" stepKey="userDefinedValue"/>
37+
<assertEquals stepKey="assertUserDefinedValueValue">
38+
<actualResult type="variable">userDefinedValue</actualResult>
39+
<expectedResult type="string">{{userDefined}}</expectedResult>
40+
</assertEquals>
41+
</actionGroup>
42+
</actionGroups>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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="StorefrontVerifyBundleProductOptionOnOrderActionGroup">
12+
<annotations>
13+
<description>Verify bundle option data for the specified option index on a placed order on the storefront.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="optionTitle" defaultValue="{{DropDownBundleOption.title}}" type="string"/>
17+
<argument name="optionProductName" defaultValue="{{_defaultProduct.name}}" type="string"/>
18+
<argument name="optionProductSku" defaultValue="{{_defaultProduct.sku}}" type="string"/>
19+
<argument name="optionProductQuantityDescription" defaultValue="Ordered 1" type="string"/>
20+
<argument name="productIndex" defaultValue="1" type="string"/>
21+
<argument name="optionIndex" defaultValue="1" type="string"/>
22+
</arguments>
23+
<waitForText userInput="{{optionTitle}}" selector="{{StorefrontCustomerOrderViewSection.productOptionLabel(productIndex, optionIndex)}}" stepKey="seeOptionTitle"/>
24+
<see userInput="{{optionProductName}}" selector="{{StorefrontCustomerOrderViewSection.productOptionProductName(productIndex, optionIndex)}}" stepKey="seeOptionProductName"/>
25+
<see userInput="{{optionProductSku}}" selector="{{StorefrontCustomerOrderViewSection.productOptionProductSku(productIndex, optionIndex)}}" stepKey="seeOptionProductSku"/>
26+
<see userInput="{{optionProductQuantityDescription}}" selector="{{StorefrontCustomerOrderViewSection.productOptionProductQuantity(productIndex, optionIndex)}}" stepKey="seeOptionProductQuantity"/>
27+
</actionGroup>
28+
</actionGroups>

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,16 @@
1616
<element name="firstInputType" type="select" selector="[name='bundle_options[bundle_options][0][type]']"/>
1717
<element name="firstRequired" type="checkbox" selector="[name='bundle_options[bundle_options][0][required]']"/>
1818
<element name="firstProductQuantity" type="input" selector="[name='bundle_options[bundle_options][0][bundle_selections][0][selection_qty]']"/>
19+
<element name="allBundleOptions" type="text" selector="[data-index=bundle_options]>tbody>tr"/>
1920
<element name="bundleOptionXTitle" type="input" selector="[name='bundle_options[bundle_options][{{x}}][title]']" parameterized="true"/>
2021
<element name="bundleOptionXInputType" type="select" selector="[name='bundle_options[bundle_options][{{x}}][type]']" parameterized="true"/>
2122
<element name="bundleOptionXRequired" type="checkbox" selector="[name='bundle_options[bundle_options][{{x}}][required]']" parameterized="true"/>
23+
<element name="bundleOptionXAllProductRows" type="text" parameterized="true" selector="[data-index=bundle_options]>tbody>tr:nth-of-type({{optionIndex}}) table[data-index=bundle_selections]>tbody>tr"/>
24+
<element name="bundleOptionXProductYIsDefault" type="input" parameterized="true" selector="[name='bundle_options[bundle_options][{{optionIndex}}][bundle_selections][{{productIndex}}][is_default]']"/>
25+
<element name="bundleOptionXProductYName" type="text" parameterized="true" selector="[data-index=bundle_options]>tbody>tr:nth-of-type({{optionIndex}}) table[data-index=bundle_selections]>tbody>tr:nth-of-type({{productIndex}}) div[data-index=name]"/>
26+
<element name="bundleOptionXProductYSku" type="text" parameterized="true" selector="[data-index=bundle_options]>tbody>tr:nth-of-type({{optionIndex}}) table[data-index=bundle_selections]>tbody>tr:nth-of-type({{productIndex}}) div[data-index=sku]"/>
2227
<element name="bundleOptionXProductYQuantity" type="input" selector="[name='bundle_options[bundle_options][{{x}}][bundle_selections][{{y}}][selection_qty]']" parameterized="true"/>
28+
<element name="bundleOptionXProductYUserDefined" type="checkbox" parameterized="true" selector="[name='bundle_options[bundle_options][{{optionIndex}}][bundle_selections][{{productIndex}}][selection_can_change_qty]']"/>
2329
<element name="bundleOptionXProductYPrice" type="input" selector="[name='bundle_options[bundle_options][{{x}}][bundle_selections][{{y}}][selection_price_value]']" parameterized="true"/>
2430
<element name="addProductsToOption" type="button" selector="[data-index='modal_set']" timeout="30"/>
2531
<element name="nthAddProductsToOption" type="button" selector="//tr[{{var}}]//button[@data-index='modal_set']" timeout="30" parameterized="true"/>
@@ -73,6 +79,7 @@
7379
<element name="firstProductOption" type="checkbox" selector="//div[@class='admin__data-grid-outer-wrap']//tr[@data-repeat-index='0']//input[@type='checkbox']"/>
7480
<element name="dynamicSkuToggle" type="checkbox" selector="div[data-index='sku_type'] .admin__actions-switch-label" timeout="30"/>
7581
<element name="dynamicPriceToggle" type="checkbox" selector="//div[@data-index='price_type']//div[@data-role='switcher']"/>
82+
<element name="dynamicPriceInput" type="input" selector="[name='product[price_type]']"/>
7683
<element name="taxClassDropDown" type="select" selector="//select[@name='product[tax_class_id]']" timeout="30"/>
7784
<element name="taxableGoodsOption" type="text" selector="//select[@name='product[tax_class_id]']//option[@data-title='Taxable Goods']"/>
7885
<element name="stockStatusField" type="select" selector="//select[@name='product[quantity_and_stock_status][is_in_stock]']"/>
@@ -90,8 +97,10 @@
9097
<element name="selectCountryOfManufacture" type="text" selector="//select[@name='product[country_of_manufacture]']//option[@data-title='{{country}}']" parameterized="true"/>
9198
<element name="dynamicSkuToggleOn" type="checkbox" selector="//div[@data-index='sku_type']//div[@data-role='switcher']//input[@value='0']"/>
9299
<element name="dynamicSkuToggleOff" type="checkbox" selector="//div[@data-index='sku_type']//div[@data-role='switcher']//input[@value='1']"/>
100+
<element name="dynamicSkuInput" type="input" selector="[name='product[sku_type]']"/>
93101
<element name="dynamicWeightToggleOn" type="checkbox" selector="//div[@data-index='weight_type']//div[@data-role='switcher']//input[@value='0']"/>
94102
<element name="dynamicWeightToggleOff" type="checkbox" selector="//div[@data-index='weight_type']//div[@data-role='switcher']//input[@value='1']"/>
103+
<element name="dynamicWeightInput" type="input" selector="[name='product[weight_type]']"/>
95104
<element name="categoryFieldName" type="text" selector="//fieldset[@data-index='container_category_ids']//label//span" timeout="30"/>
96105
<element name="categoryDone" type="button" selector=".admin__action-multiselect-actions-wrap [type='button'] span" timeout="30"/>
97106
<element name="dynamicPriceToggleOff" type="checkbox" selector="//div[@data-index='price_type']//div[@data-role='switcher']//input[@value='1']"/>

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<section name="StorefrontBundledSection">
1212
<element name="productCheckbox" type="select" selector="//*[@id='customizeTitle']/following-sibling::div[{{arg1}}]//div[{{arg2}}][@class='field choice']/input" parameterized="true"/>
1313
<element name="bundleProductsPrice" type="text" selector="//*[@class='bundle-info']//*[contains(@id,'product-price')]/span"/>
14+
<element name="bundleSummary" type="text" selector="#bundle-summary"/>
1415
<element name="nthBundledOption" type="input" selector=".option:nth-of-type({{numOption}}) .choice:nth-of-type({{numOptionSelect}}) input" parameterized="true"/>
1516
<element name="addToCart" type="button" selector="#bundle-slide" timeout="30"/>
1617
<element name="addToCartConfigured" type="button" selector="#product-addtocart-button" timeout="30"/>
@@ -21,6 +22,14 @@
2122
<element name="customizableBundleItemOption" type="text" selector="//div[@class='field choice'][1]//input[@type='checkbox']"/>
2223
<element name="customizableBundleItemOption2" type="text" selector="//div[@class='field choice'][2]//input[@type='checkbox']"/>
2324
<element name="nthOptionDiv" type="block" selector="#product-options-wrapper div.field.option:nth-of-type({{var}})" parameterized="true"/>
25+
<element name="allBundleOptions" type="block" selector="#product-options-wrapper div.field.option"/>
26+
<element name="allBundleOptionProducts" type="block" parameterized="true" selector="#product-options-wrapper div.field.option:nth-of-type({{optionIndex}}) .choice"/>
27+
<element name="bundleOptionRequired" type="block" parameterized="true" selector="#product-options-wrapper div.field.option:nth-of-type({{optionIndex}}).required"/>
28+
<element name="bundleOptionInput" type="input" parameterized="true" selector="#product-options-wrapper div.field.option:nth-of-type({{optionIndex}}) .choice:nth-of-type({{productIndex}}) input"/>
29+
<element name="bundleOptionProductName" type="text" parameterized="true" selector="#product-options-wrapper div.field.option:nth-of-type({{optionIndex}}) .choice:nth-of-type({{productIndex}}) .product-name"/>
30+
<element name="bundleOptionProductPrice" type="text" parameterized="true" selector="#product-options-wrapper div.field.option:nth-of-type({{optionIndex}}) .choice:nth-of-type({{productIndex}}) .price-notice"/>
31+
<element name="bundleOptionQuantity" type="input" parameterized="true" selector="#product-options-wrapper div.field.option:nth-of-type({{optionIndex}}) .qty input"/>
32+
<element name="bundleOptionQuantityDisabled" type="input" parameterized="true" selector="#product-options-wrapper div.field.option:nth-of-type({{optionIndex}}) .qty input[disabled]"/>
2433
<element name="nthItemOptionsTitle" type="text" selector="dl.item-options dt:nth-of-type({{var}})" parameterized="true"/>
2534
<element name="nthItemOptionsValue" type="text" selector="dl.item-options dd:nth-of-type({{var}})" parameterized="true"/>
2635
<element name="bundleProductName" type="text" selector="//*[@id='maincontent']//span[@itemprop='name']"/>

0 commit comments

Comments
 (0)