Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Commit

Permalink
Merge pull request #187 from magento-pangolin/MC-3241
Browse files Browse the repository at this point in the history
MC-3241
  • Loading branch information
RyanZolper authored Jul 10, 2019
2 parents a031592 + 88a4611 commit 7ad3a8c
Show file tree
Hide file tree
Showing 11 changed files with 294 additions and 0 deletions.
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="AdminChangeProductSEOSettingsActionGroup">
<arguments>
<argument name="productName" defaultValue="_defaultProduct.name"/>
</arguments>
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="clickSearchEngineOptimizationTab"/>
<waitForPageLoad stepKey="waitForTabOpen"/>
<fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{productName}}" stepKey="setUrlKeyInput"/>
<fillField selector="{{AdminProductSEOSection.metaTitleInput}}" userInput="{{productName}}" stepKey="setMetaTitleInput"/>
<fillField selector="{{AdminProductSEOSection.metaKeywordsInput}}" userInput="{{productName}}" stepKey="setMetaKeywordsInput"/>
<fillField selector="{{AdminProductSEOSection.metaDescriptionInput}}" userInput="{{productName}}" stepKey="setMetaDescriptionInput"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?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="AdminSetProductDesignSettingsActionGroup">
<arguments>
<argument name="designSettings" defaultValue="simpleBlankDesign"/>
</arguments>
<click selector="{{ProductDesignSection.DesignTab}}" stepKey="clickDesignTab"/>
<waitForPageLoad stepKey="waitForTabOpen"/>
<selectOption selector="{{ProductDesignSection.LayoutDropdown}}" userInput="{{designSettings.page_layout}}" stepKey="setLayout"/>
<selectOption selector="{{ProductDesignSection.productOptionsContainer}}" userInput="{{designSettings.options_container}}" stepKey="setDisplayProductOptions"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?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="AdminSwitchProductGiftMessageStatusActionGroup">
<arguments>
<argument name="status" defaultValue="0"/>
</arguments>
<click selector="{{AdminProductGiftOptionsSection.giftOptions}}" stepKey="clickToExpandGiftOptionsTab"/>
<waitForPageLoad stepKey="waitForGiftOptionsOpen"/>
<uncheckOption selector="{{AdminProductGiftOptionsSection.useConfigSettingsMessage}}" stepKey="uncheckConfigSettingsMessage"/>
<click selector="{{AdminProductGiftOptionsSection.toggleProductGiftMessage}}" stepKey="clickToGiftMessageSwitcher"/>
<seeElement selector="{{AdminProductGiftOptionsSection.giftMessageStatus('status')}}" stepKey="assertGiftMessageStatus"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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="StorefrontAssertGiftMessageFieldsActionGroup">
<waitForElementVisible selector="{{StorefrontProductCartGiftOptionSection.giftOptions}}" stepKey="waitForCartGiftOptionVisible"/>
<click selector="{{StorefrontProductCartGiftOptionSection.giftOptions}}" stepKey="clickGiftOptionBtn"/>
<seeElement selector="{{StorefrontProductCartGiftOptionSection.fieldTo}}" stepKey="seeFieldTo"/>
<seeElement selector="{{StorefrontProductCartGiftOptionSection.fieldFrom}}" stepKey="seeFieldFrom"/>
<seeElement selector="{{StorefrontProductCartGiftOptionSection.message}}" stepKey="seeMessageArea"/>
<seeElement selector="{{StorefrontProductCartGiftOptionSection.update}}" stepKey="seeUpdateButton"/>
<seeElement selector="{{StorefrontProductCartGiftOptionSection.cancel}}" stepKey="seeCancelButton"/>
</actionGroup>
</actionGroups>
21 changes: 21 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductDesignData.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
<entity name="simpleBlankDesign" type="product">
<data key="custom_design">Magento Blank</data>
<data key="page_layout">2 columns with left bar</data>
<data key="options_container">Product Info Column</data>
</entity>
<entity name="simpleLumaDesign" type="product">
<data key="custom_design">Magento Luma</data>
<data key="page_layout">Empty</data>
<data key="options_container">Block after Info Column</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
<section name="ProductDesignSection">
<element name="DesignTab" type="button" selector="//strong[@class='admin__collapsible-title']//span[text()='Design']"/>
<element name="LayoutDropdown" type="select" selector="select[name='product[page_layout]']"/>
<element name="productOptionsContainer" type="select" selector="select[name='product[options_container]']"/>
</section>
<section name="AdminProductFormRelatedUpSellCrossSellSection">
<element name="relatedProductsHeader" type="button" selector=".admin__collapsible-block-wrapper[data-index='related']" timeout="30"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminProductGiftOptionsSection">
<element name="giftOptions" type="text" selector="div[data-index='gift-options']"/>
<element name="useConfigSettingsMessage" type="checkbox" selector="[name='product[use_config_gift_message_available]']"/>
<element name="toggleProductGiftMessage" type="button" selector="input[name='product[gift_message_available]']+label"/>
<element name="giftMessageStatus" type="checkbox" selector="input[name='product[gift_message_available]'][value='{{status}}']" parameterized="true"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@
<element name="sectionHeader" type="button" selector="div[data-index='search-engine-optimization']" timeout="30"/>
<element name="urlKeyInput" type="input" selector="input[name='product[url_key]']"/>
<element name="useDefaultUrl" type="checkbox" selector="input[name='use_default[url_key]']"/>
<element name="metaTitleInput" type="input" selector="input[name='product[meta_title]']"/>
<element name="metaKeywordsInput" type="textarea" selector="textarea[name='product[meta_keyword]']"/>
<element name="metaDescriptionInput" type="textarea" selector="textarea[name='product[meta_description]']"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="StorefrontProductPageDesignSection">
<element name="layoutTwoColumnsLeft" type="block" selector=".page-layout-2columns-left"/>
<element name="layoutEmpty" type="block" selector=".page-layout-empty"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
<?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="AdminCreateAndEditSimpleProductSettingsTest">
<annotations>
<features value="Catalog"/>
<stories value="Create/Edit simple product in Admin"/>
<title value="Admin should be able to set/edit other product information when creating/editing a simple product"/>
<description value="Admin should be able to set/edit product information when creating/editing a simple product"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-3241"/>
<group value="Catalog"/>
</annotations>
<before>
<!-- Login as admin -->
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>

