Skip to content

Commit 624dedf

Browse files
committed
MAGETWO-86624: [2.2] Allowed countries restriction for a default website is applied to backend customer grid
1 parent ea5b2bd commit 624dedf

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerFiltersSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
<element name="clearFilters" type="button" selector=".admin__data-grid-header button[data-action='grid-filter-reset']" timeout="30"/>
1717
<element name="viewDropdown" type="button" selector=".admin__data-grid-action-bookmarks button.admin__action-dropdown"/>
1818
<element name="countryOptions" type="button" selector=".admin__data-grid-filters select[name=billing_country_id] option"/>
19+
<element name="countryOptionsWithoutEmptyOption" type="button" selector=".admin__data-grid-filters select[name=billing_country_id] option:not([value=''])"/>
1920
</section>
2021
</sections>

app/code/Magento/Customer/Test/Mftf/Test/AllowedCountriesRestrictionApplyOnBackendTest.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
<!--Check that all countries are allowed initially and get amount-->
5757
<amOnPage url="{{AdminConfigurationGeneralSectionPage.url('#general_country-link')}}" stepKey="goToCountryConfigurationSectionPage"/>
58-
<executeJS function="return document.querySelectorAll('{{AdminConfigurationGeneralCountryOptionsSection.allowedCountries}} option').length" stepKey="countriesAmount"/>
58+
<executeJS function="return document.querySelectorAll('{{AdminConfigurationGeneralCountryOptionsSection.allowedCountriesOptions}}').length" stepKey="countriesAmount"/>
5959

6060
<!-- Switch to first website, allow only Canada and set Canada as default country -->
6161
<actionGroup ref="AdminSwitchWebsiteActionGroup" stepKey="adminSwitchWebsite">
@@ -82,7 +82,6 @@
8282
<!--Go to Customers grid and check that filter countries amount is the same as initial allowed countries amount-->
8383
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="goToCustomersGrid"/>
8484
<click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openFiltersSectionOnCustomersGrid"/>
85-
<executeJS function="var len = document.querySelectorAll('{{AdminCustomerFiltersSection.countryOptions}}').length; return len-1;" stepKey="actualCountriesAmount"/>
86-
<assertEquals expected='($countriesAmount)' actual="($actualCountriesAmount)" stepKey="assertCountryAmounts"/>
85+
<seeNumberOfElements userInput="$countriesAmount" selector="{{AdminCustomerFiltersSection.countryOptionsWithoutEmptyOption}}" stepKey="assertCountryAmounts"/>
8786
</test>
8887
</tests>

app/code/Magento/Directory/Test/Mftf/Section/AdminConfigurationGeneralCountryOptionsSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
<element name="countryOptions" type="button" selector="#general_country-head"/>
1818
<element name="countryOptionsOpen" type="button" selector="#general_country-head.open"/>
1919
<element name="topDestinations" type="select" selector="#general_country_destinations"/>
20+
<element name="allowedCountriesOptions" selector="#general_country_allow option"/>
2021
</section>
2122
</sections>

0 commit comments

Comments
 (0)