Skip to content

Commit 8f8c253

Browse files
Manoranjan.PrakashManoranjan.Prakash
authored andcommitted
ACQE-4425: [Test case Automation]OnlyXleftNotDisplayedForSimpleProductWithMangeStockAsNoOnTestStockAndMainWebsitesTest
-addressing code review
1 parent e92b739 commit 8f8c253

File tree

4 files changed

+27
-26
lines changed

4 files changed

+27
-26
lines changed

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection/AdminProductFormSection.xml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,7 @@
8383
<element name="newAddedAttributeValue" type="text" selector="//option[contains(@data-title,'{{attributeValue}}')]" parameterized="true"/>
8484
<element name="country_Of_Manufacture" type="select" selector="//td[contains(text(), 'country_of_manufacture')]"/>
8585
<element name="textArea" type="text" selector="//textarea[@name='product[test_custom_attribute]']" timeout="30"/>
86-
<element name="unassignSource" type="button" selector="//span[text()='{{source_name}}']/../../..//button[@class='action-delete']//span[text()='Unassign']" parameterized="true"/>
87-
<element name="btnAssignSources" type="button" selector="//button//span[text()='Assign Sources']/.."/>
88-
<element name="chkSourceToAssign" type="checkbox" selector="//input[@id='idscheck{{source_id}}']/.." parameterized="true"/>
89-
<element name="btnDoneAssignedSources" type="button" selector="//aside[@class='modal-slide product_form_product_form_sources_assign_sources_modal _show']//button[@class='action-primary']//span[text()='Done']/.." />
9086
<element name="assignedSourcesQty" type="input" selector="//input[@name='sources[assigned_sources][0][quantity]']"/>
91-
<element name="searchBySource" type="input" selector="//div[contains(@data-bind,'inventory_source_listing.inventory_source_listing')]/div[2]//input[@placeholder='Search by keyword']"/>
92-
<element name="clickSearch" type="button" selector="//div[contains(@data-bind,'inventory_source_listing.inventory_source_listing')]/div[2]//button[@aria-label='Search']"/>
9387
<element name="btnAdvancedInventory" type="button" selector="//button//span[text()='Advanced Inventory']/.."/>
94-
<element name="checkConfigSettingsAdvancedInventory" type="checkbox" selector="//input[@name='product[stock_data][{{args}}]']/..//label[text()='Use Config Settings']/..//input[@type='checkbox']" parameterized="true"/>
95-
<element name="selectManageStockOption" type="select" selector="//select[@name='product[stock_data][manage_stock]']"/>
96-
<element name="btnDoneAdvancedInventory" type="button" selector="//aside[@class='modal-slide product_form_product_form_advanced_inventory_modal _show']//button[@class='action-primary']//span[text()='Done']/.." />
9788
</section>
9889
</sections>

app/code/Magento/Catalog/Test/Mftf/Test/OnlyXleftNotDisplayedForSimpleProductWithMangeStockAsNoOnTestStockAndMainWebsitesTest.xml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="OnlyXleftNotDisplayedForSimpleProductWithMangeStockAsNoOnTestStockAndMainWebsitesTest">
1212
<annotations>
1313
<features value="Inventory"/>
@@ -77,17 +77,17 @@
7777

