Skip to content

Commit

Permalink
Merge pull request magento#1040 from magento-engcom/MSI-933
Browse files Browse the repository at this point in the history
MSI-933: [Configuration-Sources] Pagination worked in Manage Sources grid - Admin user
  • Loading branch information
maghamed authored May 10, 2018
2 parents d2abcc3 + 417d393 commit 00e1a58
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<section name="AdminEditSourceContactInfoSection"/>
<section name="AdminEditSourceAddressDataSection"/>
<section name="AdminEditSourceCarriersSection"/>
<section name="AdminManageSourcesGridBody"/>
<section name="AdminManageSourcesGridControls"/>
<section name="AdminManageSourcesGridFilterControls"/>
<section name="AdminManageSourcesGridColumnControls"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
<section name="AdminManageSourcesGridBody">
<element name="dataRows" type="input" selector=".data-row"/>
</section>
<section name="AdminManageSourcesGridControls">
<element name="addNewSource" type="button" selector="#add" timeout="30"/>
<element name="done" type="button" selector=".page-main-actions button.action-primary" timeout="10"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?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="AdminPaginationWorkedInManageSourcesGridTest">
<annotations>
<features value="Multi-Source Inventory"/>
<stories value="Configuration-Sources"/>
<title value="Pagination worked in Manage Sources grid - Admin user"/>
<description value="You should be able to switch between pages on Manage Sources grid"/>
<testCaseId value="933"/>
<severity value="CRITICAL"/>
<group value="msi"/>
</annotations>

<before>
<createData entity="SpecialSourceForAdminPaginationWorkedInManageSourcesGridTest" stepKey="createSource1"/>
<createData entity="SpecialSourceForAdminPaginationWorkedInManageSourcesGridTest" stepKey="createSource2"/>
<createData entity="SpecialSourceForAdminPaginationWorkedInManageSourcesGridTest" stepKey="createSource3"/>
<createData entity="SpecialSourceForAdminPaginationWorkedInManageSourcesGridTest" stepKey="createSource4"/>
<createData entity="SpecialSourceForAdminPaginationWorkedInManageSourcesGridTest" stepKey="createSource5"/>
<createData entity="SpecialSourceForAdminPaginationWorkedInManageSourcesGridTest" stepKey="createSource6"/>
<createData entity="SpecialSourceForAdminPaginationWorkedInManageSourcesGridTest" stepKey="createSource7"/>
<createData entity="SpecialSourceForAdminPaginationWorkedInManageSourcesGridTest" stepKey="createSource8"/>
<createData entity="SpecialSourceForAdminPaginationWorkedInManageSourcesGridTest" stepKey="createSource9"/>
<createData entity="SpecialSourceForAdminPaginationWorkedInManageSourcesGridTest" stepKey="createSource10"/>
<createData entity="SpecialSourceForAdminPaginationWorkedInManageSourcesGridTest" stepKey="createSource11"/>
<createData entity="SpecialSourceForAdminPaginationWorkedInManageSourcesGridTest" stepKey="createSource12"/>
<createData entity="SpecialSourceForAdminPaginationWorkedInManageSourcesGridTest" stepKey="createSource13"/>
<createData entity="SpecialSourceForAdminPaginationWorkedInManageSourcesGridTest" stepKey="createSource14"/>
<createData entity="SpecialSourceForAdminPaginationWorkedInManageSourcesGridTest" stepKey="createSource15"/>
<createData entity="SpecialSourceForAdminPaginationWorkedInManageSourcesGridTest" stepKey="createSource16"/>
<createData entity="SpecialSourceForAdminPaginationWorkedInManageSourcesGridTest" stepKey="createSource17"/>
<createData entity="SpecialSourceForAdminPaginationWorkedInManageSourcesGridTest" stepKey="createSource18"/>
<createData entity="SpecialSourceForAdminPaginationWorkedInManageSourcesGridTest" stepKey="createSource19"/>
<createData entity="SpecialSourceForAdminPaginationWorkedInManageSourcesGridTest" stepKey="createSource20"/>
<createData entity="SpecialSourceForAdminPaginationWorkedInManageSourcesGridTest" stepKey="createSource21"/>
<createData entity="SpecialSourceForAdminPaginationWorkedInManageSourcesGridTest" stepKey="createSource22"/>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/>
</before>

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

<amOnPage url="{{AdminManageSourcePage.url}}" stepKey="amOnTheManageSourcePage"/>
<waitForPageLoad time="30" stepKey="waitForAdminManageSourcePageLoad"/>
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters1"/>
<waitForPageLoad time="30" stepKey="waitFilterCleared"/>
<actionGroup ref="AdminGridFilterSearchResultsByInput" stepKey="filterSearchResults">
<argument name="selector" value="AdminManageSourcesGridFilterControls.code"/>
<argument name="value" value="special_source"/>
</actionGroup>
<waitForPageLoad time="30" stepKey="waitFilterApplied"/>
<actionGroup ref="adminDataGridSelectPerPage" stepKey="select20SourcesPerPage">
<argument name="perPage" value="20"/>
</actionGroup>
<waitForPageLoad time="30" stepKey="waitSelectPerPageApplied"/>
<see selector="{{AdminDataGridPaginationSection.totalPages}}" userInput="2" stepKey="seeTotalPages"/>
<seeNumberOfElements selector="{{AdminManageSourcesGridBody.dataRows}}" userInput="20" stepKey="checkNumberOfRowsOnFirstPage"/>
<click selector="{{AdminDataGridPaginationSection.nextPage}}" stepKey="goToNextPage1"/>
<waitForPageLoad time="30" stepKey="waitNextGridPageOpened"/>
<seeNumberOfElements selector="{{AdminManageSourcesGridBody.dataRows}}" userInput="2" stepKey="checkNumberOfRowsOnSecondPage"/>
<click selector="{{AdminDataGridPaginationSection.previousPage}}" stepKey="goTopreviousPage1"/>
<waitForPageLoad time="30" stepKey="waitPrevGridPageOpened"/>
<seeNumberOfElements selector="{{AdminManageSourcesGridBody.dataRows}}" userInput="20" stepKey="checkNumberOfRowsOnFirstPageAgain"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,14 @@
<data key="postcode">QC G2E 6J5</data>
<data key="use_default_carrier_config">1</data>
</entity>
<!-- Please don't use this entity in your tests otherwise AdminPaginationWorkedInManageSourcesGridTest will fail -->
<entity name="SpecialSourceForAdminPaginationWorkedInManageSourcesGridTest" type="source">
<data key="id_field_name">source_code</data>
<data key="name" unique="suffix">Special Source </data>
<data key="source_code" unique="suffix">special_source_</data>
<data key="enabled">1</data>
<data key="country_id">US</data>
<data key="postcode">90230</data>
<data key="use_default_carrier_config">1</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
<actionGroup name="adminDataGridSelectPerPage">
<arguments>
<argument name="perPage"/>
<argument name="perPage" type="string"/>
</arguments>
<click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/>
<click selector="{{AdminDataGridPaginationSection.perPageOption(perPage)}}" stepKey="selectCustomPerPage"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<actionGroup name="AdminGridFilterSearchResultsByInput">
<arguments>
<argument name="selector"/>
<argument name="value"/>
<argument name="value" type="string"/>
</arguments>

<conditionalClick selector="{{AdminGridFilterControls.clearAll}}" dependentSelector=".admin__data-grid-header[data-bind='afterRender: \$data.setToolbarNode'] .admin__data-grid-filters-current._show" visible="true" stepKey="clearTheFiltersIfPresent"/>
Expand Down

0 comments on commit 00e1a58

Please sign in to comment.