Skip to content

Commit a6e2336

Browse files
committed
B2B-1655: Add MFTF test for MC-38949
- Updating scheduled import MFTF test to use existing images
1 parent 7e3dc21 commit a6e2336

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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>

app/code/Magento/Catalog/Test/Mftf/Helper/LocalFileAssertions.php

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,53 @@ public function deleteFileIfExists($filePath): void
6969
}
7070
}
7171

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+
72119
/**
73120
* Copy a file
74121
*

0 commit comments

Comments
 (0)