Skip to content

Commit 8112a38

Browse files
authored
Merge pull request #5001 from magento-tsg/2.3-develop-pr85
[TSG] TESTs Fixes for 2.3 (pr85) (2.3-develop)
2 parents 970abcb + 90b95f3 commit 8112a38

File tree

45 files changed

+875
-214
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+875
-214
lines changed

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,24 @@
1919
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessageAppears"/>
2020
<see selector="{{AdminMessagesSection.success}}" userInput="The widget instance has been saved" stepKey="seeSuccess"/>
2121
</actionGroup>
22+
23+
<actionGroup name="AdminCreateCatalogProductWidgetActionGroup" extends="AdminCreateWidgetActionGroup">
24+
<annotations>
25+
<description>EXTENDS: AdminCreateWidgetActionGroup. Creates Catalog Category Link Widget.</description>
26+
</annotations>
27+
<arguments>
28+
<argument name="categoryName" type="string" defaultValue="{{DefaultCategory.name}}"/>
29+
</arguments>
30+
31+
<waitForElementVisible selector="{{AdminNewWidgetSection.selectCategory}}" after="clickWidgetOptions" stepKey="waitForSelectCategoryButtonVisible"/>
32+
<click selector="{{AdminNewWidgetSection.selectCategory}}" stepKey="clickOnSelectCategory"/>
33+
<waitForPageLoad stepKey="waitForCategoryTreeLoaded"/>
34+
<click selector="{{AdminCategorySidebarTreeSection.expandRootCategoryByName(DefaultCategory.name)}}" stepKey="clickToExpandDefaultCategory"/>
35+
<waitForElementVisible selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryName)}}" stepKey="waitForCategoryVisible"/>
36+
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryName)}}" stepKey="selectCategory"/>
37+
<waitForPageLoad stepKey="waitForWidgetPageLoaded"/>
38+
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveButton"/>
39+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
40+
<see selector="{{AdminMessagesSection.success}}" userInput="The widget instance has been saved" stepKey="seeSuccessMessage"/>
41+
</actionGroup>
2242
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,4 +1328,9 @@
13281328
<entity name="SimpleProductUpdatePrice16" type="product2">
13291329
<data key="price">16.00</data>
13301330
</entity>
1331+
<entity name="ProductWithTwoTextFieldOptions" type="product">
1332+
<var key="sku" entityType="product" entityKey="sku" />
1333+
<requiredEntity type="product_option">ProductOptionField</requiredEntity>
1334+
<requiredEntity type="product_option">ProductOptionField2</requiredEntity>
1335+
</entity>
13311336
</entities>

app/code/Magento/Catalog/Test/Mftf/Data/ProductOptionData.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<entity name="ProductOptionField" type="product_option">
1212
<var key="product_sku" entityType="product" entityKey="sku" />
1313
<data key="title">OptionField</data>
14+
<data key="sku">OptionField</data>
1415
<data key="type">field</data>
1516
<data key="is_require">true</data>
1617
<data key="sort_order">1</data>
@@ -21,6 +22,7 @@
2122
<entity name="ProductOptionField2" type="product_option">
2223
<var key="product_sku" entityType="product" entityKey="sku" />
2324
<data key="title">OptionField2</data>
25+
<data key="sku">OptionField2</data>
2426
<data key="type">field</data>
2527
<data key="is_require">true</data>
2628
<data key="sort_order">1</data>

app/code/Magento/Catalog/Test/Mftf/Data/WidgetsData.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,15 @@
3232
<data key="display_on">All Pages</data>
3333
<data key="container">Sidebar Additional</data>
3434
</entity>
35+
<entity name="CatalogCategoryLinkWidget" type="widget">
36+
<data key="type">Catalog Category Link</data>
37+
<data key="design_theme">Magento Luma</data>
38+
<data key="name" unique="suffix">Test Widget</data>
39+
<array key="store_ids">
40+
<item>All Store Views</item>
41+
</array>
42+
<data key="sort_order">0</data>
43+
<data key="display_on">All Pages</data>
44+
<data key="container">Main Content Area</data>
45+
</entity>
3546
</entities>

app/code/Magento/Catalog/Test/Mftf/Page/StorefrontCategoryPage.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11-
<page name="StorefrontCategoryPage" url="/{{var1}}.html" area="storefront" module="Catalog" parameterized="true">
11+
<page name="StorefrontCategoryPage" url="/{{var1}}.html" area="storefront" module="Magento_Catalog" parameterized="true">
1212
<section name="StorefrontCategoryMainSection"/>
1313
<section name="WYSIWYGToolbarSection"/>
1414
</page>

