Skip to content

Commit 98782bd

Browse files
ENGCOM-9388: [MFTF] Updating with AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup #33703
- Merge Pull Request #33703 from AnnaAPak/magento2:add-AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup - Merged commits: 1. 9f06c5f 2. 987ace7 3. cca680d 4. 82a4440 5. 9ddbde2 6. b9c81fb 7. 3734856 8. 4aa8195 9. 3b409bd
2 parents be4c4e0 + 3b409bd commit 98782bd

23 files changed

+191
-36
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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="AdminClickAddOptionOnBundleProductEditPageActionGroup">
12+
<annotations>
13+
<description>Clicks the "Add Option" button on the Bundle Product Edit page</description>
14+
</annotations>
15+
<click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption"/>
16+
</actionGroup>
17+
</actionGroups>
Lines changed: 23 additions & 0 deletions
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminClickAddProductToOptionByOptionIndexActionGroup">
12+
<annotations>
13+
<description>Clicks "Add Product To Option" button for Option by index for Bundle</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="optionIndex" type="string" defaultValue="1"/>
17+
</arguments>
18+
19+
<waitForElementVisible selector="{{AdminProductFormBundleSection.nthAddProductsToOption(optionIndex)}}" stepKey="waitForAddProductsToOptionButton"/>
20+
<click selector="{{AdminProductFormBundleSection.nthAddProductsToOption(optionIndex)}}" stepKey="clickAddProductsToOptionButton"/>
21+
<waitForPageLoad stepKey="waitForPageLoadAfterAddingPorductsToBundle"/>
22+
</actionGroup>
23+
</actionGroups>
Lines changed: 23 additions & 0 deletions
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminFillBundleItemQtyActionGroup">
12+
<annotations>
13+
<description>Fills Bundle item qty</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="optionIndex" type="string" defaultValue="0"/>
17+
<argument name="productIndex" type="string" defaultValue="0"/>
18+
<argument name="qty" type="string" defaultValue="0"/>
19+
</arguments>
20+
21+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(optionIndex, productIndex)}}" userInput="{{qty}}" stepKey="fillProductDefaultQty"/>
22+
</actionGroup>
23+
</actionGroups>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="AdminFillBundleOptionTitleActionGroup">
12+
<arguments>
13+
<argument name="optionTitle" type="string" defaultValue="option1"/>
14+
<argument name="index" type="string" defaultValue="0"/>
15+
</arguments>
16+
17+
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle(index)}}" stepKey="waitForBundleOptions"/>
18+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle(index)}}" userInput="{{optionTitle}}" stepKey="fillOptionTitle"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="AdminFillBundleOptionTypeActionGroup">
12+
<annotations>
13+
<description>Fills Bundle Option Type</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="optionType" type="string" defaultValue="Checkbox"/>
17+
<argument name="optionIndex" type="string" defaultValue="0"/>
18+
</arguments>
19+
20+
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType(optionIndex)}}" userInput="{{optionType}}" stepKey="fillOptionType"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 19 additions & 0 deletions
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminOpenCreateBundleProductPageActionGroup">
12+
<annotations>
13+
<description>Opens the Create Product page for Bundle</description>
14+
</annotations>
15+
16+
<amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage"/>
17+
<waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/>
18+
</actionGroup>
19+
</actionGroups>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
<element name="priceField" type="input" selector="//div[@data-index='price']//input"/>
7676
<element name="listedBundleItem" type="text" selector="//tr[@data-repeat-index='0']//div"/>
7777
<element name="listedBundleItem2" type="text" selector="//tr[@data-repeat-index='2']//div"/>
78+
<element name="bundleItem" type="text" selector="//span[@data-index='sku']"/>
7879
<!--FirstProductOption-->
7980
<element name="firstProductOption" type="checkbox" selector="//div[@class='admin__data-grid-outer-wrap']//tr[@data-repeat-index='0']//input[@type='checkbox']"/>
8081
<element name="dynamicSkuToggle" type="checkbox" selector="div[data-index='sku_type'] .admin__actions-switch-label" timeout="30"/>

app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,23 @@
1919
<group value="Bundle"/>
2020
</annotations>
2121
<before>
22-
<!--Creating data-->
2322
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
2423
<createData entity="SimpleProduct2" stepKey="simpleProduct0"/>
2524
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
2625
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
2726
<createData entity="SimpleProduct2" stepKey="simpleProduct3"/>
2827
<magentoCron stepKey="runCronIndex" groups="index"/>
29-
<!--Admin login-->
3028
<actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/>
3129
</before>
3230
<after>
33-
<!--Deleting data-->
3431
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
3532
<deleteData createDataKey="simpleProduct0" stepKey="deleteSimpleProduct0"/>
3633
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
3734
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
3835
<deleteData createDataKey="simpleProduct3" stepKey="deleteSimpleProduct3"/>
39-
<!--Logging out-->
36+
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteBundleProductBySku">
37+
<argument name="sku" value="{{BundleProduct.sku}}"/>
38+
</actionGroup>
4039
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
4140
</after>
4241
<!--Go to bundle product creation page-->
@@ -86,14 +85,11 @@
8685
<actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts">
8786
<argument name="bundleProduct" value="BundleProduct"/>
8887
</actionGroup>
89-
90-
<!--Save the product-->
9188
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButton"/>
9289
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="messageYouSavedTheProductIsShown">
9390
<argument name="message" value="You saved the product."/>
9491
</actionGroup>
9592

96-
<!--Checking on admin side-->
9793
<scrollToTopOfPage stepKey="scroll"/>
9894
<conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems2"/>
9995
<seeElement selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="LookingForBundleItemPresence"/>
@@ -108,8 +104,6 @@
108104
<waitForPageLoad stepKey="waitCustomizationDropDown"/>
109105
<seeElement selector="{{StorefrontBundledSection.customizableBundleItemOption}}" stepKey="seeBundleItem"/>
110106

111-
<!--Add another bundle option with 2 items-->
112-
<!--Go to bundle product creation page-->
113107
<actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/>
114108
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="ClickOnButtonToRemoveFiltersIfPresent"/>
115109
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="WaitForClear"/>

app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@
5252
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions">
5353
<argument name="product" value="$$simpleProduct1$$"/>
5454
</actionGroup>
55-
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/>
55+
<actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow"/>
5656
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2">
5757
<argument name="product" value="$$simpleProduct2$$"/>
5858
</actionGroup>
59-
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/>
59+
<actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow2"/>
6060
<click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/>
6161
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/>
6262
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/>

app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProductTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@
4242
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions">
4343
<argument name="product" value="$$simpleProduct1$$"/>
4444
</actionGroup>
45-
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/>
45+
<actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow"/>
4646
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2">
4747
<argument name="product" value="$$simpleProduct2$$"/>
4848
</actionGroup>
49-
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/>
49+
<actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow2"/>
5050
<click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/>
5151
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/>
5252
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/>

0 commit comments

Comments
 (0)