Skip to content

Commit

Permalink
Merge pull request #3648 from magento-tsg/2.2-develop-mftf-pr13
Browse files Browse the repository at this point in the history
[TSG] MFTF for 2.2 (pr13) (2.2-develop)
  • Loading branch information
Alexander Akimov authored Jan 28, 2019
2 parents b10cee9 + 7757a26 commit 7a3ee17
Show file tree
Hide file tree
Showing 16 changed files with 277 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
<element name="save" type="button" selector="#save" timeout="30"/>
<element name="delete" type="button" selector="#delete"/>
<element name="add" type="button" selector="#add" timeout="30"/>
<element name="back" type="button" selector="#back" timeout="30"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
*/
-->

<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">
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminMessagesSection">
<element name="test" type="input" selector=".test"/>
<element name="success" type="text" selector="#messages div.message-success"/>
<element name="successMessageByIndex" type="text" selector=".message.message-success.success:nth-of-type({{n}})>div" parameterized="true"/>
<element name="error" type="text" selector="#messages div.message-error"/>
<element name="notice" type="text" selector=".message.message-notice.notice"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial2"/>
</actionGroup>

<actionGroup name="DeleteProductByName" extends="deleteProductUsingProductGrid">
<arguments>
<argument name="product" type="string"/>
</arguments>
<remove keyForRemoval="fillProductSkuFilter"/>
<fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product}}" stepKey="fillProductSkuFilter" after="openProductFilters"/>
<remove keyForRemoval="seeProductSkuInGrid"/>
<see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="{{product}}" stepKey="seeProductNameInGrid" after="clickApplyFilters"/>
</actionGroup>

<!--Disabled a product by filtering grid and using change status action-->
<actionGroup name="ChangeStatusProductUsingProductGridActionGroup">
<arguments>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-->

