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 #3517 from magento-tsg/2.3-develop-mftf-pr9
Browse files Browse the repository at this point in the history
[TSG] MFTF for 2.3 (pr9) (2.3.1)
  • Loading branch information
xmav authored Dec 14, 2018
2 parents b8892f0 + 113d804 commit 619f2db
Show file tree
Hide file tree
Showing 34 changed files with 358 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
<argument name="adminUser" defaultValue="_ENV"/>
</arguments>
<amOnPage url="{{AdminLoginPage.url}}" stepKey="navigateToAdmin"/>
<waitForPageLoad stepKey="waitForAdminLoginPageLoad"/>
<fillField selector="{{AdminLoginFormSection.username}}" userInput="{{adminUser.MAGENTO_ADMIN_USERNAME}}" stepKey="fillUsername"/>
<fillField selector="{{AdminLoginFormSection.password}}" userInput="{{adminUser.MAGENTO_ADMIN_PASSWORD}}" stepKey="fillPassword"/>
<click selector="{{AdminLoginFormSection.signIn}}" stepKey="clickLogin"/>
<closeAdminNotification stepKey="closeAdminNotification"/>
</actionGroup>
</actionGroups>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
*/
-->
<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">
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="DeleteCustomerActionGroup">
<arguments>
<argument name="lastName" defaultValue=""/>
</arguments>
<click stepKey="openCustomers" selector="{{AdminMenuSection.customers}}"/>
<waitForPageLoad stepKey="waitForCatalogSubmenu" time="10"/>
<click stepKey="clickOnAllCustomers" selector="{{CustomersSubmenuSection.allCustomers}}"/>
<waitForPageLoad stepKey="waitForProductsPage" time="10"/>
<!--Clear filter if exist-->
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="navigateToCustomers"/>
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingCustomerFilters"/>

<click stepKey="chooseCustomer" selector="{{CustomersPageSection.customerCheckbox(lastName)}}"/>
<waitForAjaxLoad stepKey="waitForThick" time="2"/>
<click stepKey="OpenActions" selector="{{CustomersPageSection.actions}}"/>
Expand All @@ -23,6 +23,5 @@
<waitForPageLoad stepKey="waitForDeleteItemPopup" time="10"/>
<click stepKey="clickOnOk" selector="{{CustomersPageSection.ok}}"/>
<waitForElementVisible stepKey="waitForSuccessfullyDeletedMessage" selector="{{CustomersPageSection.deletedSuccessMessage}}" time="10"/>

</actionGroup>
</actionGroups>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,18 @@
<waitForPageLoad time="30" stepKey="waitForPageLoad3"/>
<waitForText userInput="{{quantity}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/>
</actionGroup>

<!-- Add Bundle Product to Cart from the category page -->
<actionGroup name="StorefrontAddBundleProductFromCategoryToCartActionGroup">
<arguments>
<argument name="productName" type="string"/>
</arguments>
<moveMouseOver selector="{{StorefrontCategoryProductSection.ProductTitleByName(productName)}}" stepKey="moveMouseOverProduct"/>
<click selector="{{StorefrontCategoryProductSection.ProductTitleByName(productName)}}" stepKey="openProductPage"/>
<waitForPageLoad time="30" stepKey="waitForBundleProductPageLoad"/>
<click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomizeAndAddToCart"/>
<click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddBundleProductToCart"/>
<waitForElementVisible selector="{{StorefrontMinicartSection.productCount}}" stepKey="waitProductCount"/>
<see userInput="You added {{productName}} to your shopping cart." selector="{{StorefrontMessagesSection.success}}" stepKey="seeSuccessMessage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?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="StorefrontAddBundleProductWithZeroPriceToShoppingCartTest">
<annotations>
<features value="Bundle"/>
<stories value="Add Bundle product with zero price to shopping cart"/>
<title value="Add Bundle product with zero price to shopping cart"/>
<description value="Add Bundle product with zero price to shopping cart"/>
<severity value="CRITICAL"/>
<testCaseId value="MAGETWO-95167"/>
<group value="bundle"/>
</annotations>
<before>
<!--Enable freeShipping-->
<createData entity="FreeShippinMethodConfig" stepKey="enableFreeShipping"/>
<!--Create category-->
<createData entity="SimpleSubCategory" stepKey="createSubCategory"/>
<!--Create simple with zero price product-->
<createData entity="ApiProductWithDescription" stepKey="apiSimple">
<field key="price">0</field>
</createData>
<!--Create Bundle product-->
<createData entity="ApiBundleProductPriceViewRange" stepKey="apiBundleProduct">
<requiredEntity createDataKey="createSubCategory"/>
</createData>
<!--Create Attribute-->
<createData entity="DropDownBundleOption" stepKey="bundleOption">
<requiredEntity createDataKey="apiBundleProduct"/>
</createData>
<createData entity="ApiBundleLink" stepKey="createBundleLink">
<requiredEntity createDataKey="apiBundleProduct"/>
<requiredEntity createDataKey="bundleOption"/>
<requiredEntity createDataKey="apiSimple"/>
</createData>
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
</before>
<after>
<createData entity="FreeShippinMethodDefault" stepKey="disableFreeShipping"/>
<deleteData createDataKey="apiSimple" stepKey="deleteSimple"/>
<deleteData createDataKey="apiBundleProduct" stepKey="deleteBundleProduct"/>
<deleteData createDataKey="createSubCategory" stepKey="deleteCategory"/>
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/>
<actionGroup ref="logout" stepKey="logout"/>
</after>
<!--Open category page-->
<amOnPage url="{{StorefrontCategoryPage.url($$createSubCategory.custom_attributes[url_key]$$)}}" stepKey="amOnCategoryPage"/>
<!--Add bundle product to cart-->
<actionGroup ref="StorefrontAddBundleProductFromCategoryToCartActionGroup" stepKey="addBundleProductToCart">
<argument name="productName" value="$$apiBundleProduct.name$$"/>
</actionGroup>
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>

