Skip to content

Commit

Permalink
Merge pull request #5677 from magento-tsg/2.4-develop-pr39
Browse files Browse the repository at this point in the history
[TSG] TESTs Fixes for 2.4 (pr39) (2.4-develop)
  • Loading branch information
zakdma committed Jun 2, 2020
2 parents 134ef81 + 5b6121b commit 39012d4
Showing 1 changed file with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<testCaseId value="MC-71"/>
<group value="CatalogRule"/>
</annotations>

<before>
<!-- Create a simple product and a category-->
<createData entity="ApiCategory" stepKey="createCategory"/>
Expand All @@ -25,33 +26,32 @@
</createData>

<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteAllCatalogPriceRule"/>
<!-- Perform reindex and flush cache -->
<actionGroup ref="AdminReindexAndFlushCache" stepKey="reindexAndFlushCache"/>
</before>

<after>
<!-- Delete the simple product and category -->
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<!-- Delete the catalog rule -->
<amOnPage url="{{CatalogRulePage.url}}" stepKey="goToRulePage"/>
<waitForPageLoad stepKey="waitForRulePage"/>
<actionGroup ref="deleteEntitySecondaryGrid" stepKey="deletePriceRule">
<argument name="name" value="{{_defaultCatalogRule.name}}"/>
<argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/>
</actionGroup>
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
<actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteAllCatalogPriceRule"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/>
<magentoCron groups="index" stepKey="reindexInvalidatedIndices"/>
</after>

<!-- Create a catalog rule for the NOT LOGGED IN customer group -->
<actionGroup ref="NewCatalogPriceRuleByUIActionGroup" stepKey="createNewPriceRule"/>
<actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/>
<click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="saveAndApply"/>
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccess"/>

<!-- Perform reindex and flush cache -->
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
<magentoCLI command="cache:flush" stepKey="flushCache"/>
<actionGroup ref="AdminOpenNewCatalogPriceRuleFormPageActionGroup" stepKey="createNewPriceRule"/>
<actionGroup ref="AdminCatalogPriceRuleFillMainInfoActionGroup" stepKey="fillMainInfoForPriceRule">
<argument name="groups" value="'NOT LOGGED IN'"/>
</actionGroup>
<actionGroup ref="AdminCatalogPriceRuleFillActionsActionGroup" stepKey="fillActionsPriceRule"/>
<actionGroup ref="AdminCatalogPriceRuleSaveAndApplyActionGroup" stepKey="saveAndApplyFPriceRule"/>

<!-- As a NOT LOGGED IN user, go to the storefront category page and should see the discount -->
<amOnPage url="$$createCategory.name$$.html" stepKey="goToCategory1"/>
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="goToCategory1">
<argument name="category" value="$createCategory$"/>
</actionGroup>
<see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="$$createProduct.name$$" stepKey="seeProduct1"/>
<see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="$110.70" stepKey="seeDiscountedPrice1"/>

Expand All @@ -67,7 +67,9 @@
</actionGroup>

<!-- As a logged in user, go to the storefront category page and should NOT see discount -->
<amOnPage url="$$createCategory.name$$.html" stepKey="goToCategory2"/>
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="goToCategory2">
<argument name="category" value="$createCategory$"/>
</actionGroup>
<see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="$$createProduct.name$$" stepKey="seeProduct2"/>
<see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="$123.00" stepKey="seeDiscountedPrice2"/>
</test>
Expand Down

0 comments on commit 39012d4

Please sign in to comment.