Skip to content

Commit 5f8f26f

Browse files
author
Rykh Oleksandr
committed
MTA-3342: Add an ability to run specified variation from a test case
1 parent f2d309a commit 5f8f26f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,17 @@ private function initObjectManager()
9898

9999
/** @var \Magento\Mtf\Config\DataInterface $configData */
100100
$configData = $objectManagerFactory->getObjectManager()->create(\Magento\Mtf\Config\TestRunner::class);
101-
$configData->setFileName($configFileName . '.xml')->load($configFilePath);
102-
101+
$filter = getopt('', ['filter:']);
102+
if (!isset($filter['filter'])) {
103+
$configData->setFileName($configFileName . '.xml')->load($configFilePath);
104+
} else {
105+
preg_match('`variation::(.*?)$`', $filter['filter'], $variation);
106+
if (isset($variation[1]) && !empty($variation[1])) {
107+
$configData->setFileName('basic.xml')->load($configFilePath);
108+
$data['rule']['variation']['allow'][0]['name'][0]['value'] = $variation[1];
109+
$configData->merge($data);
110+
}
111+
}
103112
$this->objectManager = $objectManagerFactory->create(
104113
[\Magento\Mtf\Config\TestRunner::class => $configData]
105114
);

0 commit comments

Comments
 (0)