Skip to content

Commit 4579c10

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

File tree

2 files changed

+62
-7
lines changed

2 files changed

+62
-7
lines changed

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

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

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

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
</helper>
8585
</after>
8686

87-
<!-- Import Gift Card -->
87+
<!-- Import Configurable Product -->
8888
<actionGroup ref="AdminFillImportFormActionGroup" stepKey="fillImportForm">
8989
<argument name="importFile" value="{{ImportProduct_Configurable.fileName}}"/>
9090
<argument name="imagesFileDirectory" value="{{ImportProduct_Configurable.name}}"/>

0 commit comments

Comments
 (0)