Skip to content

Commit cdc6ea2

Browse files
authored
Merge pull request #4705 from magento-tsg/2.2.10-develop-pr115
[TSG] Fixes for 2.2 (pr115) (2.2.10-develop)
2 parents 3ae1e3e + 9caa386 commit cdc6ea2

File tree

6 files changed

+30
-16
lines changed

6 files changed

+30
-16
lines changed

app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CatalogPriceRuleActionGroup.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,27 @@
1515
</arguments>
1616
<!-- Go to the admin Catalog rule grid and add a new one -->
1717
<amOnPage url="{{AdminCatalogPriceRuleGridPage.url}}" stepKey="goToAdminCatalogPriceRuleGridPage"/>
18-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/>
18+
<waitForPageLoad time="30" stepKey="waitForPageFullyLoaded"/>
1919
<click selector="{{AdminMainActionsSection.add}}" stepKey="addNewRule"/>
20-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear1"/>
2120

2221
<!-- Fill the form according the attributes of the entity -->
22+
<waitForElementVisible selector="{{AdminCatalogPriceRuleSection.ruleName}}" stepKey="waitRuleNameFieldAppears"/>
2323
<fillField selector="{{AdminCatalogPriceRuleSection.ruleName}}" userInput="{{catalogRule.name}}" stepKey="fillName"/>
2424
<fillField selector="{{AdminCatalogPriceRuleSection.description}}" userInput="{{catalogRule.description}}" stepKey="fillDescription"/>
2525
<selectOption selector="{{AdminCatalogPriceRuleSection.websites}}" parameterArray="{{catalogRule.websites}}" stepKey="selectWebsites"/>
2626
<selectOption selector="{{AdminCatalogPriceRuleSection.customerGroups}}" parameterArray="{{catalogRule.groups}}" stepKey="selectCustomerGroups"/>
2727

28-
<click selector="{{AdminCatalogPriceRuleSection.actionsTab}}" stepKey="openActionDropdown"/>
28+
<scrollTo selector="{{AdminCatalogPriceRuleSection.actionsTabTitle}}" stepKey="scrollToActionsSection"/>
29+
<conditionalClick selector="{{AdminCatalogPriceRuleSection.actionsTabTitle}}" dependentSelector="{{AdminCatalogPriceRuleSection.actionsTabBody}}" visible="false" stepKey="openActionsTabIfCollapsed"/>
2930
<selectOption selector="{{AdminCatalogPriceRuleActionsSection.apply}}" userInput="{{catalogRule.simple_action}}" stepKey="discountType"/>
3031
<fillField selector="{{AdminCatalogPriceRuleActionsSection.discountAmount}}" userInput="{{catalogRule.discount_amount}}" stepKey="fillDiscountValue"/>
3132
<selectOption selector="{{AdminCatalogPriceRuleActionsSection.disregardRules}}" userInput="Yes" stepKey="discardSubsequentRules"/>
3233

3334
<!-- Scroll to top and either save or save and apply after the action group -->
3435
<scrollToTopOfPage stepKey="scrollToTop"/>
3536
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSave"/>
36-
<waitForPageLoad stepKey="waitForRuleSaved"/>
37-
<see userInput="You saved the rule." stepKey="verifyRuleSaved"/>
37+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
38+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the rule." stepKey="checkSuccessMessage"/>
3839
</actionGroup>
3940

4041
<actionGroup name="RemoveCatalogPriceRule">
@@ -48,13 +49,12 @@
4849
<fillField selector="{{AdminCatalogPriceRuleGridSection.filterByRuleName}}" userInput="{{ruleName}}" stepKey="filterByRuleName"/>
4950
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearch"/>
5051
<click selector="{{AdminGridTableSection.row('1')}}" stepKey="clickEdit"/>
51-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear1"/>
52-
52+
<waitForPageLoad stepKey="waitForEditRuleFormLoad"/>
53+
<waitForElementVisible selector="{{AdminMainActionsSection.delete}}" stepKey="waitDeleteButtonAppears"/>
5354
<click selector="{{AdminMainActionsSection.delete}}" stepKey="clickToDelete"/>
5455
<waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForElementVisible"/>
5556
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickToConfirm"/>
5657
<waitForPageLoad stepKey="waitForPageLoad"/>
57-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear2"/>
5858
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitSuccessMessageAppears"/>
5959
<see selector="{{AdminMessagesSection.success}}" userInput="You deleted the rule." stepKey="checkSuccessMessage"/>
6060
</actionGroup>

