Skip to content

Commit 24959dc

Browse files
Merge remote-tracking branch 'remotes/github/MAGETWO-44170' into EPAM-PR-73
2 parents de0fc3b + 8f9d81d commit 24959dc

File tree

5 files changed

+373
-2
lines changed

5 files changed

+373
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@
9999
<attachFile selector="{{AdminCategoryContentSection.uploadImageFile}}" userInput="{{image.file}}" stepKey="uploadFile"/>
100100
<waitForAjaxLoad time="30" stepKey="waitForAjaxUpload"/>
101101
<waitForLoadingMaskToDisappear stepKey="waitForLoading"/>
102-
<see selector="{{AdminCategoryContentSection.imageFileName}}" userInput="{{image.file}}" stepKey="seeImage"/>
102+
<grabTextFrom selector="{{AdminCategoryContentSection.imageFileName}}" stepKey="grabCategoryFileName"/>
103+
<assertRegExp stepKey="assertEquals" message="pass">
104+
<expectedResult type="string">/magento-logo(_[0-9]+)*?\.png$/</expectedResult>
105+
<actualResult type="variable">grabCategoryFileName</actualResult>
106+
</assertRegExp>
103107
</actionGroup>
104108

105109
<!-- Remove image from category -->
@@ -128,7 +132,11 @@
128132
<conditionalClick selector="{{AdminCategoryContentSection.sectionHeader}}" dependentSelector="{{AdminCategoryContentSection.uploadButton}}" visible="false" stepKey="openContentSection"/>
129133
<waitForPageLoad stepKey="waitForPageLoad"/>
130134
<waitForElementVisible selector="{{AdminCategoryContentSection.uploadButton}}" stepKey="seeImageSectionIsReady"/>
131-
<see selector="{{AdminCategoryContentSection.imageFileName}}" userInput="{{image.file}}" stepKey="seeImage"/>
135+
<grabTextFrom selector="{{AdminCategoryContentSection.imageFileName}}" stepKey="grabCategoryFileName"/>
136+
<assertRegExp stepKey="assertEquals" message="pass">
137+
<expectedResult type="string">/magento-logo(_[0-9]+)*?\.png$/</expectedResult>
138+
<actualResult type="variable">grabCategoryFileName</actualResult>
139+
</assertRegExp>
132140
</actionGroup>
133141

