result = $this->createResult(); } } /** * Prepare test suite. * * @return mixed */ public static function suite() { $suite = new self(); return $suite->prepareSuite(); } /** * Prepare test suite and apply application state. * * @return AppState */ public function prepareSuite() { $this->init(); return $this->objectManager->create('Magento\Mtf\TestSuite\AppState'); } /** * Call the initialization of ObjectManager. * * @return void */ public function init() { $this->initObjectManager(); } /** * Initialize ObjectManager. * * @return void */ private function initObjectManager() { if (!isset($this->objectManager)) { $objectManagerFactory = new ObjectManagerFactory(); $configFileName = isset($_ENV['testsuite_rule']) ? $_ENV['testsuite_rule'] : 'basic'; $configFilePath = realpath(MTF_BP . '/testsuites/' . $_ENV['testsuite_rule_path']); /** @var \Magento\Mtf\Config\DataInterface $configData */ $configData = $objectManagerFactory->getObjectManager()->create('Magento\Mtf\Config\TestRunner'); $configData->setFileName($configFileName . '.xml')->load($configFilePath); $this->objectManager = $objectManagerFactory->create( ['Magento\Mtf\Config\TestRunner' => $configData] ); } } }