Skip to content

Commit 9f06c5f

Browse files
committed
refactored
1 parent 6e47ef3 commit 9f06c5f

10 files changed

+232
-64
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 product.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="optionIndex" type="string" defaultValue="1"/>
17+
</arguments>
18+
19+
<waitForElementVisible selector="{{AdminProductFormBundleSection.nthAddProductsToOption(optionIndex)}}" stepKey="waitForAddProductsToBundle"/>
20+
<click selector="{{AdminProductFormBundleSection.nthAddProductsToOption(optionIndex)}}" stepKey="clickAddProductsToOption"/>
21+
<waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/>
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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<element name="bundleOptionXProductYPrice" type="input" selector="[name='bundle_options[bundle_options][{{x}}][bundle_selections][{{y}}][selection_price_value]']" parameterized="true"/>
3030
<element name="addProductsToOption" type="button" selector="[data-index='modal_set']" timeout="30"/>
3131
<element name="nthAddProductsToOption" type="button" selector="//tr[{{var}}]//button[@data-index='modal_set']" timeout="30" parameterized="true"/>
32+
<element name="nthOptions" type="text" selector="//tr[{{var}}]//span[@data-index='sku']" timeout="30" parameterized="true"/>
3233
<element name="bundlePriceType" type="select" selector="bundle_options[bundle_options][0][bundle_selections][0][selection_price_type]"/>
3334
<element name="bundlePriceValue" type="input" selector="bundle_options[bundle_options][0][bundle_selections][0][selection_price_value]"/>
3435
<!--Select"url Key"InputForm-->
@@ -75,6 +76,7 @@
7576
<element name="priceField" type="input" selector="//div[@data-index='price']//input"/>
7677
<element name="listedBundleItem" type="text" selector="//tr[@data-repeat-index='0']//div"/>
7778
<element name="listedBundleItem2" type="text" selector="//tr[@data-repeat-index='2']//div"/>
79+
<element name="bundleItem" type="text" selector="//span[@data-index='sku']"/>
7880
<!--FirstProductOption-->
7981
<element name="firstProductOption" type="checkbox" selector="//div[@class='admin__data-grid-outer-wrap']//tr[@data-repeat-index='0']//input[@type='checkbox']"/>
8082
<element name="dynamicSkuToggle" type="checkbox" selector="div[data-index='sku_type'] .admin__actions-switch-label" timeout="30"/>

0 commit comments

Comments
 (0)