Skip to content

Commit bcd9e8d

Browse files
committed
MC-207: Admin should be able to remove default video from downloadable products
- Added mftf test
1 parent 0a4ce59 commit bcd9e8d

File tree

3 files changed

+129
-0
lines changed

3 files changed

+129
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="AdminRemoveDefaultVideoDownloadableProductTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Add/remove images and videos for all product types and category"/>
15+
<title value="You should be able to remove product video from a Downloadable Product."/>
16+
<description value="You should be able to remove product video from a Downloadable Product."/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-207"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
22+
</before>
23+
<after>
24+
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
25+
</after>
26+
27+
<!-- Base AdminRemoveDefaultVideoDownloadableProductTest to be merged into -->
28+
29+
<comment userInput="Create product in admin" stepKey="anchor0"/>
30+
31+
<comment userInput="Add product video" stepKey="anchor1"/>
32+
33+
<comment userInput="Add downloadable links" stepKey="anchor2"/>
34+
35+
<comment userInput="Save product" stepKey="anchor3"/>
36+
37+
<comment userInput="Remove product video" stepKey="anchor8"/>
38+
39+
<comment userInput="Save product" stepKey="anchor9"/>
40+
41+
<comment userInput="Assert product video not in admin" stepKey="anchor10"/>
42+
43+
<comment userInput="Assert product in storefront" stepKey="anchor11"/>
44+
45+
<comment userInput="Assert product video not in storefront" stepKey="anchor12"/>
46+
</test>
47+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="AdminRemoveDefaultVideoDownloadableProductTest">
12+
<annotations>
13+
<group value="Downloadable"/>
14+
</annotations>
15+
<!-- Create downloadable product -->
16+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="adminProductIndexPageAdd" after="anchor0"/>
17+
<waitForPageLoad stepKey="waitForProductIndexPageLoad" after="adminProductIndexPageAdd"/>
18+
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage" after="adminProductIndexPageAdd">
19+
<argument name="product" value="DownloadableProduct"/>
20+
</actionGroup>
21+
<actionGroup ref="fillMainProductFormNoWeight" stepKey="fillMainProductForm" after="goToCreateProductPage">
22+
<argument name="product" value="DownloadableProduct"/>
23+
</actionGroup>
24+
25+
<!-- Add downloadable links -->
26+
<click selector="{{AdminProductDownloadableSection.sectionHeader}}" stepKey="openDownloadableSection" after="anchor2"/>
27+
<checkOption selector="{{AdminProductDownloadableSection.isDownloadableProduct}}" stepKey="checkIsDownloadable" after="openDownloadableSection"/>
28+
<fillField userInput="{{downloadableData.link_title}}" selector="{{AdminProductDownloadableSection.linksTitleInput}}" stepKey="fillDownloadableLinkTitle" after="checkIsDownloadable"/>
29+
<checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkLinksPurchasedSeparately" after="fillDownloadableLinkTitle"/>
30+
<fillField userInput="{{downloadableData.sample_title}}" selector="{{AdminProductDownloadableSection.samplesTitleInput}}" stepKey="fillDownloadableSampleTitle" after="checkLinksPurchasedSeparately"/>
31+
<actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableLinkWithMaxDownloads" after="fillDownloadableSampleTitle">
32+
<argument name="link" value="downloadableLinkWithMaxDownloads"/>
33+
</actionGroup>
34+
<actionGroup ref="addDownloadableProductLink" stepKey="addDownloadableLink" after="addDownloadableLinkWithMaxDownloads">
35+
<argument name="link" value="downloadableLink"/>
36+
</actionGroup>
37+
38+
<!--Save Product-->
39+
<actionGroup ref="saveProductForm" stepKey="saveDownloadableProduct" after="anchor3"/>
40+
41+
<!--Save Product-->
42+
<actionGroup ref="saveProductForm" stepKey="saveProductFormAfterRemove" after="anchor9"/>
43+
44+
<!-- Assert product in storefront product page -->
45+
<actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPageAfterRemove" after="anchor11">
46+
<argument name="product" value="DownloadableProduct"/>
47+
</actionGroup>
48+
</test>
49+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="AdminRemoveDefaultVideoDownloadableProductTest">
12+
<before>
13+
<!-- Set product video Youtube api key configuration -->
14+
<createData entity="ProductVideoYoutubeApiKeyConfig" stepKey="setStoreConfig" after="loginAsAdmin"/>
15+
</before>
16+
<after>
17+
<!-- Set product video configuration to default -->
18+
<createData entity="DefaultProductVideoConfig" stepKey="setStoreDefaultConfig" after="amOnLogoutPage"/>
19+
</after>
20+
21+
<!-- Add product video -->
22+
<actionGroup ref="addProductVideo" stepKey="addProductVideo" after="anchor1"/>
23+
24+
<!-- Remove product video from product -->
25+
<actionGroup ref="removeProductVideo" stepKey="removeProductVideo" after="anchor8"/>
26+
27+
<!-- Assert product video not in admin product form -->
28+
<actionGroup ref="assertProductVideoNotInAdminProductPage" stepKey="assertProductVideoNotInAdminProductPage" after="anchor10"/>
29+
30+
<!-- Assert product video not in storefront product page -->
31+
<actionGroup ref="assertProductVideoNotInStorefrontProductPage" stepKey="assertProductVideoNotInStorefrontProductPage" after="anchor12"/>
32+
</test>
33+
</tests>

0 commit comments

Comments
 (0)