<!-- Create related products -->
<createData entity="SimpleProduct2" stepKey="createFirstRelatedProduct"/>
<createData entity="SimpleProduct2" stepKey="createSecondRelatedProduct"/>
<createData entity="SimpleProduct2" stepKey="createThirdRelatedProduct"/>
</before>
<after>
<!-- Delete related products -->
<deleteData createDataKey="createFirstRelatedProduct" stepKey="deleteFirstRelatedProduct"/>
<deleteData createDataKey="createSecondRelatedProduct" stepKey="deleteSecondRelatedProduct"/>
<deleteData createDataKey="createThirdRelatedProduct" stepKey="deleteThirdRelatedProduct"/>

<!-- Log out -->
<actionGroup ref="logout" stepKey="logout"/>
</after>

<!-- Create new simple product -->
<actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createSimpleProduct"/>

<!-- Fill all main fields -->
<actionGroup ref="fillMainProductForm" stepKey="fillAllNecessaryFields"/>

<!-- Add two related products -->
<actionGroup ref="addRelatedProductBySku" stepKey="addFirstRelatedProduct">
<argument name="sku" value="$$createFirstRelatedProduct.sku$$"/>
</actionGroup>
<actionGroup ref="addRelatedProductBySku" stepKey="addSecondRelatedProduct">
<argument name="sku" value="$$createSecondRelatedProduct.sku$$"/>
</actionGroup>

<!-- Set Design settings for the product -->
<actionGroup ref="AdminSetProductDesignSettingsActionGroup" stepKey="setProductDesignSettings"/>

<!-- Set Gift Options settings for the product -->
<actionGroup ref="AdminSwitchProductGiftMessageStatusActionGroup" stepKey="enableGiftMessageSettings">
<argument name="status" value="1"/>
</actionGroup>

<!-- Save product form -->
<actionGroup ref="saveProductForm" stepKey="clickSaveButton"/>