app/code/Magento/Catalog/Test/Mftf/Section/AdminCategorySidebarTreeSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<element name="lastCreatedCategory" type="block" selector=".x-tree-root-ct li li:last-child" />
2020
<element name="treeContainer" type="block" selector=".tree-holder" />
2121
<element name="expandRootCategory" type="text" selector="img.x-tree-elbow-end-plus"/>
22+
<element name="expandRootCategoryByName" type="button" selector="//div[@class='x-tree-root-node']/li/div/a/span[contains(., '{{categoryName}}')]/../../img[contains(@class, 'x-tree-elbow-end-plus')]" parameterized="true" timeout="30"/>
2223
<element name="categoryByName" type="text" selector="//div[contains(@class, 'categories-side-col')]//a/span[contains(text(), '{{categoryName}}')]" parameterized="true" timeout="30"/>
2324
</section>
2425
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/AdminNewWidgetSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminNewWidgetSection">
1212
<element name="selectProduct" type="button" selector=".btn-chooser" timeout="30"/>
13+
<element name="selectCategory" type="button" selector="button[title='Select Category...']" timeout="30"/>
1314
</section>
1415
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductCustomizableOptionsSection.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@
5959
<element name="importOptions" type="button" selector="//button[@data-index='button_import']" timeout="30"/>
6060
</section>
6161
<section name="AdminProductImportOptionsSection">
62-
<element name="selectProductTitle" type="text" selector="//h1[contains(text(), 'Select Product')]" timeout="30"/>
63-
<element name="filterButton" type="button" selector="//button[@data-action='grid-filter-expand']" timeout="30"/>
64-
<element name="nameField" type="input" selector="//input[@name='name']" timeout="30"/>
65-
<element name="applyFiltersButton" type="button" selector="//button[@data-action='grid-filter-apply']" timeout="30"/>
66-
<element name="resetFiltersButton" type="button" selector="//button[@data-action='grid-filter-reset']" timeout="30"/>
67-
<element name="firstRowItemCheckbox" type="input" selector="//input[@data-action='select-row']" timeout="30"/>
68-
<element name="importButton" type="button" selector="//button[contains(@class, 'action-primary')]/span[contains(text(), 'Import')]" timeout="30"/>
62+
<element name="selectProductTitle" type="text" selector="//aside[contains(@class, 'product_form_product_form_import_options_modal')]//h1[contains(text(), 'Select Product')]" timeout="30"/>
63+
<element name="filterButton" type="button" selector="aside.product_form_product_form_import_options_modal button[data-action='grid-filter-expand']" timeout="30"/>
64+
<element name="nameField" type="input" selector="aside.product_form_product_form_import_options_modal input[name='name']" timeout="30"/>
65+
<element name="applyFiltersButton" type="button" selector="aside.product_form_product_form_import_options_modal button[data-action='grid-filter-apply']" timeout="30"/>
66+
<element name="resetFiltersButton" type="button" selector="aside.product_form_product_form_import_options_modal button[data-action='grid-filter-reset']" timeout="30"/>
67+
<element name="firstRowItemCheckbox" type="input" selector="aside.product_form_product_form_import_options_modal input[data-action='select-row']" timeout="30"/>
68+
<element name="importButton" type="button" selector="//aside[contains(@class, 'product_form_product_form_import_options_modal')]//button[contains(@class, 'action-primary')]/span[contains(text(), 'Import')]" timeout="30"/>
6969
</section>
7070
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryMainSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@
3434
<element name="productsList" type="block" selector="#maincontent .column.main"/>
3535
<element name="productName" type="text" selector=".product-item-name"/>
3636
<element name="productOptionList" type="text" selector="#narrow-by-list"/>
37+
<element name="productNameByPosition" type="text" selector=".products-grid li:nth-of-type({{position}}) .product-item-name a" parameterized="true"/>
3738
</section>
3839
</sections>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontWidgetsSection.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
<element name="widgetRecentlyViewedProductsGrid" type="block" selector=".block.widget.block-viewed-products-grid"/>
1313
<element name="widgetRecentlyComparedProductsGrid" type="block" selector=".block.widget.block-compared-products-grid"/>
1414
<element name="widgetRecentlyOrderedProductsGrid" type="block" selector=".block.block-reorder"/>
15+
<element name="widgetCategoryLinkByName" type="text" selector="//div[contains(@class, 'block-category-link')]/a/span[contains(., '{{categoryName}}')]" parameterized="true"/>
1516
</section>
16-
</sections>
17+
</sections>

