|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + /** |
| 4 | + * Copyright © Magento, Inc. All rights reserved. |
| 5 | + * See COPYING.txt for license details. |
| 6 | + */ |
| 7 | +--> |
| 8 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="AdminUrlForProductRewrittenCorrectlyTest"> |
| 11 | + <annotations> |
| 12 | + <features value="CatalogUrlRewrite"/> |
| 13 | + <stories value="Url rewrites for products"/> |
| 14 | + <title value="Check that URL for product rewritten correctly"/> |
| 15 | + <description value="Check that URL for product rewritten correctly"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="MC-13913"/> |
| 18 | + <useCaseId value="MAGETWO-73534"/> |
| 19 | + <group value="catalog"/> |
| 20 | + <group value="catalogUrlRewrite"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <!--Create product--> |
| 24 | + <createData entity="_defaultCategory" stepKey="category"/> |
| 25 | + <createData entity="ApiSimpleProduct" stepKey="createProduct"> |
| 26 | + <requiredEntity createDataKey="category"/> |
| 27 | + </createData> |
| 28 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 29 | + </before> |
| 30 | + <after> |
| 31 | + <!--Delete created data--> |
| 32 | + <deleteData createDataKey="createProduct" stepKey="deleteSimpleProduct"/> |
| 33 | + <deleteData createDataKey="category" stepKey="deleteCategory"/> |
| 34 | + <actionGroup ref="logout" stepKey="logout"/> |
| 35 | + </after> |
| 36 | + |
| 37 | + |
| 38 | + <!--Open Created product--> |
| 39 | + <amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="openProductEditPage"/> |
| 40 | + <!--Switch to Default Store view--> |
| 41 | + <actionGroup ref="SwitchToTheNewStoreView" stepKey="selectDefaultStoreView"> |
| 42 | + <argument name="storeViewName" value="_defaultStore"/> |
| 43 | + </actionGroup> |
| 44 | + |
| 45 | + <!--Set use default url--> |
| 46 | + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSearchEngineOptimizationTab"/> |
| 47 | + <waitForElementVisible selector="{{AdminProductSEOSection.useDefaultUrl}}" time="30" stepKey="waitForUseDefaultUrlCheckbox"/> |
| 48 | + <uncheckOption selector="{{AdminProductSEOSection.useDefaultUrl}}" stepKey="uncheckUseDefaultUrlCheckbox"/> |
| 49 | + <fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="$$createProduct.custom_attributes[url_key]$$-updated" stepKey="changeUrlKey"/> |
| 50 | + <actionGroup ref="saveProductForm" stepKey="saveProduct"/> |
| 51 | + |
| 52 | + <!--Select product and go toUpdate Attribute page--> |
| 53 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="openProductsGrid"/> |
| 54 | + <actionGroup ref="filterProductGridBySku" stepKey="filterGridBySku"> |
| 55 | + <argument name="product" value="$$createProduct$$"/> |
| 56 | + </actionGroup> |
| 57 | + <click selector="{{AdminProductFiltersSection.allCheckbox}}" stepKey="selectFilteredProduct"/> |
| 58 | + <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> |
| 59 | + <click selector="{{AdminProductGridSection.bulkActionOption('Update attributes')}}" stepKey="clickBulkUpdateAttributes"/> |
| 60 | + <waitForPageLoad stepKey="waitForUpdateAttributesPageLoad"/> |
| 61 | + <seeInCurrentUrl url="{{AdminProductUpdateAttributesPage.url}}" stepKey="seeInUrlAttributeUpdatePage"/> |
| 62 | + <click selector="{{AdminUpdateAttributesWebsiteSection.website}}" stepKey="openWebsitesTab"/> |
| 63 | + <waitForAjaxLoad stepKey="waitForLoadWebSiteTab"/> |
| 64 | + <click selector="{{AdminUpdateAttributesWebsiteSection.addProductToWebsite}}" stepKey="checkAddProductToWebsiteCheckbox"/> |
| 65 | + <click selector="{{AdminUpdateAttributesHeaderSection.saveButton}}" stepKey="clickSave"/> |
| 66 | + <see selector="{{AdminMessagesSection.success}}" userInput="A total of 1 record(s) were updated." stepKey="seeSaveSuccessMessage"/> |
| 67 | + <!--Got to Store front product page and check url--> |
| 68 | + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$-updated)}}" stepKey="navigateToSimpleProductPage"/> |
| 69 | + <seeInCurrentUrl url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$-updated)}}" stepKey="seeProductNewUrl"/> |
| 70 | + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="$$createProduct.sku$$" stepKey="seeCorrectSku"/> |
| 71 | + </test> |
| 72 | +</tests> |
0 commit comments