/**
  * Assert that customer balance amount is changed.
  *
  * @param CustomerIndex $customerIndex
  * @param Customer $customer
  * @param CustomerBalance $customerBalance
  * @param CustomerEdit $customerEdit
  * @return void
  */
 public function processAssert(CustomerIndex $customerIndex, Customer $customer, CustomerBalance $customerBalance, CustomerEdit $customerEdit)
 {
     $customerIndex->open();
     $filter = ['email' => $customer->getEmail()];
     $customerIndex->getCustomerGridBlock()->searchAndOpen($filter);
     $customerForm = $customerEdit->getCustomerBalanceForm();
     $customerForm->openTab('store_credit');
     \PHPUnit_Framework_Assert::assertTrue($customerForm->getStoreCreditTab()->isStoreCreditBalanceVisible($customerBalance->getAmountDelta()), '"Store Credit Balance" grid not displays total amount of store credit balance.');
 }
Esempio n. 2
0
 /**
  * Verify value in balance history grid.
  *
  * @param CustomerBalance $customerBalance
  * @return bool
  */
 public function verifyCustomerBalanceGrid(CustomerBalance $customerBalance)
 {
     $moreInformation = $customerBalance->getComment();
     $gridRowValue = './/tr[td[contains(.,"' . abs($customerBalance->getAmountDelta()) . '")]';
     $customerNotified = $this->customerNotified[$customerBalance->getNotifyByEmail()];
     $gridRowValue .= ' and td[contains(.,"' . $customerNotified . '")]';
     if ($moreInformation) {
         $gridRowValue .= ' and td["' . sprintf($this->moreInformation, $moreInformation) . '"]';
     }
     $gridRowValue .= ']';
     $this->waitForElementVisible('.headings');
     return $this->_rootElement->find($gridRowValue, Locator::SELECTOR_XPATH)->isVisible();
 }