Skip to content

Commit

Permalink
Merge pull request #90 from magento-pangolin/MC-4430
Browse files Browse the repository at this point in the history
  • Loading branch information
tomreece authored Apr 9, 2019
2 parents cb215ff + 3a88b83 commit 35347a5
Show file tree
Hide file tree
Showing 19 changed files with 891 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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="AssertDontSeeProductDetailsOnStorefrontActionGroup">
<arguments>
<argument name="productNumber" type="string"/>
<argument name="productInfo" type="string"/>
</arguments>
<dontSee selector="{{StorefrontCategoryProductSection.ProductInfoByNumber(productNumber)}}" userInput="{{productInfo}}" stepKey="seeProductInfo"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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="AssertProductDetailsOnStorefrontActionGroup">
<arguments>
<argument name="productNumber" type="string"/>
<argument name="productInfo" type="string"/>
</arguments>
<see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber(productNumber)}}" userInput="{{productInfo}}" stepKey="seeProductInfo"/>
</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="AssertStorefrontProductPricesActionGroup">
<arguments>
<argument name="productPrice" type="string"/>
<argument name="productFinalPrice" type="string"/>
</arguments>
<waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/>
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="productPriceAmount" userInput="{{productPrice}}"/>
<see selector="{{StorefrontProductInfoMainSection.updatedPrice}}" stepKey="productFinalPriceAmount" userInput="{{productFinalPrice}}"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?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="AssertSubTotalOnStorefrontMiniCartActionGroup">
<arguments>
<argument name="subTotal" type="string"/>
</arguments>
<waitForElementVisible selector="{{StorefrontMinicartSection.showCart}}" stepKey="waitForShowCartButtonVisible"/>
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickOnMiniCart"/>
<grabTextFrom selector="{{StorefrontMinicartSection.miniCartSubtotalField}}" stepKey="grabTextFromMiniCartSubtotalField"/>
<assertEquals message="Mini shopping cart should contain subtotal {{subTotal}}" stepKey="assertSubtotalFieldFromMiniShoppingCart1">
<expectedResult type="string">{{subTotal}}</expectedResult>
<actualResult type="variable">grabTextFromMiniCartSubtotalField</actualResult>
</assertEquals>
</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="StorefrontAddProductToCartWithQtyActionGroup">
<arguments>
<argument name="productQty" type="string"/>
</arguments>
<waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/>
<fillField selector="{{StorefrontProductPageSection.qtyInput}}" userInput="{{productQty}}" stepKey="fillProduct1Quantity"/>
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="clickOnAddToCartButton"/>
<waitForPageLoad stepKey="waitForProductToAddInCart"/>
<seeElement selector="{{StorefrontProductPageSection.successMsg}}" stepKey="seeSuccessSaveMessage"/>
</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="StorefrontSelectCustomOptionDropDownAndAssertPricesActionGroup" extends="AssertStorefrontProductPricesActionGroup">
<arguments>
<argument name="customOption" type="string"/>
<argument name="productPrice" type="string"/>
<argument name="productFinalPrice" type="string"/>
</arguments>
<selectOption selector="{{StorefrontProductPageSection.customOptionDropDown}}" userInput="{{customOption}}" stepKey="selectCustomOption" before="productPriceAmount"/>
</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="StorefrontSelectCustomOptionRadioAndAssertPricesActionGroup" extends="AssertStorefrontProductPricesActionGroup">
<arguments>
<argument name="customOption" type="entity"/>
<argument name="customOptionValue" type="entity"/>
<argument name="productPrice" type="string"/>
<argument name="productFinalPrice" type="string"/>
</arguments>
<click selector="{{StorefrontProductInfoMainSection.productAttributeOptionsRadioButtons(customOption.title, customOptionValue.price)}}" stepKey="clickRadioButtonsProductOption" before="productPriceAmount"/>
</actionGroup>
</actionGroups>
10 changes: 10 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,16 @@
<var key="sku" entityType="product" entityKey="sku" />
<requiredEntity type="product_option">ProductOptionRadiobuttonWithTwoFixedOptions</requiredEntity>
</entity>
<entity name="productWithCustomOptions" type="product">
<var key="sku" entityType="product" entityKey="sku" />
<data key="file">magento.jpg</data>
<requiredEntity type="product_option">ProductOptionDropDown2</requiredEntity>
</entity>
<entity name="productWithFixedOptions" type="product">
<var key="sku" entityType="product" entityKey="sku" />
<data key="file">magento.jpg</data>
<requiredEntity type="product_option">ProductOptionRadioButton2</requiredEntity>
</entity>
<entity name="productWithOptions2" type="product">
<var key="sku" entityType="product" entityKey="sku" />
<requiredEntity type="product_option">ProductOptionDropDownWithLongValuesTitle</requiredEntity>
Expand Down
29 changes: 29 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductOptionData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@
<data key="price_type">percent</data>
<data key="max_characters">0</data>
</entity>
<entity name="ProductOptionAreaFixed" type="product_option">
<var key="product_sku" entityType="product" entityKey="sku" />
<data key="title">OptionArea</data>
<data key="type">area</data>
<data key="is_require">false</data>
<data key="sort_order">2</data>
<data key="price">100</data>
<data key="price_type">fixed</data>
<data key="max_characters">0</data>
</entity>
<entity name="ProductOptionFile" type="product_option">
<var key="product_sku" entityType="product" entityKey="sku" />
<data key="title">OptionFile</data>
Expand All @@ -59,6 +69,16 @@
<requiredEntity type="product_option_value">ProductOptionValueDropdown1</requiredEntity>
<requiredEntity type="product_option_value">ProductOptionValueDropdown2</requiredEntity>
</entity>
<entity name="ProductOptionDropDown2" type="product_option">
<var key="product_sku" entityType="product" entityKey="sku" />
<data key="title">OptionDropDown</data>
<data key="type">drop_down</data>
<data key="sort_order">4</data>
<data key="is_require">false</data>
<requiredEntity type="product_option_value">ProductOptionValueDropdown1</requiredEntity>
<requiredEntity type="product_option_value">ProductOptionValueDropdown3</requiredEntity>
</entity>

