/**
  * Assert that New Store Group visible on StoreView Form in Store dropdown.
  *
  * @param StoreIndex $storeIndex
  * @param StoreNew $storeNew
  * @param StoreGroup $storeGroup
  * @return void
  */
 public function processAssert(StoreIndex $storeIndex, StoreNew $storeNew, StoreGroup $storeGroup)
 {
     $storeIndex->open();
     $storeGroupName = $storeGroup->getName();
     $storeIndex->getGridPageActions()->addStoreView();
     \PHPUnit_Framework_Assert::assertTrue($storeNew->getStoreForm()->isStoreVisible($storeGroupName), "Store Group '{$storeGroupName}' is not present on StoreView Form in Store dropdown.");
 }
 /**
  * Assert that displayed Store Group data on edit page equals passed from fixture.
  *
  * @param StoreIndex $storeIndex
  * @param EditGroup $editGroup
  * @param StoreGroup $storeGroup
  * @return void
  */
 public function processAssert(StoreIndex $storeIndex, EditGroup $editGroup, StoreGroup $storeGroup)
 {
     $storeIndex->open();
     $storeIndex->getStoreGrid()->openStoreGroup($storeGroup->getName());
     $formData = $editGroup->getEditFormStoreGroup()->getData();
     $fixtureData = $storeGroup->getData();
     $errors = $this->verifyData($fixtureData, $formData);
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }
 /**
  * Delete store groups.
  *
  * @return void
  */
 public function run()
 {
     foreach ($this->storeGroups as $storeGroup) {
         /** @var StoreGroup $storeGroup */
         $this->storeIndex->getStoreGrid()->openStoreGroupByName($storeGroup->getName());
         $this->editStore->getFormPageActions()->delete();
         $this->deleteStore->getFormPageActions()->delete();
     }
 }
 /**
  * Delete websites.
  *
  * @return void
  */
 public function run()
 {
     foreach ($this->websitesNames as $websiteName) {
         $this->storeIndex->open();
         $this->storeIndex->getStoreGrid()->openWebsite($websiteName);
         $this->editWebsite->getFormPageActions()->delete();
         $this->deleteWebsite->getForm()->delete();
     }
 }
 /**
  * Delete Website after test variation.
  *
  * @return void
  */
 public function tearDown()
 {
     // Delete Website
     if ($this->website->hasData('website_id')) {
         $this->storeIndex->open();
         $storeGrid = $this->storeIndex->getStoreGrid();
         $storeGrid->openWebsite($this->website->getName());
         $this->editStore->getFormPageActions()->delete();
         $this->deleteStore->getFormPageActions()->delete();
     }
 }
 /**
  * Delete store.
  *
  * @return void
  */
 public function tearDown()
 {
     $this->storeIndex->open();
     if ($this->storeGroup->getWebsiteId() !== 'Main Website') {
         $this->storeIndex->getStoreGrid()->openWebsite($this->storeGroup->getWebsiteId());
         $this->editStore->getFormPageActions()->delete();
         $this->deleteStore->getFormPageActions()->delete();
     } else {
         $this->storeIndex->getStoreGrid()->openStoreGroupByName($this->storeGroup->getName());
         $this->editStore->getFormPageActions()->delete();
         $this->deleteStore->getFormPageActions()->delete();
     }
 }
 /**
  * Delete store.
  *
  * @return void
  */
 public function tearDown()
 {
     $this->objectManager->create('Mage\\Core\\Test\\TestStep\\SetupConfigurationStep', ['configData' => 'store_view_local', 'rollback' => true])->run();
     $this->storeIndex->open();
     if ($this->store->getGroupId() === 'Main Website/Main Website Store') {
         $this->storeIndex->getStoreGrid()->openStore($this->store);
         $this->editStore->getFormPageActions()->delete();
         $this->deleteStore->getFormPageActions()->delete();
     } else {
         $this->storeIndex->getStoreGrid()->openStoreGroup(explode('/', $this->store->getGroupId())[1]);
         $this->editGroup->getFormPageActions()->delete();
         $this->deleteGroup->getFormPageActions()->delete();
     }
 }
 /**
  * Delete store.
  *
  * @return void
  */
 public function tearDown()
 {
     if (!$this->cms instanceof CmsPage) {
         return;
     }
     $stores = $this->cms->getStoreId();
     if ($stores) {
         $stores = $this->cms->getDataFieldConfig('store_id')['source']->getStore();
         foreach ($stores as $store) {
             $this->storeIndex->open();
             $this->storeIndex->getStoreGrid()->openStore($store);
             $this->editStore->getFormPageActions()->delete();
             $this->deleteStore->getFormPageActions()->delete();
         }
     }
 }
 /**
  * Assert that success message is displayed after Store Group has been created.
  *
  * @param StoreIndex $storeIndex
  * @return void
  */
 public function processAssert(StoreIndex $storeIndex)
 {
     \PHPUnit_Framework_Assert::assertEquals(self::SUCCESS_MESSAGE, $storeIndex->getMessagesBlock()->getSuccessMessages());
 }
Beispiel #10
0
 /**
  * Assert that displayed Store View data on edit page equals passed from fixture.
  *
  * @param StoreIndex $storeIndex
  * @param StoreNew $storeNew
  * @param Store $store
  * @return void
  */
 public function processAssert(StoreIndex $storeIndex, StoreNew $storeNew, Store $store)
 {
     $storeIndex->open()->getStoreGrid()->openStore($store);
     $errors = $this->verifyData($store->getData(), $storeNew->getStoreForm()->getData());
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }
 /**
  * Delete store.
  *
  * @return void
  */
 public function tearDown()
 {
     if ($this->urlRewrite !== null && $this->urlRewrite->hasData('store_id')) {
         $store = $this->urlRewrite->getDataFieldConfig('store_id')['source']->getStore();
         if ($store->getName() !== 'Default Store View') {
             $this->storeIndex->open();
             $this->storeIndex->getStoreGrid()->openStore($store);
             $this->editStore->getFormPageActions()->delete();
             $this->deleteStore->getFormPageActions()->delete();
         }
         $this->urlRewrite = null;
     }
 }
 /**
  * Assert that created Store Group can be found in Stores grid by name.
  *
  * @param StoreIndex $storeIndex
  * @param StoreGroup $storeGroup
  * @return void
  */
 public function processAssert(StoreIndex $storeIndex, StoreGroup $storeGroup)
 {
     $storeIndex->open();
     $storeGroupName = $storeGroup->getName();
     \PHPUnit_Framework_Assert::assertTrue($storeIndex->getStoreGrid()->isStoreGroupExists($storeGroupName), "Store group '{$storeGroupName}' is not present in grid.");
 }
 /**
  * Assert that success message is displayed after Store View has been created.
  *
  * @param StoreIndex $storeIndex
  * @param string|null $savedMessage
  * @return void
  */
 public function processAssert(StoreIndex $storeIndex, $savedMessage = null)
 {
     $expectedMessage = $savedMessage === null ? self::SUCCESS_MESSAGE : $savedMessage;
     \PHPUnit_Framework_Assert::assertEquals($expectedMessage, $storeIndex->getMessagesBlock()->getSuccessMessages(), 'Wrong success message is displayed.');
 }