app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,55 +15,44 @@
1515
<title value="Import customizable options to a product with existing SKU"/>
1616
<description value="Import customizable options to a product with existing SKU"/>
1717
<severity value="MAJOR"/>
18-
<testCaseId value="MAGETWO-98211"/>
18+
<testCaseId value="MC-16471"/>
1919
<useCaseId value="MAGETWO-70232"/>
2020
<group value="catalog"/>
21-
<skip>
22-
<issueId value="MC-17140"/>
23-
</skip>
2421
</annotations>
2522
<before>
26-
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
2723
<!--Create category-->
28-
<comment userInput="Create category" stepKey="commentCreateCategory"/>
2924
<createData entity="ApiCategory" stepKey="createCategory"/>
30-
<!-- Create two product -->
31-
<comment userInput="Create two product" stepKey="commentCreateTwoProduct"/>
25+
<!-- Create two products -->
3226
<createData entity="SimpleProduct2" stepKey="createFirstProduct"/>
27+
<updateData entity="ProductWithTwoTextFieldOptions" createDataKey="createFirstProduct" stepKey="updateFirstProductWithCustomOptions">
28+
<requiredEntity createDataKey="createFirstProduct"/>
29+
</updateData>
3330
<createData entity="ApiSimpleProduct" stepKey="createSecondProduct">
3431
<requiredEntity createDataKey="createCategory"/>
3532
</createData>
33+
34+
<!-- TODO: REMOVE AFTER FIX MC-21717 -->
35+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
36+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
37+
38+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
3639
</before>
3740
<after>
41+
<!--Delete created data-->
42+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
43+
<deleteData createDataKey="createFirstProduct" stepKey="deleteFirstProduct"/>
3844
<!--Delete second product with changed sku-->
39-
<comment userInput="Delete second product with changed sku" stepKey="commentDeleteProduct"/>
4045
<actionGroup ref="deleteProductBySku" stepKey="deleteSecondProduct">
4146
<argument name="sku" value="$$createFirstProduct.sku$$-1"/>
4247
</actionGroup>
43-
<!--Delete created data-->
44-
<comment userInput="Delete created data" stepKey="commentDeleteCreatedData"/>
45-
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
46-
<deleteData createDataKey="createFirstProduct" stepKey="deleteFirstProduct"/>
48+
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductGridFilter"/>
4749
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
4850
</after>
49-
<!--Go to product page -->
50-
<comment userInput="Go to product page" stepKey="commentGoToProductPage"/>
51-
<amOnPage url="{{AdminProductEditPage.url($$createFirstProduct.id$$)}}" stepKey="goToProductEditPage"/>
52-
<waitForPageLoad stepKey="waitForProductEditPageLoad"/>
53-
<actionGroup ref="AddProductCustomOptionField" stepKey="addCutomOption1">
54-
<argument name="option" value="ProductOptionField"/>
55-
</actionGroup>
56-
<actionGroup ref="AddProductCustomOptionField" stepKey="addCutomOption2">
57-
<argument name="option" value="ProductOptionField2"/>
58-
</actionGroup>
59-
<actionGroup ref="saveProductForm" stepKey="saveProduct"/>
6051
<!--Change second product sku to first product sku-->
61-
<comment userInput="Change second product sku to first product sku" stepKey="commentChangeSecondProduct"/>
6252
<amOnPage url="{{AdminProductEditPage.url($$createSecondProduct.id$$)}}" stepKey="goToProductEditPage1"/>
6353
<waitForPageLoad stepKey="waitForProductEditPageLoad1"/>
6454
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="$$createFirstProduct.sku$$" stepKey="fillProductSku1"/>
6555
<!--Import customizable options and check-->
66-
<comment userInput="Import customizable options and check" stepKey="commentImportOptions"/>
6756
<conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" visible="false" stepKey="openCustomOptionSection"/>
6857
<actionGroup ref="importProductCustomizableOptions" stepKey="importOptions">
6958
<argument name="productName" value="$$createFirstProduct.name$$"/>
@@ -77,8 +66,7 @@
7766
<argument name="optionIndex" value="1"/>
7867
</actionGroup>
7968
<!--Save product and check sku changed message-->
80-
<comment userInput="Save product and check sku changed message" stepKey="commentSAveProductAndCheck"/>
81-
<actionGroup ref="saveProductForm" stepKey="saveProduct1"/>
82-
<see userInput="SKU for product $$createSecondProduct.name$$ has been changed to $$createFirstProduct.sku$$-1." stepKey="seeSkuChangedMessage"/>
69+
<actionGroup ref="saveProductForm" stepKey="saveSecondProduct"/>
70+
<see selector="{{AdminMessagesSection.notice}}" userInput="SKU for product $$createSecondProduct.name$$ has been changed to $$createFirstProduct.sku$$-1." stepKey="seeSkuChangedMessage"/>
8371
</test>
8472
</tests>

