Skip to content

Commit 7dd5fe3

Browse files
committed
MAGETWO-90366: Automate with MFTF tax information recalculation on the shopping cart
1 parent 816145b commit 7dd5fe3

7 files changed

+12
-16
lines changed
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11-
<test name="StorefrontTaxInformationInShoppingCartForCustomerWithDefaultAddressesPhysicalQuoteTest">
11+
<test name="StorefrontTaxInformationInShoppingCartForCustomerPhysicalQuoteTest">
1212
<annotations>
1313
<features value="Tax information in shopping cart for Customer with default addresses (physical quote)"/>
1414
<title value="Tax information are updating/recalculating on fly in shopping cart for Customer with default addresses (physical quote)"/>
@@ -21,7 +21,6 @@
2121
<before>
2222
<!-- Preconditions -->
2323
<!-- Tax Rule is created based on default tax rates (Stores>Tax Rule) US-CA-*-Rate 1 = 8.2500 US-NY-*-Rate 1 = 8.3750 -->
24-
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
2524
<createData entity="SimpleTaxRule" stepKey="createTaxRule"/>
2625
<!-- Fixed Product Tax attribute is created and added to default attribute set -->
2726
<createData entity="productFPTAttribute" stepKey="createProductFPTAttribute"/>
@@ -32,12 +31,15 @@
3231
<createData entity="Tax_Config_NY" stepKey="taxConfigurationNYWithFPTEnable"/>
3332
<!-- Store>Configuration; Sales>Tax FPT Enable -->
3433
<createData entity="WeeeConfigEnable" stepKey="enableFPT"/>
34+
<!-- Customer is created with default addresses: -->
35+
<createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/>
3536
<!-- Simple product is created Price = 10; FPT United States/California/10,United States/New York/20 -->
3637
<createData entity="_defaultCategory" stepKey="createCategory"/>
3738
<createData entity="SimpleProduct" stepKey="createSimpleProduct">
3839
<field key="price">10.00</field>
3940
<requiredEntity createDataKey="createCategory"/>
4041
</createData>
42+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
4143
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct">
4244
<argument name="product" value="$$createSimpleProduct$$"/>
4345
</actionGroup>
@@ -58,8 +60,6 @@
5860
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
5961
<waitForPageLoad stepKey="waitForProductIndexPageLoad"/>
6062
<actionGroup ref="AdminResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/>
61-
<!-- Customer is created with default addresses: -->
62-
<createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/>
6363
</before>
6464
<after>
6565
<deleteData createDataKey="createTaxRule" stepKey="deleteTaxRule"/>
@@ -69,7 +69,6 @@
6969
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
7070
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
7171
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
72-
<actionGroup ref="ClearCacheActionGroup" stepKey="clearCacheAfter"/>
7372
<actionGroup ref="logout" stepKey="logout"/>
7473
</after>
7574
<!-- Test Steps -->
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11-
<test name="StorefrontTaxInformationInShoppingCartForCustomerWithDefaultAddressesVirtualQuoteTest">
11+
<test name="StorefrontTaxInformationInShoppingCartForCustomerVirtualQuoteTest">
1212
<annotations>
1313
<features value="Tax information in shopping cart for Customer with default addresses (virtual quote)"/>
1414
<title value="Tax information are updating/recalculating on fly in shopping cart for Customer with default addresses (virtual quote)"/>
@@ -21,7 +21,6 @@
2121
<before>
2222
<!-- Preconditions -->
2323
<!-- Tax Rule is created based on default tax rates (Stores>Tax Rule) US-CA-*-Rate 1 = 8.2500 US-NY-*-Rate 1 = 8.3750 -->
24-
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
2524
<createData entity="SimpleTaxRule" stepKey="createTaxRule"/>
2625
<!-- Fixed Product Tax attribute is created and added to default attribute set -->
2726
<createData entity="productFPTAttribute" stepKey="createProductFPTAttribute"/>
@@ -43,8 +42,6 @@
4342
<createData entity="DefaultTaxConfig" stepKey="defaultTaxConfiguration"/>
4443
<deleteData createDataKey="createVirtualProduct" stepKey="deleteVirtualProduct"/>
4544
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
46-
<actionGroup ref="ClearCacheActionGroup" stepKey="clearCacheAfter"/>
47-
<actionGroup ref="logout" stepKey="logout"/>
4845
</after>
4946
<!-- Test Steps -->
5047
<!-- Step 1: Go to Storefront as logged in Customer -->

