Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MFTF: Refactoring admin url rewrite multiple storeviews product import with config turned off test #28457

Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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">
<actionGroup name="AdminChangeCategoryNameOnStoreViewLevelActionGroup">
<annotations>
<description>Updates the Category Name for proper Store View.</description>
</annotations>
<arguments>
<argument name="categoryName" type="string"/>
</arguments>

<uncheckOption selector="{{AdminCategoryBasicFieldSection.categoryNameUseDefault}}"
stepKey="uncheckUseDefaultValue"/>
<fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{categoryName}}"
stepKey="changeNameField"/>
<click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="clickOnSectionHeader"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?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">
<actionGroup name="AssertAdminTargetPathInUrlRewriteGrigActionGroup">
<annotations>
<description>Assert the target path is shown in the URL Rewrite grid.</description>
</annotations>
<arguments>
<argument name="targetPath" type="string"/>
</arguments>

<seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Target Path', targetPath)}}"
stepKey="seeValueInGrid"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?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">
<actionGroup name="AssertAdminTargetPathIsNotFoundInUrlRewriteGrigActionGroup">
<annotations>
<description>Assert the target path is not shown in the URL Rewrite grid.</description>
</annotations>
<arguments>
<argument name="targetPath" type="string"/>
</arguments>

<dontSeeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', targetPath)}}"
stepKey="valueIsNotShownInGrid"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -64,92 +64,124 @@
<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="AdminChangeCategoryNameOnStoreViewLevelActionGroup" stepKey="changeCategoryNameForENStoreView">
<argument name="categoryName" value="categoryenglish"/>
</actionGroup>
<actionGroup ref="ChangeSeoUrlKeyForSubCategoryActionGroup" stepKey="changeSeoUrlKeyENStoreView">
<argument name="value" value="category-english"/>
</actionGroup>
<actionGroup ref="SwitchCategoryStoreViewActionGroup" 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="AdminChangeCategoryNameOnStoreViewLevelActionGroup" stepKey="changeCategoryNameForNLStoreView">
<argument name="categoryName" value="categorydutch"/>
</actionGroup>
<actionGroup ref="ChangeSeoUrlKeyForSubCategoryActionGroup" 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="{{AdminImportValidationMessagesSection.notice}}" userInput="Checked rows: 3, checked entities: 1, invalid rows: 0, total errors: 0" stepKey="assertNotice"/>
<see selector="{{AdminImportValidationMessagesSection.success}}" userInput="File is valid! To start import process press &quot;Import&quot; button" stepKey="assertSuccessMessage"/>
<click selector="{{AdminImportMainSection.importButton}}" stepKey="clickImportButton"/>
<see selector="{{AdminImportValidationMessagesSection.success}}" userInput="Import successfully done" stepKey="assertSuccessMessage1"/>
<see selector="{{AdminImportValidationMessagesSection.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"/>

<!-- Import products with add/update behavior -->
<actionGroup ref="AdminImportProductsWithCheckValidationResultActionGroup" stepKey="importProduct">
<argument name="behavior" value="Add/Update"/>
<argument name="importFile" value="import_updated.csv"/>
<argument name="importNoticeMessage" value="Created: 1, Updated: 0, Deleted: 0"/>
<argument name="validationNoticeMessage" value="Checked rows: 3, checked entities: 1, invalid rows: 0, total errors: 0"/>
</actionGroup>

<!--Filter Product in product page and get the Product ID -->
<actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterProduct">
<argument name="productSku" value="productformagetwo68980"/>
</actionGroup>
<grabFromCurrentUrl regex="~/id/(\d+)/~" stepKey="grabProductIdFromUrl"/>
<amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="goToUrlRewritesIndexPage"/>

<click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters"/>
<fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" userInput="category-english.html" stepKey="inputCategoryUrlForENStoreView"/>
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters"/>
<waitForPageLoad stepKey="waitForPageToLoad"/>
<seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', 'category-english.html')}}" stepKey="seeUrlInRequestPathColumn"/>
<seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Target Path', catalog/category/view/id/$$createCategory.id$$)}}" stepKey="seeUrlInTargetPathColumn"/>
<!-- Open Marketing - SEO & Search - URL Rewrites -->
<actionGroup ref="AdminSearchUrlRewriteByRequestPathActionGroup" stepKey="searchingCategoryUrlRewriteForENStoreView">
<argument name="requestPath" value="category-english.html"/>
</actionGroup>
<actionGroup ref="AssertAdminRequestPathInUrlRewriteGrigActionGroup" stepKey="seeUrlInRequestPathColumnForENStoreView">
<argument name="requestPath" value="category-english.html"/>
</actionGroup>
<actionGroup ref="AssertAdminTargetPathInUrlRewriteGrigActionGroup" stepKey="seeUrlInTargetPathColumnForENStoreView">
<argument name="targetPath" value="catalog/category/view/id/$$createCategory.id$$"/>
</actionGroup>