app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesGlobalScopeTest.xml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@
1616
<description value="Admin should be able to mass update product attributes in global scope"/>
1717
<severity value="AVERAGE"/>
1818
<testCaseId value="MC-56"/>
19-
<group value="Catalog"/>
20-
<group value="Product Attributes"/>
21-
<skip>
22-
<issueId value="MC-17140"/>
23-
</skip>
19+
<group value="catalog"/>
20+
<group value="product_attributes"/>
2421
</annotations>
2522
<before>
2623
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
24+
<actionGroup ref="deleteAllProductsUsingProductGrid" stepKey="deleteAllProducts"/>
2725
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView" />
2826
<createData entity="_defaultCategory" stepKey="createCategory"/>
2927
<createData entity="ApiSimpleProduct" stepKey="createProductOne">
@@ -38,7 +36,9 @@
3836
<deleteData createDataKey="createProductTwo" stepKey="deleteProductTwo"/>
3937
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
4038
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="AdminDeleteStoreViewActionGroup"/>
41-
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
39+
<click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/>
40+
<actionGroup ref="ClearProductsFilterActionGroup" stepKey="clearProductFilter"/>
41+
<actionGroup ref="logout" stepKey="amOnLogoutPage"/>
4242
</after>
4343

4444
<!-- Search and select products -->
@@ -58,36 +58,38 @@
5858
<!-- Switch store view -->
5959
<actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="AdminSwitchStoreViewActionGroup"/>
6060
<!-- Update attribute -->
61-
<click selector="{{AdminEditProductAttributesSection.ChangeAttributePriceToggle}}" stepKey="toggleToChangePrice"/>
61+
<checkOption selector="{{AdminEditProductAttributesSection.ChangeAttributePriceToggle}}" stepKey="toggleToChangePrice"/>
6262
<fillField selector="{{AdminEditProductAttributesSection.AttributePrice}}" userInput="$$createProductOne.price$$0" stepKey="fillAttributeNameField"/>
6363
<click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="save"/>
64-
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="Message is added to queue" stepKey="seeAttributeUpateSuccessMsg"/>
64+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" time="60" stepKey="waitForSuccessMessage"/>
65+
<see selector="{{AdminMessagesSection.success}}" userInput="Message is added to queue" stepKey="seeAttributeUpdateSuccessMsg"/>
6566

6667
<!-- Run cron twice -->
67-
<magentoCLI command="cron:run" stepKey="runCron1"/>
68-
<magentoCLI command="cron:run" stepKey="runCron2"/>
69-
<reloadPage stepKey="refreshPage"/>
70-
<waitForPageLoad stepKey="waitFormToReload1"/>
68+
<magentoCLI command="cron:run" arguments="--group=consumers" stepKey="runCron1"/>
69+
<magentoCLI command="cron:run" arguments="--group=consumers" stepKey="runCron2"/>
70+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
7171

7272
<!-- Assert on storefront default view -->
7373
<actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroupDefault"/>
7474
<actionGroup ref="StorefrontAdvancedCatalogSearchByProductNameAndPriceActionGroup" stepKey="searchByNameDefault">
75-
<argument name="name" value="$$createProductOne.name$$"/>
75+
<argument name="name" value="&quot;$$createProductOne.name$$&quot;"/>
7676
<argument name="priceFrom" value="$$createProductOne.price$$0"/>
7777
<argument name="priceTo" value="$$createProductOne.price$$0"/>
7878
</actionGroup>
7979
<actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResultDefault"/>
80+
<waitForElementVisible selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="waitForSearchResultInDefaultView"/>
8081
<see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="seeInDefault"/>
8182

8283
<!-- Assert on storefront custom view -->
8384
<actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroupCustom"/>
8485
<actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="StorefrontSwitchStoreViewActionGroup"/>
8586
<actionGroup ref="StorefrontAdvancedCatalogSearchByProductNameAndPriceActionGroup" stepKey="searchByNameCustom">
86-
<argument name="name" value="$$createProductOne.name$$"/>
87+
<argument name="name" value="&quot;$$createProductOne.name$$&quot;"/>
8788
<argument name="priceFrom" value="$$createProductOne.price$$0"/>
8889
<argument name="priceTo" value="$$createProductOne.price$$0"/>
8990
</actionGroup>
9091
<actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResultCustom"/>
92+
<waitForElementVisible selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="waitForSearchResultInCustomView"/>
9193
<see userInput="1 item" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="seeInCustom"/>
9294
</test>
9395
</tests>

app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@
6969
<waitForPageLoad stepKey="waitForSecondCategoryToSave2"/>
7070
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage2"/>
7171

72+
<!-- TODO: REMOVE AFTER FIX MC-21717 -->
73+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
74+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
75+
7276
<!--Open Category in store front page-->
7377
<amOnPage url="/$$createDefaultCategory.name$$/{{FirstLevelSubCat.name}}/{{SimpleSubCategory.name}}.html" stepKey="seeTheCategoryInStoreFrontPage"/>
7478
<waitForPageLoad stepKey="waitForStoreFrontPageLoad"/>

0 commit comments

Comments
 (0)