/** * Assert that custom system variable not in cms page form. * * @param CmsPageNew $cmsPageNew * @param SystemVariable $systemVariable * @return void */ public function processAssert(CmsPageNew $cmsPageNew, SystemVariable $systemVariable) { $customVariableName = $systemVariable->getName(); $cmsPageNew->open(); $cmsPageForm = $cmsPageNew->getPageForm(); $variables = $cmsPageForm->getSystemVariables(); \PHPUnit_Framework_Assert::assertFalse(in_array($customVariableName, $variables), 'Custom System Variable "' . $customVariableName . '" is present in Cms Page Form.'); }
/** * Creating Cms page. * * @param CmsPageFixture $cms * @return void */ public function test(CmsPageFixture $cms) { // Steps $this->cmsIndex->open(); $this->cmsIndex->getPageActionsBlock()->addNew(); $this->cmsPageNew->getPageForm()->fill($cms); $this->cmsPageNew->getPageMainActions()->save(); }
/** * Update CMS Page. * * @param CmsPage $cms * @param CmsPage $cmsOriginal * @return array */ public function test(CmsPage $cms, CmsPage $cmsOriginal) { // Steps $this->cmsPageIndex->open(); $this->cmsPageIndex->getCmsPageGridBlock()->searchAndOpen(['title' => $cmsOriginal->getTitle()]); $this->cmsPageNew->getPageForm()->fill($cms); $this->cmsPageNew->getPageMainActions()->save(); return ['cms' => $this->factory->createByCode('cmsPage', ['data' => array_merge($cmsOriginal->getData(), $cms->getData())])]; }
/** * Delete CMS Page. * * @param CmsPage $cmsPage * @return void */ public function test(CmsPage $cmsPage) { // Preconditions $cmsPage->persist(); // Steps $this->cmsPageIndex->open(); $this->cmsPageIndex->getCmsPageGridBlock()->searchAndOpen(['title' => $cmsPage->getTitle()]); $this->cmsPageNew->getPageMainActions()->delete(); }
/** * Assert that displayed CMS page data on edit page equals passed from fixture. * * @param CmsPage $cms * @param CmsPageIndex $cmsIndex * @param CmsPageNew $cmsPageNew * @return void */ public function processAssert(CmsPage $cms, CmsPageIndex $cmsIndex, CmsPageNew $cmsPageNew) { $cmsIndex->open(); $filter = ['title' => $cms->getTitle()]; $cmsIndex->getCmsPageGridBlock()->searchAndOpen($filter); $cmsFormData = $cmsPageNew->getPageForm()->getData($cms); $cmsFormData['store_id'] = implode('/', $cmsFormData['store_id']); $errors = $this->verifyData($cms->getData(), $cmsFormData); \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); }
/** * Creating Cms page. * * @param array $data * @param string $fixtureType * @return array */ public function test(array $data, $fixtureType) { // Steps $cms = $this->fixtureFactory->createByCode($fixtureType, ['data' => $data]); $this->cmsIndex->open(); $this->cmsIndex->getPageActionsBlock()->addNew(); $this->cmsPageNew->getPageForm()->fill($cms); $this->cmsPageNew->getPageMainActions()->save(); return ['cms' => $cms]; }
/** * Creating Cms page. * * @param CmsPageFixture $cms * @return void */ public function test(CmsPageFixture $cms) { // Steps $this->cmsIndex->open(); $this->cmsIndex->getPageActionsBlock()->addNew(); //TODO: remove cms page new refresh after resolve issue with static js files publication (MAGETWO-37898) $this->cmsPageNew->open(); $this->cmsPageNew->getPageForm()->fill($cms); $this->cmsPageNew->getPageMainActions()->save(); }
/** * Creating Cms page. * * @param array $data * @param string $fixtureType * @return array */ public function test(array $data, $fixtureType) { // Steps $cms = $this->fixtureFactory->createByCode($fixtureType, ['data' => $data]); $this->cmsIndex->open(); $this->cmsIndex->getPageActionsBlock()->addNew(); //TODO: remove cms page new refresh after resolve issue with static js files publication (MAGETWO-37898) $this->cmsPageNew->open(); $this->cmsPageNew->getPageForm()->fill($cms); $this->cmsPageNew->getPageMainActions()->save(); return ['cms' => $cms]; }