Skip to content

Commit

Permalink
Merge pull request magento#1228 from magento-engcom/mftf_kis
Browse files Browse the repository at this point in the history
Batch of  MFTF tests.
  • Loading branch information
maghamed authored Jun 7, 2018
2 parents b75ce56 + 2593bbb commit 6c609ba
Show file tree
Hide file tree
Showing 20 changed files with 1,479 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
</section>
<section name="AdminEditStockSourcesSection">
<element name="assignSources" type="button" selector="button[data-index='assign_sources_button']" timeout="30"/>
<element name="rowSourceDrag" type="block" selector=".data-row[data-repeat-index='{{arg1}}'] .draggable-handle" parameterized="true"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
<click selector="{{AdminProductSourcesSection.advancedInventory}}" stepKey="clickOnAdvancedInventoryForWhiteConfigurableVariation"/>
<uncheckOption selector="{{AdminAdvancedInventorySection.manageStockUseDefault}}" stepKey="uncheckManageStockSystemValueForWhiteConfigurableVariation"/>
<selectOption selector="{{AdminAdvancedInventorySection.manageStock}}" userInput="No" stepKey="disableManageStockForWhiteConfigurableVariation"/>
<click selector="{{AdminAdvancedInventoryControls.done}}" stepKey="doneWithDisableManageStockForWhiteConfigurableVariation"/>
<click selector="{{AdminAdvancedInventoryControlsSection.done}}" stepKey="doneWithDisableManageStockForWhiteConfigurableVariation"/>
<actionGroup ref="AdminFormSaveAndClose" stepKey="saveAndCloseDisableMangeStockForWhiteConfigurableVariation"/>

<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateBackToAdminProductGridToDisableManageStockForRedConfigurableVariation"/>
Expand All @@ -203,7 +203,7 @@
<click selector="{{AdminProductSourcesSection.advancedInventory}}" stepKey="clickOnAdvancedInventoryForRedConfigurableVariation"/>
<uncheckOption selector="{{AdminAdvancedInventorySection.manageStockUseDefault}}" stepKey="uncheckManageStockSystemValueForRedConfigurableVariation"/>
<selectOption selector="{{AdminAdvancedInventorySection.manageStock}}" userInput="No" stepKey="disableManageStockForRedConfigurableVariation"/>
<click selector="{{AdminAdvancedInventoryControls.done}}" stepKey="doneWithDisableManageStockForRedConfigurableVariation"/>
<click selector="{{AdminAdvancedInventoryControlsSection.done}}" stepKey="doneWithDisableManageStockForRedConfigurableVariation"/>
<actionGroup ref="AdminFormSaveAndClose" stepKey="saveAndCloseDisableMangeStockForRedConfigurableVariation"/>

<comment userInput="Check, configurable product back to category page and has 'In Stock' status on product view page." stepKey="checkConfigurableProductBackOnStorefront"/>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
<test name="AdminManageSourceGridChangeColumnOrderByDragAndDropTest">
<annotations>
<features value="Multi-Source Inventory"/>
<stories value="Column drag and drop changed column order."/>
<title value="Column drag and drop changed column order in Manage Sources grid by Admin user."/>
<description value="Column drag and drop changed column order in Manage Sources grid by Admin user."/>
<testCaseId value="932"/>
<severity value="CRITICAL"/>
<group value="msi"/>
</annotations>

<before>
<createData entity="_minimalSource" stepKey="createCustomSource"/>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<waitForPageLoad stepKey="waitForPageLoadAfterLogin"/>

<amOnPage url="{{AdminManageSourcePage.url}}" stepKey="amOnTheSourcesGridPage"/>
<waitForPageLoad stepKey="waitForTheSourcesGridPageLoad"/>
<click selector="{{AdminGridColumnsControls.columns}}" stepKey="clickOnTheColumnsButton"/>
<click selector="{{AdminGridColumnsControls.reset}}" stepKey="clickOnResetToRestoreDefaultColumns"/>
<click selector="{{AdminGridColumnsControls.cancel}}" stepKey="clickOnCancelToCloseDropdownMenu"/>
</before>
<after>
<dragAndDrop selector1="{{AdminGridHeaders.headerByName('Is Enabled')}}"
selector2="{{AdminGridHeaders.headerByName('Name')}}"
stepKey="dragAndDropIsEnabledColumnToDefaultPosition"/>
<waitForPageLoad time="30" stepKey="waitForMoveConfirmationAfterMoveIsEnabledColumnToDefaultPosition"/>

