Skip to content

Commit

Permalink
MAGETWO-90374: Automate with MFTF product tier price
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriyprime committed Jul 8, 2018
1 parent aa6b899 commit dd22d9a
Show file tree
Hide file tree
Showing 16 changed files with 426 additions and 0 deletions.
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
<!--Reset the product grid to the default view-->
<actionGroup name="AdminResetProductGridToDefaultViewActionGroup">
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
<click selector="{{AdminProductGridFilterSection.viewDropdown}}" stepKey="openViewBookmarksTab"/>
<waitForElementVisible selector="{{AdminProductGridFilterSection.viewBookmark('Default View')}}" time="10" stepKey="waitForViewBookmarkElementVisible"/>
<click selector="{{AdminProductGridFilterSection.viewBookmark('Default View')}}" stepKey="resetToDefaultGridView"/>
<see selector="{{AdminProductGridFilterSection.viewDropdown}}" userInput="Default View" stepKey="seeDefaultViewSelected"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
<section name="AdminProductMessagesSection"/>
<section name="AdminMessagesSection"/>
<section name="AdminProductCustomizableOptionsSection" />
<section name="AdminProductFormAdvancedPricingSection"/>
</page>
</pages>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
<section name="AdminProductFormAdvancedPricingSection">
<element name="customerGroupPriceAddButton" type="button" selector="[data-action='add_new_row']" timeout="30"/>
<element name="customerGroupPriceDeleteButton" type="button" selector="[data-action='remove_row']" timeout="30"/>
<element name="advancedPricingCloseButton" type="button" selector=".product_form_product_form_advanced_pricing_modal button.action-close" timeout="30"/>
<element name="productTierPriceWebsiteSelect" type="select" selector="[name='product[tier_price][{{var1}}][website_id]']" parameterized="true"/>
<element name="productTierPriceCustGroupSelect" type="select" selector="[name='product[tier_price][{{var1}}][cust_group]']" parameterized="true"/>
<element name="productTierPriceQtyInput" type="input" selector="[name='product[tier_price][{{var1}}][price_qty]']" parameterized="true"/>
<element name="productTierPriceValueTypeSelect" type="select" selector="[name='product[tier_price][{{var1}}][value_type]']" parameterized="true"/>
<element name="productTierPriceFixedPriceInput" type="input" selector="[name='product[tier_price][{{var1}}][price]']" parameterized="true"/>
<element name="productTierPricePercentageValuePriceInput" type="input" selector="[name='product[tier_price][{{var1}}][percentage_value]']" parameterized="true"/>
<element name="specialPrice" type="input" selector="input[name='product[special_price]']"/>
<element name="doneButton" type="button" selector=".product_form_product_form_advanced_pricing_modal button.action-primary" timeout="5"/>
<element name="save" type="button" selector="#save-button"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<element name="productSku" type="input" selector=".admin__field[data-index=sku] input"/>
<element name="productStatus" type="checkbox" selector="input[name='product[status]']"/>
<element name="productPrice" type="input" selector=".admin__field[data-index=price] input"/>
<element name="advancedPricingLink" type="button" selector="button[data-index='advanced_pricing_button']"/>
<element name="categoriesDropdown" type="multiselect" selector="div[data-index='category_ids']"/>
<element name="productQuantity" type="input" selector=".admin__field[data-index=qty] input"/>
<element name="productStockStatus" type="select" selector="select[name='product[quantity_and_stock_status][is_in_stock]']"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@
<element name="applyFilters" type="button" selector="button[data-action='grid-filter-apply']" timeout="30"/>
<element name="newFromDateFilter" type="input" selector="input.admin__control-text[name='news_from_date[from]']"/>
<element name="skuFilter" type="input" selector="input.admin__control-text[name='sku']"/>
<element name="viewBookmark" type="button" selector="//div[contains(@class, 'admin__data-grid-action-bookmarks')]/ul/li/div/a[text() = '{{label}}']" parameterized="true" timeout="30"/>
<element name="viewDropdown" type="button" selector=".admin__data-grid-action-bookmarks button.admin__action-dropdown"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@
<element name="ProductInfoByName" type="text" selector="//main//li[.//a[contains(text(), '{{var1}}')]]//div[@class='product-item-info']" parameterized="true"/>
<element name="ProductAddToCompareByName" type="text" selector="//main//li[.//a[contains(text(), '{{var1}}')]]//a[contains(@class, 'tocompare')]" parameterized="true"/>
<element name="ProductImageByNameAndSrc" type="text" selector="//main//li[.//a[contains(text(), '{{var1}}')]]//img[contains(@src, '{{src}}')]" parameterized="true"/>
<element name="productPriceFinal" type="text" selector="//span[@data-price-type='finalPrice']//span[@class='price'][contains(.,'{{var1}}')]" parameterized="true"/>
<element name="productPriceOld" type="text" selector="//span[@data-price-type='oldPrice']//span[@class='price'][contains(., '{{var1}}')]" parameterized="true"/>
<element name="productPriceLabel" type="text" selector="//span[@class='price-label'][contains(text(),'{{var1}}')]" parameterized="true"/>
<element name="productPriceLinkAfterLabel" type="text" selector="//span[@class='price-label'][contains(text(),'{{var1}}')]/following::span[contains(text(), '{{var2}}')]" parameterized="true"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<element name="productName" type="text" selector=".base"/>
<element name="productSku" type="text" selector=".product.attribute.sku>.value"/>
<element name="productPrice" type="text" selector=".price"/>
<element name="qty" type="input" selector="#qty"/>
<element name="productStockStatus" type="text" selector=".stock[title=Availability]>span"/>
<element name="productDescription" type="text" selector="#description .value"/>
<element name="productImageSrc" type="text" selector="//*[@id='maincontent']//div[@class='gallery-placeholder']//img[contains(@src, '{{src}}')]" parameterized="true"/>
Expand Down Expand Up @@ -49,5 +50,10 @@
<element name="productAddToCompare" type="button" selector="a.action.tocompare"/>
<element name="productOptionDropDownTitle" type="text" selector="//label[contains(.,'{{var1}}')]" parameterized="true"/>
<element name="productOptionDropDownOptionTitle" type="text" selector="//label[contains(.,'{{var1}}')]/../div[@class='control']//select//option[contains(.,'{{var2}}')]" parameterized="true"/>

<!-- Tier price selectors -->
<element name="productTierPriceByForTextLabel" type="text" selector="//ul[contains(@class, 'prices-tier')]//li[{{var1}}][contains(text(),'Buy {{var2}} for')]" parameterized="true"/>
<element name="productTierPriceAmount" type="text" selector="//ul[contains(@class, 'prices-tier')]//li[{{var1}}]//span[contains(text(), '{{var2}}')]" parameterized="true"/>
<element name="productTierPriceSavePercentageAmount" type="text" selector="//ul[contains(@class, 'prices-tier')]//li[{{var1}}]//span[contains(@class, 'percent')][contains(text(), '{{var2}}')]" parameterized="true"/>
</section>
</sections>
Loading

0 comments on commit dd22d9a

Please sign in to comment.