Skip to content

Commit dc89813

Browse files
committed
MC-110: Admin should be able to add default video for bundle products
- Added mftf test
1 parent bcd9e8d commit dc89813

File tree

5 files changed

+98
-16
lines changed

5 files changed

+98
-16
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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="AdminAddDefaultVideoBundleProductTest" extends="AdminAddDefaultVideoDownloadableProductTest">
12+
<before>
13+
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
14+
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
15+
</before>
16+
<after>
17+
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
18+
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
19+
</after>
20+
21+
<!-- Create a bundle product -->
22+
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage" after="waitForProductIndexPageLoad">
23+
<argument name="product" value="BundleProduct"/>
24+
</actionGroup>
25+
<actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillMainProductForm" after="goToCreateProductPage">
26+
<argument name="product" value="BundleProduct"/>
27+
</actionGroup>
28+
29+
<!-- Add two bundle items -->
30+
<conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="step0" after="anchor2"/>
31+
<click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="step1" after="step0"/>
32+
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="step2" after="step1"/>
33+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="step3" after="step2"/>
34+
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="step4" after="step3"/>
35+
<waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="step5" after="step4"/>
36+
<click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="step6" after="step5"/>
37+
<waitForPageLoad stepKey="step7" after="step6"/>
38+
<actionGroup ref="filterProductGridBySku" stepKey="step8" after="step7">
39+
<argument name="product" value="$$simpleProduct1$$"/>
40+
</actionGroup>
41+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="step9" after="step8"/>
42+
<actionGroup ref="filterProductGridBySku" stepKey="step10" after="step9">
43+
<argument name="product" value="$$simpleProduct2$$"/>
44+
</actionGroup>
45+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="step11" after="step10"/>
46+
<click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="step12" after="step11"/>
47+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="step13" after="step12"/>
48+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="step14" after="step13"/>
49+
50+
<!-- Assert product in storefront product page -->
51+
<actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage" after="anchor5">
52+
<argument name="product" value="BundleProduct"/>
53+
</actionGroup>
54+
</test>
55+
</tests>
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+
<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="AdminAddDefaultVideoBundleProductTest" extends="AdminAddDefaultVideoDownloadableProductTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Add/remove images and videos for all product types and category"/>
15+
<title value="Admin should be able to add default video for a Bundle Product"/>
16+
<description value="Admin should be able to add default video for a Bundle Product"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-110"/>
19+
<group value="Catalog"/>
20+
</annotations>
21+
22+
<!-- Base AdminAddDefaultVideoDownloadableProductTest -->
23+
24+
</test>
25+
</tests>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Test/AdminAddDefaultVideoDownloadableProductTest.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
<annotations>
1313
<features value="Catalog"/>
1414
<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"/>
15+
<title value="Admin should be able to add default video for a Downloadable Product"/>
16+
<description value="Admin should be able to add default video for a Downloadable Product"/>
1717
<severity value="MAJOR"/>
1818
<testCaseId value="MC-114"/>
19+
<group value="Catalog"/>
1920
</annotations>
2021
<before>
2122
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Test/AdminRemoveDefaultVideoDownloadableProductTest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<annotations>
1313
<features value="Catalog"/>
1414
<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."/>
15+
<title value="Admin should be able to remove default video from a Downloadable Product"/>
16+
<description value="Admin should be able to remove default video from a Downloadable Product"/>
1717
<severity value="MAJOR"/>
1818
<testCaseId value="MC-207"/>
1919
</annotations>
@@ -24,7 +24,7 @@
2424
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
2525
</after>
2626

27-
<!-- Base AdminRemoveDefaultVideoDownloadableProductTest to be merged into -->
27+
<!-- Base AdminRemoveDefaultVideoDownloadableProductTest -->
2828

2929
<comment userInput="Create product in admin" stepKey="anchor0"/>
3030

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Downloadable/Test/AdminAddDefaultVideoDownloadableProductTest.xml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,31 @@
1313
<group value="Downloadable"/>
1414
</annotations>
1515
<!-- 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">
16+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToAdminProductIndexPage" after="anchor0"/>
17+
<waitForPageLoad stepKey="waitForProductIndexPageLoad" after="goToAdminProductIndexPage"/>
18+
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage" after="waitForProductIndexPageLoad">
1919
<argument name="product" value="DownloadableProduct"/>
2020
</actionGroup>
2121
<actionGroup ref="fillMainProductFormNoWeight" stepKey="fillMainProductForm" after="goToCreateProductPage">
2222
<argument name="product" value="DownloadableProduct"/>
2323
</actionGroup>
2424

2525
<!-- 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">
26+
<!-- Start specific product steps, generic stepKey so that it can be used for test extensions -->
27+
<click selector="{{AdminProductDownloadableSection.sectionHeader}}" stepKey="step0" after="anchor2"/>
28+
<checkOption selector="{{AdminProductDownloadableSection.isDownloadableProduct}}" stepKey="step1" after="step0"/>
29+
<fillField userInput="{{downloadableData.link_title}}" selector="{{AdminProductDownloadableSection.linksTitleInput}}" stepKey="step2" after="step1"/>
30+
<checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="step3" after="step2"/>
31+
<fillField userInput="{{downloadableData.sample_title}}" selector="{{AdminProductDownloadableSection.samplesTitleInput}}" stepKey="step4" after="step3"/>
32+
<actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="step5" after="step4">
3233
<argument name="link" value="downloadableLinkWithMaxDownloads"/>
3334
</actionGroup>
34-
<actionGroup ref="addDownloadableProductLink" stepKey="addDownloadableLink" after="addDownloadableLinkWithMaxDownloads">
35+
<actionGroup ref="addDownloadableProductLink" stepKey="step6" after="step5">
3536
<argument name="link" value="downloadableLink"/>
3637
</actionGroup>
3738

3839
<!--Save Product-->
39-
<actionGroup ref="saveProductForm" stepKey="saveDownloadableProduct" after="anchor3"/>
40+
<actionGroup ref="saveProductForm" stepKey="saveProduct" after="anchor3"/>
4041

4142
<!-- Assert product in storefront product page -->
4243
<actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage" after="anchor5">

0 commit comments

Comments
 (0)