-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Category page and layered navigation for product on custom stock with…
… Elasticsearch 6
- Loading branch information
1 parent
c657f82
commit 055012f
Showing
1 changed file
with
116 additions
and
0 deletions.
There are no files selected for viewing
116 changes: 116 additions & 0 deletions
116
InventoryAdminUi/Test/Mftf/Test/ElasticSearchLayeredNavigationCustomStockTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
<?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="ElasticSearchLayeredNavigationCustomStockTest"> | ||
<annotations> | ||
<stories value="Elasticsearch layered navigation on custom stock"/> | ||
<title value="Elasticsearch layered navigation simple product on custom stock."/> | ||
<description value="Verify, Category page and Layered Navigation for Simple Products on custom stock with Elasticsearch enabled."/> | ||
<testCaseId value="https://app.hiptest.com/projects/69435/test-plan/folders/441590/scenarios/2688239"/> | ||
<severity value="CRITICAL"/> | ||
<group value="msi"/> | ||
<group value="multi_mode"/> | ||
</annotations> | ||
|
||
<before> | ||
<createData entity="SimpleSubCategory" stepKey="category"/> | ||
<createData entity="Msi_US_Customer" stepKey="customer"/> | ||
|
||
<createData entity="FullSource1" stepKey="customSource"/> | ||
<createData entity="BasicMsiStock1" stepKey="customStock"/> | ||
<createData entity="SourceStockLinked1" stepKey="stockSourceLink"> | ||
<requiredEntity createDataKey="customStock"/> | ||
<requiredEntity createDataKey="customSource"/> | ||
</createData> | ||
<actionGroup ref="LoginAsAdmin" stepKey="loginToAdminArea"/> | ||
<amOnPage url="{{AdminManageStockPage.url}}" stepKey="amOnTheStockGridPage"/> | ||
<waitForPageLoad time="30" stepKey="waitForStockGridPageLoad"/> | ||
<actionGroup ref="searchAdminDataGridByKeyword" stepKey="searchCustomStockByKeyword"> | ||
<argument name="keyword" value="$$customStock.stock[name]$$"/> | ||
</actionGroup> | ||
<click selector="{{AdminGridRow.editByValue($$customStock.stock[name]$$)}}" stepKey="clickOnEditForCustomStock"/> | ||
<waitForPageLoad time="60" stepKey="waitForStockEditPageLoad"/> | ||
<selectOption selector="{{AdminEditStockSalesChannelsSection.websites}}" userInput="Main Website" stepKey="selectWebsiteAsSalesChannel"/> | ||
<click selector="{{AdminGridMainControls.saveAndContinue}}" stepKey="saveCustomStock"/> | ||
|
||
<comment userInput="Perform reindex and cache flush after assign default stock to main website." stepKey="reindexCacheFlushAfterAssignDefaultStockToMainWebsite"/> | ||
<magentoCLI command="indexer:reindex" stepKey="performReindex"/> | ||
<magentoCLI command="cache:flush" stepKey="cleanCache"/> | ||
|
||
<createData entity="SimpleProduct" stepKey="simpleProduct"> | ||
<field key="price">10.00</field> | ||
<requiredEntity createDataKey="category"/> | ||
</createData> | ||
<amOnPage url="{{AdminProductEditPage.url($$simpleProduct.id$$)}}" stepKey="openProductEditPageToAssignSource"/> | ||
<actionGroup ref="AssignSourceToProductActionGroup" stepKey="assignUSSource1ToCreatedProduct"> | ||
<argument name="sourceCode" value="$$customSource.source[source_code]$$"/> | ||
</actionGroup> | ||
<fillField selector="{{AdminProductSourcesGrid.rowQty('1')}}" userInput="100" stepKey="setCustomSourceQuantity"/> | ||
<actionGroup ref="UnassignSourceFromProductActionGroup" stepKey="unassignDefaultSourceFromProduct"> | ||
<argument name="sourceCode" value="{{_defaultSource.name}}"/> | ||
</actionGroup> | ||
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveEditedSimpleProduct"/> | ||
|
||
<createData entity="SimpleProduct" stepKey="simpleProduct2"> | ||
<field key="price">40.00</field> | ||
<requiredEntity createDataKey="category"/> | ||
</createData> | ||
<amOnPage url="{{AdminProductEditPage.url($$simpleProduct2.id$$)}}" stepKey="openProductEditPageToAssignSource2"/> | ||
<actionGroup ref="AssignSourceToProductActionGroup" stepKey="assignUSSource1ToCreatedProduct2"> | ||
<argument name="sourceCode" value="$$customSource.source[source_code]$$"/> | ||
</actionGroup> | ||
<fillField selector="{{AdminProductSourcesGrid.rowQty('1')}}" userInput="100" stepKey="setCustomSourceQuantity2"/> | ||
<actionGroup ref="UnassignSourceFromProductActionGroup" stepKey="unassignDefaultSourceFromProduct2"> | ||
<argument name="sourceCode" value="{{_defaultSource.name}}"/> | ||
</actionGroup> | ||
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveEditedSimpleProduct2"/> | ||
|
||
<!--Enable ElasticSearch as search engine.--> | ||
<magentoCLI command="config:set catalog/search/engine elasticsearch6" stepKey="enableElasticSearchAsSearchEngine"/> | ||
<magentoCLI command="indexer:reindex" stepKey="performReindexAfterElasticSearchEnable"/> | ||
<magentoCLI command="cache:flush" stepKey="cleanCacheAfterElasticSearchEnable"/> | ||
</before> | ||
<after> | ||
<comment userInput="Assign Default Stock to Main Website " stepKey="assignDefaultStockToMainWebsiteComment"/> | ||
<amOnPage url="{{AdminManageStockPage.url}}" stepKey="navigateToStockListPage"/> | ||
<waitForPageLoad time="20" stepKey="waitForStockListPageLoad"/> | ||
<actionGroup ref="searchAdminDataGridByKeyword" stepKey="searchDefaultStockByName"> | ||
<argument name="keyword" value="_defaultStock.name"/> | ||
</actionGroup> | ||
<click selector="{{AdminGridRow.editByValue(_defaultStock.name)}}" stepKey="clickEditDefaultStock"/> | ||
<waitForPageLoad time="20" stepKey="waitFroDefaultStockEditPageLoad"/> | ||
<selectOption selector="{{AdminEditStockSalesChannelsSection.websites}}" userInput="Main Website" stepKey="selectDefaultWebsiteAsSalesChannelForDefaultStock"/> | ||
<click selector="{{AdminGridMainControls.saveAndContinue}}" stepKey="saveDefaultStock"/> | ||
<actionGroup ref="DisableSourceActionGroup" stepKey="disableCreatedCustomSource"> | ||
<argument name="sourceCode" value="$$customSource.source[source_code]$$"/> | ||
</actionGroup> | ||
<deleteData createDataKey="category" stepKey="deleteCategory"/> | ||
<deleteData createDataKey="customer" stepKey="deleteCustomer"/> | ||
<deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> | ||
<deleteData createDataKey="simpleProduct2" stepKey="deleteProduct2"/> | ||
<deleteData createDataKey="customStock" stepKey="deleteCustomStock"/> | ||
|
||
<!--Revert ElasticSearch as search engine.--> | ||
<actionGroup ref="ResetSearchEngineConfiguration" stepKey="resetCatalogSearchConfiguration"/> | ||
<magentoCLI command="indexer:reindex" stepKey="performReindexAfterElasticSearchDisable"/> | ||
<magentoCLI command="cache:flush" stepKey="cleanCacheAfterElasticSearchDisable"/> | ||
<actionGroup ref="logout" stepKey="logoutOfAdmin1"/> | ||
</after> | ||
|
||
<!--Verify products are visible on storefront page.--> | ||
<amOnPage url="{{StorefrontCategoryPage.url($$category.name$$)}}" stepKey="navigateToCategoryToVerifyProductsAreVisible"/> | ||
<waitForPageLoad time="30" stepKey="waitForCategoryPageIsLoadToVerifyProductIsNotVisible"/> | ||
<see userInput="$$simpleProduct.name$$" stepKey="verifyProduct1IsVisible"/> | ||
<see userInput="$$simpleProduct2.name$$" stepKey="verifyProduct2IsVisible"/> | ||
<!--Verify prices in layered navigation.--> | ||
<click selector="{{StorefrontLayeredNavigationSection.shoppingOptionsByName('Price')}}" stepKey="openLayeredNavigation"/> | ||
<see userInput="$10.00 - $19.99" selector="//a[contains(@href, 'price=10-20')]" stepKey="verifySmallerPriceRange"/> | ||
<see userInput="40.00 and above" selector="//a[contains(@href, 'price=40')]" stepKey="verifyLargerPriceRange"/> | ||
</test> | ||
</tests> |