<actionGroups 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/actionGroupSchema.xsd">
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="SearchForProductOnBackendActionGroup">
<arguments>
<argument name="product" defaultValue="product"/>
Expand All @@ -19,4 +19,11 @@
<fillField stepKey="fillSkuFieldOnFiltersSection" userInput="{{product.sku}}" selector="{{AdminProductFiltersSection.SkuInput}}"/>
<click stepKey="clickApplyFiltersButton" selector="{{AdminProductFiltersSection.Apply}}"/>
</actionGroup>
<actionGroup name="SearchForProductOnBackendByNameActionGroup" extends="SearchForProductOnBackendActionGroup">
<arguments>
<argument name="productName" type="string"/>
</arguments>
<remove keyForRemoval="fillSkuFieldOnFiltersSection"/>
<fillField userInput="{{productName}}" selector="{{AdminProductFiltersSection.NameInput}}" after="cleanFiltersIfTheySet" stepKey="fillNameFieldOnFiltersSection"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,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">
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminProductGridSection">
<element name="productRowBySku" type="block" selector="//div[@id='container']//tr//td[count(../../..//th[./*[.='SKU']]/preceding-sibling::th) + 1][./*[.='{{sku}}']]" parameterized="true" />
<element name="loadingMask" type="text" selector=".admin__data-grid-loading-mask[data-component*='product_listing']"/>
<element name="columnHeader" type="button" selector="//div[@data-role='grid-wrapper']//table[contains(@class, 'data-grid')]/thead/tr/th[contains(@class, 'data-grid-th')]/span[text() = '{{label}}']" parameterized="true" timeout="30"/>
<element name="productGridElement1" type="input" selector="#addselector" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?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="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="StorefrontShoppingCartCheckCustomerDefaultShippingAddressForVirtualQuoteTest">
<annotations>
<features value="Checkout"/>
<stories value="Checkout via the Storefront"/>
<title value="Estimator in Shopping cart must be pre-filled by Customer default shipping address for virtual quote"/>
<description value="Estimator in Shopping cart must be pre-filled by Customer default shipping address for virtual quote"/>
<severity value="CRITICAL"/>
<testCaseId value="MAGETWO-78596"/>
<group value="checkout"/>
</annotations>
<before>
<createData entity="VirtualProduct" stepKey="createVirtualProduct"/>
<createData entity="Customer_With_Different_Default_Billing_Shipping_Addresses" stepKey="createCustomer"/>
</before>
<after>
<actionGroup ref="CustomerLogoutStorefrontActionGroup" stepKey="customerLogout"/>
<deleteData createDataKey="createVirtualProduct" stepKey="deleteVirtualProduct"/>
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
</after>
<!-- Steps -->
<!-- Step 1: Go to Storefront as Customer -->
<actionGroup ref="CustomerLoginOnStorefront" stepKey="customerLogin">
<argument name="customer" value="$$createCustomer$$" />
</actionGroup>
<!-- Step 2: Add virtual product to cart -->
<amOnPage url="{{StorefrontProductPage.url($$createVirtualProduct.custom_attributes[url_key]$)}}" stepKey="amOnPage"/>
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart">
<argument name="product" value="$$createVirtualProduct$$"/>
<argument name="productCount" value="1"/>
</actionGroup>
<!-- Step 3: Go to Shopping Cart -->
<actionGroup ref="StorefrontViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingcart"/>
<!-- Step 4: Open Estimate Tax section -->
<click selector="{{StorefrontCheckoutCartSummarySection.estimateShippingAndTax}}" stepKey="openEstimateTaxSection"/>
<seeOptionIsSelected selector="{{StorefrontCheckoutCartSummarySection.country}}" userInput="{{US_Address_CA.country}}" stepKey="checkCountry"/>
<seeOptionIsSelected selector="{{StorefrontCheckoutCartSummarySection.region}}" userInput="{{US_Address_CA.state}}" stepKey="checkState"/>
<scrollTo selector="{{StorefrontCheckoutCartSummarySection.postcode}}" stepKey="scrollToPostCodeField"/>
<grabValueFrom selector="{{StorefrontCheckoutCartSummarySection.postcode}}" stepKey="grabTextPostCode"/>
<assertEquals message="Customer postcode is invalid" stepKey="checkCustomerPostcode">
<expectedResult type="string">{{US_Address_CA.postcode}}</expectedResult>
<actualResult type="variable">grabTextPostCode</actualResult>
</assertEquals>
</test>
</tests>
9 changes: 9 additions & 0 deletions app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
<data key="state">California</data>
<data key="postcode">90230</data>
<data key="country_id">US</data>
<data key="country">United States</data>
<data key="default_billing">Yes</data>
<data key="default_shipping">Yes</data>
<requiredEntity type="region">RegionCA</requiredEntity>
Expand Down Expand Up @@ -104,4 +105,12 @@
<data key="country">United Kingdom</data>
<data key="telephone">444-44-444-44</data>
</entity>
<entity name="US_Default_Billing_Address_TX" type="address" extends="US_Address_TX">
<data key="default_billing">false</data>
<data key="default_shipping">true</data>
</entity>
<entity name="US_Default_Shipping_Address_CA" type="address" extends="US_Address_CA">
<data key="default_billing">true</data>
<data key="default_shipping">false</data>
</entity>
</entities>
12 changes: 12 additions & 0 deletions app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,16 @@
<data key="website_id">0</data>
<requiredEntity type="address">US_Address_NY</requiredEntity>
</entity>
<entity name="Customer_With_Different_Default_Billing_Shipping_Addresses" type="customer">
<data key="group_id">1</data>
<data key="email" unique="prefix">John.Doe@example.com</data>
<data key="firstname">John</data>
<data key="lastname">Doe</data>
<data key="fullname">John Doe</data>
<data key="password">pwdTest123!</data>
<data key="store_id">0</data>
<data key="website_id">0</data>
<requiredEntity type="address">US_Default_Billing_Address_TX</requiredEntity>
<requiredEntity type="address">US_Default_Shipping_Address_CA</requiredEntity>
</entity>
</entities>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<!--Search grid with keyword search-->
<actionGroup name="AdminFilterCartPriceRuleActionGroup">
<arguments>
<argument name="ruleName"/>
</arguments>
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
<fillField selector="{{AdminCartPriceRulesSection.filterByNameInput}}" userInput="{{ruleName}}" stepKey="filterByName"/>
<click selector="{{AdminCartPriceRulesSection.searchButton}}" stepKey="doFilter"/>
</actionGroup>
</actionGroups>
20 changes: 19 additions & 1 deletion app/code/Magento/Store/Test/Mftf/Data/StoreData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* See COPYING.txt for license details.
*/
-->
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
<entity name="_defaultStore" type="store">
<data key="name">Default Store View</data>
<data key="code">default</data>
Expand Down Expand Up @@ -39,6 +39,24 @@
<data key="store_type">store</data>
<requiredEntity type="storeGroup">customStoreGroup</requiredEntity>
</entity>
<entity name="CustomStoreENNotUnique" type="store">
<data key="name">EN</data>
<data key="code">en</data>
<data key="is_active">1</data>
<data key="store_id">null</data>
<data key="store_action">add</data>
<data key="store_type">store</data>
<requiredEntity type="storeGroup">customStoreGroup</requiredEntity>
</entity>
<entity name="CustomStoreNLNotUnique" type="store">
<data key="name">NL</data>
<data key="code">nl</data>
<data key="is_active">1</data>
<data key="store_id">null</data>
<data key="store_action">add</data>
<data key="store_type">store</data>
<requiredEntity type="storeGroup">customStoreGroup</requiredEntity>
</entity>
<entity name="secondStore" type="store">
<data key="name">Second Store View</data>
<data key="code">second_store_view</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* See COPYING.txt for license details.
*/
-->
<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">
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminNewStoreViewActionsSection">
<element name="backButton" type="button" selector="#back" timeout="30"/>
<element name="delete" type="button" selector="#delete" timeout="30"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-->

