Skip to content

Commit

Permalink
Merge pull request #5388 from magento-tsg/2.4-develop-pr19
Browse files Browse the repository at this point in the history
[TSG] TESTs Fixes for 2.4 (pr19) (2.4-develop)
  • Loading branch information
zakdma authored Feb 27, 2020
2 parents 24c2169 + c0bc92c commit 9f093a3
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,21 @@
<test name="EndToEndB2CLoggedInUserTest">
<annotations>
<features value="End to End scenarios"/>
<stories value="B2C logged in user - MAGETWO-72524"/>
<stories value="B2C logged in user - MC-25681"/>
<group value="e2e"/>
<title value="You should be able to pass End to End B2C Logged In User scenario"/>
<description value="New user signup and browses catalog, searches for product, adds product to cart, adds product to wishlist, compares products, uses coupon code and checks out."/>
<severity value="CRITICAL"/>
<testCaseId value="MAGETWO-87653"/>
<skip>
<issueId value="MC-17140"/>
</skip>
<testCaseId value="MC-25681"/>
<group value="SearchEngineMysql"/>
</annotations>
<before>
<resetCookie userInput="PHPSESSID" stepKey="resetCookieForCart"/>
</before>
<after>
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<actionGroup ref="DeleteCustomerFromAdminActionGroup" stepKey="deleteCustomerFromAdmin"/>
<actionGroup ref="logout" stepKey="adminLogout"/>
</after>
<!-- Step 0: User signs up an account -->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?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="AdminUploadTransactionEmailsImageActionGroup">
<annotations>
<description>Upload logo image for email</description>
</annotations>
<arguments>
<argument name="image" type="string" defaultValue="{{MagentoLogo.file}}"/>
<argument name="width" type="string" defaultValue="200"/>
<argument name="height" type="string" defaultValue="100"/>
</arguments>

<conditionalClick selector="{{AdminDesignConfigSection.transactionalEmailSectionHeader}}" dependentSelector="{{AdminDesignConfigSection.transactionalEmailSectionBody}}" visible="false" stepKey="openTransactionalEmailSection"/>
<waitForElementVisible selector="{{AdminDesignConfigSection.logoImageAlt}}" stepKey="waitVisibleUploadLogo"/>
<attachFile selector="{{AdminDesignConfigSection.logoUpload}}" userInput="{{image}}" stepKey="attachLogo"/>
<waitForElementVisible selector="{{AdminDesignConfigSection.logoPreview}}" stepKey="waitingForLogoToUpload"/>
<seeElement selector="{{AdminDesignConfigSection.logoPreview}}" stepKey="logoPreviewIsVisible"/>
<fillField selector="{{AdminDesignConfigSection.logoImageAlt}}" userInput="{{image}}" stepKey="fillFieldImageAlt"/>
<fillField selector="{{AdminDesignConfigSection.logoImageWidth}}" userInput="{{width}}" stepKey="fillFieldImageWidth"/>
<fillField selector="{{AdminDesignConfigSection.logoImageHeight}}" userInput="{{height}}" stepKey="fillFieldImageHeight"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,44 @@
<test name="TransactionalEmailsLogoUploadTest">
<annotations>
<features value="Email"/>
<stories value="Email"/>
<title value="MC-13908: Uploading a Transactional Emails logo"/>
<stories value="Transactional Emails logo"/>
<title value="Uploading a Transactional Emails logo"/>
<description value="Transactional Emails Logo should be able to be uploaded in the admin and previewed"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-13908"/>
<group value="LogoUpload"/>
<skip>
<issueId value="MC-18496"/>
</skip>
<testCaseId value="MC-27620"/>
<useCaseId value="MC-10932"/>
<group value="theme"/>
<group value="email"/>
</annotations>
<!--Login to Admin Area-->
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginToAdminArea"/>
<!--Login to Admin Area-->
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
</before>
<!--Logout from Admin Area-->
<after>
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
<!-- Clear filter on Design Config Page -->
<amOnPage url="{{DesignConfigPage.url}}" stepKey="navigateToDesignConfigPage" />
<waitForPageLoad stepKey="waitForPageLoadToViewDesignConfigPage"/>
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/>
<!--Logout from Admin Area-->
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
</after>
<!--Navigate to content->Design->Config page-->
<amOnPage url="{{DesignConfigPage.url}}" stepKey="navigateToDesignConfigPage" />
<waitForPageLoad stepKey="waitForPageloadToViewDesignConfigPage"/>
<click selector="{{AdminDesignConfigSection.scopeRow('3')}}" stepKey="editStoreView"/>
<waitForPageLoad stepKey="waitForPageLoadToViewDesignConfigPage"/>
<actionGroup ref="AdminGridFilterSearchResultsBySelectActionGroup" stepKey="filterThemeDesignConfiguration">
<argument name="attributeSelector" value="store_id"/>
<argument name="attributeValue" value="{{_defaultStore.name}}"/>
</actionGroup>
<click selector="{{AdminDesignConfigSection.scopeRow('1')}}" stepKey="editStoreView"/>
<waitForPageLoad stepKey="waitForPageLoadToOpenStoreViewEditPage"/>
<!--Click Upload logo in Transactional Emails and upload the image and preview it-->
<click selector="{{AdminDesignConfigSection.logoWrapperOpen}}" stepKey="openTab" />
<attachFile selector="{{AdminDesignConfigSection.logoUpload}}" userInput="{{MagentoLogo.file}}" stepKey="attachLogo"/>
<wait time="5" stepKey="waitingForLogoToUpload" />
<seeElement selector="{{AdminDesignConfigSection.logoPreview}}" stepKey="LogoPreviewIsVisible"/>
<!-- Upload Image -->
<actionGroup ref="AdminUploadTransactionEmailsImageActionGroup" stepKey="uploadImage">
<argument name="width" value="200"/>
<argument name="height" value="100"/>
</actionGroup>
<!--Save Design Configuration -->
<actionGroup ref="ClickSaveButtonActionGroup" stepKey="saveDesignConfiguration">
<argument name="message" value="You saved the configuration."/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,12 @@
<title value="Create Credit Memo for Offline Payment Methods"/>
<description value="Create CreditMemo return to stock only one unit of configurable product"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-15865"/>
<testCaseId value="MC-28444"/>
<group value="sales"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>