<!-- Disable source as it can broke single source mode tests. -->
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFiltersForSource"/>
<actionGroup ref="AdminGridFilterSearchResultsByInput" stepKey="filterSearchResultsForSources">
<argument name="selector" value="AdminManageSourcesGridFilterControls.code"/>
<argument name="value" value="$$createCustomSource.source[source_code]$$"/>
</actionGroup>
<click selector="{{AdminGridRow.editByValue($$createCustomSource.source[source_code]$$)}}" stepKey="clickOnEditCustomSource"/>
<waitForPageLoad time="30" stepKey="waitForSourceEditPageLoad"/>
<click selector="{{AdminEditSourceGeneralSection.isEnabledLabel}}" stepKey="clickIsEnabledToDisable"/>
<actionGroup ref="AdminFormSaveAndClose" stepKey="saveAndCloseCustomSource"/>

<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
</after>

<grabMultiple selector="{{AdminGridHeaders.columnsNames}}" stepKey="grabColumnsDefaultOrder" />
<assertEquals stepKey="assertDefaultOrder">
<actualResult type="variable">grabColumnsDefaultOrder</actualResult>
<expectedResult type="array">["Code", "Name", "Is Enabled", "Action"]</expectedResult>
</assertEquals>

<dragAndDrop selector1="{{AdminGridHeaders.headerByName('Code')}}"
selector2="{{AdminGridHeaders.headerByName('Is Enabled')}}"
stepKey="dragAndDroCodepColumn"/>
<waitForPageLoad time="30" stepKey="waitForMoveConfirmationAfterCodeColumnMoved"/>
<grabMultiple selector="{{AdminGridHeaders.columnsNames}}" stepKey="grabColumnsAfterCodeColumnMoved" />
<assertEquals stepKey="assertOrderAfterCodeColumnMoved">
<actualResult type="variable">grabColumnsAfterCodeColumnMoved</actualResult>
<expectedResult type="array">["Name", "Is Enabled", "Code", "Action"]</expectedResult>
</assertEquals>

<dragAndDrop selector1="{{AdminGridHeaders.headerByName('Name')}}"
selector2="{{AdminGridHeaders.headerByName('Is Enabled')}}"
stepKey="dragAndDropNameColumn"/>
<waitForPageLoad time="30" stepKey="waitForMoveConfirmationAfterNameColumnMoved"/>
<grabMultiple selector="{{AdminGridHeaders.columnsNames}}" stepKey="grabColumnsAfterNameColumnMoved" />
<assertEquals stepKey="assertOrderAfterNameColumnMoved">
<actualResult type="variable">grabColumnsAfterNameColumnMoved</actualResult>
<expectedResult type="array">["Is Enabled", "Name", "Code", "Action"]</expectedResult>
</assertEquals>
</test>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
<test name="AdminManageSourceGridColumnsSortingTest">
<annotations>
<features value="Multi-Source Inventory"/>
<stories value="Columns sorting order changed by Admin user"/>
<title value="Columns sorting order changed in Manage Source grid by Admin user"/>
<description value="You should be able to Change Columns Sorting Order in Manage Source grid."/>
<testCaseId value="935"/>
<severity value="CRITICAL"/>
<group value="msi"/>
</annotations>

<before>
<createData entity="SourceForColumnsSortingOrderTestOnly" stepKey="createCustomSource1"/>
<createData entity="SourceForColumnsSortingOrderTestOnly" stepKey="createCustomSource2"/>
<createData entity="SourceForColumnsSortingOrderTestOnly" stepKey="createCustomSource3"/>
<createData entity="SourceForColumnsSortingOrderTestOnly" stepKey="createCustomSource4"/>

<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
</before>
<after>
<!-- Disable source as it can broke single source mode tests. -->
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFiltersForSourceToDisableCustomSource1"/>
<actionGroup ref="AdminGridFilterSearchResultsByInput" stepKey="filterSearchResultsForSourcesToDisableCustomSource1">
<argument name="selector" value="AdminManageSourcesGridFilterControls.code"/>
<argument name="value" value="$$createCustomSource1.source[source_code]$$"/>
</actionGroup>
<click selector="{{AdminGridRow.editByValue($$createCustomSource1.source[source_code]$$)}}" stepKey="clickOnEditCustomSourceToDisableCustomSource1"/>
<waitForPageLoad time="30" stepKey="waitForSourceEditPageLoadToDisableCustomSource1"/>
<click selector="{{AdminEditSourceGeneralSection.isEnabledLabel}}" stepKey="clickIsEnabledToDisableCustomSource1"/>
<actionGroup ref="AdminFormSaveAndClose" stepKey="saveAndCloseCustomSourceToDisableCustomSource1"/>

