Skip to content

Commit

Permalink
Merge pull request magento#3282 from magento-tsg/2.3-develop-mftf-pr7
Browse files Browse the repository at this point in the history
[TSG] MFTF for 2.3 (pr7) (2.3.1)
  • Loading branch information
Alexander Akimov authored Oct 17, 2018
2 parents 515218f + 1e501f2 commit f710f9b
Show file tree
Hide file tree
Showing 13 changed files with 410 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,10 @@
<arguments>
<argument name="website" type="string"/>
</arguments>
<scrollTo selector="{{CreateProductSection.productInWebsite}}" stepKey="ScrollToWebsites"/>
<click selector="{{CreateProductSection.productInWebsite}}" stepKey="ClickTpOpenProductInWebsite"/>
<scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToWebsites"/>
<click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="clickToOpenProductInWebsite"/>
<waitForPageLoad stepKey="waitForPageOpened"/>
<click selector="{{CreateProductSection.isSelected(website)}}" stepKey="SelectWebsite"/>
<click selector="{{CreateProductSection.saveButton}}" stepKey="clickSaveProduct"/>
<checkOption selector="{{ProductInWebsitesSection.website(website)}}" stepKey="selectWebsite"/>
</actionGroup>

<!--Switch to New Store view-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,26 @@
<click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/>
<waitForPageLoad stepKey="waitForPageLoad2" />
</actionGroup>
<actionGroup name="navigateToEditProductAttribute">
<arguments>
<argument name="ProductAttribute" type="string"/>
</arguments>
<amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/>
<waitForPageLoad stepKey="waitForPageLoad1"/>
<fillField selector="{{AdminProductAttributeGridSection.GridFilterFrontEndLabel}}" userInput="{{ProductAttribute}}" stepKey="navigateToAttributeEditPage1" />
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="navigateToAttributeEditPage2" />
<waitForPageLoad stepKey="waitForPageLoad2" />
<click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="navigateToAttributeEditPage3" />
<waitForPageLoad stepKey="waitForPageLoad3" />
</actionGroup>
<actionGroup name="changeUseForPromoRuleConditionsProductAttribute">
<arguments>
<argument name="option" type="string"/>
</arguments>
<click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStoreFrontPropertiesTab"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<selectOption selector="{{StorefrontPropertiesSection.useForPromoRuleConditions}}" userInput="{{option}}" stepKey="changeOption"/>
<click selector="{{AttributePropertiesSection.Save}}" stepKey="saveAttribute"/>
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the product attribute." stepKey="successMessage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
<argument name="mode" type="string"/>
<argument name="numOfProductsPerPage" type="string"/>
<argument name="sortBy" type="string" defaultValue="position"/>
<argument name="sort" type="string" defaultValue="asc"/>
</arguments>
<!-- Go to storefront category page -->
<amOnPage url="{{StorefrontCategoryPage.url(category)}}?product_list_limit={{numOfProductsPerPage}}&amp;product_list_mode={{mode}}&amp;product_list_order={{sortBy}}" stepKey="onCategoryPage"/>
<amOnPage url="{{StorefrontCategoryPage.url(category)}}?product_list_limit={{numOfProductsPerPage}}&amp;product_list_mode={{mode}}&amp;product_list_order={{sortBy}}&amp;product_list_dir={{sort}}" stepKey="onCategoryPage"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>

Expand Down
4 changes: 4 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/FrontendLabelData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@
<data key="store_id">0</data>
<data key="label" unique="suffix">attributeTwo</data>
</entity>
<entity name="ProductAttributeFrontendLabelThree" type="FrontendLabel">
<data key="store_id">0</data>
<data key="label" unique="suffix">attributeThree</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="StorefrontProductPage" url="/{{var1}}.html" area="storefront" module="Catalog" parameterized="true">
<page name="StorefrontProductPage" url="/{{var1}}.html" area="storefront" module="Magento_Catalog" parameterized="true">
<section name="StorefrontProductInfoMainSection" />
<section name="StorefrontProductInfoDetailsSection" />
<section name="WYSIWYGToolbarSection"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
<element name="rowProductSku" type="text" selector="#catalog_category_products_table tbody tr:nth-of-type({{row}}) .col-sku" parameterized="true"/>
<element name="rowPrice" type="text" selector="#catalog_category_products_table tbody tr:nth-of-type({{row}}) .col-price" parameterized="true"/>
<element name="rowPosition" type="input" selector="#catalog_category_products_table tbody tr:nth-of-type({{row}}) .col-position .position input" timeout="30" parameterized="true"/>
<element name="productGridNameProduct" type="text" selector="//table[@id='catalog_category_products_table']//td[contains(., '{{productName}}')]" parameterized="true"/>
</section>
</sections>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
<?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="AdminFilteringCategoryProductsUsingScopeSelectorTest">
<annotations>
<features value="Catalog"/>
<title value="Filtering Category Products using scope selector"/>
<description value="Filtering Category Products using scope selector"/>
<severity value="MAJOR"/>
<testCaseId value="MAGETWO-48850"/>
<group value="catalog"/>
</annotations>
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<!--Create website, Sore adn Store View-->
<actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="adminCreateWebsite">
<argument name="newWebsiteName" value="secondWebsite"/>
<argument name="websiteCode" value="second_website"/>
</actionGroup>
<actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="adminCreateStore">
<argument name="website" value="secondWebsite"/>
<argument name="storeGroupName" value="secondStore"/>
<argument name="storeGroupCode" value="second_store"/>
</actionGroup>
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="adminCreateStoreView">
<argument name="StoreGroup" value="customStoreTierPrice"/>
<argument name="customStore" value="customStoreView"/>
</actionGroup>

