Skip to content

Commit 89379a1

Browse files
Manjusha.SManjusha.S
authored andcommitted
Merge branch 'ACQE-3331' into functional-testing-automation
2 parents 2e3577c + 2d1ba56 commit 89379a1

10 files changed

+281
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAddCustomAttributeToSelectedProductActionGroup">
12+
<annotations>
13+
<description>Add the created attribute to the selected product</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="attributeCode" type="string" defaultValue="test_attribute"/>
17+
<argument name="adminOption1" type="string" defaultValue="value 1 admin"/>
18+
</arguments>
19+
20+
<click selector="{{AdminProductFormActionSection.addAttributeButton}}" stepKey="clickOnAddAttributeButton" />
21+
<click selector="{{AdminProductAttributeSetGridSection.searchAttributeByFilter}}" stepKey="searchAttributeByFilter" />
22+
<fillField selector="{{AdminProductAttributeSetGridSection.setAttributeCode}}" userInput="{{attributeCode}}" stepKey="filterAttributeCode"/>
23+
<click selector="{{AdminProductAttributeSetGridSection.applyFilter}}" stepKey="applyFilter" />
24+
<waitForPageLoad stepKey="waitForResultsToBeDisplayed"/>
25+
<checkOption selector="{{AdminProductAttributeSetGridSection.selectFromAttributeResult(attributeCode)}}" stepKey="selectAttributeFromDisplayedResult"/>
26+
<click selector="{{AdminProductAttributeSetGridSection.addSelected}}" stepKey="clickAddSelectedButton" />
27+
<waitForPageLoad stepKey="waitForAttributesToBeAdded"/>
28+
<scrollTo selector="{{AdminProductFormSection.attributeTab}}" stepKey="scrollToAttributeTab" />
29+
<click selector="{{AdminProductFormSection.attributeTab}}" stepKey="expandAttributeTab" />
30+
<selectOption selector="{{AdminProductFormSection.customSelectField(attributeCode)}}" userInput="{{adminOption1}}" stepKey="selectAvalueFromDropdown"/>
31+
<click selector="{{AdminProductFormSection.save}}" stepKey="saveTheProduct" />
32+
<waitForPageLoad stepKey="waitForProductsToBeSaved"/>
33+
</actionGroup>
34+
</actionGroups>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="CreateCustomAttributeActionGroup">
12+
<annotations>
13+
<description>Create a custom attribute to be added to any product from admin portal.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="attributeLabel" type="string" defaultValue="Test Attribute"/>
17+
<argument name="attributeCode" type="string" defaultValue="test_attribute"/>
18+
<argument name="inputType" type="string" defaultValue="Dropdown"/>
19+
<argument name="valueRequired" type="string" defaultValue="Yes"/>
20+
<argument name="adminOption1" type="string" defaultValue="value 1 admin"/>
21+
<argument name="adminOption1Value" type="string" defaultValue="value1"/>
22+
<argument name="adminOption2" type="string" defaultValue="value 2 admin"/>
23+
<argument name="adminOption2Value" type="string" defaultValue="value2"/>
24+
<argument name="toBeUsedInSearch" type="string" defaultValue="Yes"/>
25+
<argument name="isComparableOnStoreFront" type="string" defaultValue="Yes"/>
26+
<argument name="usedInLayeredNavigation" type="string" defaultValue="Filterable (with results)"/>
27+
<argument name="isVisibleOnCatalogPagesOnStorefront" type="string" defaultValue="Yes"/>
28+
</arguments>
29+
30+
<!-- Navigate to Stores > Attributes > Products > Product Attribute-->
31+
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/>
32+
33+
<!-- Click on Add new Attribute button -->
34+
<click selector="{{AdminProductAttributeGridSection.createNewAttributeBtn}}" stepKey="clickAddNewAttributeButton"/>
35+
36+
<!-- Add details to Attribute Properties -->
37+
<fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{attributeLabel}}" stepKey="fillAttributeLabel"/>
38+
<selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="{{inputType}}" stepKey="selectDropdown"/>
39+
<selectOption selector="{{AttributePropertiesSection.ValueRequired}}" userInput="{{valueRequired}}" stepKey="selectRequiredAsYes"/>
40+
41+
<click selector="{{AttributePropertiesSection.dropdownAddOptions}}" stepKey="addOptions"/>
42+
<checkOption selector="{{AttributePropertiesSection.dropdownNthOptionIsDefault('1')}}" stepKey="selectIsDefaultForValue1"/>
43+
<fillField selector="{{AttributePropertiesSection.dropdownNthOptionAdmin('1')}}" userInput="{{adminOption1}}" stepKey="fillAdmin1"/>
44+
<fillField selector="{{AttributePropertiesSection.dropdownNthOptionDefaultStoreView('1')}}" userInput="{{adminOption1Value}}" stepKey="fillDefaultStoreView1"/>
45+
46+
<click selector="{{AttributePropertiesSection.dropdownAddOptions}}" stepKey="addOptionsAgain"/>
47+
<fillField selector="{{AttributePropertiesSection.dropdownNthOptionAdmin('2')}}" userInput="{{adminOption2}}" stepKey="fillAdmin2"/>
48+
<fillField selector="{{AttributePropertiesSection.dropdownNthOptionDefaultStoreView('2')}}" userInput="{{adminOption2Value}}" stepKey="fillDefaultStoreView2"/>
49+
50+
<!-- Add details to Advanced Attribute Properties -->
51+
<click selector="{{AttributePropertiesSection.AdvancedProperties}}" stepKey="clickAdvancedAttributeProperties"/>
52+
<waitForElementVisible selector="{{AttributePropertiesSection.AttributeCode}}" stepKey="waitForAttributeCodeToBeVisible"/>
53+
<fillField selector="{{AttributePropertiesSection.AttributeCode}}" userInput="{{attributeCode}}" stepKey="fillAttributeCode"/>
54+
55+
<!-- Navigate to Storefront Properties -->
56+
<scrollToTopOfPage stepKey="scrollToStoreFrontProperties"/>
57+
<click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStoreFrontProperties"/>
58+
59+
<!-- Provide the Storefront Properties -->
60+
<selectOption selector="{{AdminNewAttributePanel.useInSearch}}" userInput="{{toBeUsedInSearch}}" stepKey="selectYesForUseInSearch"/>
61+
<selectOption selector="{{AdminNewAttributePanel.comparableOnStorefront}}" userInput="{{isComparableOnStoreFront}}" stepKey="selectYesForComparableOnStorefront"/>
62+
<selectOption selector="{{AdminNewAttributePanel.useInLayeredNavigation}}" userInput="{{usedInLayeredNavigation}}" stepKey="selectLayeredNavigation"/>
63+
<selectOption selector="{{AdminNewAttributePanel.visibleOnCatalogPagesOnStorefront}}" userInput="{{isVisibleOnCatalogPagesOnStorefront}}" stepKey="selectYesForVisibleOnCatalogPagesForStoreFront"/>
64+
65+
<!-- Save the Attribute -->
66+
<click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="saveTheAttribute"/>
67+
<waitForPageLoad stepKey="waitForProductPageToLoad"/>
68+
</actionGroup>
69+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection/AttributePropertiesSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@
2929
<element name="dropdownNthOptionDefaultStoreView" type="textarea" selector="tbody[data-role='options-container'] tr:nth-child({{var}}) td:nth-child(4) input" parameterized="true"/>
3030
<element name="dropdownNthOptionDelete" type="button" selector="tbody[data-role='options-container'] tr:nth-child({{var}}) button[title='Delete']" parameterized="true"/>
3131
<element name="attributeLabelValidationError" type="text" selector=".field-attribute_label .mage-error"/>
32+
<element name="AttributeCode" type="input" selector="#attribute_code"/>
3233
</section>
3334
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeSetGridSection.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,11 @@
1515
<element name="AttributeSetName" type="text" selector="//td[contains(text(), '{{var1}}')]" parameterized="true"/>
1616
<element name="addAttributeSetBtn" type="button" selector="button.add-set" timeout="30"/>
1717
<element name="resetFilter" type="button" selector="button[data-action='grid-filter-reset']" timeout="30"/>
18+
<element name="selectAttributeTitle" type="text" selector="//div[contains(text(),'Select Attribute')]" timeout="30"/>
19+
<element name="searchAttributeByFilter" type="button" selector="//div[@class='data-grid-filters-action-wrap']//button[contains(text(),'Filters')]" timeout="30"/>
20+
<element name="setAttributeCode" type="input" selector="//input[@name='attribute_code']" timeout="30"/>
21+
<element name="applyFilter" type="button" selector="//button[@class='action-secondary' and @data-action='grid-filter-apply']" timeout="30"/>
22+
<element name="selectFromAttributeResult" type="checkbox" selector="//div[@class='data-grid-cell-content' and contains(text(),'{{var1}}')]/../..//input[@data-action='select-row']" parameterized="true"/>
23+
<element name="addSelected" type="button" selector="//button//span[contains(text(),'Add Selected')]"/>
1824
</section>
1925
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductMoreInformationSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
<element name="attributeValue" type="text" selector=".col.data"/>
1919
<!-- The tab transform to an accordion when window resize -->
2020
<element name="moreInformationSectionToggleState" type="button" selector="//*[@id='tab-label-additional-title']/ancestor::div[@aria-selected='{{boolean}}'][@aria-expanded='{{boolean}}']" parameterized="true"/>
21+
<element name="customAttributeValueCheck" type="text" selector="//table[@class='data table additional-attributes']//td[@class='col data' and contains(text(),'{{var1}}')]" parameterized="true"/>
2122
</section>
2223
</sections>
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
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+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AddExistingProductAttributeFromProductPageTest">
12+
<annotations>
13+
<stories value="Add Existing Product Attribute From Product Page"/>
14+
<title value="Add Existing Product Attribute From Product Page"/>
15+
<description value="Add Existing Product Attribute From Product Page to new products"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="MC-26780"/>
18+
<group value="Catalog"/>
19+
</annotations>
20+
21+
<before>
22+
<!-- Login as admin -->
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="login"/>
24+
25+
<!--Create Category-->
26+
<createData entity="NewRootCategory" stepKey="createAnchorCategory"/>
27+
28+
<!--Create SubCategory-->
29+
<createData entity="SubCategoryWithParent" stepKey="subCategory">
30+
<requiredEntity createDataKey="createAnchorCategory"/>
31+
</createData>
32+
33+
<!--Create Simple Product-->
34+
<createData entity="SimpleProduct" stepKey="createSimpleProduct">
35+
<requiredEntity createDataKey="subCategory"/>
36+
</createData>
37+
38+
<!-- Select the anchorCategory for Main Webstore Store-->
39+
<actionGroup ref="UpdateRootCategoryForStoresActionGroup" stepKey="UpdateRootCategoryForStores">
40+
<argument name="rootCategoryName" value="$$createAnchorCategory.name$$"/>
41+
</actionGroup>
42+
</before>
43+
44+
<after>
45+
<!-- Delete created attribute -->
46+
<actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToAttributeEditPage">
47+
<argument name="ProductAttribute" value="Test Attribute"/>
48+
</actionGroup>
49+
<click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="clickDeleteAttribute" />
50+
<click selector="{{AttributeDeleteModalSection.confirm}}" stepKey="clickOkToConfirmDelete" />
51+
<waitForPageLoad stepKey="waitForDeletion"/>
52+
53+
<!-- Select the Default Category for Main Webstore -->
54+
<actionGroup ref="UpdateRootCategoryForStoresActionGroup" stepKey="UpdateRootCategoryForStores">
55+
<argument name="rootCategoryName" value="Default Category"/>
56+
</actionGroup>
57+
58+
<!-- Delete created category and product -->
59+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
60+
<deleteData createDataKey="subCategory" stepKey="deleteSubCategory"/>
61+
<deleteData createDataKey="createAnchorCategory" stepKey="deleteAnchorCategory"/>
62+
63+
<!-- logout of the application -->
64+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
65+
</after>
66+
67+
<!-- Create Custom Attribute -->
68+
<actionGroup ref="CreateCustomAttributeActionGroup" stepKey="createCustomAttribute"/>
69+
70+
<!-- Navigate to the created Products and select the filtered product -->
71+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
72+
73+
<!-- Select the product to which attribute ahs to be added -->
74+
<actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku">
75+
<argument name="product" value="$$createSimpleProduct$$"/>
76+
</actionGroup>
77+
<click selector="{{AdminProductGridSection.productRowBySku($$createSimpleProduct.sku$$)}}" stepKey="selectTheFilteredProduct" />
78+
<waitForPageLoad stepKey="waitForProductToLoad"/>
79+
80+
<!-- Add the created attribute to the selected product -->
81+
<actionGroup ref="AdminAddCustomAttributeToSelectedProductActionGroup" stepKey="addCreatedAttributeToTheProduct"/>
82+
83+
<!-- Navigate to Storefront -->
84+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPage2">
85+
<argument name="category" value="$$subCategory$$"/>
86+
</actionGroup>
87+
<waitForPageLoad stepKey="waitForStoreFrontPageToBeLoaded"/>
88+
89+
<!-- Verify the attributes added to the product in storefront -->
90+
<actionGroup ref="VerifyTheProductAttributeOnStoreFrontActionGroup" stepKey="verifyTheAttributesAddedToTheProductInStorefront"/>
91+
</test>
92+
</tests>

