Skip to content

Commit ee0ab6a

Browse files
committed
B2B-2135: [AWS S3] Remove redundant steps from AwsS3* tests
1 parent c901f76 commit ee0ab6a

6 files changed

+98
-213
lines changed

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

Lines changed: 18 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -24,65 +24,45 @@
2424
</annotations>
2525

2626
<before>
27-
<!-- Locally Copy Import Files to Unique Media Import Directory -->
28-
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportFiles" after="createCustomer">
29-
<argument name="path">pub/media/import/{{ImportProduct_Bundle.name}}</argument>
30-
</helper>
31-
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyImportFile" after="createDirectoryForImportFiles">
32-
<argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Bundle.fileName}}</argument>
33-
<argument name="destination">pub/media/import/{{ImportProduct_Bundle.name}}/{{ImportProduct_Bundle.fileName}}</argument>
34-
</helper>
35-
<remove keyForRemoval="createDirectoryForImportImages"/>
36-
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct1BaseImage">
37-
<argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple1_Bundle.baseImage}}</argument>
38-
<argument name="destination">pub/media/import/{{ImportProduct_Bundle.name}}/{{ImportProductSimple1_Bundle.baseImage}}</argument>
39-
</helper>
40-
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct2BaseImage">
41-
<argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple2_Bundle.smallImage}}</argument>
42-
<argument name="destination">pub/media/import/{{ImportProduct_Bundle.name}}/{{ImportProductSimple2_Bundle.smallImage}}</argument>
43-
</helper>
44-
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProduct3BaseImage">
45-
<argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple3_Bundle.thumbnailImage}}</argument>
46-
<argument name="destination">pub/media/import/{{ImportProduct_Bundle.name}}/{{ImportProductSimple3_Bundle.thumbnailImage}}</argument>
47-
</helper>
48-
49-
<!-- Enable AWS S3 Remote Storage & Sync -->
50-
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" after="copyProduct3BaseImage"/>
27+
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" after="createCustomer"/>
5128
<magentoCLI command="remote-storage:sync" timeout="120" stepKey="syncRemoteStorage" after="enableRemoteStorage"/>
5229

53-
<!-- Copy to Import Directory in AWS S3 -->
54-
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="createDirectory" stepKey="createDirectoryForImportFilesInS3" after="syncRemoteStorage">
30+
<comment userInput="BIC workaround" stepKey="createDirectoryForImportFiles" after="syncRemoteStorage"/>
31+
<comment userInput="BIC workaround" stepKey="copyImportFile" after="createDirectoryForImportFiles"/>
32+
33+
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="createDirectory" stepKey="createDirectoryForImportImages">
5534
<argument name="path">var/import/images/{{ImportProduct_Bundle.name}}</argument>
5635
</helper>
57-
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProduct1BaseImageInS3" after="createDirectoryForImportFilesInS3">
58-
<argument name="source">media/import/{{ImportProduct_Bundle.name}}/{{ImportProductSimple1_Bundle.baseImage}}</argument>
36+
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copyFromLocal" stepKey="copyProduct1BaseImage">
37+
<argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple1_Bundle.baseImage}}</argument>
5938
<argument name="destination">var/import/images/{{ImportProduct_Bundle.name}}/{{ImportProductSimple1_Bundle.baseImage}}</argument>
6039
</helper>
61-
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProduct2BaseImageInS3" after="copyProduct1BaseImageInS3">
62-
<argument name="source">media/import/{{ImportProduct_Bundle.name}}/{{ImportProductSimple2_Bundle.smallImage}}</argument>
40+
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copyFromLocal" stepKey="copyProduct2BaseImage">
41+
<argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple2_Bundle.smallImage}}</argument>
6342
<argument name="destination">var/import/images/{{ImportProduct_Bundle.name}}/{{ImportProductSimple2_Bundle.smallImage}}</argument>
6443
</helper>
65-
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProduct3BaseImageInS3" after="copyProduct2BaseImageInS3">
66-
<argument name="source">media/import/{{ImportProduct_Bundle.name}}/{{ImportProductSimple3_Bundle.thumbnailImage}}</argument>
44+
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copyFromLocal" stepKey="copyProduct3BaseImage">
45+
<argument name="source">dev/tests/acceptance/tests/_data/{{ImportProductSimple3_Bundle.thumbnailImage}}</argument>
6746
<argument name="destination">var/import/images/{{ImportProduct_Bundle.name}}/{{ImportProductSimple3_Bundle.thumbnailImage}}</argument>
6847
</helper>
48+
49+
<comment userInput="BIC workaround" stepKey="createDirectoryForImportFilesInS3" after="copyProduct3BaseImage"/>
50+
<comment userInput="BIC workaround" stepKey="copyProduct1BaseImageInS3" after="createDirectoryForImportFilesInS3"/>
51+
<comment userInput="BIC workaround" stepKey="copyProduct2BaseImageInS3" after="copyProduct1BaseImageInS3"/>
52+
<comment userInput="BIC workaround" stepKey="copyProduct3BaseImageInS3" after="copyProduct2BaseImageInS3"/>
6953
</before>
7054

7155
<after>
7256
<!-- Delete S3 Data -->
7357
<remove keyForRemoval="deleteProductImageDirectory"/>
74-
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryS3" after="deleteCustomer">
75-
<argument name="path">media/import/{{ImportProduct_Bundle.name}}</argument>
76-
</helper>
58+
<comment userInput="BIC workaround" stepKey="deleteImportFilesDirectoryS3" after="deleteCustomer"/>
7759
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportImagesFilesDirectoryS3" after="deleteImportFilesDirectoryS3">
7860
<argument name="path">var/import/images/{{ImportProduct_Bundle.name}}</argument>
7961
</helper>
8062

