Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Commit

Permalink
Merge branch 'mftf-cover-notice-bundle' of https://github.com/TomashK…
Browse files Browse the repository at this point in the history
…hamlai/magento2 into mftf-cover-notice-bundle
  • Loading branch information
TomashKhamlai committed Nov 4, 2019
2 parents dac1ea5 + 018a9d6 commit 67f33c4
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 0 deletions.
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,113 @@
<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"/>
<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>

0 comments on commit 67f33c4

Please sign in to comment.