7878
<fillField userInput="10" selector="{{AdminProductFormSection.productPrice}}" stepKey="updatePriceTo10"/>
7979
<fillField userInput="1" selector="{{AdminProductFormSection.productWeight}}" stepKey="updateWeight"/>
80-
<conditionalClick selector="{{AdminProductFormSection.unassignSource('Default Source')}}" dependentSelector="{{AdminProductFormSection.unassignSource('Default Source')}}" visible="true" stepKey="unassignDefaultSource"/>
81-
<click selector="{{AdminProductFormSection.btnAssignSources}}" stepKey="clickAssignSourcesButton"/>
82-
<waitForElementVisible selector="{{AdminProductFormSection.searchBySource}}" stepKey="waitForSearchSourceToBeVisible"/>
83-
<fillField userInput="$$createSource.source[source_code]$$" selector="{{AdminProductFormSection.searchBySource}}" stepKey="enterSource"/>
84-
<click selector="{{AdminProductFormSection.clickSearch}}" stepKey="clickSearchButton"/>
85-
<waitForElementVisible selector="{{AdminProductFormSection.chkSourceToAssign('$$createSource.source[source_code]$$')}}" stepKey="waitForAssignsourcesToBeVisible"/>
86-
<checkOption selector="{{AdminProductFormSection.chkSourceToAssign('$$createSource.source[source_code]$$')}}" stepKey="checkTheCreatedSource"/>
87-
<click selector="{{AdminProductFormSection.btnDoneAssignedSources}}" stepKey="clickOnDoneButton"/>
80+
<conditionalClick selector="{{AdminProductFormConfigurationsSection.unAssignSource('Default Source')}}" dependentSelector="{{AdminProductFormConfigurationsSection.unAssignSource('Default Source')}}" visible="true" stepKey="unAssignDefaultSource"/>
81+
<click selector="{{AdminProductFormConfigurationsSection.btnAssignSources}}" stepKey="clickAssignSourcesButton"/>
82+
<waitForElementVisible selector="{{AdminProductFormConfigurationsSection.searchBySource}}" stepKey="waitForSearchSourceToBeVisible"/>
83+
<fillField userInput="$$createSource.source[source_code]$$" selector="{{AdminProductFormConfigurationsSection.searchBySource}}" stepKey="enterSource"/>
84+
<click selector="{{AdminProductFormConfigurationsSection.clickSearch}}" stepKey="clickSearchButton"/>
85+
<waitForElementVisible selector="{{AdminProductFormConfigurationsSection.chkSourceToAssign('$$createSource.source[source_code]$$')}}" stepKey="waitForAssignSourcesToBeVisible"/>
86+
<checkOption selector="{{AdminProductFormConfigurationsSection.chkSourceToAssign('$$createSource.source[source_code]$$')}}" stepKey="checkTheCreatedSource"/>
87+
<click selector="{{AdminProductFormConfigurationsSection.btnDoneAssignedSources}}" stepKey="clickOnDoneButton"/>
8888
<fillField userInput="2" selector="{{AdminProductFormSection.assignedSourcesQty}}" stepKey="setQtyForAssignedSources"/>
8989
<click selector="{{AdminProductFormSection.save}}" stepKey="clickOnSaveButton"/>
90-
<see userInput="You saved the product." stepKey="saveSuccessfulForManagestockAsYes"/>
90+
<see userInput="You saved the product." stepKey="saveSuccessfulForManageStockAsYes"/>
9191

9292
<magentoCLI stepKey="reindexForAssignedSources" command="indexer:reindex"/>
9393
<magentoCLI stepKey="flushCacheForAssignedSources" command="cache:flush"/>
@@ -107,14 +107,14 @@
107107
</actionGroup>
108108
<waitForElementVisible selector="{{AdminProductFormSection.btnAdvancedInventory}}" stepKey="waitForAdvancedInventoryToBeVisible"/>
109109
<click selector="{{AdminProductFormSection.btnAdvancedInventory}}" stepKey="clickOnAdvancedInventoryButton"/>
110-
<waitForElementVisible selector="{{AdminProductFormSection.checkConfigSettingsAdvancedInventory('use_config_manage_stock')}}" stepKey="waitForAdvancedInventoryPageToBeLoaded"/>
111-
<uncheckOption selector="{{AdminProductFormSection.checkConfigSettingsAdvancedInventory('use_config_manage_stock')}}" stepKey="uncheckManageStockOption"/>
112-
<selectOption userInput="No" selector="{{AdminProductFormSection.selectManageStockOption}}" stepKey="selectNoAsManageStock"/>
113-
<click selector="{{AdminProductFormSection.btnDoneAdvancedInventory}}" stepKey="clickOnAdvancedInventoryDoneButton"/>
110+
<waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.checkConfigSettingsAdvancedInventory('use_config_manage_stock')}}" stepKey="waitForAdvancedInventoryPageToBeLoaded"/>
111+
<uncheckOption selector="{{AdminProductFormAdvancedInventorySection.checkConfigSettingsAdvancedInventory('use_config_manage_stock')}}" stepKey="uncheckManageStockOption"/>
112+
<selectOption userInput="No" selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" stepKey="selectNoAsManageStock"/>
113+
<click selector="{{AdminProductFormAdvancedInventorySection.doneButton}}" stepKey="clickOnAdvancedInventoryDoneButton"/>
114114
<click selector="{{AdminProductFormSection.save}}" stepKey="clickOnSaveButtonPostSettingManageStockAsNo"/>
115-
<see userInput="You saved the product." stepKey="saveSuccessfulForManagestockAsNo"/>
116-
<magentoCLI stepKey="reindexForSettingManagestockAsNo" command="indexer:reindex"/>
117-
<magentoCLI stepKey="flushCacheForSettingManagestockAsNo" command="cache:flush"/>
115+
<see userInput="You saved the product." stepKey="saveSuccessfulForManageStockAsNo"/>
116+
<magentoCLI stepKey="reindexForSettingManageStockAsNo" command="indexer:reindex"/>
117+
<magentoCLI stepKey="flushCacheForSettingManageStockAsNo" command="cache:flush"/>
118118