<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">
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="StorefrontTaxInformationInShoppingCartForCustomerPhysicalQuoteTest">
<annotations>
<features value="Tax information in shopping cart for Customer with default addresses (physical quote)"/>
Expand Down Expand Up @@ -62,6 +62,7 @@
<actionGroup ref="AdminResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/>
</before>
<after>
<actionGroup ref="CustomerLogoutStorefrontActionGroup" stepKey="customerLogout"/>
<deleteData createDataKey="createTaxRule" stepKey="deleteTaxRule"/>
<deleteData createDataKey="createProductFPTAttribute" stepKey="deleteProductFPTAttribute"/>
<createData entity="DefaultTaxConfig" stepKey="defaultTaxConfiguration"/>
Expand All @@ -87,9 +88,13 @@
<actionGroup ref="StorefrontViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/>
<!-- Step 4: Open Estimate Shipping and Tax section -->
<conditionalClick selector="{{StorefrontCheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{StorefrontCheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingandTax" />
<see selector="{{StorefrontCheckoutCartSummarySection.country}}" userInput="$$createCustomer.country_id$$" stepKey="checkCustomerCountry" />
<see selector="{{StorefrontCheckoutCartSummarySection.region}}" userInput="$$createCustomer.state$$" stepKey="checkCustomerRegion" />
<see selector="{{StorefrontCheckoutCartSummarySection.postcode}}" userInput="$$createCustomer.postcode$$" stepKey="checkCustomerPostcode" />
<seeOptionIsSelected selector="{{StorefrontCheckoutCartSummarySection.country}}" userInput="{{US_Address_CA.country}}" stepKey="checkCustomerCountry" />
<seeOptionIsSelected selector="{{StorefrontCheckoutCartSummarySection.region}}" userInput="{{US_Address_CA.state}}" stepKey="checkCustomerRegion" />
<grabValueFrom selector="{{StorefrontCheckoutCartSummarySection.postcode}}" stepKey="grabTextPostCode"/>
<assertEquals message="Customer postcode is invalid" stepKey="checkCustomerPostcode">
<expectedResult type="string">{{US_Address_CA.postcode}}</expectedResult>
<actualResult type="variable">grabTextPostCode</actualResult>
</assertEquals>
<see selector="{{StorefrontCheckoutCartSummarySection.amountFPT}}" userInput="$10" stepKey="checkAmountFPTCA" />
<see selector="{{StorefrontCheckoutCartSummarySection.taxAmount}}" userInput="$0.83" stepKey="checkTaxAmountCA" />
<scrollTo selector="{{StorefrontCheckoutCartSummarySection.taxSummary}}" stepKey="scrollToTaxSummary" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-->