<!-- Create Data -->
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>

<!-- Create the category -->
<createData entity="ApiCategory" stepKey="createCategory"/>

<!-- Create the configurable product and add it to the category -->
Expand Down Expand Up @@ -88,6 +83,7 @@
<!-- Enable payment method one of "Check/Money Order" and shipping method one of "Flat Rate" -->
<magentoCLI command="config:set {{enabledCheckMoneyOrder.label}} {{enabledCheckMoneyOrder.value}}" stepKey="enableCheckMoneyOrder"/>
<createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRate"/>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
</before>
<after>
<!-- Delete data -->
Expand All @@ -97,8 +93,10 @@
<deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/>
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>
<deleteData createDataKey="createCategory" stepKey="deleteApiCategory"/>
<actionGroup ref="logout" stepKey="logout"/>

<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductGridFilters"/>
<actionGroup ref="logout" stepKey="logout"/>
<!-- Reindex invalidated indices after product attribute has been created/deleted -->
<actionGroup ref="CliRunReindexUsingCronJobsActionGroup" stepKey="reindexInvalidatedIndices"/>
</after>
Expand All @@ -109,9 +107,9 @@

<!--Add configurable product to order-->
<actionGroup ref="AddConfigurableProductToOrderFromAdminActionGroup" stepKey="addConfigurableProductToOrder">
<argument name="product" value="$$createConfigProduct$$"/>
<argument name="attribute" value="$$createConfigProductAttribute$$"/>
<argument name="option" value="$$getConfigAttributeOption1$$"/>
<argument name="product" value="$createConfigProduct$"/>
<argument name="attribute" value="$createConfigProductAttribute$"/>
<argument name="option" value="$getConfigAttributeOption1$"/>
</actionGroup>

<actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerInfo">
Expand All @@ -121,19 +119,16 @@
<actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRate"/>
<click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitOrder"/>
<waitForPageLoad stepKey="waitForSubmitOrderPage"/>
<see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/>
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessageForOrderAppears"/>
<see selector="{{AdminMessagesSection.success}}" userInput="You created the order." stepKey="seeSuccessMessageForOrder"/>

<!-- Create Invoice -->
<actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/>
<click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/>
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/>
<see selector="{{AdminMessagesSection.success}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess"/>
<actionGroup ref="SubmitInvoiceActionGroup" stepKey="clickSubmitInvoice"/>

<!-- Go to Sales > Orders > find out placed order and open -->
<grabTextFrom selector="|Order # (\d+)|" stepKey="grabOrderId" />
<assertNotEmpty actual="$grabOrderId" stepKey="assertOrderIdIsNotEmpty" after="grabOrderId"/>
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder">
<argument name="orderId" value="{$grabOrderId}"/>
<actionGroup ref="AdminOpenOrderByEntityIdActionGroup" stepKey="openOrder">
<argument name="entityId" value="{$grabOrderIdClickSubmitInvoice}"/>
</actionGroup>

<!-- Click 'Credit Memo' button and fill data from dataset: partial refund -->
Expand All @@ -143,11 +138,7 @@
</actionGroup>

<!-- On order's page click 'Refund offline' button -->
<click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickRefundOffline"/>
<waitForPageLoad stepKey="waitForResultPage"/>

