|
| 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="StorefrontBundleProductShownInCategoryListAndGrid"> |
| 12 | + <annotations> |
| 13 | + <features value="Bundle"/> |
| 14 | + <stories value="Bundle products list on Storefront"/> |
| 15 | + <title value="Customer should be able to see bundle products in the category products list and grid views"/> |
| 16 | + <description value="Customer should be able to see bundle products in the category products list and grid views"/> |
| 17 | + <severity value="CRITICAL"/> |
| 18 | + <testCaseId value="MC-226"/> |
| 19 | + <group value="Bundle"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!--Admin login--> |
| 23 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 24 | + <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> |
| 25 | + <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> |
| 26 | + <createData entity="SimpleProduct2" stepKey="simpleProduct3"/> |
| 27 | + <createData entity="SimpleProduct2" stepKey="simpleProduct4"/> |
| 28 | + </before> |
| 29 | + <after> |
| 30 | + <!--Logging out--> |
| 31 | + <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> |
| 32 | + <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> |
| 33 | + <deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/> |
| 34 | + <deleteData createDataKey="simpleProduct3" stepKey="deleteSimpleProduct3"/> |
| 35 | + <deleteData createDataKey="simpleProduct4" stepKey="deleteSimpleProduct4"/> |
| 36 | + </after> |
| 37 | + <!--Make category--> |
| 38 | + <amOnPage url="{{AdminCategoryPage.url}}" stepKey="goToCategoryPage"/> |
| 39 | + <waitForPageLoad stepKey="waitForCategoryPageLoad"/> |
| 40 | + <actionGroup ref="CreateCategory" stepKey="createASubcategory"> |
| 41 | + <argument name="categoryEntity" value="SimpleSubCategory"/> |
| 42 | + </actionGroup> |
| 43 | + |
| 44 | + <!--Go to bundle product creation page--> |
| 45 | + <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage" /> |
| 46 | + <waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/> |
| 47 | + |
| 48 | + <!--Categories--> |
| 49 | + <click selector="{{AdminProductFormBundleSection.categoriesDropDown}}" stepKey="dropDownCategories"/> |
| 50 | + <fillField selector="{{AdminProductFormBundleSection.searchForCategory}}" userInput="{{SimpleSubCategory.name}}" stepKey="searchForCategory"/> |
| 51 | + <click selector="{{AdminProductFormBundleSection.selectCategory}}" stepKey="selectCategory"/> |
| 52 | + <click selector="{{AdminProductFormBundleSection.categoriesLabel}}" stepKey="clickOnCategoriesLabelToCloseOptions"/> |
| 53 | + |
| 54 | + <!--Create bundle product--> |
| 55 | + <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> |
| 56 | + <click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption3"/> |
| 57 | + <waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/> |
| 58 | + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/> |
| 59 | + <selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/> |
| 60 | + <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> |
| 61 | + <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> |
| 62 | + <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> |
| 63 | + <argument name="product" value="$$simpleProduct1$$"/> |
| 64 | + </actionGroup> |
| 65 | + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> |
| 66 | + <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> |
| 67 | + <argument name="product" value="$$simpleProduct2$$"/> |
| 68 | + </actionGroup> |
| 69 | + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> |
| 70 | + <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> |
| 71 | + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> |
| 72 | + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> |
| 73 | + <actionGroup ref="AncillaryPrepBundleProduct" stepKey="createBundledProductForTwoSimpleProducts"/> |
| 74 | + |
| 75 | + <!--Save the product--> |
| 76 | + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> |
| 77 | + <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="messageYouSavedTheProductIsShown"/> |
| 78 | + |
| 79 | + <!--Go to category page--> |
| 80 | + <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToHomePage"/> |
| 81 | + <waitForPageLoad stepKey="waitForHomePageToload"/> |
| 82 | + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="cartClickCategory"/> |
| 83 | + |
| 84 | + <!--Check in grid view--> |
| 85 | + <seeInTitle userInput="{{SimpleSubCategory.name}}" stepKey="assertCategoryNameInTitle"/> |
| 86 | + <see userInput="{{SimpleSubCategory.name}}" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryName"/> |
| 87 | + <see userInput="1" selector="{{StorefrontCategoryMainSection.productCount}} span" stepKey="assertProductCount"/> |
| 88 | + <seeElement selector="{{StorefrontCategoryMainSection.firstProduct}}" stepKey="assertBundleProductPresence"/> |
| 89 | + |
| 90 | + <!--Check in list view--> |
| 91 | + <click selector="{{StorefrontCategoryMainSection.categoryListView}}" stepKey="switchToListView"/> |
| 92 | + <seeInTitle userInput="{{SimpleSubCategory.name}}" stepKey="assertCategoryNameInTitleAgain"/> |
| 93 | + <see userInput="{{SimpleSubCategory.name}}" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryNamAgain"/> |
| 94 | + <see userInput="1" selector="{{StorefrontCategoryMainSection.productCount}} span" stepKey="assertProductCountAgain"/> |
| 95 | + <seeElement selector="{{StorefrontCategoryMainSection.firstProduct}}" stepKey="assertBundleProductPresenceAgain"/> |
| 96 | + </test> |
| 97 | +</tests> |
0 commit comments