app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
<before>
2222
<!-- Preconditions -->
2323
<!-- Tax Rule is created based on default tax rates (Stores>Tax Rule) US-CA-*-Rate 1 = 8.2500 US-NY-*-Rate 1 = 8.3750 -->
24-
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
2524
<createData entity="SimpleTaxRule" stepKey="createTaxRule"/>
2625
<!-- Fixed Product Tax attribute is created and added to default attribute set -->
2726
<createData entity="productFPTAttribute" stepKey="createProductFPTAttribute"/>
@@ -38,6 +37,7 @@
3837
<field key="price">10.00</field>
3938
<requiredEntity createDataKey="createCategory"/>
4039
</createData>
40+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
4141
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct">
4242
<argument name="product" value="$$createSimpleProduct$$"/>
4343
</actionGroup>
@@ -66,7 +66,6 @@
6666
<createData entity="WeeeConfigDisable" stepKey="disableFPT"/>
6767
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
6868
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
69-
<actionGroup ref="ClearCacheActionGroup" stepKey="clearCacheAfter"/>
7069
<actionGroup ref="logout" stepKey="logout"/>
7170
</after>
7271
<!-- Test Steps -->

app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
<before>
2222
<!-- Preconditions -->
2323
<!-- Tax Rule is created based on default tax rates (Stores>Tax Rule) US-CA-*-Rate 1 = 8.2500 US-NY-*-Rate 1 = 8.3750 -->
24-
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
2524
<createData entity="SimpleTaxRule" stepKey="createTaxRule"/>
2625
<!-- Fixed Product Tax attribute is created and added to default attribute set -->
2726
<createData entity="productFPTAttribute" stepKey="createProductFPTAttribute"/>
@@ -40,8 +39,6 @@
4039
<deleteData createDataKey="createProductFPTAttribute" stepKey="deleteProductFPTAttribute"/>
4140
<createData entity="DefaultTaxConfig" stepKey="defaultTaxConfiguration"/>
4241
<deleteData createDataKey="createVirtualProduct" stepKey="deleteVirtualProduct"/>
43-
<actionGroup ref="ClearCacheActionGroup" stepKey="clearCacheAfter"/>
44-
<actionGroup ref="logout" stepKey="logout"/>
4542
</after>
4643
<!-- Test Steps -->
4744
<!-- Step 1: Go to Storefront as Guest -->

app/code/Magento/Weee/Test/Mftf/ActionGroup/AdminProductAddFPTValueActionGroup.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@
1616
<argument name="valueForFPT" type="string"/>
1717
</arguments>
1818
<click selector="{{AdminProductAddFPTValueSection.addFPT(FPTAttributeCode)}}" stepKey="clickAddFPTButton1"/>
19+
<waitForPageLoad stepKey="waitForProductIndexPageLoad"/>
1920
<selectOption selector="{{AdminProductAddFPTValueSection.selectCountryForFPT(FPTAttributeCode)}}" userInput="{{countryForFPT}}" stepKey="selectcountryForFPT"/>
21+
<waitForPageLoad stepKey="waitForProductIndexPageLoad2"/>
2022
<selectOption selector="{{AdminProductAddFPTValueSection.selectStateForFPT(FPTAttributeCode)}}" userInput="{{stateForFPT}}" stepKey="selectstateForFPT"/>
23+
<waitForPageLoad stepKey="waitForProductIndexPageLoad3"/>
2124
<fillField selector="{{AdminProductAddFPTValueSection.setTaxValueForFPT(FPTAttributeCode)}}" userInput="{{valueForFPT}}" stepKey="setTaxvalueForFPT"/>
25+
<waitForPageLoad stepKey="waitForProductIndexPageLoad4"/>
2226
</actionGroup>
2327
</actionGroups>

app/code/Magento/Weee/Test/Mftf/Data/FixedProductAttributeData.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
1111
<entity name="productFPTAttribute" type="ProductAttribute">
1212
<data key="attribute_code" unique="suffix">attribute</data>
13-
<data key="is_unique">true</data>
13+
<data key="is_unique">false</data>
1414
<data key="frontend_input">weee</data>
1515
<data key="is_used_in_grid">true</data>
1616
<data key="is_visible_in_grid">true</data>

app/code/Magento/Weee/Test/Mftf/Page/AdminProductEditPage.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
11-
<page name="AdminProductEditPage" url="catalog/product/edit/id/{{product_id}}/" area="admin" module="Magento_Catalog">
11+
<page name="AdminProductEditPage" url="catalog/product/edit/id/{{product_id}}/" area="admin" module="Magento_Catalog" parameterized="true">
1212
<section name="AdminProductAddFPTValueSection"/>
1313
</page>
1414
</pages>

0 commit comments

Comments
 (0)