Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Category page and layered navigation for product on custom stock with Elasticsearch 6 #2478

Merged
merged 1 commit into from
Aug 13, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>