Skip to content

Commit

Permalink
Merge pull request #3654 from magento-tsg/2.3-develop-mftf-pr12
Browse files Browse the repository at this point in the history
[TSG] MFTF for 2.3 (pr12) (2.3.1)
  • Loading branch information
xmav authored Jan 30, 2019
2 parents da1173a + 02b5ff6 commit beb0274
Show file tree
Hide file tree
Showing 11 changed files with 177 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@
<click selector="{{AdminProductFiltersSection.apply}}" stepKey="clickApplyFiltersButton"/>
</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>

<actionGroup name="ClearProductsFilterActionGroup">
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
<waitForPageLoad time="30" stepKey="waitForProductsPageToLoad"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,12 @@
<group value="checkout"/>
</annotations>
<before>
<createData entity="_defaultCategory" stepKey="createCategory"/>
<createData entity="defaultVirtualProduct" stepKey="createVirtualProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>
<createData entity="Simple_US_Customer_CA" stepKey="createCustomer">
<field key="group_id">1</field>
</createData>
<createData entity="VirtualProduct" stepKey="createVirtualProduct"/>
<createData entity="Customer_With_Different_Default_Billing_Shipping_Addresses" stepKey="createCustomer"/>
</before>
<after>
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
<deleteData createDataKey="createVirtualProduct" stepKey="deleteVirtualProduct"/>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
</after>
<!-- Steps -->
Expand All @@ -48,8 +42,8 @@
<actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingcart"/>
<!-- Step 4: Open Estimate Tax section -->
<click selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" stepKey="openEstimateTaxSection"/>
<see selector="{{CheckoutCartSummarySection.country}}" userInput="{{US_Address_CA.country_id}}" stepKey="checkCountry"/>
<see selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{US_Address_CA.state}}" stepKey="checkState"/>
<seeOptionIsSelected selector="{{CheckoutCartSummarySection.country}}" userInput="{{US_Address_CA.country}}" stepKey="checkCountry"/>
<seeOptionIsSelected selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{US_Address_CA.state}}" stepKey="checkState"/>
<scrollTo selector="{{CheckoutCartSummarySection.postcode}}" stepKey="scrollToPostCodeField"/>
<grabValueFrom selector="{{CheckoutCartSummarySection.postcode}}" stepKey="grabTextPostCode"/>
<assertEquals message="Customer postcode is invalid" stepKey="checkCustomerPostcode">
Expand Down
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 @@ -129,6 +129,7 @@
<data key="city">Los Angeles</data>
<data key="state">California</data>
<data key="country_id">US</data>
<data key="country">United States</data>
<data key="postcode">90001</data>
<data key="telephone">512-345-6789</data>
<data key="default_billing">Yes</data>
Expand Down Expand Up @@ -182,4 +183,12 @@
</array>
<data key="state">California</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 @@ -166,4 +166,16 @@
<data key="website_id">0</data>
<requiredEntity type="address">UK_Not_Default_Address</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>
18 changes: 18 additions & 0 deletions app/code/Magento/Store/Test/Mftf/Data/StoreData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,24 @@
<data key="store_type">group</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="staticStore" type="store">
<!--data key="group_id">customStoreGroup.id</data-->
<data key="name">Second Store View</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@
<actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/>
<!-- Step 4: Open Estimate Shipping and Tax section -->
<conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingandTax" />
<see selector="{{CheckoutCartSummarySection.country}}" userInput="{{US_Address_CA.country_id}}" stepKey="checkCustomerCountry" />
<see selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{US_Address_CA.state}}" stepKey="checkCustomerRegion" />
<seeOptionIsSelected selector="{{CheckoutCartSummarySection.country}}" userInput="{{US_Address_CA.country}}" stepKey="checkCustomerCountry" />
<seeOptionIsSelected selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{US_Address_CA.state}}" stepKey="checkCustomerRegion" />
<grabValueFrom selector="{{CheckoutCartSummarySection.postcode}}" stepKey="grabTextPostCode"/>
<assertEquals message="Customer postcode is invalid" stepKey="checkCustomerPostcode">
<expectedResult type="string">{{US_Address_CA.postcode}}</expectedResult>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
<actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/>
<!-- Step 4: Open Estimate Shipping and Tax section -->
<conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingandTax" />
<see selector="{{CheckoutCartSummarySection.country}}" userInput="{{US_Address_NY.country_id}}" stepKey="checkCustomerCountry" />
<see selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{US_Address_NY.state}}" stepKey="checkCustomerRegion" />
<seeOptionIsSelected selector="{{CheckoutCartSummarySection.country}}" userInput="{{US_Address_NY.country}}" stepKey="checkCustomerCountry" />
<seeOptionIsSelected selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{US_Address_NY.state}}" stepKey="checkCustomerRegion" />
<grabValueFrom selector="{{CheckoutCartSummarySection.postcode}}" stepKey="grabTextPostCode"/>
<assertEquals message="Customer postcode is invalid" stepKey="checkCustomerPostcode">
<expectedResult type="string">{{US_Address_NY.postcode}}</expectedResult>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<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"/>
<element name="searchButton" type="button" selector="//button[@data-ui-id='widget-button-1']" timeout="30"/>
<element name="emptyRecordMessage" type="text" selector="//*[@class='empty-text']"/>
<element name="requestPathColumn" type="text" selector="//tr[@data-role='row']['{{var1}}']/td[@data-column='request_path']" parameterized="true"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?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="AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest">
<annotations>
<features value="Url Rewrite"/>
<stories value="Url Rewrites for Multiple Storeviews"/>
<title value="Url Rewrites Correctly Generated for Multiple Storeviews During Product Import"/>
<description value="Check Url Rewrites Correctly Generated for Multiple Storeviews During Product Import."/>
<severity value="CRITICAL"/>
<testCaseId value="MAGETWO-68980"/>
<group value="urlRewrite"/>
</annotations>
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<!-- Create Store View EN -->
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreViewEn">
<argument name="customStore" value="customStoreENNotUnique"/>
</actionGroup>
<!-- Create Store View NL -->
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreViewNl">
<argument name="customStore" value="customStoreNLNotUnique"/>
</actionGroup>
<createData entity="ApiCategory" stepKey="createCategory">
<field key="name">category-admin</field>
</createData>
</before>
<after>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<actionGroup ref="deleteProductByName" stepKey="deleteImportedProduct">
<argument name="sku" value="productformagetwo68980"/>
<argument name="name" value="productformagetwo68980"/>
</actionGroup>
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFiltersIfSet"/>
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreViewEn">
<argument name="customStore" value="customStoreENNotUnique"/>
</actionGroup>
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreViewNl">
<argument name="customStore" value="customStoreNLNotUnique"/>
</actionGroup>
<actionGroup ref="logout" stepKey="logout"/>
</after>
<actionGroup ref="switchCategoryStoreView" stepKey="switchToStoreViewEn">
<argument name="Store" value="customStoreENNotUnique.name"/>
<argument name="CatName" value="$$createCategory.name$$"/>
</actionGroup>
<uncheckOption selector="{{AdminCategoryBasicFieldSection.categoryNameUseDefault}}" stepKey="uncheckUseDefaultValueENStoreView"/>
<fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="category-english" stepKey="changeNameField"/>
<click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="clickOnSectionHeader"/>
<actionGroup ref="ChangeSeoUrlKeyForSubCategory" stepKey="changeSeoUrlKeyENStoreView">
<argument name="value" value="category-english"/>
</actionGroup>
<actionGroup ref="switchCategoryStoreView" stepKey="switchToStoreViewNl">
<argument name="Store" value="customStoreNLNotUnique.name"/>
<argument name="CatName" value="$$createCategory.name$$"/>
</actionGroup>
<uncheckOption selector="{{AdminCategoryBasicFieldSection.categoryNameUseDefault}}" stepKey="uncheckUseDefaultValue1"/>
<fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="category-dutch" stepKey="changeNameFieldNLStoreView"/>
<click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="clickOnSectionHeader2"/>
<actionGroup ref="ChangeSeoUrlKeyForSubCategory" stepKey="changeSeoUrlKeyNLStoreView">
<argument name="value" value="category-dutch"/>
</actionGroup>
<amOnPage url="{{AdminImportIndexPage.url}}" stepKey="navigateToSystemImport"/>
<selectOption selector="{{AdminImportMainSection.entityType}}" userInput="Products" stepKey="selectProductsOption"/>
<waitForElementVisible selector="{{AdminImportMainSection.importBehavior}}" stepKey="waitForImportBehaviorElementVisible"/>
<selectOption selector="{{AdminImportMainSection.importBehavior}}" userInput="Add/Update" stepKey="selectAddUpdateOption"/>
<attachFile selector="{{AdminImportMainSection.selectFileToImport}}" userInput="import_updated.csv" stepKey="attachFileForImport"/>
<click selector="{{AdminImportHeaderSection.checkDataButton}}" stepKey="clickCheckDataButton"/>
<see selector="{{AdminMessagesSection.notice}}" userInput="Checked rows: 3, checked entities: 1, invalid rows: 0, total errors: 0" stepKey="assertNotice"/>
<see selector="{{AdminMessagesSection.successMessage}}" userInput="File is valid! To start import process press &quot;Import&quot; button" stepKey="assertSuccessMessage"/>
<click selector="{{AdminImportMainSection.importButton}}" stepKey="clickImportButton"/>
<see selector="{{AdminMessagesSection.successMessage}}" userInput="Import successfully done" stepKey="assertSuccessMessage1"/>
<see selector="{{AdminMessagesSection.notice}}" userInput="Created: 1, Updated: 0, Deleted: 0" stepKey="assertNotice1"/>
<actionGroup ref="SearchForProductOnBackendByNameActionGroup" stepKey="searchForProductOnBackend">
<argument name="productName" value="productformagetwo68980"/>
</actionGroup>
<click selector="{{AdminProductGridSection.productRowBySku('productformagetwo68980')}}" stepKey="clickOnProductRow"/>
<grabFromCurrentUrl regex="~/id/(\d+)/~" stepKey="grabProductIdFromUrl"/>
<amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="goToUrlRewritesIndexPage"/>

<fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="category-english.html" stepKey="inputCategoryUrlForENStoreView"/>
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearchButton"/>
<seeElement selector="{{AdminUrlRewriteIndexSection.requestPathColumnValue('category-english.html')}}" stepKey="seeUrlInRequestPathColumn"/>
<seeElement selector="{{AdminUrlRewriteIndexSection.targetPathColumnValue(catalog/category/view/id/$$createCategory.id$$)}}" stepKey="seeUrlInTargetPathColumn"/>

<fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="category-dutch.html" stepKey="inputCategoryUrlForNLStoreView"/>
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearchButton1"/>
<seeElement selector="{{AdminUrlRewriteIndexSection.requestPathColumnValue('category-dutch.html')}}" stepKey="seeUrlInRequestPathColumn1"/>
<seeElement selector="{{AdminUrlRewriteIndexSection.targetPathColumnValue(catalog/category/view/id/$$createCategory.id$$)}}" stepKey="seeUrlInTargetPathColumn1"/>

<fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="productformagetwo68980-english.html" stepKey="inputProductUrlForENStoreView"/>
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearchButton2"/>
<seeElement selector="{{AdminUrlRewriteIndexSection.requestPathColumnValue('productformagetwo68980-english.html')}}" stepKey="seeUrlInRequestPathColumn2"/>
<seeElement selector="{{AdminUrlRewriteIndexSection.targetPathColumnValue('catalog/product/view/id/$grabProductIdFromUrl')}}" stepKey="seeUrlInTargetPathColumn2"/>

<fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="productformagetwo68980-dutch.html" stepKey="inputProductUrlForENStoreView1"/>
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearchButton3"/>
<seeElement selector="{{AdminUrlRewriteIndexSection.requestPathColumnValue('productformagetwo68980-dutch.html')}}" stepKey="seeUrlInRequestPathColumn3"/>
<seeElement selector="{{AdminUrlRewriteIndexSection.targetPathColumnValue('catalog/product/view/id/$grabProductIdFromUrl')}}" stepKey="seeUrlInTargetPathColumn3"/>

<fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="category-english/productformagetwo68980-english.html" stepKey="inputProductUrlForENStoreView2"/>
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearchButton4"/>
<seeElement selector="{{AdminUrlRewriteIndexSection.requestPathColumnValue('category-english/productformagetwo68980-english.html')}}" stepKey="seeUrlInRequestPathColumn4"/>
<seeElement selector="{{AdminUrlRewriteIndexSection.targetPathColumnValue(catalog/product/view/id/$grabProductIdFromUrl/category/$$createCategory.id$$)}}" stepKey="seeUrlInTargetPathColumn4"/>

<fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="category-dutch/productformagetwo68980-dutch.html" stepKey="inputProductUrlForENStoreView3"/>
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearchButton5"/>
<seeElement selector="{{AdminUrlRewriteIndexSection.requestPathColumnValue('category-dutch/productformagetwo68980-dutch.html')}}" stepKey="seeUrlInRequestPathColumn5"/>
<seeElement selector="{{AdminUrlRewriteIndexSection.targetPathColumnValue(catalog/product/view/id/$grabProductIdFromUrl/category/$$createCategory.id$$)}}" stepKey="seeUrlInTargetPathColumn5"/>
</test>
</tests>
4 changes: 4 additions & 0 deletions dev/tests/acceptance/tests/_data/import_updated.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
product_websites,store_view_code,attribute_set_code,product_type,categories,sku,price,name,url_key
base,,Default,simple,Default Category/category-admin,productformagetwo68980,123,productformagetwo68980,productformagetwo68980
,en,Default,simple,,productformagetwo68980,,productformagetwo68980-english,productformagetwo68980-english
,nl,Default,simple,,productformagetwo68980,,productformagetwo68980-dutch,productformagetwo68980-dutch
Loading

0 comments on commit beb0274

Please sign in to comment.