<!--Place order-->
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping">
<argument name="shippingMethod" value="Free Shipping"/>
</actionGroup>
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="checkoutPlaceOrder"/>
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/>

<!--Check subtotal in created order-->
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<actionGroup ref="filterOrderGridById" stepKey="filterOrderById">
<argument name="orderId" value="$grabOrderNumber"/>
</actionGroup>
<click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/>
<waitForPageLoad stepKey="waitForAdminOrderPageLoad"/>
<scrollTo selector="{{AdminOrderTotalSection.subTotal}}" stepKey="scrollToOrderTotalSection"/>
<see selector="{{AdminOrderTotalSection.subTotal}}" userInput="$0.00" stepKey="checkSubtotal"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@
<argument name="simpleProduct"/>
</arguments>
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/>
<click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/>
<fillField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/>
Expand Down Expand Up @@ -313,4 +312,19 @@
<click selector="{{AdminProductFormAdvancedPricingSection.save}}" stepKey="clickSaveProduct"/>
<waitForPageLoad stepKey="waitForSave"/>
</actionGroup>

<!--Check tier price with a discount percentage on product-->
<actionGroup name="AssertDiscountsPercentageOfProducts">
<arguments>
<argument name="amount" type="string" defaultValue="45"/>
</arguments>
<click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingButton"/>
<waitForElement selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForCustomerGroupPriceAddButton"/>
<grabValueFrom selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput('0')}}" stepKey="grabProductTierPriceInput"/>
<assertEquals stepKey="assertProductTierPriceInput">
<expectedResult type="string">{{amount}}</expectedResult>
<actualResult type="string">$grabProductTierPriceInput</actualResult>
</assertEquals>
</actionGroup>

</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@
</arguments>
<!--TODO use other action group for filtering grid when MQE-539 is implemented -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
<waitForPageLoad time="60" stepKey="waitForPageLoadInitial"/>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/>
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="AdminCategoryPage" url="catalog/category/" area="admin" module="Catalog">
<page name="AdminCategoryPage" url="catalog/category/" area="admin" module="Magento_Catalog">
<section name="AdminCategorySidebarActionSection"/>
<section name="AdminCategoryMainActionsSection"/>
<section name="AdminCategorySidebarTreeSection"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/>
<actionGroup ref="logout" stepKey="logout"/>
</after>

<!-- Login Customer Storefront -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
<arguments>
<argument name="customerVar" defaultValue="CustomerEntityOne"/>
<argument name="customerAddressVar" defaultValue="CustomerAddressSimple"/>
<!--First available shipping method will be selected if value is not passed for shippingMethod-->
<argument name="shippingMethod" defaultValue="" type="string"/>
</arguments>
<fillField selector="{{CheckoutShippingSection.email}}" userInput="{{customerVar.email}}" stepKey="enterEmail"/>
<fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/>
Expand All @@ -36,7 +38,7 @@
<fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/>
<fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/>
<click selector="{{CheckoutShippingSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/>
<click selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('shippingMethod')}}" stepKey="selectShippingMethod"/>
<waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/>
<click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/>
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/>
Expand Down Expand Up @@ -131,6 +133,24 @@
<seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/>
</actionGroup>

<!-- Place order with logged the user -->
<actionGroup name="PlaceOrderWithLoggedUserActionGroup">
<arguments>
<!--First available shipping method will be selected if value is not passed for shippingMethod-->
<argument name="shippingMethod" defaultValue="" type="string"/>
</arguments>
<waitForElementVisible selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="waitProceedToCheckout"/>
<click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="clickProceedToCheckout"/>
<click selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('shippingMethod')}}" stepKey="selectShippingMethod"/>
<waitForElement selector="{{CheckoutShippingSection.next}}" stepKey="waitForNextButton"/>
<click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/>
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/>
<seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/>
<waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="waitForPlaceOrderButton"/>
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/>
<see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/>
</actionGroup>