<!-- Open product page -->
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage">
<argument name="productUrl" value="{{_defaultProduct.name}}"/>
</actionGroup>

<!-- Assert related products at the storefront -->
<seeElement selector="{{StorefrontProductRelatedProductsSection.relatedProductName($$createFirstRelatedProduct.name$$)}}" stepKey="seeFirstRelatedProductInStorefront"/>
<seeElement selector="{{StorefrontProductRelatedProductsSection.relatedProductName($$createSecondRelatedProduct.name$$)}}" stepKey="seeSecondRelatedProductInStorefront"/>

<!-- Assert product design settings "left bar is present at product page with 2 columns" -->
<seeElement selector="{{StorefrontProductPageDesignSection.layoutTwoColumnsLeft}}" stepKey="seeDesignChanges"/>

<!-- Assert Gift Option product settings is present -->
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart">
<argument name="product" value="_defaultProduct"/>
<argument name="productCount" value="1"/>
</actionGroup>
<actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openShoppingCart"/>
<actionGroup ref="StorefrontAssertGiftMessageFieldsActionGroup" stepKey="assertGiftMessageFieldsArePresent"/>

<!-- Open created product -->
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct">
<argument name="product" value="_defaultProduct"/>
</actionGroup>
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct">
<argument name="product" value="_defaultProduct"/>
</actionGroup>

<!-- Edit product Search Engine Optimization settings -->
<actionGroup ref="AdminChangeProductSEOSettingsActionGroup" stepKey="editProductSEOSettings">
<argument name="productName" value="SimpleProduct.name"/>
</actionGroup>

<!-- Edit related products -->
<actionGroup ref="addRelatedProductBySku" stepKey="addThirdRelatedProduct">
<argument name="sku" value="$$createThirdRelatedProduct.sku$$"/>
</actionGroup>
<click selector="{{AdminProductFormRelatedUpSellCrossSellSection.removeRelatedProduct($$createFirstRelatedProduct.sku$$)}}" stepKey="removeFirstRelatedProduct"/>

<!-- Edit Design settings for the product -->
<actionGroup ref="AdminSetProductDesignSettingsActionGroup" stepKey="editProductDesignSettings">
<argument name="designSettings" value="simpleLumaDesign"/>
</actionGroup>

<!-- Edit Gift Option product settings -->
<actionGroup ref="AdminSwitchProductGiftMessageStatusActionGroup" stepKey="disableGiftMessageSettings"/>

<!-- Save product form -->
<actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/>

<!-- Verify Url Key after changing -->
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage">
<argument name="productUrl" value="{{SimpleProduct.name}}"/>
</actionGroup>

<!-- Assert related products at the storefront -->
<seeElement selector="{{StorefrontProductRelatedProductsSection.relatedProductName($$createSecondRelatedProduct.name$$)}}" stepKey="seeSecondRelatedProduct"/>
<seeElement selector="{{StorefrontProductRelatedProductsSection.relatedProductName($$createThirdRelatedProduct.name$$)}}" stepKey="seeThirdRelatedProduct"/>

<!-- Assert product design settings "Layout empty" -->
<seeElement selector="{{StorefrontProductPageDesignSection.layoutEmpty}}" stepKey="seeNewDesignChanges"/>

<!-- Assert Gift Option product settings -->
<actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/>
<dontSeeElement selector="{{StorefrontProductCartGiftOptionSection.giftOptions}}" stepKey="dontSeeGiftOptionBtn"/>

<!-- Delete created simple product -->
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct">
<argument name="product" value="_defaultProduct"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="StorefrontProductCartGiftOptionSection">
<element name="giftOptions" type="button" selector=".action.action-gift"/>
<element name="fieldTo" type="input" selector=".gift-options-content .field-to input"/>
<element name="fieldFrom" type="input" selector=".gift-options-content .field-from input"/>
<element name="message" type="textarea" selector="#gift-message-whole-message"/>
<element name="update" type="button" selector=".action-update"/>
<element name="cancel" type="button" selector=".action-cancel"/>
</section>
</sections>

0 comments on commit 7ad3a8c

Please sign in to comment.