/** * Select store view for order based on Order fixture. * * @param StoreFixture|null $store * @return void */ public function selectStoreView(StoreFixture $store = null) { if (!$this->isVisible()) { return; } $storeName = $store == null ? 'Default Store View' : $store->getName(); $selector = sprintf($this->storeLabel, $storeName); $this->_rootElement->find($selector, Locator::SELECTOR_XPATH, 'checkbox')->setValue('Yes'); $this->getTemplateBlock()->waitLoader(); }
/** * Check is Store View Visible. * * @param Store $store * @return bool */ public function isStoreViewVisible(Store $store) { $availableStores = explode("\n", $this->_rootElement->find($this->storeSwitcher)->getText()); return in_array(strtoupper($store->getName()), $availableStores); }
/** * Assert that created Store View can be found in Stores grid by name. * * @param StoreIndex $storeIndex * @param Store $store * @return void */ public function processAssert(StoreIndex $storeIndex, Store $store) { $storeName = $store->getName(); $storeIndex->open(); \PHPUnit_Framework_Assert::assertTrue($storeIndex->getStoreGrid()->isStoreExists($storeName), "Store {$storeName} is not present in grid."); }
/** * Open Store View. * * @param Store $store * @return void */ public function openStore(Store $store) { $this->_rootElement->find(sprintf($this->storeName, $store->getName()), Locator::SELECTOR_XPATH)->click(); }