Skip to content

Commit b611bae

Browse files
added mftf test
1 parent 3bfc316 commit b611bae

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed

app/code/Magento/Config/Test/Mftf/Data/CountryOptionConfigData.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,13 @@
2121
<entity name="DefaultAdminAccountAllowCountry" type="checkoutTotalFlagZero">
2222
<data key="value">0</data>
2323
</entity>
24+
<entity name="SetAdminAccountAllowCountryToDefaultForDefaultWebsite" type="default_admin_account_country_options_config_for_default_website">
25+
<requiredEntity type="checkoutTotalFlagZero">DefaultAdminAccountAllowCountry</requiredEntity>
26+
</entity>
27+
<entity name="SetAllowedCountryUsConfig">
28+
<data key="path">general/country/allow</data>
29+
<data key="value">US</data>
30+
<data key="scope">websites</data>
31+
<data key="scope_code">base</data>
32+
</entity>
2433
</entities>

app/code/Magento/Config/Test/Mftf/Metadata/SystemConfigCountriesMeta.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,18 @@
3232
</object>
3333
</object>
3434
</operation>
35+
36+
<operation name="DefaultAdminAccountCountryOptionConfigDefaultWebsite" dataType="default_admin_account_country_options_config_for_default_website" type="create" auth="adminFormKey" url="/admin/system_config/save/section/general/website/1/" method="POST">
37+
<object key="groups" dataType="default_admin_account_country_options_config_for_default_website">
38+
<object key="country" dataType="default_admin_account_country_options_config_for_default_website">
39+
<object key="fields" dataType="default_admin_account_country_options_config_for_default_website">
40+
<object key="allow" dataType="default_admin_account_country_options_config_for_default_website">
41+
<object key="inherit" dataType="checkoutTotalFlagZero">
42+
<field key="value">string</field>
43+
</object>
44+
</object>
45+
</object>
46+
</object>
47+
</object>
48+
</operation>
3549
</operations>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminPlaceOrderWhenCountryAllowedOnlyOnCurrentWebsiteScopeTest">
11+
<annotations>
12+
<features value="Customer"/>
13+
<stories value="Customer Order"/>
14+
<title value="Place an order when country allowed only on current website"/>
15+
<description value="Place an order when country allowed only on current website scope"/>
16+
<severity value="MAJOR"/>
17+
<group value="customer"/>
18+
</annotations>
19+
<before>
20+
<magentoCLI command="config:set --scope={{SetAllowedCountryUsConfig.scope}} --scope-code={{SetAllowedCountryUsConfig.scope_code}} {{SetAllowedCountryUsConfig.path}} {{SetAllowedCountryUsConfig.value}}" stepKey="setAllowedCountryUs"/>
21+
<magentoCLI command="config:set {{SetAllowedCountryUsConfig.path}} ''" stepKey="unselectAllCountriesFromAllowedCounties"/>
22+
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/>
23+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
24+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
25+
</before>
26+
<after>
27+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
28+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
29+
<createData entity="DisableAdminAccountAllowCountry" stepKey="setDefaultValueForAllowCountries"/>
30+
<createData entity="SetAdminAccountAllowCountryToDefaultForDefaultWebsite" stepKey="setDefaultValueForAllowCountriesForDefaultWebsites"/>
31+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
32+
</after>
33+
34+
<actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer">
35+
<argument name="customer" value="$createCustomer$"/>
36+
</actionGroup>
37+
<actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToTheOrder">
38+
<argument name="product" value="$createSimpleProduct$"/>
39+
<argument name="productQty" value="2"/>
40+
</actionGroup>
41+
<actionGroup ref="AdminSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/>
42+
<actionGroup ref="AdminOrderClickSubmitOrderActionGroup" stepKey="submitOrder"/>
43+
<actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/>
44+
</test>
45+
</tests>

0 commit comments

Comments
 (0)