134142
<!-- Action to navigate to Media Gallery. Used in tests to cleanup uploaded images -->
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminVirtualProductTypeSwitchingToDownloadableProductTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Product type switching"/>
15+
<title value="Virtual product type switching on editing to Downloadable product"/>
16+
<description value="Virtual product type switching on editing to Downloadable product"/>
17+
<testCaseId value="MC-17954"/>
18+
<useCaseId value="MAGETWO-44170"/>
19+
<severity value="MAJOR"/>
20+
<group value="catalog"/>
21+
</annotations>
22+
<before>
23+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
24+
<!--Create product-->
25+
<comment userInput="Create product" stepKey="commentCreateProduct"/>
26+
<createData entity="VirtualProduct" stepKey="createProduct"/>
27+
</before>
28+
<after>
29+
<!--Delete product-->
30+
<comment userInput="Delete product" stepKey="commentDeleteProduct"/>
31+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
32+
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductFilters"/>
33+
<actionGroup ref="logout" stepKey="logout"/>
34+
</after>
35+
<!--Change product type to Downloadable-->
36+
<comment userInput="Change product type to Downloadable" stepKey="commentCreateDownloadable"/>
37+
<amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="gotToDownloadableProductPage"/>
38+
<waitForPageLoad stepKey="waitForDownloadableProductPageLoad"/>
39+
<actionGroup ref="AdminAddDownloadableLinkInformationActionGroup" stepKey="addDownloadableLinkInformation"/>
40+
<checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/>
41+
<actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableProductLink">
42+
<argument name="link" value="downloadableLinkWithMaxDownloads"/>
43+
</actionGroup>
44+
<actionGroup ref="saveProductForm" stepKey="saveDownloadableProductForm"/>
45+
<!--Assert downloadable product on Admin product page grid-->
46+
<comment userInput="Assert configurable product in Admin product page grid" stepKey="commentAssertDownloadableProductOnAdmin"/>
47+
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPage"/>
48+
<actionGroup ref="filterProductGridBySku2" stepKey="filterProductGridBySku">
49+
<argument name="sku" value="$$createProduct.sku$$"/>
50+
</actionGroup>
51+
<see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="$$createProduct.name$$" stepKey="seeDownloadableProductNameInGrid"/>
52+
<see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="Downloadable Product" stepKey="seeDownloadableProductTypeInGrid"/>
53+
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearDownloadableProductFilters"/>
54+
<!--Assert downloadable product on storefront-->
55+
<comment userInput="Assert downloadable product on storefront" stepKey="commentAssertDownloadableProductOnStorefront"/>
56+
<amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="openDownloadableProductPage"/>
57+
<waitForPageLoad stepKey="waitForStorefrontDownloadableProductPageLoad"/>
58+
<see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertDownloadableProductInStock"/>
59+
<scrollTo selector="{{StorefrontDownloadableProductSection.downloadableLinkBlock}}" stepKey="scrollToLinksInStorefront"/>
60+
<seeElement selector="{{StorefrontDownloadableProductSection.downloadableLinkLabel(downloadableLinkWithMaxDownloads.title)}}" stepKey="seeDownloadableLink" />
61+
</test>
62+
<test name="AdminDownloadableProductTypeSwitchingToSimpleProductTest" extends="AdminVirtualProductTypeSwitchingToDownloadableProductTest">
63+
<annotations>
64+
<features value="Catalog"/>
65+
<stories value="Product type switching"/>
66+
<title value="Downloadable product type switching on editing to Simple product"/>
67+
<description value="Downloadable product type switching on editing to Simple product"/>
68+
<testCaseId value="MC-17955"/>
69+
<useCaseId value="MAGETWO-44170"/>
70+
<severity value="MAJOR"/>
71+
<group value="catalog"/>
72+
</annotations>
73+
<!--Change product type to Simple-->
74+
<comment userInput="Change product type to Simple Product" stepKey="commentCreateSimple"/>
75+
<amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="gotToProductPage"/>
76+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
77+
<actionGroup ref="AdminAddDownloadableLinkInformationActionGroup" stepKey="addDownloadableLinkInformation"/>
78+
<selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has weight" stepKey="selectWeightForProduct"/>
79+
<actionGroup ref="saveProductForm" stepKey="saveProductForm"/>
80+
<!--Assert simple product on Admin product page grid-->
81+
<comment userInput="Assert simple product in Admin product page grid" stepKey="commentAssertProductOnAdmin"/>
82+
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogSimpleProductPage"/>
83+
<actionGroup ref="filterProductGridBySku2" stepKey="filterSimpleProductGridBySku">
84+
<argument name="sku" value="$$createProduct.sku$$"/>
85+
</actionGroup>
86+
<see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="$$createProduct.name$$" stepKey="seeSimpleProductNameInGrid"/>
87+
<see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="Simple Product" stepKey="seeSimpleProductTypeInGrid"/>
88+
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearSimpleProductFilters"/>
89+
<!--Assert simple product on storefront-->
90+
<comment userInput="Assert simple product on storefront" stepKey="commentAssertSimpleProductOnStorefront"/>
91+
<amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="openSimpleProductPage"/>
92+
<waitForPageLoad stepKey="waitForStorefrontSimpleProductPageLoad"/>
93+
<see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertSimpleProductInStock"/>
94+
<dontSeeElement selector="{{StorefrontDownloadableProductSection.downloadableLinkLabel(downloadableLinkWithMaxDownloads.title)}}" stepKey="dontSeeDownloadableLink" />
95+
</test>
96+
</tests>

0 commit comments

Comments
 (0)