/**
  * Assert that displayed Store Group data on edit page equals passed from fixture
  *
  * @param StoreIndex $storeIndex
  * @param EditGroup $editGroup
  * @param StoreGroup $storeGroup
  * @param StoreGroup $storeGroupOrigin [optional]
  * @return void
  */
 public function processAssert(StoreIndex $storeIndex, EditGroup $editGroup, StoreGroup $storeGroup, StoreGroup $storeGroupOrigin = null)
 {
     $fixtureData = $storeGroupOrigin != null ? array_merge($storeGroupOrigin->getData(), $storeGroup->getData()) : $storeGroup->getData();
     $storeIndex->open()->getStoreGrid()->searchAndOpenStoreGroup($storeGroup);
     $formData = $editGroup->getEditFormGroup()->getData();
     $errors = $this->verifyData($fixtureData, $formData);
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }
 /**
  * Update New StoreGroup
  *
  * @param StoreGroup $storeGroupOrigin
  * @param StoreGroup $storeGroup
  * @return void
  */
 public function test(StoreGroup $storeGroupOrigin, StoreGroup $storeGroup)
 {
     //Preconditions
     $storeGroupOrigin->persist();
     //Steps
     $this->storeIndex->open();
     $this->storeIndex->getStoreGrid()->searchAndOpenStore($storeGroupOrigin);
     $this->editGroup->getEditFormGroup()->fill($storeGroup);
     $this->editGroup->getFormPageActions()->save();
 }
 /**
  * Assert that created Store Group can not be found in Stores grid by name
  *
  * @param StoreIndex $storeIndex
  * @param StoreGroup $storeGroup
  * @return void
  */
 public function processAssert(StoreIndex $storeIndex, StoreGroup $storeGroup)
 {
     $storeGroupName = $storeGroup->getName();
     $storeIndex->open()->getStoreGrid()->search(['group_title' => $storeGroupName]);
     \PHPUnit_Framework_Assert::assertFalse($storeIndex->getStoreGrid()->isStoreExists($storeGroupName), 'Store group \'' . $storeGroupName . '\' is present in grid.');
 }
 /**
  * Delete StoreGroup
  *
  * @param StoreGroup $storeGroup
  * @param string $createBackup
  * @return void
  */
 public function test(StoreGroup $storeGroup, $createBackup)
 {
     //Preconditions
     $storeGroup->persist();
     $this->backupIndex->open()->getBackupGrid()->massaction([], 'Delete', true, 'Select All');
     //Steps
     $this->storeIndex->open();
     $this->storeIndex->getStoreGrid()->searchAndOpenStoreGroup($storeGroup);
     $this->editGroup->getFormPageActions()->delete();
     $this->deleteGroup->getDeleteGroupForm()->fillForm(['create_backup' => $createBackup]);
     $this->deleteGroup->getFormPageFooterActions()->delete();
 }
 /**
  * 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)
 {
     $storeGroupName = $storeGroup->getName();
     $storeIndex->open()->getGridPageActions()->addStoreView();
     \PHPUnit_Framework_Assert::assertTrue($storeNew->getStoreForm()->isStoreVisible($storeGroupName), 'Store Group \'' . $storeGroupName . '\' is not present on StoreView Form in Store dropdown.');
 }
Example #6
0
 /**
  * Search and open appropriate Store.
  *
  * @param StoreGroup $storeGroup
  * @return void
  */
 public function searchAndOpenStoreGroup(StoreGroup $storeGroup)
 {
     $storeGroupName = $storeGroup->getName();
     $this->search(['group_title' => $storeGroupName]);
     $this->_rootElement->find(sprintf($this->storeName, $storeGroupName), Locator::SELECTOR_XPATH)->click();
 }
Example #7
0
 /**
  * Search and open appropriate store
  *
  * @param StoreGroup $storeGroup
  * @return void
  */
 public function searchAndOpenStore(StoreGroup $storeGroup)
 {
     $storeName = $storeGroup->getName();
     $this->search(['group_title' => $storeName]);
     $this->editStore($storeName);
 }