<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFiltersForSourceToDisableCustomSource2"/>
<actionGroup ref="AdminGridFilterSearchResultsByInput" stepKey="filterSearchResultsForSourcesToDisableCustomSource2">
<argument name="selector" value="AdminManageSourcesGridFilterControls.code"/>
<argument name="value" value="$$createCustomSource2.source[source_code]$$"/>
</actionGroup>
<click selector="{{AdminGridRow.editByValue($$createCustomSource2.source[source_code]$$)}}" stepKey="clickOnEditCustomSourceToDisableCustomSource2"/>
<waitForPageLoad time="30" stepKey="waitForSourceEditPageLoadToDisableCustomSource2"/>
<click selector="{{AdminEditSourceGeneralSection.isEnabledLabel}}" stepKey="clickIsEnabledToDisableCustomSource2"/>
<actionGroup ref="AdminFormSaveAndClose" stepKey="saveAndCloseCustomSourceToDisableCustomSource2"/>

<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFiltersForSourceToDisableCustomSource3"/>
<actionGroup ref="AdminGridFilterSearchResultsByInput" stepKey="filterSearchResultsForSourcesToDisableCustomSource3">
<argument name="selector" value="AdminManageSourcesGridFilterControls.code"/>
<argument name="value" value="$$createCustomSource3.source[source_code]$$"/>
</actionGroup>
<click selector="{{AdminGridRow.editByValue($$createCustomSource3.source[source_code]$$)}}" stepKey="clickOnEditCustomSourceToDisableCustomSource3"/>
<waitForPageLoad time="30" stepKey="waitForSourceEditPageLoadToDisableCustomSource3"/>
<click selector="{{AdminEditSourceGeneralSection.isEnabledLabel}}" stepKey="clickIsEnabledToDisableCustomSource3"/>
<actionGroup ref="AdminFormSaveAndClose" stepKey="saveAndCloseCustomSourceToDisableCustomSource3"/>

<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFiltersForSourceToDisableCustomSource4"/> <actionGroup ref="AdminGridFilterSearchResultsByInput" stepKey="filterSearchResultsForSourcesToDisableCustomSource4">
<argument name="selector" value="AdminManageSourcesGridFilterControls.code"/>
<argument name="value" value="$$createCustomSource4.source[source_code]$$"/>
</actionGroup>
<click selector="{{AdminGridRow.editByValue($$createCustomSource4.source[source_code]$$)}}" stepKey="clickOnEditCustomSourceToDisableCustomSource4"/>
<waitForPageLoad time="30" stepKey="waitForSourceEditPageLoadToDisableCustomSource4"/>
<click selector="{{AdminEditSourceGeneralSection.isEnabledLabel}}" stepKey="clickIsEnabledToDisableCustomSource4"/>
<actionGroup ref="AdminFormSaveAndClose" stepKey="saveAndCloseCustomSourceToDisableCustomSource4"/>

<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
</after>

<amOnPage url="{{AdminManageSourcePage.url}}" stepKey="amOnTheSourcesGridPage"/>
<waitForPageLoad time="30" stepKey="waitForSourceGridPageLoad"/>

<actionGroup ref="AdminGridFilterSearchResultsByInput" stepKey="filterSearchResults">
<argument name="selector" value="AdminManageSourcesGridFilterControls.code"/>
<argument name="value" value="source_for_columns_sorting_test_only"/>
</actionGroup>
<waitForPageLoad time="30" stepKey="waitForFilterApplied"/>

<comment userInput="Reset sorting for Code to avoid wrong behavior" stepKey="resetSortingForCodeComment"/>
<click selector="{{AdminGridHeaders.headerByName('Name')}}" stepKey="clickOnNameHeaderToResetSorting"/>
<waitForPageLoad time="10" stepKey="waitForSourceGridPageLoadAfterResetSorting"/>