<!-- Check product in checkout cart items -->
<actionGroup name="CheckProductInCheckoutCartItemsActionGroup">
<arguments>
Expand Down Expand Up @@ -161,7 +181,7 @@
<actionGroup name="CheckTotalsSortOrderInSummarySection">
<arguments>
<argument name="elementName" type="string"/>
<argument name="positionNumber" type="integer"/>
<argument name="positionNumber" type="string"/>
</arguments>
<see userInput="{{elementName}}" selector="{{CheckoutCartSummarySection.elementPosition(positionNumber)}}" stepKey="assertElementPosition"/>
</actionGroup>
Expand Down Expand Up @@ -236,11 +256,18 @@
<conditionalClick selector="{{CheckoutCartSummarySection.shippingHeading}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="openShippingDetails"/>
<see selector="{{CheckoutCartSummarySection.countryParameterized('placeNumber')}}" userInput="{{country}}" stepKey="seeCountry"/>
</actionGroup>

<actionGroup name="StorefrontSignOutActionGroup">
<click selector="{{StoreFrontSignOutSection.customerAccount}}" stepKey="clickCustomerButton"/>
<click selector="{{StoreFrontSignOutSection.signOut}}" stepKey="clickToSignOut"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<see userInput="You are signed out" stepKey="signOut"/>
</actionGroup>

<!--Click Place Order button-->
<actionGroup name="ClickPlaceOrderActionGroup">
<waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/>
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/>
<see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@
<comment userInput="Check order summary in checkout" stepKey="commentCheckOrderSummaryInCheckout" after="guestCheckoutFillingShippingSection" />
<actionGroup ref="CheckOrderSummaryInCheckoutActionGroup" stepKey="guestCheckoutCheckOrderSummary" after="commentCheckOrderSummaryInCheckout">
<!-- @TODO: Change to scalar value after MQE-498 is implemented -->
<argument name="subtotal" value="E2EB2CQuote.subtotal"/>
<argument name="subtotal" value="{{E2EB2CQuote.subtotal}}"/>
<!-- @TODO: Change to scalar value after MQE-498 is implemented -->
<argument name="shippingTotal" value="E2EB2CQuote.shipping"/>
<argument name="shippingTotal" value="{{E2EB2CQuote.shipping}}"/>
<!-- @TODO: Change to scalar value after MQE-498 is implemented -->
<argument name="shippingMethod" value="E2EB2CQuote.shippingMethod"/>
<argument name="shippingMethod" value="{{E2EB2CQuote.shippingMethod}}"/>
<!-- @TODO: Change to scalar value after MQE-498 is implemented -->
<argument name="total" value="E2EB2CQuote.total"/>
<argument name="total" value="{{E2EB2CQuote.total}}"/>
</actionGroup>

<!-- Check ship to information in checkout -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@
<comment userInput="Check order summary in checkout" stepKey="commentCheckOrderSummaryInCheckout" after="checkoutFillingShippingSection" />
<actionGroup ref="CheckOrderSummaryInCheckoutActionGroup" stepKey="checkoutCheckOrderSummary" after="commentCheckOrderSummaryInCheckout">
<!-- @TODO: Change to scalar value after MQE-498 is implemented -->
<argument name="subtotal" value="E2EB2CQuote.subtotal"/>
<argument name="subtotal" value="{{E2EB2CQuote.subtotal}}"/>
<!-- @TODO: Change to scalar value after MQE-498 is implemented -->
<argument name="shippingTotal" value="E2EB2CQuote.shipping"/>
<argument name="shippingTotal" value="{{E2EB2CQuote.shipping}}"/>
<!-- @TODO: Change to scalar value after MQE-498 is implemented -->
<argument name="shippingMethod" value="E2EB2CQuote.shippingMethod"/>
<argument name="shippingMethod" value="{{E2EB2CQuote.shippingMethod}}"/>
<!-- @TODO: Change to scalar value after MQE-498 is implemented -->
<argument name="total" value="E2EB2CQuote.total"/>
<argument name="total" value="{{E2EB2CQuote.total}}"/>
</actionGroup>

<!-- Check ship to information in checkout -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
<createData entity="Simple_US_Customer" stepKey="simpleuscustomer"/>
</before>
<after>
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
<!--Clear filters-->
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="navigateToCustomers"/>
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingCustomerFilters"/>

<actionGroup ref="logout" stepKey="logout"/>
<deleteData createDataKey="simpleproduct1" stepKey="deleteProduct1"/>
<deleteData createDataKey="simplecategory" stepKey="deleteCategory"/>
<deleteData createDataKey="simpleuscustomer" stepKey="deleteCustomer"/>
Expand Down
Loading

0 comments on commit 619f2db

Please sign in to comment.