예제 #1
0
 /**
  * Create currency rate test.
  *
  * @param CurrencyRate $currencyRate
  * @param CatalogProductSimple $product
  * @param $config
  * @return void
  */
 public function test(CurrencyRate $currencyRate, CatalogProductSimple $product, ConfigData $config)
 {
     // Preconditions:
     $product->persist();
     $config->persist();
     // Steps:
     $this->currencyIndexPage->open();
     $this->currencyIndexPage->getCurrencyRateForm()->fill($currencyRate);
     $this->currencyIndexPage->getFormPageActions()->save();
 }
 /**
  * Import currency rates.
  *
  * @param string $configData
  * @return void
  * @throws \Exception
  */
 protected function importCurrencyRate($configData)
 {
     $this->objectManager->getInstance()->create('Magento\\Config\\Test\\TestStep\\SetupConfigurationStep', ['configData' => $configData])->run();
     // Import Exchange Rates for currencies
     $this->currencyIndex->open();
     $this->currencyIndex->getCurrencyRateForm()->clickImportButton();
     if ($this->currencyIndex->getMessagesBlock()->isVisibleMessage('warning')) {
         throw new \Exception($this->currencyIndex->getMessagesBlock()->getWarningMessages());
     }
     $this->currencyIndex->getFormPageActions()->save();
 }
 /**
  * Import currency rates.
  *
  * @param string $configData
  * @return void
  */
 protected function importCurrencyRate($configData)
 {
     $this->objectManager->getInstance()->create('Magento\\Core\\Test\\TestStep\\SetupConfigurationStep', ['configData' => $configData])->run();
     // Import Exchange Rates for currencies
     $this->currencyIndex->open();
     $this->currencyIndex->getGridPageActions()->clickImportButton();
     $this->currencyIndex->getMainPageActions()->saveCurrentRate();
 }