Skip to content

Cover an issue with removing bundle options #25466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,17 @@
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '4')}}" userInput="2" stepKey="fillQuantity5" after="fillQuantity4"/>
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '5')}}" userInput="2" stepKey="fillQuantity6" after="fillQuantity5"/>
</actionGroup>

<actionGroup name="deleteBundleOptionByIndex">
<annotations>
<description>Requires Navigation to Product Creation page. Removes any Bundle Option by index specified in arguments. 'deleteIndex' refers to Bundle option number.</description>
</annotations>
<arguments>
<argument name="deleteIndex" type="string"/>
</arguments>

<conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/>
<scrollTo selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" stepKey="scrollUpABit"/>
<click selector="{{AdminProductFormBundleSection.deleteOption(deleteIndex)}}" stepKey="clickDeleteOption"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
<element name="currentBundleOption" type="text" selector="//div[@data-index='bundle-items']//div[contains(@class, 'admin__collapsible-title')]/span"/>
<!--AddingAnOption-->
<element name="addOptions" type="button" selector="//tr[@data-repeat-index='0']//td[4]" timeout="30"/>
<!--DragAnOption -->
<element name="dragOption" type="block" selector="//tr[{{dragIndex}}]//div[contains(@class, 'draggable-handle')]" timeout="30" parameterized="true"/>
<!--DeleteAnOption -->
<element name="deleteOption" type="button" selector="//tr[{{deleteIndex}}]//button[@data-index='delete_button']" timeout="30" parameterized="true"/>
<!--SEODropdownTab-->
<element name="seoDropdown" type="button" selector="//div[@data-index='search-engine-optimization']"/>
<element name="seoDependent" type="button" selector="//div[@data-index='search-engine-optimization']//div[contains(@class, '_show')]"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,116 @@
<argument name="websiteName" value="$createWebsite.website[name]$"/>
</actionGroup>
</test>
<test name="AdminCreateAndEditBundleProductOptionsNegativeTest">
<annotations>
<features value="Bundle"/>
<stories value="Modify bundle product in Admin"/>
<title value="Admin should be able to remove any bundle option a bundle product"/>
<description value="Admin should be able to set/edit other product information when creating/editing a bundle product"/>
<severity value="MAJOR"/>
<testCaseId value="MC-224"/>
<skip>
<issueId value="https://github.com/magento/magento2/issues/25468"/>
</skip>
<group value="Catalog"/>
</annotations>
<before>
<!-- Create a Website -->
<createData entity="customWebsite" stepKey="createWebsite"/>

<!-- Create first simple product for a bundle option -->
<createData entity="SimpleProduct2" stepKey="createFirstSimpleProduct"/>

<!-- Create second simple product for a bundle option -->
<createData entity="SimpleProduct2" stepKey="createSecondSimpleProduct"/>

<!-- Login as admin -->
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
</before>
<after>
<!-- Delete the simple product -->
<deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteFirstSimpleProduct"/>

<!-- Delete the simple product -->
<deleteData createDataKey="createSecondSimpleProduct" stepKey="deleteSecondSimpleProduct"/>

<!-- Delete a Website -->
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite">
<argument name="websiteName" value="Second Website"/>
</actionGroup>

<!-- Log out -->
<actionGroup ref="logout" stepKey="logout"/>
</after>

<!-- Create new bundle product -->
<actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createBundleProduct">
<argument name="productType" value="bundle"/>
</actionGroup>

<!-- Fill all main fields -->
<actionGroup ref="fillMainBundleProductForm" stepKey="fillMainProductFields"/>

<!-- Add first bundle option to the product -->
<actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addFirstBundleOption">
<argument name="x" value="0"/>
<argument name="n" value="1"/>
<argument name="prodOneSku" value="$$createFirstSimpleProduct.sku$$"/>
<argument name="prodTwoSku" value="$$createSecondSimpleProduct.sku$$"/>
<argument name="optionTitle" value="{{RadioButtonsOption.title}}"/>
<argument name="inputType" value="{{RadioButtonsOption.type}}"/>
</actionGroup>

<!-- Add second bundle option to the product -->
<actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addSecondBundleOption">
<argument name="x" value="1"/>
<argument name="n" value="2"/>
<argument name="prodOneSku" value="$$createFirstSimpleProduct.sku$$"/>
<argument name="prodTwoSku" value="$$createSecondSimpleProduct.sku$$"/>
<argument name="optionTitle" value="{{CheckboxOption.title}}"/>
<argument name="inputType" value="{{CheckboxOption.type}}"/>
</actionGroup>

<!-- Add third bundle option to the product -->
<actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addThirdBundleOption">
<argument name="x" value="2"/>
<argument name="n" value="3"/>
<argument name="prodOneSku" value="$$createFirstSimpleProduct.sku$$"/>
<argument name="prodTwoSku" value="$$createSecondSimpleProduct.sku$$"/>
<argument name="optionTitle" value="{{RadioButtonsOption.title}}"/>
<argument name="inputType" value="{{RadioButtonsOption.type}}"/>
</actionGroup>

<!-- Set product in created Website -->
<actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="selectProductInWebsites">
<argument name="website" value="$createWebsite.website[name]$"/>
</actionGroup>

<!-- Save product form -->
<actionGroup ref="saveProductForm" stepKey="saveWithThreeOptions"/>

<!-- Open created product -->
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct">
<argument name="product" value="BundleProduct"/>
</actionGroup>
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct">
<argument name="product" value="BundleProduct"/>
</actionGroup>

<!-- Remove second option -->
<actionGroup ref="deleteBundleOptionByIndex" stepKey="deleteSecondOption">
<argument name="deleteIndex" value="1"/>
</actionGroup>

<!-- Save product form -->
<actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/>
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveWithTwoOptions"/>
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="messageYouSavedTheProductIsShown"/>

<!-- Delete created bundle product -->
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct">
<argument name="product" value="BundleProduct"/>
</actionGroup>
</test>
</tests>