Skip to content

Commit cacdfdb

Browse files
committed
Merge branch '2.2-tests-pr' of github.com:magento-pangolin/magento2ce into MC-8893
# Conflicts: # app/code/Magento/Catalog/Test/Mftf/ActionGroup/OpenStoreFrontProductPageActionGroup.xml
2 parents d75c551 + d412edb commit cacdfdb

File tree

41 files changed

+1285
-2
lines changed

Some content is hidden

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

41 files changed

+1285
-2
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAnchorCategoryActionGroup">
12+
<arguments>
13+
<argument name="categoryName" type="string"/>
14+
</arguments>
15+
<!--Open Category page-->
16+
<amOnPage url="{{AdminCategoryPage.url}}" stepKey="openAdminCategoryIndexPage"/>
17+
<waitForPageLoad stepKey="waitForPageToLoaded"/>
18+
<click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="clickOnExpandTree"/>
19+
<waitForPageLoad stepKey="waitForCategoryToLoad"/>
20+
<click selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryName)}}" stepKey="selectCategory"/>
21+
<waitForPageLoad stepKey="waitForPageToLoad"/>
22+
23+
<!--Enable Anchor for category -->
24+
<scrollTo selector="{{CategoryDisplaySettingsSection.DisplaySettingTab}}" x="0" y="-80" stepKey="scrollToDisplaySetting"/>
25+
<click selector="{{CategoryDisplaySettingsSection.DisplaySettingTab}}" stepKey="selectDisplaySetting"/>
26+
<checkOption selector="{{CategoryDisplaySettingsSection.anchor}}" stepKey="enableAnchor"/>
27+
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveSubCategory"/>
28+
</actionGroup>
29+
</actionGroups>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAssignCategoryToProductAndSaveActionGroup">
12+
<arguments>
13+
<argument name="categoryName" type="string"/>
14+
</arguments>
15+
<!-- on edit Product page catalog/product/edit/id/{{product_id}}/ -->
16+
<click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="openDropDown"/>
17+
<checkOption selector="{{AdminProductFormSection.selectCategory(categoryName)}}" stepKey="selectCategory"/>
18+
<click selector="{{AdminProductFormSection.done}}" stepKey="clickDone"/>
19+
<waitForPageLoad stepKey="waitForApplyCategory"/>
20+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSave"/>
21+
<waitForPageLoad stepKey="waitForSavingProduct"/>
22+
<see userInput="You saved the product." selector="{{AdminMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/>
23+
</actionGroup>
24+
</actionGroups>

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,21 @@
103103
<conditionalClick selector="{{AdminProductGridTableHeaderSection.id('ascend')}}" dependentSelector="{{AdminProductGridTableHeaderSection.id('descend')}}" visible="false" stepKey="sortById"/>
104104
<waitForPageLoad stepKey="waitForPageLoad"/>
105105
</actionGroup>
106+
107+
<!--Filter and select the the product -->
108+
<actionGroup name="filterAndSelectProduct">
109+
<arguments>
110+
<argument name="productSku" type="string"/>
111+
</arguments>
112+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
113+
<waitForPageLoad stepKey="waitForProductIndexPageToLoad"/>
114+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
115+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/>
116+
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{productSku}}" stepKey="fillProductSkuFilter"/>
117+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
118+
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/>
119+
<click stepKey="openSelectedProduct" selector="{{AdminProductGridSection.productRowBySku(productSku)}}"/>
120+
<waitForPageLoad stepKey="waitForProductToLoad"/>
121+
<waitForElementVisible selector="{{AdminHeaderSection.pageTitle}}" stepKey="waitForProductTitle"/>
122+
</actionGroup>
106123
</actionGroups>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminUnassignCategoryOnProductAndSaveActionGroup">
12+
<arguments>
13+
<argument name="categoryName" type="string"/>
14+
</arguments>
15+
<!-- on edit Product page catalog/product/edit/id/{{product_id}}/ -->
16+
<click selector="{{AdminProductFormSection.unselectCategories(categoryName)}}" stepKey="clearCategory"/>
17+
<waitForPageLoad stepKey="waitForDelete"/>
18+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSave"/>
19+
<waitForPageLoad stepKey="waitForSavingProduct"/>
20+
<see userInput="You saved the product." selector="{{AdminMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/>
21+
</actionGroup>
22+
</actionGroups>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10-
<actionGroup name="OpenStorefrontProductPageActionGroup">
10+
<actionGroup name="OpenStoreFrontProductPageActionGroup">
1111
<arguments>
1212
<argument name="productUrlKey" type="string"/>
1313
</arguments>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="OpenStorefrontProductPageActionGroup">
11+
<arguments>
12+
<argument name="productUrlKey" type="string"/>
13+
</arguments>
14+
<amOnPage url="{{StorefrontProductPage.url(productUrlKey)}}" stepKey="amOnProductPage"/>
15+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
16+
</actionGroup>
17+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<!-- Assert shipping method name and price are present in cart -->
12+
<actionGroup name="StorefrontAssertShippingMethodOptionPresentInCartActionGroup">
13+
<arguments>
14+
<argument name="methodName" type="string"/>
15+
<argument name="price" type="string"/>
16+
</arguments>
17+
<see selector="{{StorefrontCheckoutCartSummarySection.methodName}}" userInput="{{methodName}}" stepKey="seeShippingName"/>
18+
<see selector="{{StorefrontCheckoutCartSummarySection.shippingPrice}}" userInput="{{price}}" stepKey="seeShippingPrice"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontGoToCategoryPageActionGroup">
12+
<arguments>
13+
<argument name="categoryName" type="string"/>
14+
</arguments>
15+
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="onFrontend"/>
16+
<waitForPageLoad stepKey="waitForStorefrontPageLoad"/>
17+
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName(categoryName)}}" stepKey="toCategory"/>
18+
<waitForPageLoad stepKey="waitForCategoryPage"/>
19+
</actionGroup>
20+
<actionGroup name="StorefrontGoToSubCategoryPageActionGroup" extends="StorefrontGoToCategoryPageActionGroup">
21+
<arguments>
22+
<argument name="subCategoryName" type="string"/>
23+
</arguments>
24+
<moveMouseOver selector="{{StorefrontHeaderSection.NavigationCategoryByName(categoryName)}}" stepKey="toCategory"/>
25+
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName(subCategoryName)}}" stepKey="openSubCategory" after="toCategory"/>
26+
</actionGroup>
27+
</actionGroups>

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,4 +311,17 @@
311311
<requiredEntity type="product_option">ProductOptionField</requiredEntity>
312312
<requiredEntity type="product_option">ProductOptionField2</requiredEntity>
313313
</entity>
314+
<entity name="defaultSimpleProduct" type="product">
315+
<data key="name" unique="suffix">Testp</data>
316+
<data key="sku" unique="suffix">testsku</data>
317+
<data key="type_id">simple</data>
318+
<data key="attribute_set_id">4</data>
319+
<data key="visibility">4</data>
320+
<data key="price">560.00</data>
321+
<data key="urlKey" unique="suffix">testurl-</data>
322+
<data key="status">1</data>
323+
<data key="quantity">25</data>
324+
<data key="weight">1</data>
325+
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
326+
</entity>
314327
</entities>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
<section name="AdminCategoryProductsSection">
1212
<element name="sectionHeader" type="button" selector="div[data-index='assign_products']" timeout="30"/>
1313
<element name="tabProductClosed" type="block" selector="div[data-index='assign_products'] [data-state-collapsible='closed']"/>
14+
<element name="addProducts" type="button" selector="#catalog_category_add_product_tabs" timeout="30"/>
1415
</section>
1516
</sections>

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@
4343
<element name="customAttributeDropdownField" type="select" selector="select[name='product[{{attributeCode}}]']" parameterized="true"/>
4444
<element name="customAttributeInputField" type="select" selector="input[name='product[{{attributeCode}}]']" parameterized="true"/>
4545
<element name="customAttributeSelectOptions" type="select" selector="select[name='product[{{attributeCode}}]'] option" parameterized="true"/>
46+
<element name="currentCategory" type="text" selector=".admin__action-multiselect-crumb > span"/>
47+
<element name="searchCategory" type="input" selector=".action-menu._active input.admin__action-multiselect-search"/>
48+
<element name="selectCategory" type="input" selector="//label[contains(., '{{categoryName}}')]" parameterized="true"/>
49+
<element name="done" type="button" selector=".admin__action-multiselect-actions-wrap button" timeout="30"/>
50+
<element name="save" type="button" selector="#save-button"/>
51+
<element name="unselectCategories" type="button" selector="//span[@class='admin__action-multiselect-crumb']/span[contains(.,'{{category}}')]/../button" parameterized="true" timeout="30"/>
52+
<element name="enableProductLabel" type="checkbox" selector=".admin__actions-switch > input[name='product[status]']+label"/>
53+
<element name="selectCategory" type="input" selector="//label[contains(., '{{categoryName}}')]" parameterized="true"/>
4654
</section>
4755
<section name="ProductInWebsitesSection">
4856
<element name="sectionHeader" type="button" selector="div[data-index='websites']" timeout="30"/>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="CategoryDisplaySettingsSection">
12+
<element name="DisplaySettingTab" type="button" selector="//strong[@class='admin__collapsible-title']//span[text()='Display Settings']"/>
13+
<element name="anchor" type="checkbox" selector="input[name='is_anchor']"/>
14+
</section>
15+
</sections>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,7 @@
2323
<element name="categoryPageProductImage" type="text" selector=".products-grid img[src*='/{{var1}}']" parameterized="true"/>
2424
<element name="categoryPageProductName" type="text" selector=".products.list.items.product-items li:nth-of-type({{line}}) .product-item-link" timeout="30" parameterized="true"/>
2525
<element name="categoryEmptyMessage" type="text" selector=".column.main .message.info.empty"/>
26+
<element name="productName" type="text" selector=".product-item-name"/>
27+
<element name="productLinkByHref" type="text" selector="a.product-item-link[href$='{{var1}}.html']" parameterized="true"/>
2628
</section>
2729
</sections>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
<element name="topCategory" type="button" selector="//a[contains(@class,'level-top')]/span[contains(text(),'{{var1}}')]" parameterized="true"/>
1313
<element name="subCategory" type="button" selector="//ul[contains(@class,'submenu')]//span[contains(text(),'{{var1}}')]" parameterized="true"/>
1414
<element name="breadcrumbs" type="textarea" selector=".items"/>
15+
<element name="categoryBreadcrumbs" type="textarea" selector=".breadcrumbs li"/>
1516
</section>
1617
</sections>

0 commit comments

Comments
 (0)