119119
<!-- Verify with Manage Stock set as No for the product -->
120120
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPageOnStorefrontForManageStockAsNo">

app/code/Magento/CatalogInventory/Test/Mftf/Section/AdminProductFormAdvancedInventorySection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,7 @@
3636
<element name="maxiQtyAllowedInCartError" type="text" selector="[name='product[stock_data][max_sale_qty]'] + label.admin__field-error"/>
3737
<element name="backorders" type="select" selector="//*[@name='product[stock_data][backorders]']"/>
3838
<element name="useConfigSettingsForBackorders" type="checkbox" selector="//input[@name='product[stock_data][use_config_backorders]']"/>
39+
<element name="checkConfigSettingsAdvancedInventory" type="checkbox" selector="//input[@name='product[stock_data][{{args}}]']/..//label[text()='Use Config Settings']/..//input[@type='checkbox']" parameterized="true"/>
40+
<element name="selectManageStockOption" type="select" selector="//select[@name='product[stock_data][manage_stock]']"/>
3941
</section>
4042
</sections>

app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection/AdminProductFormConfigurationsSection.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,13 @@
5353
<element name="fileUploaderInput" type="file" selector="//input[@type='file' and @class='file-uploader-input']"/>
5454
<element name="variationImageSource" type="text" selector="[data-index='configurable-matrix'] [data-index='thumbnail_image_container'] img[src*='{{imageName}}']" parameterized="true"/>
5555
<element name="variationProductLinkByName" type="text" selector="//div[@data-index='configurable-matrix']//*[@data-index='name_container']//a[contains(text(), '{{productName}}')]" parameterized="true"/>
56+
<element name="unAssignSource" type="button" selector="//span[text()='{{source_name}}']/../../..//button[@class='action-delete']//span[text()='Unassign']" parameterized="true"/>
57+
<element name="btnAssignSources" type="button" selector="//button//span[text()='Assign Sources']/.."/>
58+
<element name="chkSourceToAssign" type="checkbox" selector="//input[@id='idscheck{{source_id}}']/.." parameterized="true"/>
59+
<element name="btnDoneAssignedSources" type="button" selector="//aside[@class='modal-slide product_form_product_form_sources_assign_sources_modal _show']//button[@class='action-primary']//span[text()='Done']/.." />
60+
<element name="searchBySource" type="input" selector="//div[contains(@data-bind,'inventory_source_listing.inventory_source_listing')]/div[2]//input[@placeholder='Search by keyword']"/>
61+
<element name="clickSearch" type="button" selector="//div[contains(@data-bind,'inventory_source_listing.inventory_source_listing')]/div[2]//button[@aria-label='Search']"/>
62+
<element name="btnDoneAdvancedInventory" type="button" selector="//aside[@class='modal-slide product_form_product_form_advanced_inventory_modal _show']//button[@class='action-primary']//span[text()='Done']/.." />
63+
5664
</section>
5765
</sections>

0 commit comments

Comments
 (0)