|
| 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="AdminAddDefaultImageBundleProductTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Bundle"/> |
| 14 | + <stories value="Add/remove images and videos for all product types and category"/> |
| 15 | + <title value="Admin should be able to add default images for a Bundle Product"/> |
| 16 | + <description value="Admin should be able to add default images for a Bundle Product"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="MC-115"/> |
| 19 | + <group value="Bundle"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 23 | + <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> |
| 24 | + <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> |
| 25 | + </before> |
| 26 | + <after> |
| 27 | + <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> |
| 28 | + <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> |
| 29 | + <deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/> |
| 30 | + </after> |
| 31 | + |
| 32 | + <!-- Create a bundle product --> |
| 33 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/> |
| 34 | + <waitForPageLoad stepKey="waitForProductPageLoadBundle"/> |
| 35 | + <actionGroup ref="goToCreateProductPage" stepKey="goToCreateBundleProduct"> |
| 36 | + <argument name="product" value="BundleProduct"/> |
| 37 | + </actionGroup> |
| 38 | + |
| 39 | + <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillBundleProductNameAndSku"> |
| 40 | + <argument name="product" value="BundleProduct"/> |
| 41 | + </actionGroup> |
| 42 | + |
| 43 | + <!-- Add two bundle items --> |
| 44 | + <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> |
| 45 | + <click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption3"/> |
| 46 | + <waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/> |
| 47 | + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/> |
| 48 | + <selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/> |
| 49 | + <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> |
| 50 | + <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> |
| 51 | + <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> |
| 52 | + <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> |
| 53 | + <argument name="product" value="$$simpleProduct1$$"/> |
| 54 | + </actionGroup> |
| 55 | + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> |
| 56 | + <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> |
| 57 | + <argument name="product" value="$$simpleProduct2$$"/> |
| 58 | + </actionGroup> |
| 59 | + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> |
| 60 | + <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> |
| 61 | + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> |
| 62 | + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> |
| 63 | + |
| 64 | + <!-- Add image to product --> |
| 65 | + <actionGroup ref="addProductImage" stepKey="addImageForProduct"> |
| 66 | + <argument name="image" value="MagentoLogo"/> |
| 67 | + </actionGroup> |
| 68 | + |
| 69 | + <!--Save product--> |
| 70 | + <actionGroup ref="saveProductForm" stepKey="saveProduct"/> |
| 71 | + |
| 72 | + <!-- Assert product image in admin product form --> |
| 73 | + <actionGroup ref="assertProductImageAdminProductPage" stepKey="assertProductImageAdminProductPage"/> |
| 74 | + |
| 75 | + <!-- Assert product in storefront product page --> |
| 76 | + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> |
| 77 | + <argument name="product" value="BundleProduct"/> |
| 78 | + </actionGroup> |
| 79 | + |
| 80 | + <!-- Assert product image in storefront product page --> |
| 81 | + <actionGroup ref="assertProductImageStorefrontProductPage" stepKey="assertProductImageStorefrontProductPage"> |
| 82 | + <argument name="product" value="BundleProduct"/> |
| 83 | + <argument name="image" value="MagentoLogo"/> |
| 84 | + </actionGroup> |
| 85 | + </test> |
| 86 | +</tests> |
0 commit comments