8163
<!-- Disable AWS S3 Remote Storage & Delete Local Data -->
8264
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logoutFromAdmin"/>
83-
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryLocal" after="disableRemoteStorage">
84-
<argument name="path">pub/media/import/{{ImportProduct_Bundle.name}}</argument>
85-
</helper>
65+
<comment userInput="BIC workaround" stepKey="deleteImportFilesDirectoryLocal" after="disableRemoteStorage"/>
8666
</after>
8767

8868
<!-- Import Bundle Product -->

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

Lines changed: 17 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -24,65 +24,45 @@
2424
</annotations>
2525

2626
<before>
27-
<!-- Locally Copy Import Files to Unique Media Import Directory -->
28-
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportFiles" after="createCustomer">
29-
<argument name="path">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}</argument>
30-
</helper>
31-
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyImportFile" after="createDirectoryForImportFiles">
32-
<argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_FileLinks.fileName}}</argument>
33-
<argument name="destination">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.fileName}}</argument>
27+
<comment userInput="BIC workaround" stepKey="createDirectoryForImportFiles" after="createCustomer"/>
28+
<comment userInput="BIC workaround" stepKey="copyImportFile" after="createDirectoryForImportFiles"/>
29+
30+
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="createDirectory" stepKey="createDirectoryForImportImages">
31+
<argument name="path">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}</argument>
3432
</helper>
35-
<remove keyForRemoval="createDirectoryForImportImages"/>
36-
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyBaseImage">
33+
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copyFromLocal" stepKey="copyBaseImage">
3734
<argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_FileLinks.baseImage}}</argument>
38-
<argument name="destination">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.baseImage}}</argument>
35+
<argument name="destination">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.baseImage}}</argument>
3936
</helper>
40-
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copySmallImage">
37+
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copyFromLocal" stepKey="copySmallImage">
4138
<argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_FileLinks.smallImage}}</argument>
42-
<argument name="destination">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.smallImage}}</argument>
39+
<argument name="destination">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.smallImage}}</argument>
4340
</helper>
44-
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyThumbnailImage">
41+
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copyFromLocal" stepKey="copyThumbnailImage">
4542
<argument name="source">dev/tests/acceptance/tests/_data/{{ImportProduct_Downloadable_FileLinks.thumbnailImage}}</argument>
46-
<argument name="destination">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.thumbnailImage}}</argument>
43+
<argument name="destination">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.thumbnailImage}}</argument>
4744
</helper>
4845

49-
<!-- Enable AWS S3 Remote Storage & Sync -->
5046
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" after="copyThumbnailImage"/>
5147
<magentoCLI command="remote-storage:sync" timeout="120" stepKey="syncRemoteStorage" after="enableRemoteStorage"/>
5248

53-
<!-- Copy to Import Directory in AWS S3 -->
54-
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="createDirectory" stepKey="createDirectoryForImportFilesInS3" after="syncRemoteStorage">
55-
<argument name="path">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}</argument>
56-
</helper>
57-
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyBaseImageInS3" after="createDirectoryForImportFilesInS3">
58-
<argument name="source">media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.baseImage}}</argument>
59-
<argument name="destination">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.baseImage}}</argument>
60-
</helper>
61-
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copySmallImageInS3" after="copyBaseImageInS3">
62-
<argument name="source">media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.smallImage}}</argument>
63-
<argument name="destination">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.smallImage}}</argument>
64-
</helper>
65-
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyThumbnailImageInS3" after="copySmallImageInS3">
66-
<argument name="source">media/import/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.thumbnailImage}}</argument>
67-
<argument name="destination">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}/{{ImportProduct_Downloadable_FileLinks.thumbnailImage}}</argument>
68-
</helper>
49+
<comment userInput="BIC workaround" stepKey="createDirectoryForImportFilesInS3" after="syncRemoteStorage"/>
50+
<comment userInput="BIC workaround" stepKey="copyBaseImageInS3" after="createDirectoryForImportFilesInS3"/>
51+
<comment userInput="BIC workaround" stepKey="copySmallImageInS3" after="copyBaseImageInS3"/>
52+
<comment userInput="BIC workaround" stepKey="copyThumbnailImageInS3" after="copySmallImageInS3"/>
6953
</before>
7054

7155
<after>
7256
<!-- Delete S3 Data -->
7357
<remove keyForRemoval="deleteProductImageDirectory"/>
74-
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryS3" after="deleteCustomer">
75-
<argument name="path">media/import/{{ImportProduct_Downloadable_FileLinks.name}}</argument>
76-
</helper>
58+
<comment userInput="BIC workaround" stepKey="deleteImportFilesDirectoryS3" after="deleteCustomer"/>
7759
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportImagesFilesDirectoryS3" after="deleteImportFilesDirectoryS3">
7860
<argument name="path">var/import/images/{{ImportProduct_Downloadable_FileLinks.name}}</argument>
7961
</helper>
8062

8163
<!-- Disable AWS S3 Remote Storage & Delete Local Data -->
8264
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logoutFromAdmin"/>
83-
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryLocal" after="disableRemoteStorage">
84-
<argument name="path">pub/media/import/{{ImportProduct_Downloadable_FileLinks.name}}</argument>
85-
</helper>
65+
<comment userInput="BIC workaround" stepKey="deleteImportFilesDirectoryLocal" after="disableRemoteStorage"/>
8666
</after>
8767

8868
<!-- Import Downloadable Product -->

0 commit comments

Comments
 (0)