Skip to content

Commit a269d17

Browse files
committed
Merge remote-tracking branch 'origin/2.2-develop' into MAGETWO-98521
# Conflicts: # app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
2 parents 18dff83 + 6ddf099 commit a269d17

20 files changed

+338
-10
lines changed

app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminAccountActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<actionGroup name="AdminAccountSetInterfaceLocaleActionGroup">
1212
<arguments>
13-
<argument name="localeName" type="string"/>
13+
<argument name="localeName" defaultValue="en_US" type="string"/>
1414
</arguments>
1515
<!-- Navigate to admin System Account Page-->
1616
<amOnPage url="{{AdminSystemAccountPage.url}}" stepKey="openAdminSystemAccountPage"/>

app/code/Magento/Bundle/Test/Mftf/Section/StorefrontCategoryProductSection.xml

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

99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontCategoryProductSection">
1212
<element name="priceToByProductId" type="text" selector="div[data-product-id='{{id}}'] .price-to" parameterized="true"/>
1313
<element name="priceFromByProductId" type="text" selector="div[data-product-id='{{id}}'] .price-from" parameterized="true"/>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
<!-- Assign Image role in admin product page -->
12+
<actionGroup name="AdminAssignImageRolesActionGroup">
13+
<arguments>
14+
<argument name="image"/>
15+
</arguments>
16+
<conditionalClick selector="{{AdminProductImagesSection.productImagesToggleState('closed')}}" dependentSelector="{{AdminProductImagesSection.productImagesToggleState('open')}}" visible="false" stepKey="clickSectionImage"/>
17+
<click selector="{{AdminProductImagesSection.imageFile(image.fileName)}}" stepKey="clickProductImage"/>
18+
<waitForElementVisible selector="{{AdminProductImagesSection.altText}}" stepKey="seeAltTextSection"/>
19+
<checkOption selector="{{AdminProductImagesSection.roleImage('Base')}}" stepKey="checkRoleBase"/>
20+
<checkOption selector="{{AdminProductImagesSection.roleImage('Small')}}" stepKey="checkRoleSmall"/>
21+
<checkOption selector="{{AdminProductImagesSection.roleImage('Thumbnail')}}" stepKey="checkRoleThumbnail"/>
22+
<checkOption selector="{{AdminProductImagesSection.roleImage('Swatch')}}" stepKey="checkRoleSwatch"/>
23+
<click selector="{{AdminSlideOutDialogSection.closeButton}}" stepKey="clickCloseButton"/>
24+
</actionGroup>
25+
</actionGroups>

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

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<arguments>
3636
<argument name="product" defaultValue="_defaultProduct"/>
3737
</arguments>
38+
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
3839
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/>
3940
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductSku"/>
4041
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/>
@@ -283,4 +284,50 @@
283284
</arguments>
284285
<amOnPage url="{{AdminProductEditPage.url(productId)}}" stepKey="goToProduct"/>
285286
</actionGroup>
287+
288+
<!-- Change any product data product description You should be on product page -->
289+
<actionGroup name="AdminChangeProductDescriptionActionGroup">
290+
<arguments>
291+
<argument name="description" type="string"/>
292+
</arguments>
293+
<conditionalClick selector="{{AdminProductContentSection.sectionHeader}}" dependentSelector="{{AdminProductContentSection.sectionHeader}}" visible="true" stepKey="openDescriptionDropDown"/>
294+
<fillField selector="{{AdminProductContentSection.descriptionTextArea}}" userInput="{{description}}" stepKey="fillLongDescription"/>
295+
</actionGroup>
296+
<!-- Change any product data product short description You should be on product page -->
297+
<actionGroup name="AdminChangeProductShortDescriptionActionGroup" extends="AdminChangeProductDescriptionActionGroup">
298+
<remove keyForRemoval="fillLongDescription"/>
299+
<fillField selector="{{AdminProductContentSection.shortDescriptionTextArea}}" userInput="{{description}}" stepKey="fillShortDescription"/>
300+
</actionGroup>
301+
302+
<!-- This action group simply navigates to the product catalog page -->
303+
<actionGroup name="AdminGoToProductCatalogPage">
304+
<comment userInput="actionGroup:GoToProductCatalogPage" stepKey="actionGroupComment"/>
305+
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPage"/>
306+
<waitForPageLoad stepKey="waitForPageToLoad"/>
307+
</actionGroup>
308+
309+
<!-- You are on product Edit Page -->
310+
<!-- Assert checkbox available for website in Product In Websites -->
311+
<actionGroup name="AdminAssertWebsiteIsAvailableInProductWebsites">
312+
<arguments>
313+
<argument name="website" type="string"/>
314+
</arguments>
315+
<scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToProductInWebsitesSection"/>
316+
<conditionalClick selector="{{ProductInWebsitesSection.sectionHeader}}" dependentSelector="{{ProductInWebsitesSection.sectionHeaderOpened}}" visible="false" stepKey="expandProductWebsitesSection"/>
317+
<seeElement selector="{{ProductInWebsitesSection.website(website)}}" stepKey="seeCheckboxForWebsite"/>
318+
</actionGroup>
319+
320+
<!-- You are on product Edit Page -->
321+
<!-- Assert checkbox not available for website in Product In Websites -->
322+
<actionGroup name="AdminAssertWebsiteIsNotAvailableInProductWebsites" extends="AdminAssertWebsiteIsAvailableInProductWebsites">
323+
<remove keyForRemoval="seeCheckboxForWebsite"/>
324+
<dontSeeElement selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="dontSeeCheckboxForWebsite"/>
325+
</actionGroup>
326+
327+
<!-- You are on product Edit Page -->
328+
<!-- Assert checkbox Is checked for website in Product In Websites -->
329+
<actionGroup name="AdminAssertProductIsAssignedToWebsite" extends="AdminAssertWebsiteIsAvailableInProductWebsites">
330+
<remove keyForRemoval="seeCheckboxForWebsite"/>
331+
<seeCheckboxIsChecked selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="seeCustomWebsiteIsChecked"/>
332+
</actionGroup>
286333
</actionGroups>

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,15 @@
9191
<seeInTitle userInput="{{subCategory.name}}" stepKey="assertCategoryNameInTitle"/>
9292
<see userInput="{{subCategory.name}}" selector="{{StorefrontCategoryMainSection.categoryTitle}}" stepKey="assertCategoryName"/>
9393
</actionGroup>
94+
<!-- Assert product store view image in storefront category page -->
95+
<actionGroup name="AssertStorefrontActiveImageCategoryActionGroup">
96+
<arguments>
97+
<argument name="category"/>
98+
<argument name="product"/>
99+
<argument name="image" type="string"/>
100+
</arguments>
101+
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName(category.name)}}" stepKey="openCategoryPage"/>
102+
<waitForPageLoad time="30" stepKey="waitForCategoryPage"/>
103+
<seeElement selector="{{StorefrontCategoryProductSection.ProductImageByNameAndSrc(product.name, image)}}" stepKey="seeImage"/>
104+
</actionGroup>
94105
</actionGroups>

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,11 @@
3434
<seeElement selector="{{StorefrontProductMediaSection.imageFile(image)}}" stepKey="seeImage"/>
3535
<see userInput="{{price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeProductPrice"/>
3636
</actionGroup>
37+
<!-- Assert image Store View in storefront product page -->
38+
<actionGroup name="AssertStorefrontActiveImageProductActionGroup">
39+
<arguments>
40+
<argument name="image" type="string"/>
41+
</arguments>
42+
<seeElement selector="{{StorefrontProductMediaSection.productImageActive(image)}}" stepKey="seeActiveImage"/>
43+
</actionGroup>
3744
</actionGroups>

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,15 @@
324324
<data key="weight">1</data>
325325
<requiredEntity type="product_extension_attribute">EavStock100</requiredEntity>
326326
</entity>
327+
<entity name="Magento3" type="image">
328+
<data key="title" unique="suffix">Magento3</data>
329+
<data key="price">1.00</data>
330+
<data key="file_type">Upload File</data>
331+
<data key="shareable">Yes</data>
332+
<data key="file">magento3.jpg</data>
333+
<data key="filename">magento3</data>
334+
<data key="file_extension">jpg</data>
335+
</entity>
327336
<entity name="OutOfStockProduct" type="product">
328337
<data key="sku" unique="suffix">testSku</data>
329338
<data key="type_id">simple</data>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
1111
<page name="AdminProductCreatePage" url="catalog/product/new/set/{{set}}/type/{{type}}/" area="admin" module="Magento_Catalog" parameterized="true">
1212
<section name="AdminProductFormSection"/>
1313
<section name="AdminProductFormActionSection"/>
@@ -18,6 +18,7 @@
1818
<section name="AdminProductCustomizableOptionsSection" />
1919
<section name="AdminAddProductsToOptionPanelSection" />
2020
<section name="AdminProductFormAdvancedPricingSection"/>
21+
<section name="AdminProductContentSection"/>
2122
<section name="AdminProductCustomizableOptionsImportModalSection"/>
2223
</page>
2324
</pages>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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="AdminProductContentSection">
12+
<element name="sectionHeader" type="button" selector="div[data-index='content']" timeout="30"/>
13+
<element name="descriptionTextArea" type="textarea" selector="div[data-index='content'] #product_form_description"/>
14+
<element name="shortDescriptionTextArea" type="textarea" selector="div[data-index='content'] #product_form_short_description"/>
15+
</section>
16+
</sections>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
</section>
5454
<section name="ProductInWebsitesSection">
5555
<element name="sectionHeader" type="button" selector="div[data-index='websites']" timeout="30"/>
56+
<element name="sectionHeaderOpened" type="button" selector="[data-index='websites']._show" timeout="30"/>
5657
<element name="website" type="checkbox" selector="//label[contains(text(), '{{var1}}')]/parent::div//input[@type='checkbox']" parameterized="true"/>
5758
<element name="isWebsiteDisabled" type="checkbox" selector="//label[contains(text(), '{{websiteName}}')]/parent::div//input[@type='checkbox' and @disabled]" parameterized="true"/>
5859
</section>

0 commit comments

Comments
 (0)