<click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters1"/>
<fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" userInput="category-dutch.html" stepKey="inputCategoryUrlForNLStoreView"/>
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters1"/>
<waitForPageLoad stepKey="waitForPageToLoad1"/>
<seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', 'category-dutch.html')}}" stepKey="seeUrlInRequestPathColumn1"/>
<seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Target Path', catalog/category/view/id/$$createCategory.id$$)}}" stepKey="seeUrlInTargetPathColumn1"/>
<actionGroup ref="AdminSearchUrlRewriteByRequestPathActionGroup" stepKey="searchingCategoryUrlRewriteForNLStoreView">
<argument name="requestPath" value="category-dutch.html"/>
</actionGroup>
<actionGroup ref="AssertAdminRequestPathInUrlRewriteGrigActionGroup" stepKey="seeUrlInRequestPathColumnForNLStoreView">
<argument name="requestPath" value="category-dutch.html"/>
</actionGroup>
<actionGroup ref="AssertAdminTargetPathInUrlRewriteGrigActionGroup" stepKey="seeUrlInTargetPathColumnForNLStoreView">
<argument name="targetPath" value="catalog/category/view/id/$$createCategory.id$$"/>
</actionGroup>

<click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters2"/>
<fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" userInput="productformagetwo68980-english.html" stepKey="inputProductUrlForENStoreView"/>
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters2"/>
<waitForPageLoad stepKey="waitForPageToLoad2"/>
<seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', 'productformagetwo68980-english.html')}}" stepKey="seeUrlInRequestPathColumn2"/>
<seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Target Path', 'catalog/product/view/id/$grabProductIdFromUrl')}}" stepKey="seeUrlInTargetPathColumn2"/>
<dontSeeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', 'category-english/productformagetwo68980-english.html')}}" stepKey="seeUrlInRequestPathColumn4"/>
<dontSeeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Target Path', catalog/product/view/id/$grabProductIdFromUrl/category/$$createCategory.id$$)}}" stepKey="seeUrlInTargetPathColumn4"/>
<actionGroup ref="AdminSearchUrlRewriteByRequestPathActionGroup" stepKey="searchingProductUrl">
<argument name="requestPath" value="productformagetwo68980-english.html"/>
</actionGroup>
<actionGroup ref="AssertAdminRequestPathInUrlRewriteGrigActionGroup" stepKey="seeRequestPathForProduct">
<argument name="requestPath" value="productformagetwo68980-english.html"/>
</actionGroup>
<actionGroup ref="AssertAdminTargetPathInUrlRewriteGrigActionGroup" stepKey="seeTargetPathForProduct">
<argument name="targetPath" value="catalog/product/view/id/$grabProductIdFromUrl"/>
</actionGroup>
<actionGroup ref="AssertAdminRequestPathIsNotFoundInUrlRewriteGrigActionGroup" stepKey="doNotSeeRequestPathForENStoreView">
<argument name="requestPath" value="category-english/productformagetwo68980-english.html"/>
</actionGroup>
<actionGroup ref="AssertAdminTargetPathIsNotFoundInUrlRewriteGrigActionGroup" stepKey="doNotSeeTargetPathForENStoreView">
<argument name="targetPath" value="catalog/product/view/id/$grabProductIdFromUrl/category/$$createCategory.id$$"/>
</actionGroup>

