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 #4414 from magento-pangolin/2.3-tests-pr
Browse files Browse the repository at this point in the history
Regression Automation Team Sprint #3
  • Loading branch information
Joan He authored Jul 15, 2019
2 parents fb58417 + 3ddbf83 commit 079bdf0
Show file tree
Hide file tree
Showing 36 changed files with 877 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">

<!-- Skip by MQE-1576 -->
<actionGroup name="ConfigureBraintree">
<!-- GoTo ConfigureBraintree fields -->
<click stepKey="clickOnSTORES" selector="{{AdminMenuSection.stores}}"/>
Expand Down Expand Up @@ -50,4 +50,4 @@
<magentoCLI stepKey="disableBrainTree" command="config:set payment/braintree/active 0"/>
<magentoCLI stepKey="disableBrainTreePaypal" command="config:set payment/braintree_paypal/active 0"/>
</actionGroup>
</actionGroups>
</actionGroups>
22 changes: 12 additions & 10 deletions app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
*/
-->

<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
<entity name="SampleBraintreeConfig" type="braintree_config_state">
<requiredEntity type="title">SampleTitle</requiredEntity>
<requiredEntity type="payment_action">SamplePaymentAction</requiredEntity>
Expand Down Expand Up @@ -54,13 +53,13 @@
<data key="value">sandbox</data>
</entity>
<entity name="MerchantId" type="merchant_id">
<data key="value">d4pdjhxgjfrsmzbf</data>
<data key="value">MERCH_ID</data>
</entity>
<entity name="PublicKey" type="public_key">
<data key="value">m7q4wmh43xrgyrst</data>
<data key="value">PUBLIC_KEY</data>
</entity>
<entity name="PrivateKey" type="private_key">
<data key="value">67de364080b1b4e2492d7a3de413a572</data>
<data key="value">PRIVATE_KEY</data>
</entity>

<!-- default configuration used to restore Magento config -->
Expand Down Expand Up @@ -138,14 +137,17 @@
<data key="year">20</data>
<data key="cvv">113</data>
</entity>
<entity name="StoredPaymentMethods">
<data key="cardNumberEnding">5100</data>
<data key="cardExpire">12/2020</data>
</entity>

<entity name="BraintreeConfigurationData" type="data">
<data key="title">Credit Card (Braintree)</data>
<data key="merchantID">d4pdjhxgjfrsmzbf</data>
<data key="publicKey">m7q4wmh43xrgyrst</data>
<data key="privateKey">67de364080b1b4e2492d7a3de413a572</data>
<data key="merchantAccountID">Magneto</data>
<data key="merchantID">MERCH_ID</data>
<data key="publicKey">PUBLIC_KEY</data>
<data key="privateKey">PRIVATE_KEY</data>
<data key="merchantAccountID">MERCH_ACCOUNT_ID</data>
<data key="titleForPayPalThroughBraintree">PayPal (Braintree)</data>
</entity>

</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
<severity value="MAJOR"/>
<testCaseId value="MAGETWO-93767"/>
<group value="braintree"/>
<skip>
<issueId value="MQE-1576"/>
</skip>
</annotations>

<before>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
<severity value="CRITICAL"/>
<testCaseId value="MAGETWO-93677"/>
<group value="braintree"/>
<skip>
<issueId value="MQE-1576"/>
</skip>
</annotations>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
<severity value="CRITICAL"/>
<testCaseId value="MAGETWO-94472"/>
<group value="braintree"/>
<skip>
<issueId value="MQE-1576"/>
</skip>
</annotations>

<before>
Expand Down
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>
Loading

0 comments on commit 079bdf0

Please sign in to comment.