Skip to content

Commit d58077e

Browse files
committed
MC-205: Admin should be able to remove default video from bundle products
- Added mftf test
1 parent dc89813 commit d58077e

File tree

6 files changed

+104
-15
lines changed

6 files changed

+104
-15
lines changed

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Bundle/Test/AdminAddDefaultVideoBundleProductTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
1111
<test name="AdminAddDefaultVideoBundleProductTest" extends="AdminAddDefaultVideoDownloadableProductTest">
12+
<annotations>
13+
<group value="Bundle"/>
14+
</annotations>
1215
<before>
1316
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
1417
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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="AdminRemoveDefaultVideoBundleProductTest" extends="AdminRemoveDefaultVideoDownloadableProductTest">
12+
<annotations>
13+
<group value="Bundle"/>
14+
</annotations>
15+
<before>
16+
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
17+
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
18+
</before>
19+
<after>
20+
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
21+
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
22+
</after>
23+
24+
<!-- Create a bundle product -->
25+
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage" after="waitForProductIndexPageLoad">
26+
<argument name="product" value="BundleProduct"/>
27+
</actionGroup>
28+
<actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillMainProductForm" after="goToCreateProductPage">
29+
<argument name="product" value="BundleProduct"/>
30+
</actionGroup>
31+
32+
<!-- Add two bundle items -->
33+
<conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="step0" after="anchor2"/>
34+
<click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="step1" after="step0"/>
35+
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="step2" after="step1"/>
36+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="step3" after="step2"/>
37+
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="step4" after="step3"/>
38+
<waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="step5" after="step4"/>
39+
<click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="step6" after="step5"/>
40+
<waitForPageLoad stepKey="step7" after="step6"/>
41+
<actionGroup ref="filterProductGridBySku" stepKey="step8" after="step7">
42+
<argument name="product" value="$$simpleProduct1$$"/>
43+
</actionGroup>
44+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="step9" after="step8"/>
45+
<actionGroup ref="filterProductGridBySku" stepKey="step10" after="step9">
46+
<argument name="product" value="$$simpleProduct2$$"/>
47+
</actionGroup>
48+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="step11" after="step10"/>
49+
<click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="step12" after="step11"/>
50+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="step13" after="step12"/>
51+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="step14" after="step13"/>
52+
53+
<!-- Assert product in storefront product page -->
54+
<actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage" after="anchor11">
55+
<argument name="product" value="BundleProduct"/>
56+
</actionGroup>
57+
</test>
58+
</tests>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
<comment userInput="Add product video" stepKey="anchor1"/>
3333

34-
<comment userInput="Add downloadable links" stepKey="anchor2"/>
34+
<comment userInput="Add additional product data" stepKey="anchor2"/>
3535

3636
<comment userInput="Save product" stepKey="anchor3"/>
3737

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="AdminRemoveDefaultVideoBundleProductTest" extends="AdminRemoveDefaultVideoDownloadableProductTest">
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 remove default video from a Bundle Product"/>
16+
<description value="Admin should be able to remove default video from a Bundle Product"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-205"/>
19+
<group value="Catalog"/>
20+
</annotations>
21+
22+
<!-- Base AdminRemoveDefaultVideoBundleProductTest -->
23+
24+
</test>
25+
</tests>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<description value="Admin should be able to remove default video from a Downloadable Product"/>
1717
<severity value="MAJOR"/>
1818
<testCaseId value="MC-207"/>
19+
<group value="Catalog"/>
1920
</annotations>
2021
<before>
2122
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
@@ -30,7 +31,7 @@
3031

3132
<comment userInput="Add product video" stepKey="anchor1"/>
3233

33-
<comment userInput="Add downloadable links" stepKey="anchor2"/>
34+
<comment userInput="Add additional product data" stepKey="anchor2"/>
3435

3536
<comment userInput="Save product" stepKey="anchor3"/>
3637

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

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,39 @@
1212
<annotations>
1313
<group value="Downloadable"/>
1414
</annotations>
15+
1516
<!-- 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">
17+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToAdminProductIndexPage" after="anchor0"/>
18+
<waitForPageLoad stepKey="waitForProductIndexPageLoad" after="goToAdminProductIndexPage"/>
19+
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage" after="waitForProductIndexPageLoad">
1920
<argument name="product" value="DownloadableProduct"/>
2021
</actionGroup>
2122
<actionGroup ref="fillMainProductFormNoWeight" stepKey="fillMainProductForm" after="goToCreateProductPage">
2223
<argument name="product" value="DownloadableProduct"/>
2324
</actionGroup>
2425

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

3840
<!--Save Product-->
39-
<actionGroup ref="saveProductForm" stepKey="saveDownloadableProduct" after="anchor3"/>
41+
<actionGroup ref="saveProductForm" stepKey="saveProduct" after="anchor3"/>
4042

4143
<!--Save Product-->
42-
<actionGroup ref="saveProductForm" stepKey="saveProductFormAfterRemove" after="anchor9"/>
44+
<actionGroup ref="saveProductForm" stepKey="saveProductAfterRemove" after="anchor9"/>
4345

4446
<!-- Assert product in storefront product page -->
45-
<actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPageAfterRemove" after="anchor11">
47+
<actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage" after="anchor11">
4648
<argument name="product" value="DownloadableProduct"/>
4749
</actionGroup>
4850
</test>

0 commit comments

Comments
 (0)