<click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters3"/>
<fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" userInput="productformagetwo68980-dutch.html" stepKey="inputProductUrlForENStoreView1"/>
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters3"/>
<waitForPageLoad stepKey="waitForPageToLoad3"/>
<seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', 'productformagetwo68980-dutch.html')}}" stepKey="seeUrlInRequestPathColumn3"/>
<seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Target Path', 'catalog/product/view/id/$grabProductIdFromUrl')}}" stepKey="seeUrlInTargetPathColumn3"/>
<dontSeeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', 'category-dutch/productformagetwo68980-dutch.html')}}" stepKey="seeUrlInRequestPathColumn5"/>
<dontSeeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Target Path', catalog/product/view/id/$grabProductIdFromUrl/category/$$createCategory.id$$)}}" stepKey="seeUrlInTargetPathColumn5"/>
<actionGroup ref="AdminSearchUrlRewriteByRequestPathActionGroup" stepKey="searchingProductUrlForNLStoreView">
<argument name="requestPath" value="productformagetwo68980-dutch.html"/>
</actionGroup>
<actionGroup ref="AssertAdminRequestPathInUrlRewriteGrigActionGroup" stepKey="seeRequestPathForProductForNLStoreView">
<argument name="requestPath" value="productformagetwo68980-dutch.html"/>
</actionGroup>
<actionGroup ref="AssertAdminTargetPathInUrlRewriteGrigActionGroup" stepKey="seeTargetPathForProductForNLStoreView">
<argument name="targetPath" value="catalog/product/view/id/$grabProductIdFromUrl"/>
</actionGroup>
<actionGroup ref="AssertAdminRequestPathIsNotFoundInUrlRewriteGrigActionGroup" stepKey="doNotSeeRequestPathForNLStoreView">
<argument name="requestPath" value="category-dutch/productformagetwo68980-dutch.html"/>
</actionGroup>
<actionGroup ref="AssertAdminTargetPathIsNotFoundInUrlRewriteGrigActionGroup" stepKey="doNotSeeTargetPathForNLStoreView">
<argument name="targetPath" value="catalog/product/view/id/$grabProductIdFromUrl/category/$$createCategory.id$$"/>
</actionGroup>

<!-- Switch StoreView -->
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="amOnProduct4Page"/>
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="amOnStoreFrontHomePage"/>
<actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToCustomStoreView">
<argument name="storeView" value="customStoreENNotUnique"/>
</actionGroup>

<amOnPage url="/productformagetwo68980-english.html" stepKey="navigateToProductPage"/>
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="productformagetwo68980-english" stepKey="seeProductName"/>
<amOnPage url="/category-english/productformagetwo68980-english.html" stepKey="navigateToProductPage2"/>
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="productformagetwo68980-english" stepKey="seeProductName2"/>
<!-- Assert Redirects work and Product is present on StoreFront-->
<actionGroup ref="AssertStorefrontProductRedirectActionGroup" stepKey="verifyProductInStoreFrontPage">
<argument name="productName" value="productformagetwo68980-english"/>
<argument name="productSku" value="productformagetwo68980"/>
<argument name="productRequestPath" value="/productformagetwo68980-english.html"/>
</actionGroup>
<actionGroup ref="AssertStorefrontProductRedirectActionGroup" stepKey="verifyProductInStoreFrontPageSecondAttempt">
<argument name="productName" value="productformagetwo68980-english"/>
<argument name="productSku" value="productformagetwo68980"/>
<argument name="productRequestPath" value="/category-english/productformagetwo68980-english.html"/>
</actionGroup>

<!-- Switch StoreView -->
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="amOnProduct4Page2"/>
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="backToHomePage"/>
<actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToCustomStoreView2">
<argument name="storeView" value="customStoreNLNotUnique"/>
</actionGroup>

<amOnPage url="/productformagetwo68980-dutch.html" stepKey="navigateToProductPage3"/>
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="productformagetwo68980-dutch" stepKey="seeProductName3"/>
<amOnPage url="/category-dutch/productformagetwo68980-dutch.html" stepKey="navigateToProductPage4"/>
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="productformagetwo68980-dutch" stepKey="seeProductName4"/>
<!-- Assert Redirects work and Product is present on StoreFront-->
<actionGroup ref="AssertStorefrontProductRedirectActionGroup" stepKey="verifyProductInStoreFrontPageThirdAttempt">
<argument name="productName" value="productformagetwo68980-dutch"/>
<argument name="productSku" value="productformagetwo68980"/>
<argument name="productRequestPath" value="/productformagetwo68980-dutch.html"/>
</actionGroup>
<actionGroup ref="AssertStorefrontProductRedirectActionGroup" stepKey="verifyProductInStoreFrontPageFourthAttempt">
<argument name="productName" value="productformagetwo68980-dutch"/>
<argument name="productSku" value="productformagetwo68980"/>
<argument name="productRequestPath" value="/category-dutch/productformagetwo68980-dutch.html"/>
</actionGroup>
</test>
</tests>