File tree Expand file tree Collapse file tree 2 files changed +69
-0
lines changed
app/code/Magento/Catalog/Test/Mftf Expand file tree Collapse file tree 2 files changed +69
-0
lines changed Original file line number Diff line number Diff line change
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
+ <actionGroups xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
10
+ xsi : noNamespaceSchemaLocation =" urn:magento:mftf:Test/etc/actionGroupSchema.xsd" >
11
+ <actionGroup name =" AdminAssertProductImageOnProductPageActionGroup" >
12
+ <annotations >
13
+ <description >Validates that the provided product image is present and correct.</description >
14
+ </annotations >
15
+ <arguments >
16
+ <argument name =" image" defaultValue =" {{MagentoLogo.filename}}" type =" string" />
17
+ </arguments >
18
+ <conditionalClick selector =" {{AdminProductImagesSection.productImagesToggle}}" dependentSelector =" {{AdminProductImagesSection.imageUploadButton}}" visible =" false" stepKey =" openProductImagesSection" />
19
+ <waitForPageLoad stepKey =" waitForPageLoad" />
20
+ <seeElement selector =" {{AdminProductImagesSection.imageFile(image)}}" stepKey =" seeImage" />
21
+ </actionGroup >
22
+ </actionGroups >
Original file line number Diff line number Diff line change @@ -69,6 +69,53 @@ public function deleteFileIfExists($filePath): void
69
69
}
70
70
}
71
71
72
+ /**
73
+ * Recursive delete directory
74
+ *
75
+ * @param string $path
76
+ * @return void
77
+ *
78
+ * @throws \Magento\Framework\Exception\FileSystemException
79
+ */
80
+ public function deleteDirectory ($ path ): void
81
+ {
82
+ $ realPath = $ this ->expandPath ($ path );
83
+ if ($ this ->driver ->isExists ($ realPath )) {
84
+ $ this ->driver ->deleteDirectory ($ realPath );
85
+ }
86
+ }
87
+
88
+ /**
89
+ * Copy source into destination
90
+ *
91
+ * @param string $source
92
+ * @param string $destination
93
+ * @return void
94
+ *
95
+ * @throws \Magento\Framework\Exception\FileSystemException
96
+ */
97
+ public function copy ($ source , $ destination ): void
98
+ {
99
+ $ sourceRealPath = $ this ->expandPath ($ source );
100
+ $ destinationRealPath = $ this ->expandPath ($ destination );
101
+ $ this ->driver ->copy ($ sourceRealPath , $ destinationRealPath );
102
+ }
103
+
104
+ /**
105
+ * Create directory
106
+ *
107
+ * @param string $path
108
+ * @param int $permissions
109
+ * @return void
110
+ *
111
+ * @throws \Magento\Framework\Exception\FileSystemException
112
+ */
113
+ public function createDirectory ($ path , $ permissions = 0777 ): void
114
+ {
115
+ $ sourceRealPath = $ this ->expandPath ($ path );
116
+ $ this ->driver ->createDirectory ($ sourceRealPath , $ permissions );
117
+ }
118
+
72
119
/**
73
120
* Copy a file
74
121
*
You can’t perform that action at this time.
0 commit comments