/** * Reset Currency Symbol Entity test. * * @param CurrencySymbolEntity $currencySymbolOriginal * @param CurrencySymbolEntity $currencySymbol * @param string $currencySymbolDefault * @param string $configData * @return array */ public function test(CurrencySymbolEntity $currencySymbolOriginal, CurrencySymbolEntity $currencySymbol, $currencySymbolDefault, $configData) { // Preconditions $currencySymbolOriginal->persist(); $this->importCurrencyRate($configData); // Steps $this->currencySymbolIndex->open(); $this->currencySymbolIndex->getCurrencySymbolForm()->fill($currencySymbol); $this->currencySymbolIndex->getPageActions()->save(); return ['currencySymbol' => $this->fixtureFactory->createByCode('currencySymbolEntity', ['data' => array_merge($currencySymbol->getData(), ['custom_currency_symbol' => $currencySymbolDefault])])]; }
/** * Switch currency to specified one. * * @param CurrencySymbolEntity $currencySymbol * @return void */ public function switchCurrency(CurrencySymbolEntity $currencySymbol) { $this->waitForElementVisible($this->currencySwitch); $currencyLink = $this->_rootElement->find($this->currencySwitch); $customCurrencySwitch = explode(" ", $this->_rootElement->find($this->currencySwitch)->getText()); $currencyCode = $currencySymbol->getCode(); if ($customCurrencySwitch[0] !== $currencyCode) { $currencyLink->click(); $currencyLink = $this->_rootElement->find(sprintf($this->currencyLinkLocator, $currencyCode), Locator::SELECTOR_XPATH); $currencyLink->click(); $this->waitForElementVisible($this->language . $currencyCode); } }