<!--Create Simple Product and Category -->
<createData entity="_defaultCategory" stepKey="createCategory"/>
<createData entity="_defaultProduct" stepKey="createProduct0">
<requiredEntity createDataKey="createCategory"/>
</createData>
<createData entity="_defaultProduct" stepKey="createProduct1">
<requiredEntity createDataKey="createCategory"/>
</createData>
<createData entity="_defaultProduct" stepKey="createProduct2">
<requiredEntity createDataKey="createCategory"/>
</createData>
<createData entity="_defaultProduct" stepKey="createProduct12">
<requiredEntity createDataKey="createCategory"/>
</createData>

<!-- Set filter to product name and product0 not assigned to any website-->
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="filterGroupedProductOptions">
<argument name="product" value="_defaultProduct"/>
</actionGroup>

<click selector="{{AdminProductGridSection.productGridNameProduct('$$createProduct0.name$$')}}"
stepKey="clickOpenProductForEdit"/>
<waitForPageLoad time="30" stepKey="waitForProductEditOpen"/>

<scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToWebsitesSection"/>
<click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="clickToOpenWebsiteSection"/>
<waitForPageLoad stepKey="waitForToOpenedWebsiteSection"/>
<uncheckOption selector="{{ProductInWebsitesSection.website('Main Website')}}" stepKey="uncheckWebsite"/>
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/>
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product."
stepKey="seeSuccessMessage"/>

<!-- Set filter to product name and product2 in website 2 only -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
<waitForPageLoad time="30" stepKey="waitForProductsPageToLoad"/>
<click selector="{{AdminProductGridSection.productGridNameProduct('$$createProduct2.name$$')}}"
stepKey="clickOpenProductForEdit1"/>
<waitForPageLoad time="30" stepKey="waitForProductEditOpen1"/>

<actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectProductInWebsites">
<argument name="website" value="secondWebsite"/>
</actionGroup>
<uncheckOption selector="{{ProductInWebsitesSection.website('Main Website')}}" stepKey="uncheckWebsite1"/>
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct1"/>
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product."
stepKey="seeSuccessMessage1"/>

<!-- Set filter to product name and product12 assigned to both websites 1 and 2 -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex1"/>
<waitForPageLoad time="30" stepKey="waitForProductsPageToLoad1"/>
<click selector="{{AdminProductGridSection.productGridNameProduct('$$createProduct12.name$$')}}"
stepKey="clickOpenProductForEdit2"/>
<waitForPageLoad time="30" stepKey="waitForProductEditOpen2"/>

<actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectProductInWebsites1">
<argument name="website" value="secondWebsite"/>
</actionGroup>
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct2"/>
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product."
stepKey="seeSuccessMessage2"/>
</before>
<after>
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite">
<argument name="websiteName" value="secondWebsite"/>
</actionGroup>
<actionGroup ref="ClearProductsFilterActionGroup" stepKey="clearProductsFilter"/>
<deleteData createDataKey="createProduct0" stepKey="deleteProduct"/>
<deleteData createDataKey="createProduct1" stepKey="deleteProduct1"/>
<deleteData createDataKey="createProduct2" stepKey="deleteProduct2"/>
<deleteData createDataKey="createProduct12" stepKey="deleteProduct3"/>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<actionGroup ref="logout" stepKey="logout"/>
</after>
<!-- Step 1-2: Open Category page and Set scope selector to All Store Views-->
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="goToCategoryPage"/>
<waitForPageLoad stepKey="waitForCategoryPageLoad"/>
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree($$createCategory.name$$)}}"
stepKey="clickCategoryName"/>
<click selector="{{AdminCategoryProductsSection.sectionHeader}}" stepKey="openProductSection"/>
<see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct0.name$$)}}"
userInput="$$createProduct0.name$$" stepKey="seeProductName"/>
<see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct1.name$$)}}"
userInput="$$createProduct1.name$$" stepKey="seeProductName1"/>
<see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct2.name$$)}}"
userInput="$$createProduct2.name$$" stepKey="seeProductName2"/>
<see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct12.name$$)}}"
userInput="$$createProduct12.name$$" stepKey="seeProductName3"/>

