/** * Assert that displayed Website data on edit page equals passed from fixture * * @param StoreIndex $storeIndex * @param EditWebsite $editWebsite * @param Website $website * @return void */ public function processAssert(StoreIndex $storeIndex, EditWebsite $editWebsite, Website $website) { $fixtureData = $website->getData(); $storeIndex->open()->getStoreGrid()->searchAndOpenWebsite($website); $formData = $editWebsite->getEditFormWebsite()->getData(); $errors = $this->verifyData($fixtureData, $formData); \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); }
/** * Assert that created Website can't be found in grid by name * * @param StoreIndex $storeIndex * @param Website $website * @return void */ public function processAssert(StoreIndex $storeIndex, Website $website) { $websiteName = $website->getName(); $storeIndex->open()->getStoreGrid()->search(['website_title' => $websiteName]); \PHPUnit_Framework_Assert::assertFalse($storeIndex->getStoreGrid()->isWebsiteExists($website), 'Website \'' . $websiteName . '\' is present in grid.'); }
/** * Delete Website * * @param Website $website * @param string $createBackup * @return void */ public function test(Website $website, $createBackup) { //Preconditions $website->persist(); $this->backupIndex->open()->getBackupGrid()->massaction([], 'Delete', true, 'Select All'); //Steps $this->storeIndex->open(); $this->storeIndex->getStoreGrid()->searchAndOpenWebsite($website); $this->editWebsite->getFormPageActions()->delete(); $this->deleteWebsite->getDeleteWebsiteForm()->fillForm(['create_backup' => $createBackup]); $this->deleteWebsite->getFormPageActions()->delete(); }
/** * Search and open appropriate Website. * * @param Website $website * @return void */ public function searchAndOpenWebsite(Website $website) { $websiteName = $website->getName(); $this->search(['website_title' => $websiteName]); $this->_rootElement->find(sprintf($this->storeName, $websiteName), Locator::SELECTOR_XPATH)->click(); }
/** * Assert that Website visible on Store Group Form in Website dropdown * * @param StoreIndex $storeIndex * @param NewGroupIndex $newGroupIndex * @param Website $website * @return void */ public function processAssert(StoreIndex $storeIndex, NewGroupIndex $newGroupIndex, Website $website) { $websiteName = $website->getName(); $storeIndex->open()->getGridPageActions()->createStoreGroup(); \PHPUnit_Framework_Assert::assertTrue($newGroupIndex->getEditFormGroup()->isWebsiteVisible($websiteName), 'Website \'' . $websiteName . '\' is not present on Store Group Form in Website dropdown.'); }
/** * Merge Website fixtures * * @param Website $website * @param Website $websiteOrigin * @return Website */ protected function mergeFixture(Website $website, Website $websiteOrigin) { $data = array_merge($websiteOrigin->getData(), $website->getData()); return $this->fixtureFactory->createByCode('website', ['data' => $data]); }