<!-- Perform all assertions: assert refund success create message -->
<see selector="{{AdminIndexManagementSection.successMessage}}" userInput="You created the credit memo." stepKey="assertRefundSuccessCreateMessage"/>
<actionGroup ref="SubmitCreditMemoActionGroup" stepKey="clickRefundOffline"/>

<!-- Assert product Qty decreased after CreditMemo -->
<actionGroup ref="AdminAssertProductQtyInGridActionGroup" stepKey="assertQtyDecreased">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<title value="Category rules should apply to grouped product with invisible individual products"/>
<description value="Category rules should apply to grouped product with invisible individual products"/>
<severity value="CRITICAL"/>
<testCaseId value="MC-13608"/>
<testCaseId value="MC-31863"/>
<group value="SalesRule"/>
</annotations>
<before>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
<element name="logoUpload" type ="input" selector="[name='email_logo']" />
<element name="logoWrapperOpen" type ="text" selector="[data-index='email'] [data-state-collapsible ='closed']"/>
<element name="logoPreview" type ="text" selector="[alt ='magento-logo.png']"/>
<element name="logoImageAlt" type ="text" selector="[name='email_logo_alt']"/>
<element name="logoImageWidth" type ="text" selector="[name='email_logo_width']"/>
<element name="logoImageHeight" type ="text" selector="[name='email_logo_height']"/>
<element name="faviconArrow" type="button" selector="#ZmF2aWNvbg-- > .jstree-icon" />
<element name="checkIfFaviconArrowExpand" type="button" selector="//li[@id='ZmF2aWNvbg--' and contains(@class,'jstree-closed')]" />
<element name="storesArrow" type="button" selector="#ZmF2aWNvbi9zdG9yZXM- > .jstree-icon" />
Expand All @@ -34,5 +37,7 @@
<element name="imageWatermarkType" type="text" selector="//div[contains(@class, 'fieldset-wrapper-title')]//span[contains(text(), '{{watermarkType}}')]" parameterized="true"/>
<element name="appliedTheme" type="select" selector="select[name='theme_theme_id']"/>
<element name="scopeEditLinkByName" type="button" selector="//tr//td[count(//div[@data-role='grid-wrapper']//tr//th[normalize-space(.)= '{{scope}}']/preceding-sibling::th)+1][contains(.,'{{scopeName}}')]/..//a[contains(@class, 'action-menu-item')]" timeout="30" parameterized="true"/>
<element name="transactionalEmailSectionHeader" type="button" selector="[data-index='email'] .fieldset-wrapper-title" timeout="30"/>
<element name="transactionalEmailSectionBody" type="block" selector="[data-index='email'] .admin__fieldset-wrapper-content" timeout="30"/>
</section>
</sections>
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="AdminGridFilterSearchResultsBySelectActionGroup">
<annotations>
<description>Filters an Admin Grid page using the provided Filter Selector and Search Value.</description>
</annotations>
<arguments>
<argument name="attributeSelector" type="string" defaultValue="store_id"/>
<argument name="attributeValue" type="string" defaultValue="{{_defaultStore.name}}"/>
</arguments>

<conditionalClick selector="{{AdminGridFilterControls.clearAll}}" dependentSelector="{{AdminGridFilterControls.clearAll}}" visible="true" stepKey="clearTheFiltersIfPresent"/>
<waitForPageLoad time="30" stepKey="waitForFilterApplied"/>
<click selector="{{AdminGridFilterControls.filters}}" stepKey="clickOnFilters"/>
<selectOption selector="{{AdminDataGridFilterSection.filterSelectFieldByName(attributeSelector)}}" userInput="{{attributeValue}}" stepKey="setAttributeValue"/>
<click selector="{{AdminGridFilterControls.applyFilters}}" stepKey="clickOnApplyFilters"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<element name="filterExpand" type="button" selector="//div[@class='admin__data-grid-header'][(not(ancestor::*[@class='sticky-header']) and not(contains(@style,'visibility: hidden'))) or (ancestor::*[@class='sticky-header' and not(contains(@style,'display: none'))])]//button[@data-action='grid-filter-expand']" />
<element name="inputFieldByNameAttr" type="input" selector="//*[@data-part='filter-form']//input[@name='{{inputNameAttr}}']" parameterized="true" />
<element name="inputFieldByNameAttrInGrid" type="input" selector="//*[@data-role='filter-form']//input[@name='{{inputNameAttr}}']" parameterized="true"/>
<element name="filterSelectFieldByName" type="select" selector="//*[@data-part='filter-form']//select[@name='{{fieldName}}']" parameterized="true"/>
<element name="apply" type="button" selector="//*[@data-part='filter-form']//button[@data-action='grid-filter-apply']" />
<element name="clear" type="button" selector=".admin__data-grid-header [data-action='grid-filter-reset']" />
</section>
Expand Down

0 comments on commit 9f093a3

Please sign in to comment.