<!-- Step 3: Set scope selector to Website1( Storeview for the Website 1) -->
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewDropdownToggle}}"
stepKey="clickStoresList"/>
<waitForPageLoad stepKey="waitForCategoryPageLoad1"/>
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewOption('Default Store View')}}"
stepKey="clickStoreView"/>
<waitForElement selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}"
stepKey="waitForModalAccept"/>
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}" stepKey="clickActionAccept"/>
<waitForElementNotVisible selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}"
stepKey="waitForNotVisibleModalAccept"/>
<waitForPageLoad stepKey="waitForCategoryPageLoad2"/>
<click selector="{{AdminCategoryProductsSection.sectionHeader}}" stepKey="openProductSection1"/>
<see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct1.name$$)}}"
userInput="$$createProduct1.name$$" stepKey="seeProductName4"/>
<see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct12.name$$)}}"
userInput="$$createProduct12.name$$" stepKey="seeProductName5"/>
<dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct0.name$$)}}"
userInput="$$createProduct0.name$$" stepKey="dontSeeProductName"/>
<dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct2.name$$)}}"
userInput="$$createProduct2.name$$" stepKey="dontSeeProductName1"/>

<!-- Step 4: Set scope selector to Website2 ( StopreView for Website 2) -->
<scrollToTopOfPage stepKey="scrollToTopOfPage1"/>
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewDropdownToggle}}"
stepKey="clickStoresList1"/>
<waitForPageLoad stepKey="waitForCategoryPageLoad3"/>
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewOption('secondStoreView')}}"
stepKey="clickStoreView1"/>
<waitForElement selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}"
stepKey="waitForModalAccept1"/>
<click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}"
stepKey="clickActionAccept1"/>
<waitForElementNotVisible selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}"
stepKey="waitForNotVisibleModalAccept1"/>
<waitForPageLoad stepKey="waitForCategoryPageLoad4"/>
<click selector="{{AdminCategoryProductsSection.sectionHeader}}" stepKey="openProductSection2"/>
<see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct2.name$$)}}"
userInput="$$createProduct2.name$$" stepKey="seeProductName6"/>
<see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct12.name$$)}}"
userInput="$$createProduct12.name$$" stepKey="seeProductName7"/>
<dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct0.name$$)}}"
userInput="$$createProduct0.name$$" stepKey="dontSeeProductName2"/>
<dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct2.name$$)}}"
userInput="$$createProduct1.name$$" stepKey="dontSeeProductName3"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
<amOnPage stepKey="goToPriceRulePage" url="{{CatalogRulePage.url}}"/>
<waitForPageLoad stepKey="waitForPriceRulePage"/>
<click stepKey="addNewRule" selector="{{AdminGridMainControls.add}}"/>
<waitForPageLoad stepKey="waitForIndividualRulePage"/>

<!-- Fill the form according the attributes of the entity -->
<fillField stepKey="fillName" selector="{{AdminNewCatalogPriceRule.ruleName}}" userInput="{{catalogRule.name}}"/>
Expand All @@ -44,4 +43,19 @@
<click stepKey="applyRules" selector="{{AdminCatalogPriceRuleGrid.applyRules}}"/>
<see stepKey="assertSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="Updated rules applied."/>
</actionGroup>

<!--Add Catalog Rule Condition With product SKU-->
<actionGroup name="newCatalogPriceRuleByUIWithConditionIsSKU" extends="newCatalogPriceRuleByUI">
<arguments>
<argument name="productSku"/>
</arguments>
<click selector="{{AdminNewCatalogPriceRule.conditionsTab}}" after="discardSubsequentRules" stepKey="openConditionsTab"/>
<waitForPageLoad after="openConditionsTab" stepKey="waitForConditionTabOpened"/>
<click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" after="waitForConditionTabOpened" stepKey="addNewCondition"/>
<selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="Magento\CatalogRule\Model\Rule\Condition\Product|sku" after="addNewCondition" stepKey="selectTypeCondition"/>
<waitForPageLoad after="selectTypeCondition" stepKey="waitForConditionChosed"/>
<click selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsis('1')}}" after="waitForConditionChosed" stepKey="clickEllipsis"/>
<fillField selector="{{AdminNewCatalogPriceRuleConditions.targetInput('1', '1')}}" userInput="{{productSku}}" after="clickEllipsis" stepKey="fillProductSku"/>
<click selector="{{AdminNewCatalogPriceRuleConditions.applyButton('1', '1')}}" after="fillProductSku" stepKey="clickApply"/>
</actionGroup>
</actionGroups>
14 changes: 14 additions & 0 deletions app/code/Magento/CatalogRule/Test/Mftf/Data/CatalogRuleData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,18 @@
<data key="simple_action">to_fixed</data>
<data key="discount_amount">110.7</data>
</entity>

<entity name="CatalogRuleByPercentWith96Amount" type="catalogRule">
<data key="name" unique="suffix">CatalogPriceRule</data>
<data key="description">Catalog Price Rule Description</data>
<data key="is_active">1</data>
<array key="customer_group_ids">
<item>0</item>
</array>
<array key="website_ids">
<item>1</item>
</array>
<data key="simple_action">by_percent</data>
<data key="discount_amount">96</data>
</entity>
</entities>
Loading

0 comments on commit f710f9b

Please sign in to comment.