/** * Delete Custom System Variable Entity test. * * @param SystemVariable $systemVariable * @return void */ public function test(SystemVariable $systemVariable) { // Precondition $systemVariable->persist(); // Steps $filter = ['code' => $systemVariable->getCode(), 'name' => $systemVariable->getName()]; $this->systemVariableIndexPage->open(); $this->systemVariableIndexPage->getSystemVariableGrid()->searchAndOpen($filter); $this->systemVariableNewPage->getFormPageActions()->delete(); }
/** * Injection data. * * @param SystemVariableIndex $systemVariableIndex * @param SystemVariableNew $systemVariableNew * @param SystemVariable $customVariableOrigin * @param FixtureFactory $factory * @return array */ public function __inject(SystemVariableIndex $systemVariableIndex, SystemVariableNew $systemVariableNew, SystemVariable $customVariableOrigin, FixtureFactory $factory) { $this->systemVariableIndexPage = $systemVariableIndex; $this->systemVariableNewPage = $systemVariableNew; $customVariableOrigin->persist(); // TODO: Move store creation to "__prepare" method after fix bug MAGETWO-29331 $storeOrigin = $factory->createByCode('store', ['dataset' => 'custom']); $storeOrigin->persist(); $this->store = $storeOrigin; return ['customVariableOrigin' => $customVariableOrigin, 'storeOrigin' => $storeOrigin]; }
/** * Update Custom System Variable Entity test. * * @param FixtureFactory $fixtureFactory * @param SystemVariable $customVariable * @param SystemVariable $customVariableOrigin * @param string $saveAction * @return array */ public function test(FixtureFactory $fixtureFactory, SystemVariable $customVariable, SystemVariable $customVariableOrigin, $saveAction) { $this->store = $fixtureFactory->createByCode('store', ['dataset' => 'custom']); $this->store->persist(); $customVariableOrigin->persist(); $filter = ['code' => $customVariableOrigin->getCode()]; // Steps $this->systemVariableIndexPage->open(); $this->systemVariableIndexPage->getSystemVariableGrid()->searchAndOpen($filter); $this->systemVariableNewPage->getFormPageActions()->selectStoreView($this->store->getData('name')); $this->systemVariableNewPage->getSystemVariableForm()->fill($customVariable); $this->systemVariableNewPage->getFormPageActions()->{$saveAction}(); return ['storeOrigin' => $this->store, 'customVariableOrigin' => $customVariableOrigin]; }