|
5 | 5 | * See COPYING.txt for license details.
|
6 | 6 | */
|
7 | 7 | -->
|
8 |
| - |
9 | 8 | <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
|
10 | 9 | <test name="AdminGenerateUrlRewritesForProductInCategoriesSwitchOffTest">
|
11 | 10 | <annotations>
|
|
18 | 17 | <group value="urlRewrite"/>
|
19 | 18 | </annotations>
|
20 | 19 |
|
21 |
| - <!-- Preconditions--> |
22 | 20 | <before>
|
23 | 21 | <!-- Set the configuration for Generate "category/product" URL Rewrites-->
|
24 | 22 | <comment userInput="Enable config to generate category/product URL Rewrites" stepKey="commentEnableConfig" />
|
25 | 23 | <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 1" stepKey="enableGenerateUrlRewrite"/>
|
26 | 24 | <!--Flush cache-->
|
27 | 25 | <magentoCLI command="cache:flush" stepKey="cleanCache1"/>
|
28 |
| - <!-- Create 4 categories --> |
29 |
| - <createData entity="SimpleSubCategory" stepKey="simpleSubCategory0"/> |
30 |
| - <createData entity="SimpleSubCategory" stepKey="simpleSubCategory1"/> |
31 |
| - <createData entity="SubCategoryWithParent" stepKey="simpleSubCategory2"> |
32 |
| - <requiredEntity createDataKey="simpleSubCategory1"/> |
33 |
| - </createData> |
34 |
| - <createData entity="SubCategoryWithParent" stepKey="simpleSubCategory3"> |
35 |
| - <requiredEntity createDataKey="simpleSubCategory2"/> |
36 |
| - </createData> |
37 |
| - <!-- Create Simple product 1 and assign it to Category 3 and 0 --> |
38 |
| - <createData entity="ApiSimpleProduct" stepKey="createSimpleProduct"> |
39 |
| - <requiredEntity createDataKey="simpleSubCategory3"/> |
40 |
| - <requiredEntity createDataKey="simpleSubCategory0"/> |
| 26 | + |
| 27 | + <actionGroup ref="LoginAsAdmin" stepKey="login"/> |
| 28 | + <createData entity="SimpleSubCategory" stepKey="createCategory"/> |
| 29 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct"> |
| 30 | + <requiredEntity createDataKey="createCategory"/> |
41 | 31 | </createData>
|
42 | 32 | </before>
|
43 | 33 | <after>
|
44 |
| - <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> |
45 |
| - <deleteData createDataKey="simpleSubCategory1" stepKey="deletesimpleSubCategory1"/> |
46 |
| - <deleteData createDataKey="simpleSubCategory0" stepKey="deletesimpleSubCategory0"/> |
47 |
| - <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> |
| 34 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 35 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> |
| 36 | + <actionGroup ref="logout" stepKey="logout"/> |
48 | 37 | </after>
|
49 |
| - <!-- Steps --> |
50 |
| - <!-- 1. Log in to Admin --> |
51 |
| - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
52 |
| - <!-- 2. Open Marketing - SEO & Search - URL Rewrites --> |
| 38 | + |
| 39 | + <!-- 1. Open Marketing - SEO & Search - URL Rewrites --> |
53 | 40 | <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="amOnUrlRewriteIndexPage"/>
|
54 | 41 | <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="$createSimpleProduct.custom_attributes[url_key]$.html" stepKey="inputProductName"/>
|
55 | 42 | <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearchButton"/>
|
56 | 43 | <seeElement selector="{{AdminUrlRewriteIndexSection.requestPathColumnValue($createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeValue1"/>
|
57 |
| - <seeElement selector="{{AdminUrlRewriteIndexSection.requestPathColumnValue($simpleSubCategory0.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeValue2"/> |
58 |
| - <seeElement selector="{{AdminUrlRewriteIndexSection.requestPathColumnValue($simpleSubCategory1.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeValue3"/> |
59 |
| - <seeElement selector="{{AdminUrlRewriteIndexSection.requestPathColumnValue($simpleSubCategory1.custom_attributes[url_key]$/$simpleSubCategory2.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeValue4"/> |
60 |
| - <seeElement selector="{{AdminUrlRewriteIndexSection.requestPathColumnValue($simpleSubCategory1.custom_attributes[url_key]$/$simpleSubCategory2.custom_attributes[url_key]$/$simpleSubCategory3.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeValue5"/> |
61 |
| - |
62 |
| - <!-- 3. Edit Category 2 for Default Store View: --> |
63 |
| - <actionGroup ref="switchCategoryStoreView" stepKey="switchStoreView"> |
64 |
| - <argument name="Store" value="_defaultStore.name"/> |
65 |
| - <argument name="CatName" value="$$simpleSubCategory0.name$$"/> |
66 |
| - </actionGroup> |
67 |
| - <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSeoSection2"/> |
68 |
| - <uncheckOption selector="{{AdminCategorySEOSection.UrlKeyDefaultValueCheckbox}}" stepKey="uncheckRedirect2"/> |
69 |
| - <fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="$simpleSubCategory0.custom_attributes[url_key]$-new" stepKey="changeURLKey"/> |
70 |
| - <checkOption selector="{{AdminCategorySEOSection.UrlKeyRedirectCheckbox}}" stepKey="checkUrlKeyRedirect"/> |
71 |
| - |
72 |
| - <!-- 4. Save Category 2 --> |
73 |
| - <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> |
74 |
| - <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccessMessageAfterSaved"/> |
| 44 | + <seeElement selector="{{AdminUrlRewriteIndexSection.requestPathColumnValue($createCategory.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeValue2"/> |
75 | 45 |
|
76 |
| - <!-- 5. Set the configuration for Generate "category/product" URL Rewrites to No--> |
| 46 | + <!-- 2. Set the configuration for Generate "category/product" URL Rewrites to No--> |
77 | 47 | <amOnPage url="{{CatalogConfigPage.url}}" stepKey="amOnCatalogConfigPage"/>
|
78 | 48 | <conditionalClick selector="{{CatalogSection.seo}}" dependentSelector="{{CatalogSection.CheckIfSeoTabExpand}}" visible="true" stepKey="expandSeoTab" />
|
79 | 49 | <waitForElementVisible selector="{{CatalogSection.GenerateUrlRewrites}}" stepKey="GenerateUrlRewritesSelect"/>
|
|
83 | 53 | <click selector="{{CatalogSection.save}}" stepKey="saveConfig" />
|
84 | 54 | <waitForPageLoad stepKey="waitForSavingSystemConfiguration"/>
|
85 | 55 |
|
86 |
| - <!-- 6. Flush cache--> |
| 56 | + <!-- 3. Flush cache--> |
87 | 57 | <magentoCLI command="cache:flush" stepKey="cleanCache"/>
|
88 | 58 |
|
89 |
| - <!-- 7. Open Marketing - SEO & Search - URL Rewrites --> |
| 59 | + <!-- 4. Open Marketing - SEO & Search - URL Rewrites --> |
90 | 60 | <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="amOnUrlRewriteIndexPage2"/>
|
91 | 61 | <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="$createSimpleProduct.custom_attributes[url_key]$.html" stepKey="inputProductName2"/>
|
92 | 62 | <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearchButton2"/>
|
93 | 63 | <seeElement selector="{{AdminUrlRewriteIndexSection.requestPathColumnValue($createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeInListValue1"/>
|
94 |
| - <dontSeeElement selector="{{AdminUrlRewriteIndexSection.requestPathColumnValue($simpleSubCategory1.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="dontSeeValue2"/> |
95 |
| - <dontSeeElement selector="{{AdminUrlRewriteIndexSection.requestPathColumnValue($simpleSubCategory1.custom_attributes[url_key]$/$simpleSubCategory2.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="dontSeeValue3"/> |
96 |
| - <dontSeeElement selector="{{AdminUrlRewriteIndexSection.requestPathColumnValue($simpleSubCategory1.custom_attributes[url_key]$/$simpleSubCategory2.custom_attributes[url_key]$/$simpleSubCategory3.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="dontSeeValue4"/> |
97 |
| - <seeElement selector="{{AdminUrlRewriteIndexSection.requestPathColumnValue($simpleSubCategory0.custom_attributes[url_key]$-new/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeRedirect2"/> |
| 64 | + <dontSeeElement selector="{{AdminUrlRewriteIndexSection.requestPathColumnValue($createCategory.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="dontSeeValue2"/> |
98 | 65 | </test>
|
99 | 66 | </tests>
|
0 commit comments