<comment userInput="Ascend sorting for Code" stepKey="ascendSortingForCodeComment"/>
<click selector="{{AdminGridHeaders.headerByName('Code')}}" stepKey="clickOnCodeHeaderToSetAscendSorting"/>
<waitForPageLoad time="10" stepKey="waitForSourceGridPageLoadAfterSettingAscendSortingForCode"/>
<see userInput="$$createCustomSource1.source[return]$$" selector="{{AdminGridRow.rowByIndex('0')}}" stepKey="seeCustomSource1CodeInRow1WhenAscendSorting"/>
<see userInput="$$createCustomSource2.source[return]$$" selector="{{AdminGridRow.rowByIndex('1')}}" stepKey="seeCustomSource2CodeInRow2WhenAscendSorting"/>
<see userInput="$$createCustomSource3.source[return]$$" selector="{{AdminGridRow.rowByIndex('2')}}" stepKey="seeCustomSource3CodeInRow3WhenAscendSorting"/>
<see userInput="$$createCustomSource4.source[return]$$" selector="{{AdminGridRow.rowByIndex('3')}}" stepKey="seeCustomSource4CodeInRow4WhenAscendSorting"/>

<comment userInput="Descend sorting for Code" stepKey="descendSortingForCodeComment"/>
<click selector="{{AdminGridHeaders.headerByName('Code')}}" stepKey="clickOnCodeHeaderToSetDescendSorting"/>
<waitForPageLoad time="10" stepKey="waitForSourceGridPageLoadAfterSettingDescendSortingForCode"/>
<see userInput="$$createCustomSource4.source[return]$$" selector="{{AdminGridRow.rowByIndex('0')}}" stepKey="seeCustomSource4CodeInRow1WhenDescendSorting"/>
<see userInput="$$createCustomSource3.source[return]$$" selector="{{AdminGridRow.rowByIndex('1')}}" stepKey="seeCustomSource3CodeInRow2WhenDescendSorting"/>
<see userInput="$$createCustomSource2.source[return]$$" selector="{{AdminGridRow.rowByIndex('2')}}" stepKey="seeCustomSource2CodeInRow3WhenDescendSorting"/>
<see userInput="$$createCustomSource1.source[return]$$" selector="{{AdminGridRow.rowByIndex('3')}}" stepKey="seeCustomSource1CodeInRow4WhenDescendSorting"/>

<comment userInput="Ascend sorting for Name" stepKey="ascendSortingForNameComment"/>
<click selector="{{AdminGridHeaders.headerByName('Name')}}" stepKey="clickOnNameHeaderToSetAscendSorting"/>
<waitForPageLoad time="10" stepKey="waitForSourceGridPageLoadAfterSettingAscendSortingForName"/>
<see userInput="$$createCustomSource1.source[name]$$" selector="{{AdminGridRow.rowByIndex('0')}}" stepKey="seeCustomSource1NameInRow1WhenAscendSorting"/>
<see userInput="$$createCustomSource2.source[name]$$" selector="{{AdminGridRow.rowByIndex('1')}}" stepKey="seeCustomSource2NameInRow2WhenAscendSorting"/>
<see userInput="$$createCustomSource3.source[name]$$" selector="{{AdminGridRow.rowByIndex('2')}}" stepKey="seeCustomSource3NameInRow3WhenAscendSorting"/>
<see userInput="$$createCustomSource4.source[name]$$" selector="{{AdminGridRow.rowByIndex('3')}}" stepKey="seeCustomSource4NameInRow4WhenAscendSorting"/>

<comment userInput="Descend sorting for Name" stepKey="descendSortingForNameComment"/>
<click selector="{{AdminGridHeaders.headerByName('Name')}}" stepKey="clickOnNameHeaderToSetDescendSorting"/>
<waitForPageLoad time="10" stepKey="waitForSourceGridPageLoadAfterSettingDescendSortingForName"/>
<see userInput="$$createCustomSource4.source[name]$$" selector="{{AdminGridRow.rowByIndex('0')}}" stepKey="seeCustomSource4NameInRow1WhenDescendSorting"/>
<see userInput="$$createCustomSource3.source[name]$$" selector="{{AdminGridRow.rowByIndex('1')}}" stepKey="seeCustomSource3NameInRow2WhenDescendSorting"/>
<see userInput="$$createCustomSource2.source[name]$$" selector="{{AdminGridRow.rowByIndex('2')}}" stepKey="seeCustomSource2NameInRow3WhenDescendSorting"/>
<see userInput="$$createCustomSource1.source[name]$$" selector="{{AdminGridRow.rowByIndex('3')}}" stepKey="seeCustomSource1NameInRow4WhenDescendSorting"/>
</test>
</tests>
Loading

0 comments on commit 6c609ba

Please sign in to comment.