app/code/Magento/CatalogRule/Test/Mftf/Data/CatalogRuleData.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,16 @@
4747
<data key="simple_action">to_percent</data>
4848
<data key="discount_amount">90</data>
4949
</entity>
50+
<entity name="CatalogRuleToPercent90" type="catalogRule">
51+
<data key="name" unique="suffix">CatalogPriceRule</data>
52+
<data key="description">Catalog Price Rule Description</data>
53+
<array key="groups">
54+
<item>NOT LOGGED IN</item>
55+
</array>
56+
<array key="websites">
57+
<item>Main Website</item>
58+
</array>
59+
<data key="simple_action">Adjust final price to this percentage</data>
60+
<data key="discount_amount">90</data>
61+
</entity>
5062
</entities>

app/code/Magento/CatalogRule/Test/Mftf/Section/AdminCatalogPriceRuleSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,7 @@
2727
<element name="priority" type="input" selector="[name='sort_order']"/>
2828
<element name="conditionsTab" type="block" selector="[data-index='block_promo_catalog_edit_tab_conditions']"/>
2929
<element name="actionsTab" type="block" selector="[data-index='actions']"/>
30+
<element name="actionsTabTitle" type="block" selector="[data-index='actions'] .fieldset-wrapper-title"/>
31+
<element name="actionsTabBody" type="block" selector="[data-index='actions'] .admin__fieldset-wrapper-content"/>
3032
</section>
3133
</sections>

app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,9 @@
4444
<after>
4545
<deleteData createDataKey="createSimpleProductApi" stepKey="deleteSimpleProductApi"/>
4646
<!-- Delete the rule -->
47-
<actionGroup ref="RemoveCatalogPriceRule" stepKey="deletePriceRule">
48-
<argument name="ruleName" value="CatalogRuleToPercent.name" />
49-
</actionGroup>
47+
<actionGroup ref="deleteAllCatalogPriceRule" stepKey="removeAllExistingCartPriceRules"/>
5048

5149
<!--Clear all filters in grid-->
52-
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="resetCatalogRuleGridFilters"/>
5350
<amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/>
5451
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/>
5552
<actionGroup ref="logout" stepKey="logout"/>

app/code/Magento/SalesRule/Test/Mftf/Section/StorefrontDiscountSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<section name="StorefrontDiscountSection">
1111
<element name="discountTab" type="button" selector="#block-discount-heading"/>
1212
<element name="couponInput" type="input" selector="#coupon_code"/>
13-
<element name="applyCodeBtn" type="button" selector="button[value='Apply Discount']"/>
13+
<element name="applyCodeBtn" type="button" selector="button[value='Apply Discount']" timeout="30"/>
1414
<element name="cancelCoupon" type="button" selector="button[value='Cancel Coupon']"/>
1515
<element name="discountInput" type="input" selector="#discount-code"/>
1616
<element name="discountBlockActive" type="text" selector=".block.discount.active"/>

app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@
6969
<requiredEntity createDataKey="createConfigChildProduct2"/>
7070
</createData>
7171

72+
<!--Login to Admin-->
73+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
74+
75+
<actionGroup ref="deleteAllCartPriceRule" stepKey="deleteAllCartPriceRules"/>
76+
7277
<!--Create cart price rule-->
7378
<createData entity="SaleRule50PercentDiscountNoCoupon" stepKey="createCartPriceRule">
7479
<field key="discount_amount">70</field>
@@ -78,9 +83,6 @@
7883
<requiredEntity createDataKey="createCartPriceRule"/>
7984
</createData>
8085

81-
<!--Login to Admin-->
82-
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
83-
8486
<!--Set attribute sku property Use for Promo Rule Conditions = Yes and save attribute-->
8587
<actionGroup ref="navigateToProductAttribute" stepKey="goToProductAttributeSkuPage">
8688
<argument name="attributeCode" value="sku"/>
@@ -117,6 +119,7 @@
117119
<actionGroup ref="logout" stepKey="logout"/>
118120
</after>
119121

122+
<actionGroup ref="CustomerLogoutStorefrontActionGroup" stepKey="customerLogout"/>
120123
<!--Go to product page-->
121124
<amOnPage url="{{StorefrontProductPage.url($$createConfigProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage"/>
122125

0 commit comments

Comments
 (0)