Skip to content

Commit 0a4ce59

Browse files
committed
MC-114: Admin should be able to add default video for downloadable products
- Added mftf test
1 parent a125c32 commit 0a4ce59

File tree

3 files changed

+119
-0
lines changed

3 files changed

+119
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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="AdminAddDefaultVideoDownloadableProductTest">
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 add default video for a Downloadable Product"/>
16+
<description value="You should be able to add default video for a Downloadable Product"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-114"/>
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 AdminAddDefaultVideoDownloadableProductTest -->
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="Assert product video in admin" stepKey="anchor4"/>
38+
39+
<comment userInput="Assert product in storefront" stepKey="anchor5"/>
40+
41+
<comment userInput="Assert product video in storefront" stepKey="anchor6"/>
42+
</test>
43+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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="AdminAddDefaultVideoDownloadableProductTest">
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+
<!-- Assert product in storefront product page -->
42+
<actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage" after="anchor5">
43+
<argument name="product" value="DownloadableProduct"/>
44+
</actionGroup>
45+
</test>
46+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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="AdminAddDefaultVideoDownloadableProductTest">
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+
<!-- Assert product video in admin product form -->
25+
<actionGroup ref="assertProductVideoAdminProductPage" stepKey="assertProductVideoAdminProductPage" after="anchor4"/>
26+
27+
<!-- Assert product video in storefront product page -->
28+
<actionGroup ref="assertProductVideoStorefrontProductPage" stepKey="assertProductVideoStorefrontProductPage" after="anchor6"/>
29+
</test>
30+
</tests>

0 commit comments

Comments
 (0)