Skip to content

Commit

Permalink
Merge pull request #130 from magento-pangolin/MC-4767
Browse files Browse the repository at this point in the history
MC-4767
  • Loading branch information
soumyau authored Jul 17, 2019
2 parents b339504 + 6e60e41 commit f87bba6
Show file tree
Hide file tree
Showing 20 changed files with 554 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@
<element name="contentDropDownIfNotShowing" type="button" selector="//div[@data-index='content']//div[contains(@class, '_hide')]"/>
<element name="longDescription" type="input" selector="#product_form_description"/>
<element name="shortDescription" type="input" selector="#product_form_short_description"/>
<!--BundleOptinsDropDown-->
<!--BundleOptionsDropDown-->
<element name="bundleOptionsDropDown" type="button" selector="div[data-index='bundle-items']" timeout="30"/>
<element name="currentBundleOption" type="text" selector="//div[@data-index='bundle-items']//div[contains(@class, 'admin__collapsible-title')]/span"/>
<!--AddingAnOption-->
<element name="addOptions" type="button" selector="//tr[@data-repeat-index='0']//td[4]" timeout="30"/>
<!--SEODropdownTab-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<element name="productQuantity" type="input" selector=".admin__control-text[name='product[quantity_and_stock_status][qty]']"/>
<element name="currentVariationsQuantityCells" type="button" selector="td[data-index='quantity_container']"/>
<element name="rowByCode" type="textarea" selector="//span[contains(text(), '{{var1}}-{{var2}}')]//ancestor-or-self::tr" parameterized="true"/>
<element name="currentAttribute" type="text" selector="//fieldset[@class='admin__fieldset']/div[contains(@class, 'admin__field _disabled')]//span"/>
</section>
<section name="AdminConfigurableProductSelectAttributesSlideOut">
<element name="grid" type="button" selector=".admin__data-grid-wrap tbody"/>
Expand Down
16 changes: 16 additions & 0 deletions app/code/Magento/Downloadable/Test/Mftf/Data/ProductData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,20 @@
<requiredEntity type="custom_attribute_array">ApiProductShortDescription</requiredEntity>
<requiredEntity type="downloadable_link">apiDownloadableLink</requiredEntity>
</entity>
<entity name="DownloadableProductWithTwoLink100" type="product">
<data key="sku" unique="suffix">downloadableproduct</data>
<data key="type_id">downloadable</data>
<data key="attribute_set_id">4</data>
<data key="name" unique="suffix">DownloadableProduct</data>
<data key="price">50.99</data>
<data key="quantity">100</data>
<data key="weight">0</data>
<data key="status">1</data>
<data key="is_shareable">0</data>
<data key="urlKey" unique="suffix">downloadableproduct</data>
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
<requiredEntity type="downloadable_link">downloadableLink1</requiredEntity>
<requiredEntity type="downloadable_link">downloadableLink2</requiredEntity>
</entity>
</entities>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?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="AdminAddToOrderBundleProductActionGroup">
<arguments>
<argument name="option" type="string"/>
<argument name="selectedProductName" type="string"/>
<argument name="quantity" type="string"/>
</arguments>
<scrollTo selector="{{AdminOrderFormConfigureProductSection.bundleItems}}" stepKey="scroll"/>
<click selector="{{AdminOrderFormConfigureProductSection.bundleItems}}" stepKey="focusOnSideDialog"/>
<waitForAjaxLoad stepKey="waitForAjax"/>
<click selector="{{AdminOrderFormConfigureProductSection.bundleSelect(option)}}" stepKey="clickSelector"/>
<selectOption selector="{{AdminOrderFormConfigureProductSection.bundleSelect(option)}}" userInput="{{selectedProductName}}" stepKey="selectionOption"/>
<waitForAjaxLoad stepKey="waitForAjaxLoad"/>
<fillField userInput="{{quantity}}" selector="{{AdminOrderFormConfigureProductSection.quantity}}" stepKey="fillQty"/>
<click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/>
<scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/>
<click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?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="AdminAddToOrderConfigurableProductActionGroup">
<arguments>
<argument name="attribute" type="string"/>
<argument name="option" type="string"/>
<argument name="quantity" type="string"/>
</arguments>
<scrollTo selector="{{AdminOrderFormConfigureProductSection.associatedProducts}}" stepKey="scroll"/>
<click selector="{{AdminOrderFormConfigureProductSection.associatedProducts}}" stepKey="focusOnSideDialog"/>
<waitForAjaxLoad stepKey="waitForAjax"/>
<click selector="{{AdminOrderFormConfigureProductSection.optionSelectNew(attribute)}}" stepKey="clickSelector"/>
<selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelectNew(attribute)}}" userInput="{{option}}" stepKey="selectionOption"/>
<waitForAjaxLoad stepKey="waitForAjaxLoad"/>
<fillField userInput="{{quantity}}" selector="{{AdminOrderFormConfigureProductSection.quantity}}" stepKey="fillQty"/>
<click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/>
<scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/>
<click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/>
</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="AdminAddToOrderCouponCodeActionGroup">
<arguments>
<argument name="couponCode" type="string"/>
</arguments>
<fillField userInput="{{couponCode}}" selector="{{AdminOrderFormDiscountSection.fieldCouponCode}}" stepKey="fillCouponCode"/>
<click selector="{{AdminOrderFormDiscountSection.applyCouponCode}}" stepKey="clickApply"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?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="AdminAddToOrderDownloadableProductActionGroup">
<arguments>
<argument name="link" type="string"/>
<argument name="quantity" type="string" defaultValue="1"/>
</arguments>
<scrollTo selector="{{AdminOrderFormConfigureProductSection.downloadableInformation}}" stepKey="scroll"/>
<click selector="{{AdminOrderFormConfigureProductSection.downloadableInformation}}" stepKey="focusOnSideDialog"/>
<waitForAjaxLoad stepKey="waitForAjax"/>
<checkOption selector="{{AdminOrderFormConfigureProductSection.checkLinkDownloadableProduct(link)}}" stepKey="checkLink"/>
<waitForAjaxLoad stepKey="waitForAjaxLoad"/>
<fillField userInput="{{quantity}}" selector="{{AdminOrderFormConfigureProductSection.quantity}}" stepKey="fillQty"/>
<click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/>
<scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/>
<click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/>
</actionGroup>
</actionGroups>
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="AdminFilterProductInCreateOrderActionGroup">
<arguments>
<argument name="productSKU" type="string"/>
</arguments>
<click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/>
<fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{productSKU}}" stepKey="fillSkuFilter"/>
<click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchConfigurable"/>
<scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/>
<checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectProduct"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoading"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminSubmitOrderActionGroup">
<click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitOrder"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/>
</actionGroup>
</actionGroups>
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.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertSalesPrintOrderBillingAddress">
<arguments>
<argument name="address" type="entity"/>
</arguments>
<see userInput="{{address.firstname}}" selector="{{StorefrontOrderDetailsSection.billingAddressBlock}}" stepKey="seeFirstname"/>
<see userInput="{{address.lastname}}" selector="{{StorefrontOrderDetailsSection.billingAddressBlock}}" stepKey="seeLastname"/>
<see userInput="{{address.company}}" selector="{{StorefrontOrderDetailsSection.billingAddressBlock}}" stepKey="seeCompany"/>
<see userInput="{{address.street[0]}}" selector="{{StorefrontOrderDetailsSection.billingAddressBlock}}" stepKey="seeStreet"/>
<see userInput="{{address.city}}" selector="{{StorefrontOrderDetailsSection.billingAddressBlock}}" stepKey="seeCity"/>
<see userInput="{{address.state}}" selector="{{StorefrontOrderDetailsSection.billingAddressBlock}}" stepKey="seeState"/>
<see userInput="{{address.postcode}}" selector="{{StorefrontOrderDetailsSection.billingAddressBlock}}" stepKey="seePostcode"/>
<see userInput="{{address.country}}" selector="{{StorefrontOrderDetailsSection.billingAddressBlock}}" stepKey="seeCountry"/>
<see userInput="{{address.telephone}}" selector="{{StorefrontOrderDetailsSection.billingAddressBlock}}" stepKey="seeTelephone"/>
</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="StorefrontFillOrdersAndReturnsFormActionGroup">
<arguments>
<argument name="orderNumber" type="string"/>
<argument name="customer" type="entity"/>
</arguments>
<fillField selector="{{StorefrontGuestOrderSearchSection.orderId}}" userInput="{{orderNumber}}" stepKey="inputOrderId"/>
<fillField selector="{{StorefrontGuestOrderSearchSection.billingLastName}}" userInput="{{customer.lastname}}" stepKey="inputBillingLastName"/>
<selectOption selector="{{StorefrontGuestOrderSearchSection.findOrderBy}}" userInput="email" stepKey="selectFindOrderByEmail"/>
<fillField selector="{{StorefrontGuestOrderSearchSection.email}}" userInput="{{customer.email}}" stepKey="inputEmail"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
<section name="AdminOrderFormPaymentSection"/>
<section name="AdminOrderFormTotalSection"/>
<section name="AdminOrderFormStoreSelectorSection"/>
<section name="AdminOrderFormDiscountSection"/>
</page>
</pages>
14 changes: 14 additions & 0 deletions app/code/Magento/Sales/Test/Mftf/Page/StorefrontPrintOrderPage.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="StorefrontPrintOrderPage" url="sales/guest/print/order_id/{{order_id}}" module="Magento_Sales" area="storefront" parameterized="true">
<section name="StorefrontOrderDetailsSection"/>
</page>
</pages>
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@
<section name="AdminOrderFormConfigureProductSection">
<element name="configure" type="button" selector="//a[@product_id='{{productId}}']" parameterized="true"/>
<element name="optionSelect" type="select" selector="//div[contains(@class,'product-options')]//select[//label[text() = '{{option}}']]" parameterized="true"/>
<element name="optionSelectNew" type="select" selector="//label[text()='{{option1}}']/following-sibling::div/select" parameterized="true"/>
<element name="quantity" type="input" selector="#product_composite_configure_input_qty"/>
<element name="ok" type="button" selector=".modal-header .page-actions button[data-role='action']" timeout="30"/>
<element name="associatedProducts" type="block" selector="._show #catalog_product_composite_configure_fields_configurable"/>
<element name="bundleItems" type="block" selector="._show #catalog_product_composite_configure_fields_bundle"/>
<element name="bundleSelect" type="select" selector="//label/span[text()='{{bundleOption}}']/../following-sibling::div/select" parameterized="true"/>
<element name="downloadableInformation" type="block" selector="._show #catalog_product_composite_configure_fields_downloadable"/>
<element name="checkLinkDownloadableProduct" type="checkbox" selector="//label[contains(text(),'{{link}}')]/preceding-sibling::input" parameterized="true"/>
<element name="selectOption" type="select" selector="//form[@id='product_composite_configure_form']//select"/>
</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="AdminOrderFormDiscountSection">
<element name="fieldCouponCode" type="input" selector="//input[@name='coupon_code']"/>
<element name="applyCouponCode" type="button" selector="//input[@name='coupon_code']/following-sibling::button"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="StorefrontGuestOrderViewSection">
<element name="orderInformationTab" type="text" selector="//*[@class='nav item current']/strong[contains(text(), 'Order Information')]"/>
<element name="printOrder" type="button" selector=".order-actions-toolbar .actions .print" timeout="30"/>
</section>
</sections>
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.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="StorefrontOrderDetailsSection">
<element name="orderDetailsBlock" type="block" selector=".block-order-details-view"/>
<element name="billingAddressBlock" type="block" selector=".box-order-billing-address > .box-content > address"/>
<element name="discountSalesRule" type="text" selector="tr.discount span.price"/>
<element name="grandTotalPrice" type="text" selector="tr.grand_total span.price"/>
<element name="paymentMethod" type="text" selector=".box-order-billing-method dt.title"/>
<element name="shippingMethod" type="text" selector=".box-order-shipping-method div.box-content"/>
<element name="productNameCell" type="text" selector="//*[contains(@class, 'product-item-name')]"/>
</section>
</sections>
Loading

0 comments on commit f87bba6

Please sign in to comment.