|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + /** |
| 4 | + * Copyright 2025 Adobe |
| 5 | + * All Rights Reserved. |
| 6 | + */ |
| 7 | +--> |
| 8 | + |
| 9 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 10 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 11 | + <test name="AdminImportCustomOptionsBetweenProductsTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Catalog"/> |
| 14 | + <stories value="Import customizable options between products "/> |
| 15 | + <title value="Import customizable options from Product A to Product B and verify order "/> |
| 16 | + <description value="This test case verifies whether customizable options in simple product displaying in order while importing from other product."/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-6349"/> |
| 19 | + <group value="catalog"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!-- Pre-condition 2: Create two products --> |
| 23 | + <createData entity="_defaultProduct" stepKey="productA"/> |
| 24 | + <createData entity="_defaultProduct" stepKey="productB"/> |
| 25 | + <!-- Step 1: Login as admin --> |
| 26 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 27 | + <!-- Pre-condition 1: Create store view --> |
| 28 | + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createFrenchStoreView"> |
| 29 | + <argument name="customStore" value="customStoreFR"/> |
| 30 | + </actionGroup> |
| 31 | + </before> |
| 32 | + <after> |
| 33 | + <!-- Delete products, store view --> |
| 34 | + <deleteData createDataKey="productA" stepKey="deleteProductA"/> |
| 35 | + <deleteData createDataKey="productB" stepKey="deleteProductB"/> |
| 36 | + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteFrenchStoreView"> |
| 37 | + <argument name="customStore" value="customStoreFR"/> |
| 38 | + </actionGroup> |
| 39 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 40 | + </after> |
| 41 | + <!-- Step 2: Edit product A --> |
| 42 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEdit"> |
| 43 | + <argument name="productId" value="$$productA.id$$"/> |
| 44 | + </actionGroup> |
| 45 | + <!-- Step 3: Expand Customizable options --> |
| 46 | + <scrollTo selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="scrollToCustomizableOptionsA"/> |
| 47 | + <waitForElementClickable selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="waitForCustomizableOptionsA"/> |
| 48 | + <click selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="openCustomizableOptionsA"/> |
| 49 | + <!-- Step 4,5: Click on Add options button and Add options --> |
| 50 | + <actionGroup ref="AdminAddProductCustomOptionActionGroup" stepKey="addProductCustomFieldOption1"> |
| 51 | + <argument name="customOptionTitle" value="Option1"/> |
| 52 | + <argument name="customOptionType" value="Field"/> |
| 53 | + </actionGroup> |
| 54 | + <actionGroup ref="AdminAddProductCustomOptionActionGroup" stepKey="addProductCustomFieldOption2"> |
| 55 | + <argument name="customOptionTitle" value="Option2"/> |
| 56 | + <argument name="customOptionType" value="Field"/> |
| 57 | + </actionGroup> |
| 58 | + <actionGroup ref="AdminAddProductCustomOptionActionGroup" stepKey="addProductCustomFieldOption3"> |
| 59 | + <argument name="customOptionTitle" value="Option3"/> |
| 60 | + <argument name="customOptionType" value="Field"/> |
| 61 | + </actionGroup> |
| 62 | + <actionGroup ref="AdminAddProductCustomOptionActionGroup" stepKey="addProductCustomFieldOption4"> |
| 63 | + <argument name="customOptionTitle" value="Option4"/> |
| 64 | + <argument name="customOptionType" value="Field"/> |
| 65 | + </actionGroup> |
| 66 | + <scrollToTopOfPage stepKey="scrollToTopOfThePage"/> |
| 67 | + <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProductA"/> |
| 68 | + <!-- Step 6: Change the store view, and in customization option change the title --> |
| 69 | + <waitForElementClickable selector="{{AdminProductFormActionSection.changeStoreButton}}" stepKey="waitForStoreSwitch"/> |
| 70 | + <click selector="{{AdminProductFormActionSection.changeStoreButton}}" stepKey="clickStoreSwitcher"/> |
| 71 | + <waitForElementClickable selector="{{AdminProductFormActionSection.selectStoreView(customStoreFR.name)}}" stepKey="waitForFrenchStore"/> |
| 72 | + <click selector="{{AdminProductFormActionSection.selectStoreView(customStoreFR.name)}}" stepKey="selectFrenchStoreView"/> |
| 73 | + <waitForElementClickable selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForAcceptStoreSwitch"/> |
| 74 | + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="acceptStoreSwitch"/> |
| 75 | + <waitForPageLoad stepKey="waitForFrenchStoreView"/> |
| 76 | + <scrollTo selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="scrollToCustomOptions"/> |
| 77 | + <waitForElementClickable selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="waitForCustomizableOptions"/> |
| 78 | + <click selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="openCustomizableOptions"/> |
| 79 | + <actionGroup ref="AdminEditFieldTitleCustomOptionsActionGroup" stepKey="editOption1"> |
| 80 | + <argument name="optionNumber" value="1"/> |
| 81 | + <argument name="optionInputFieldNumber" value="0"/> |
| 82 | + <argument name="title" value="Option1FR"/> |
| 83 | + </actionGroup> |
| 84 | + <actionGroup ref="AdminEditFieldTitleCustomOptionsActionGroup" stepKey="editOption2"> |
| 85 | + <argument name="optionNumber" value="2"/> |
| 86 | + <argument name="optionInputFieldNumber" value="1"/> |
| 87 | + <argument name="title" value="Option2FR"/> |
| 88 | + </actionGroup> |
| 89 | + <actionGroup ref="AdminEditFieldTitleCustomOptionsActionGroup" stepKey="editOption3"> |
| 90 | + <argument name="optionNumber" value="3"/> |
| 91 | + <argument name="optionInputFieldNumber" value="2"/> |
| 92 | + <argument name="title" value="Option3FR"/> |
| 93 | + </actionGroup> |
| 94 | + <actionGroup ref="AdminEditFieldTitleCustomOptionsActionGroup" stepKey="editOption4"> |
| 95 | + <argument name="optionNumber" value="4"/> |
| 96 | + <argument name="optionInputFieldNumber" value="3"/> |
| 97 | + <argument name="title" value="Option4FR"/> |
| 98 | + </actionGroup> |
| 99 | + <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProductAFR"/> |
| 100 | + <!--Step 7,8,9: Edit product B and import options from product A --> |
| 101 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage"> |
| 102 | + <argument name="productId" value="$$productB.id$$"/> |
| 103 | + </actionGroup> |
| 104 | + <waitForElementClickable selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="waitForCustomizableOptionsForProductB"/> |
| 105 | + <click selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="openCustomizableOptionsForProductB"/> |
| 106 | + <actionGroup ref="ImportProductCustomizableOptionsActionGroup" stepKey="importOptions"> |
| 107 | + <argument name="productName" value="$$productA.name$$"/> |
| 108 | + </actionGroup> |
| 109 | + <!--Step 10: Save product B--> |
| 110 | + <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProductB"/> |
| 111 | + <!-- Navigate to custom options and set pagination display--> |
| 112 | + <scrollTo selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="scrollToTheCustomOptions"/> |
| 113 | + <waitForElementClickable selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="waitForTheCustomizableOptions"/> |
| 114 | + <click selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="openTheCustomizableOptions"/> |
| 115 | + <actionGroup ref="AdminOpenAndApplyCustomOptionRecordsPerPageActionGroup" stepKey="setCustomPageSize"> |
| 116 | + <argument name="perPageInputValue" value="2"/> |
| 117 | + </actionGroup> |
| 118 | + <!-- Step 11: Verify options in product B are in correct order and have correct titles --> |
| 119 | + <actionGroup ref="AdminAssertCustomOptionBasedOnPositionActionGroup" stepKey="seeOption1Title"> |
| 120 | + <argument name="positionNumber" value="1"/> |
| 121 | + <argument name="title" value="Option1"/> |
| 122 | + </actionGroup> |
| 123 | + <actionGroup ref="AdminAssertCustomOptionBasedOnPositionActionGroup" stepKey="seeOption2Title"> |
| 124 | + <argument name="positionNumber" value="2"/> |
| 125 | + <argument name="title" value="Option2"/> |
| 126 | + </actionGroup> |
| 127 | + <!-- Click on custom options pagination next button--> |
| 128 | + <scrollTo selector="{{AdminProductCustomizableOptionsSection.paginationNextButton}}" x="0" y="-80" stepKey="scrollToPagination"/> |
| 129 | + <waitForElementClickable selector="{{AdminProductCustomizableOptionsSection.paginationNextButton}}" stepKey="waitForPaginationToBecomeActive"/> |
| 130 | + <click selector="{{AdminProductCustomizableOptionsSection.paginationNextButton}}" stepKey="clickNextButton"/> |
| 131 | + <waitForPageLoad stepKey="waitForPaginationToLoad"/> |
| 132 | + <actionGroup ref="AdminAssertCustomOptionBasedOnPositionActionGroup" stepKey="seeOption3Title"> |
| 133 | + <argument name="positionNumber" value="1"/> |
| 134 | + <argument name="title" value="Option3"/> |
| 135 | + </actionGroup> |
| 136 | + <actionGroup ref="AdminAssertCustomOptionBasedOnPositionActionGroup" stepKey="seeOption4Title"> |
| 137 | + <argument name="positionNumber" value="2"/> |
| 138 | + <argument name="title" value="Option4"/> |
| 139 | + </actionGroup> |
| 140 | + </test> |
| 141 | +</tests> |
0 commit comments