Skip to content

Commit c3d7356

Browse files
committed
MQE-741: two steps with same step key, the later step will overwrite the previous step.
1 parent 4ecb0ae commit c3d7356

File tree

4 files changed

+1995
-1890
lines changed

4 files changed

+1995
-1890
lines changed

etc/di.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@
199199

200200
<virtualType name="Magento\FunctionalTestingFramework\Config\SchemaLocator\TestData" type="Magento\FunctionalTestingFramework\Config\SchemaLocator">
201201
<arguments>
202-
<argument name="schemaPath" xsi:type="string">Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd</argument>
202+
<argument name="schemaPath" xsi:type="string">Magento/FunctionalTestingFramework/Test/etc/mergedTestSchema.xsd</argument>
203+
<argument name="perFileSchema" xsi:type="string">Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd</argument>
203204
</arguments>
204205
</virtualType>
205206
<virtualType name="Magento\FunctionalTestingFramework\Config\Reader\TestData" type="Magento\FunctionalTestingFramework\Config\Reader\TestFilesystem">

src/Magento/FunctionalTestingFramework/Config/SchemaLocator.php

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,49 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\FunctionalTestingFramework\Config;
78

89
/**
9-
* Class SchemaLocator
10-
* Scenario configuration schema locator
10+
* Configuration schema locator.
1111
*/
1212
class SchemaLocator implements \Magento\FunctionalTestingFramework\Config\SchemaLocatorInterface
1313
{
1414
/**
15-
* XSD schema path
15+
* Path to corresponding XSD file with validation rules for merged config.
1616
*
1717
* @var string
1818
*/
19-
protected $schemaPath;
19+
private $schemaPath;
20+
21+
/**
22+
* Path to corresponding XSD file with validation rules for separate config files.
23+
*
24+
* @var string
25+
*/
26+
private $perFileSchema;
27+
2028

2129
/**
2230
* Class constructor
2331
*
2432
* @param string $schemaPath
33+
* @param string|null $perFileSchema
2534
*/
26-
public function __construct($schemaPath)
35+
public function __construct($schemaPath, $perFileSchema = null)
2736
{
2837
if (constant('FW_BP') && file_exists(FW_BP . DIRECTORY_SEPARATOR . $schemaPath)) {
29-
$this->schemaPath = FW_BP . DIRECTORY_SEPARATOR . $schemaPath;
38+
$this->schemaPath = FW_BP . DIRECTORY_SEPARATOR . $schemaPath;
39+
$this->perFileSchema = $perFileSchema === null
40+
? $this->schemaPath
41+
: FW_BP . DIRECTORY_SEPARATOR . $perFileSchema;
3042
} else {
3143
$path = dirname(dirname(dirname(__DIR__)));
3244
$path = str_replace('\\', DIRECTORY_SEPARATOR, $path);
33-
$this->schemaPath = $path . DIRECTORY_SEPARATOR . $schemaPath;
45+
$this->schemaPath = $path . DIRECTORY_SEPARATOR . $schemaPath;
46+
$this->perFileSchema = $perFileSchema === null
47+
? $this->schemaPath
48+
: $path . DIRECTORY_SEPARATOR . $perFileSchema;
3449
}
3550
}
3651

@@ -51,6 +66,6 @@ public function getSchema()
5166
*/
5267
public function getPerFileSchema()
5368
{
54-
return null;
69+
return $this->perFileSchema;
5570
}
5671
}

0 commit comments

Comments
 (0)