/**
  * 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
  */
 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();
 }
 /**
  * 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();
 }
 /**
  * Assert that success message is displayed after currency rate saved.
  *
  * @param SystemCurrencyIndex $currencyIndexPage
  * @return void
  */
 public function processAssert(SystemCurrencyIndex $currencyIndexPage)
 {
     $actualMessage = $currencyIndexPage->getMessagesBlock()->getSuccessMessage();
     \PHPUnit_Framework_Assert::assertEquals(self::SUCCESS_MESSAGE, $actualMessage, 'Wrong success message is displayed.' . "\nExpected: " . self::SUCCESS_MESSAGE . "\nActual: " . $actualMessage);
 }