Skip to content

Commit eb1ffd7

Browse files
committed
B2B-1648: Implement Solution for Unblocking S3 MFTF Import Tests
- Unskipping & fixing S3 import configurable product MFTF test
1 parent 3c46d10 commit eb1ffd7

File tree

2 files changed

+67
-9
lines changed

2 files changed

+67
-9
lines changed

app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml

Lines changed: 61 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,74 @@
2020
<group value="importExport"/>
2121
<group value="ConfigurableProduct"/>
2222
<group value="remote_storage_aws_s3"/>
23-
<skip>
24-
<issueId value="MC-39280"/>
25-
</skip>
2623
</annotations>
2724

2825
<before>
29-
<!-- Enable AWS S3 Remote Storage -->
30-
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" before="createImportProductAttribute"/>
26+
<!-- Locally Copy Import Files to Unique Media Import Directory -->
27+
<helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportFiles" after="createCustomer">
28+
<argument name="path">pub/media/import/{{ImportProduct_Configurable.name}}</argument>
29+
</helper>
30+
<helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyImportFile" after="createDirectoryForImportFiles">
31+
<argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Configurable.fileName}}</argument>
32+
<argument name="destination">pub/media/import/{{ImportProduct_Configurable.name}}/{{ImportProduct_Configurable.fileName}}</argument>
33+
</helper>
34+
<remove keyForRemoval="createDirectoryForImportImages"/>
35+
<helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct1BaseImage">
36+
<argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple1_Configurable.baseImage}}</argument>
37+
<argument name="destination">pub/media/import/{{ImportProduct_Configurable.name}}/{{ImportProductSimple1_Configurable.baseImage}}</argument>
38+
</helper>
39+
<helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct2BaseImage">
40+
<argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple2_Configurable.smallImage}}</argument>
41+
<argument name="destination">pub/media/import/{{ImportProduct_Configurable.name}}/{{ImportProductSimple2_Configurable.smallImage}}</argument>
42+
</helper>
43+
<helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct3BaseImage">
44+
<argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple3_Configurable.thumbnailImage}}</argument>
45+
<argument name="destination">pub/media/import/{{ImportProduct_Configurable.name}}/{{ImportProductSimple3_Configurable.thumbnailImage}}</argument>
46+
</helper>
47+
48+
<!-- Enable AWS S3 Remote Storage & Sync -->
49+
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" after="copyProduct3BaseImage"/>
50+
<magentoCLI command="remote-storage:sync" timeout="120" stepKey="syncRemoteStorage" after="enableRemoteStorage"/>
51+
52+
<!-- Copy to Import Directory in AWS S3 -->
53+
<helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="createDirectory" stepKey="createDirectoryForImportFilesInS3" after="syncRemoteStorage">
54+
<argument name="path">var/import/images/{{ImportProduct_Configurable.name}}</argument>
55+
</helper>
56+
<helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProduct1BaseImageInS3" after="createDirectoryForImportFilesInS3">
57+
<argument name="source">media/import/{{ImportProduct_Configurable.name}}/{{ImportProductSimple1_Configurable.baseImage}}</argument>
58+
<argument name="destination">var/import/images/{{ImportProduct_Configurable.name}}/{{ImportProductSimple1_Configurable.baseImage}}</argument>
59+
</helper>
60+
<helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProduct2BaseImageInS3" after="copyProduct1BaseImageInS3">
61+
<argument name="source">media/import/{{ImportProduct_Configurable.name}}/{{ImportProductSimple2_Configurable.smallImage}}</argument>
62+
<argument name="destination">var/import/images/{{ImportProduct_Configurable.name}}/{{ImportProductSimple2_Configurable.smallImage}}</argument>
63+
</helper>
64+
<helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProduct3BaseImageInS3" after="copyProduct2BaseImageInS3">
65+
<argument name="source">media/import/{{ImportProduct_Configurable.name}}/{{ImportProductSimple3_Configurable.thumbnailImage}}</argument>
66+
<argument name="destination">var/import/images/{{ImportProduct_Configurable.name}}/{{ImportProductSimple3_Configurable.thumbnailImage}}</argument>
67+
</helper>
3168
</before>
3269

3370
<after>
34-
<!-- Disable AWS S3 Remote Storage -->
71+
<!-- Delete S3 Data -->
72+
<remove keyForRemoval="deleteProductImageDirectory"/>
73+
<helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryS3" after="deleteCustomer">
74+
<argument name="path">media/import/{{ImportProduct_Configurable.name}}</argument>
75+
</helper>
76+
<helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportImagesFilesDirectoryS3" after="deleteImportFilesDirectoryS3">
77+
<argument name="path">var/import/images/{{ImportProduct_Configurable.name}}</argument>
78+
</helper>
79+
80+
<!-- Disable AWS S3 Remote Storage & Delete Local Data -->
3581
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logoutFromAdmin"/>
82+
<helper class="\Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryLocal" after="disableRemoteStorage">
83+
<argument name="path">pub/media/import/{{ImportProduct_Configurable.name}}</argument>
84+
</helper>
3685
</after>
86+
87+
<!-- Import Gift Card -->
88+
<actionGroup ref="AdminFillImportFormActionGroup" stepKey="fillImportForm">
89+
<argument name="importFile" value="{{ImportProduct_Configurable.fileName}}"/>
90+
<argument name="imagesFileDirectory" value="{{ImportProduct_Configurable.name}}"/>
91+
</actionGroup>
3792
</test>
3893
</tests>

app/code/Magento/ConfigurableImportExport/Test/Mftf/Test/AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@
278278
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Configurable.name}}" stepKey="seeProductName2"/>
279279
<see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Configurable.sku}}" stepKey="seeSku2"/>
280280
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportProductSimple1_Configurable.price}}" stepKey="seePrice2"/>
281-
<seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple1_Configurable.baseImageName)}}" stepKey="seeBaseImage2"/>
281+
<waitForPageLoad stepKey="waitForImageLoad1"/>
282+
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple1_Configurable.baseImageName)}}" stepKey="seeBaseImage2"/>
282283

283284
<!-- Storefront: Verify Configurable Product Option 2 Info & Image -->
284285
<actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectOption2">
@@ -288,7 +289,8 @@
288289
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Configurable.name}}" stepKey="seeProductName3"/>
289290
<see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Configurable.sku}}" stepKey="seeSku3"/>
290291
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportProductSimple2_Configurable.price}}" stepKey="seePrice3"/>
291-
<seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple2_Configurable.baseImageName)}}" stepKey="seeBaseImage3"/>
292+
<waitForPageLoad stepKey="waitForImageLoad2"/>
293+
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple2_Configurable.baseImageName)}}" stepKey="seeBaseImage3"/>
292294

293295
<!-- Storefront: Verify Configurable Product Option 3 Info & Image -->
294296
<actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectOption3">
@@ -298,7 +300,8 @@
298300
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Configurable.name}}" stepKey="seeProductName4"/>
299301
<see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Configurable.sku}}" stepKey="seeSku4"/>
300302
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportProductSimple3_Configurable.price}}" stepKey="seePrice4"/>
301-
<seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple3_Configurable.baseImageName)}}" stepKey="seeBaseImage4"/>
303+
<waitForPageLoad stepKey="waitForImageLoad3"/>
304+
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple3_Configurable.baseImageName)}}" stepKey="seeBaseImage4"/>
302305

303306
<!-- Purchase Configurable Product -->
304307
<actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addProductToCart"/>

0 commit comments

Comments
 (0)