<entity name="ProductOptionDropDownWithLongValuesTitle" type="product_option">
<var key="product_sku" entityType="product" entityKey="sku" />
<data key="title">OptionDropDownWithLongTitles</data>
Expand All @@ -77,6 +97,15 @@
<requiredEntity type="product_option_value">ProductOptionValueRadioButtons1</requiredEntity>
<requiredEntity type="product_option_value">ProductOptionValueRadioButtons2</requiredEntity>
</entity>
<entity name="ProductOptionRadioButton2" type="product_option">
<var key="product_sku" entityType="product" entityKey="sku" />
<data key="title">OptionRadioButtons</data>
<data key="type">radio</data>
<data key="sort_order">4</data>
<data key="is_require">false</data>
<requiredEntity type="product_option_value">ProductOptionValueRadioButtons1</requiredEntity>
<requiredEntity type="product_option_value">ProductOptionValueRadioButtons4</requiredEntity>
</entity>
<entity name="ProductOptionRadiobuttonWithTwoFixedOptions" type="product_option">
<var key="product_sku" entityType="product" entityKey="sku" />
<data key="title">OptionRadioButtons</data>
Expand Down
12 changes: 12 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductOptionValueData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@
<data key="price">99.99</data>
<data key="price_type">percent</data>
</entity>
<entity name="ProductOptionValueDropdown3" type="product_option_value">
<data key="title">OptionValueDropDown3</data>
<data key="sort_order">2</data>
<data key="price">10</data>
<data key="price_type">percent</data>
</entity>
<entity name="ProductOptionValueRadioButtons4" type="product_option_value">
<data key="title">OptionValueRadioButtons4</data>
<data key="sort_order">1</data>
<data key="price">9.99</data>
<data key="price_type">fixed</data>
</entity>
<entity name="ProductOptionValueRadioButtons3" type="product_option_value">
<data key="title">OptionValueRadioButtons3</data>
<data key="sort_order">3</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
<element name="orderTotal" type="input" selector=".grand.totals .amount .price"/>
<element name="customOptionDropDown" type="select" selector="//*[@id='product-options-wrapper']//select[contains(@class, 'product-custom-option admin__control-select')]"/>
<element name="qtyInputWithProduct" type="input" selector="//tr//strong[contains(.,'{{productName}}')]/../../td[@class='col qty']//input" parameterized="true"/>
<element name="customOptionRadio" type="input" selector="//span[contains(text(),'{{customOption}}')]/../../input" parameterized="true"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
<click stepKey="clickToCalender" selector="{{AdminNewCatalogPriceRule.toDateButton}}"/>
<click stepKey="clickToToday" selector="{{AdminNewCatalogPriceRule.todayDate}}"/>
<click stepKey="openActionDropdown" selector="{{AdminNewCatalogPriceRule.actionsTab}}"/>
<selectOption stepKey="discountType" selector="{{AdminNewCatalogPriceRuleActions.apply}}" userInput="{{catalogRule.simple_action}}"/>
<fillField stepKey="fillDiscountValue" selector="{{AdminNewCatalogPriceRuleActions.discountAmount}}" userInput="{{catalogRule.discount_amount}}"/>
<selectOption stepKey="discountType" selector="{{AdminNewCatalogPriceRuleActions.apply}}" userInput="{{catalogRule.simple_action}}"/>
<selectOption stepKey="discardSubsequentRules" selector="{{AdminNewCatalogPriceRuleActions.disregardRules}}" userInput="Yes"/>

<!-- Scroll to top and either save or save and apply after the action group -->
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.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="CatalogSelectCustomerGroupActionGroup">
<arguments>
<argument name="customerGroupName" defaultValue="NOT LOGGED IN" type="string"/>
</arguments>
<selectOption selector="{{AdminNewCatalogPriceRule.customerGroups}}" userInput="{{customerGroupName}}" stepKey="selectCustomerGroup"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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="SaveAndApplyCatalogPriceRuleActionGroup">
<waitForElementVisible selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="waitForSaveAndApplyButton"/>
<click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="saveAndApply"/>
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccess"/>
</actionGroup>
</actionGroups>
Loading

0 comments on commit 35347a5

Please sign in to comment.