|
| 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="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 11 | + <test name="AdminValidateRelatedUpsellCrossSellPositionValueInProductExportCsvTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Catalog"/> |
| 14 | + <stories value="[Magento Cloud] Removing cross sell products the position count is not being reset"/> |
| 15 | + <title value="Admin to validate related, upsell and cross sell position value in products export csv"/> |
| 16 | + <description value="Admin to validate related, upsell and cross sell position value in products export csv"/> |
| 17 | + <severity value="AVERAGE"/> |
| 18 | + <testCaseId value="AC-2844"/> |
| 19 | + <useCaseId value="ACP2E-676"/> |
| 20 | + <group value="SimpleProduct"/> |
| 21 | + </annotations> |
| 22 | + |
| 23 | + <before> |
| 24 | + <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> |
| 25 | + <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> |
| 26 | + <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> |
| 27 | + <createData entity="SimpleProduct2" stepKey="simpleProduct3"/> |
| 28 | + <createData entity="SimpleProduct2" stepKey="simpleProduct4"/> |
| 29 | + <createData entity="SimpleProduct2" stepKey="simpleProduct5"/> |
| 30 | + <magentoCron stepKey="runCronIndex" groups="index"/> |
| 31 | + </before> |
| 32 | + |
| 33 | + <after> |
| 34 | + <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> |
| 35 | + <deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/> |
| 36 | + <deleteData createDataKey="simpleProduct3" stepKey="deleteSimpleProduct3"/> |
| 37 | + <deleteData createDataKey="simpleProduct4" stepKey="deleteSimpleProduct4"/> |
| 38 | + <deleteData createDataKey="simpleProduct5" stepKey="deleteSimpleProduct5"/> |
| 39 | + |
| 40 | + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteSavedProduct"> |
| 41 | + <argument name="product" value="SimpleProduct"/> |
| 42 | + </actionGroup> |
| 43 | + <actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="NavigateToAndResetProductGridToDefaultView"/> |
| 44 | + |
| 45 | + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory"> |
| 46 | + <argument name="path">var/export</argument> |
| 47 | + </helper> |
| 48 | + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexInvalidatedIndices"> |
| 49 | + <argument name="indices" value=""/> |
| 50 | + </actionGroup> |
| 51 | + <!--Logout to Admin Area--> |
| 52 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/> |
| 53 | + </after> |
| 54 | + |
| 55 | + <!-- Create product --> |
| 56 | + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/> |
| 57 | + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> |
| 58 | + <argument name="product" value="SimpleProduct"/> |
| 59 | + </actionGroup> |
| 60 | + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductForm"> |
| 61 | + <argument name="product" value="SimpleProduct"/> |
| 62 | + </actionGroup> |
| 63 | + |
| 64 | + <!--Add related product1--> |
| 65 | + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct1"> |
| 66 | + <argument name="sku" value="$$simpleProduct1.sku$$"/> |
| 67 | + </actionGroup> |
| 68 | + <!--Add related product2--> |
| 69 | + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct2"> |
| 70 | + <argument name="sku" value="$$simpleProduct2.sku$$"/> |
| 71 | + </actionGroup> |
| 72 | + <!--Add related product3--> |
| 73 | + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct3"> |
| 74 | + <argument name="sku" value="$$simpleProduct3.sku$$"/> |
| 75 | + </actionGroup> |
| 76 | + <!--Add related product4--> |
| 77 | + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct4"> |
| 78 | + <argument name="sku" value="$$simpleProduct4.sku$$"/> |
| 79 | + </actionGroup> |
| 80 | + |
| 81 | + <!--Remove related sell product2--> |
| 82 | + <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.removeRelatedProduct($$simpleProduct2.sku$$)}}" stepKey="removeRelatedProduct"/> |
| 83 | + |
| 84 | + <!--Add up sell product1--> |
| 85 | + <actionGroup ref="AddUpSellProductBySkuActionGroup" stepKey="addUpSellProduct1"> |
| 86 | + <argument name="sku" value="$$simpleProduct1.sku$"/> |
| 87 | + </actionGroup> |
| 88 | + <!--Add up sell product2--> |
| 89 | + <actionGroup ref="AddUpSellProductBySkuActionGroup" stepKey="addUpSellProduct2"> |
| 90 | + <argument name="sku" value="$$simpleProduct2.sku$"/> |
| 91 | + </actionGroup> |
| 92 | + <!--Add up sell product3--> |
| 93 | + <actionGroup ref="AddUpSellProductBySkuActionGroup" stepKey="addUpSellProduct3"> |
| 94 | + <argument name="sku" value="$$simpleProduct3.sku$"/> |
| 95 | + </actionGroup> |
| 96 | + <!--Add up sell product4--> |
| 97 | + <actionGroup ref="AddUpSellProductBySkuActionGroup" stepKey="addUpSellProduct4"> |
| 98 | + <argument name="sku" value="$$simpleProduct4.sku$"/> |
| 99 | + </actionGroup> |
| 100 | + <!--Add up sell product5--> |
| 101 | + <actionGroup ref="AddUpSellProductBySkuActionGroup" stepKey="addUpSellProduct5"> |
| 102 | + <argument name="sku" value="$$simpleProduct5.sku$"/> |
| 103 | + </actionGroup> |
| 104 | + |
| 105 | + <!--Remove upsell product2--> |
| 106 | + <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.removeUpsellProduct($$simpleProduct2.sku$$)}}" stepKey="removeUpsellProduct"/> |
| 107 | + |
| 108 | + <!--Add cross sell product1--> |
| 109 | + <actionGroup ref="AddCrossSellProductBySkuActionGroup" stepKey="addCrossSellProduct1"> |
| 110 | + <argument name="sku" value="$$simpleProduct1.sku$"/> |
| 111 | + </actionGroup> |
| 112 | + <!--Add cross sell product2--> |
| 113 | + <actionGroup ref="AddCrossSellProductBySkuActionGroup" stepKey="addCrossSellProduct2"> |
| 114 | + <argument name="sku" value="$$simpleProduct2.sku$"/> |
| 115 | + </actionGroup> |
| 116 | + <!--Add cross sell product3--> |
| 117 | + <actionGroup ref="AddCrossSellProductBySkuActionGroup" stepKey="addCrossSellProduct3"> |
| 118 | + <argument name="sku" value="$$simpleProduct3.sku$"/> |
| 119 | + </actionGroup> |
| 120 | + |
| 121 | + <!--Remove cross sell product2--> |
| 122 | + <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.removeCrossSellProduct($$simpleProduct2.sku$$)}}" stepKey="removeCrossSellProduct"/> |
| 123 | + |
| 124 | + <!--Save the product--> |
| 125 | + <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButton"/> |
| 126 | + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="messageYouSavedTheProductIsShown"> |
| 127 | + <argument name="message" value="You saved the product."/> |
| 128 | + </actionGroup> |
| 129 | + |
| 130 | + <!-- Export Created Products --> |
| 131 | + <actionGroup ref="AdminNavigateToExportPageActionGroup" stepKey="goToExportIndexPage"/> |
| 132 | + <actionGroup ref="ExportAllProductsActionGroup" stepKey="exportCreatedProducts"/> |
| 133 | + |
| 134 | + <!-- Start Message Queue for Export Consumer --> |
| 135 | + <actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue"> |
| 136 | + <argument name="consumerName" value="{{AdminExportMessageConsumerData.consumerName}}"/> |
| 137 | + <argument name="maxMessages" value="{{AdminExportMessageConsumerData.messageLimit}}"/> |
| 138 | + </actionGroup> |
| 139 | + <reloadPage stepKey="refreshPage"/> |
| 140 | + <waitForPageLoad stepKey="waitForReload"/> |
| 141 | + <waitForElementVisible selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="waitForFileName"/> |
| 142 | + <grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="getFilename"/> |
| 143 | + <actionGroup ref="AdminGetExportFilenameOnServerActionGroup" stepKey="grabNameFile"> |
| 144 | + <argument name="rowIndex" value="0"/> |
| 145 | + </actionGroup> |
| 146 | + |
| 147 | + <!-- Download Export File --> |
| 148 | + <actionGroup ref="DownloadFileActionGroup" stepKey="downloadCreatedProducts"> |
| 149 | + <argument name="fileName" value="{$getFilename}"/> |
| 150 | + </actionGroup> |
| 151 | + |
| 152 | + <!-- Validate Downloaded Export File on File System: Simple Product --> |
| 153 | + <grabAttributeFrom userInput="href" selector="{{AdminExportAttributeSection.download('0')}}" stepKey="grabExportUrl"/> |
| 154 | + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsRelatedProductPosition"> |
| 155 | + <argument name="url">{$grabExportUrl}</argument> |
| 156 | + <argument name="expectedString">1,2,3</argument> |
| 157 | + </helper> |
| 158 | + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsUpsellProductPosition"> |
| 159 | + <argument name="url">{$grabExportUrl}</argument> |
| 160 | + <argument name="expectedString">1,2,3,4</argument> |
| 161 | + </helper> |
| 162 | + <helper class="\Magento\Backend\Test\Mftf\Helper\CurlHelpers" method="assertCurlResponseContainsString" stepKey="assertDownloadFileContainsCrossSellProductPosition"> |
| 163 | + <argument name="url">{$grabExportUrl}</argument> |
| 164 | + <argument name="expectedString">1,2</argument> |
| 165 | + </helper> |
| 166 | + |
| 167 | + <!-- Delete Export File --> |
| 168 | + <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> |
| 169 | + <argument name="fileName" value="{$getFilename}"/> |
| 170 | + </actionGroup> |
| 171 | + <helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="assertFileDoesNotExist" stepKey="assertExportFileDeleted"> |
| 172 | + <argument name="filePath">var/export/{$grabNameFile}</argument> |
| 173 | + </helper> |
| 174 | + </test> |
| 175 | +</tests> |
0 commit comments