9 use Magento\Variable\Test\Fixture\SystemVariable;
10 use Magento\Variable\Test\Page\Adminhtml\SystemVariableIndex;
11 use Magento\Variable\Test\Page\Adminhtml\SystemVariableNew;
13 use Magento\Mtf\Fixture\FixtureFactory;
14 use Magento\Mtf\TestCase\Injectable;
15 use Magento\Mtf\TestStep\TestStepFactory;
75 private $testStepFactory;
86 SystemVariableIndex $systemVariableIndex,
87 SystemVariableNew $systemVariableNew,
88 TestStepFactory $testStepFactory
90 $this->systemVariableIndexPage = $systemVariableIndex;
91 $this->systemVariableNewPage = $systemVariableNew;
92 $this->testStepFactory = $testStepFactory;
106 FixtureFactory $fixtureFactory,
107 SystemVariable $customVariable,
108 SystemVariable $customVariableOrigin,
113 $this->configData = $configData;
114 $this->testStepFactory->create(
115 \
Magento\Config\Test\TestStep\SetupConfigurationStep::class,
116 [
'configData' => $this->configData]
118 $this->store = $fixtureFactory->createByCode(
'store', [
'dataset' =>
'custom']);
119 $this->store->persist();
120 $customVariableOrigin->persist();
121 $filter = [
'code' => $customVariableOrigin->getCode()];
124 $this->systemVariableIndexPage->open();
125 $this->systemVariableIndexPage->getSystemVariableGrid()->searchAndOpen($filter);
126 $this->systemVariableNewPage->getFormPageActions()->selectStoreView($this->store->getData(
'name'));
127 $this->systemVariableNewPage->getSystemVariableForm()->fill($customVariable);
128 $this->systemVariableNewPage->getFormPageActions()->$saveAction();
131 'customVariableOrigin' => $customVariableOrigin
142 if ($this->store !==
null) {
143 $storeIndex = $this->objectManager->create(\
Magento\Backend\Test\Page\Adminhtml\StoreIndex::class);
145 $storeIndex->getStoreGrid()->searchAndOpen([
'store_title' => $this->store->getName()]);
146 $storeNew = $this->objectManager->create(\
Magento\Backend\Test\Page\Adminhtml\StoreNew::class);
147 $storeNew->getFormPageActions()->delete();
148 $storeDelete = $this->objectManager->create(\
Magento\Backend\Test\Page\Adminhtml\StoreDelete::class);
149 $storeDelete->getStoreForm()->fillForm([
'create_backup' =>
'No']);
150 $storeDelete->getFormPageActions()->delete();
__inject(SystemVariableIndex $systemVariableIndex, SystemVariableNew $systemVariableNew, TestStepFactory $testStepFactory)
test(FixtureFactory $fixtureFactory, SystemVariable $customVariable, SystemVariable $customVariableOrigin, $saveAction, $configData=null)