app/code/Magento/LayeredNavigation/Test/Mftf/Section/LayeredNavigationSection/StorefrontLayeredNavigationSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<element name="appliedFilterLabel" type="text" selector=".filter-current .items > li.item:nth-of-type({{position}}) > span.filter-label" parameterized="true"/>
1313
<element name="appliedFilterValue" type="text" selector=".filter-current .items > li.item:nth-of-type({{position}}) > span.filter-value" parameterized="true"/>
1414
<element name="shoppingOptionsExpanded" type="button" selector="//a[@rel='nofollow' and contains(text(),'{{var}}')]" parameterized="true"/>
15+
<element name="shoppingOptionsExpandedCount" type="button" selector="//a[@rel='nofollow' and contains(text(),'{{var1}}')]//span[@class='count' and contains(text(),'{{var2}}')]" parameterized="true"/>
1516
<element name="nowShoppingBy" type="text" selector="//strong[@class='block-subtitle filter-current-subtitle']"/>
1617
<element name="actionRemove" type="button" selector="//a[@class='action remove']" />
1718
<element name="nowShoppingByAttribute" type="text" selector="//span[@class='filter-label' and contains(text(),'{{var}}')]" parameterized="true"/>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="UpdateRootCategoryForStoresActionGroup">
12+
<annotations>
13+
<description>Update Root Category for Stores</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="rootCategoryName" type="string"/>
17+
</arguments>
18+
<amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/>
19+
<waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/>
20+
<click selector="{{AdminStoresMainActionsSection.mainWebsiteStore}}" stepKey="selectTheStoreToResetToAnchorCategory"/>
21+
<waitForPageLoad stepKey="waitForStoresInformationResult"/>
22+
<selectOption selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" userInput="{{rootCategoryName}}" stepKey="chooseAnchorCategory"/>
23+
<click selector="{{AdminStoresMainActionsSection.saveButton}}" stepKey="saveTheStoresCategory"/>
24+
<click selector="{{AttributeDeleteModalSection.confirm}}" stepKey="clickOkToConfirmAnchorCategoryAsMainWebsiteStoreCategory" />
25+
<waitForPageLoad stepKey="waitForStorePageToSave"/>
26+
</actionGroup>
27+
</actionGroups>

0 commit comments

Comments
 (0)