<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">
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="StorefrontTaxInformationInShoppingCartForCustomerVirtualQuoteTest">
<annotations>
<features value="Tax information in shopping cart for Customer with default addresses (virtual quote)"/>
Expand Down Expand Up @@ -37,6 +37,7 @@
<createData entity="Simple_US_NY_Customer" stepKey="createCustomer"/>
</before>
<after>
<actionGroup ref="CustomerLogoutStorefrontActionGroup" stepKey="customerLogout"/>
<deleteData createDataKey="createTaxRule" stepKey="deleteTaxRule"/>
<deleteData createDataKey="createProductFPTAttribute" stepKey="deleteProductFPTAttribute"/>
<createData entity="DefaultTaxConfig" stepKey="defaultTaxConfiguration"/>
Expand All @@ -59,9 +60,13 @@
<actionGroup ref="StorefrontViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/>
<!-- Step 4: Open Estimate Shipping and Tax section -->
<conditionalClick selector="{{StorefrontCheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{StorefrontCheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingandTax" />
<see selector="{{StorefrontCheckoutCartSummarySection.country}}" userInput="$$createCustomer.country_id$$" stepKey="checkCustomerCountry" />
<see selector="{{StorefrontCheckoutCartSummarySection.region}}" userInput="$$createCustomer.state$$" stepKey="checkCustomerRegion" />
<see selector="{{StorefrontCheckoutCartSummarySection.postcode}}" userInput="$$createCustomer.postcode$$" stepKey="checkCustomerPostcode" />
<seeOptionIsSelected selector="{{StorefrontCheckoutCartSummarySection.country}}" userInput="{{US_Address_NY.country}}" stepKey="checkCustomerCountry" />
<seeOptionIsSelected selector="{{StorefrontCheckoutCartSummarySection.region}}" userInput="{{US_Address_NY.state}}" stepKey="checkCustomerRegion" />
<grabValueFrom selector="{{StorefrontCheckoutCartSummarySection.postcode}}" stepKey="grabTextPostCode"/>
<assertEquals message="Customer postcode is invalid" stepKey="checkCustomerPostcode">
<expectedResult type="string">{{US_Address_NY.postcode}}</expectedResult>
<actualResult type="variable">grabTextPostCode</actualResult>
</assertEquals>
<scrollTo selector="{{StorefrontCheckoutCartSummarySection.taxSummary}}" stepKey="scrollToTaxSummary" />
<click selector="{{StorefrontCheckoutCartSummarySection.taxSummary}}" stepKey="expandTaxSummary"/>
<see selector="{{StorefrontCheckoutCartSummarySection.rate}}" userInput="US-NY-*-Rate 1 (8.375%)" stepKey="checkRateNY" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
-->

<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">
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminUrlRewriteIndexSection">
<element name="requestPathFilter" type="input" selector="#urlrewriteGrid_filter_request_path"/>
<element name="requestPathColumnValue" type="text" selector="//*[@id='urlrewriteGrid']//tbody//td[@data-column='request_path' and normalize-space(.)='{{columnValue}}']" parameterized="true"/>
<element name="targetPathColumnValue" type="text" selector="//*[@id='urlrewriteGrid']//tbody//td[@data-column='target_path' and normalize-space(.)='{{columnValue}}']" parameterized="true"/>
</section>
</sections>
Loading

0 comments on commit 7a3ee17

Please sign in to comment.