/**
  * Delete Term Entity test.
  *
  * @param CheckoutAgreement $agreement
  * @return void
  */
 public function test(CheckoutAgreement $agreement)
 {
     // Precondition
     $agreement->persist();
     // Steps
     $this->agreementIndex->open()->getAgreementGridBlock()->searchAndOpen(['name' => $agreement->getName()]);
     $this->agreementNew->getPageActionsBlock()->delete();
 }
 /**
  * Create checkout agreement.
  *
  * @return array
  */
 public function run()
 {
     $this->agreementIndex->open();
     $this->agreementIndex->getPageActionsBlock()->addNew();
     $this->agreementNew->getAgreementsForm()->fill($this->agreement);
     $this->agreementNew->getPageActionsBlock()->save();
     return ['agreement' => $this->agreement];
 }
 /**
  * Delete terms on backend
  *
  * @return void
  */
 public function run()
 {
     $this->agreementIndex->open();
     while ($this->agreementIndex->getAgreementGridBlock()->isFirstRowVisible()) {
         $this->agreementIndex->getAgreementGridBlock()->openFirstRow();
         $this->agreementNew->getPageActionsBlock()->delete();
     }
 }
 /**
  * Update checkout agreement.
  *
  * @return array
  */
 public function run()
 {
     $this->agreementIndex->open();
     $this->agreementIndex->getAgreementGridBlock()->searchAndOpen(['name' => $this->agreement->getName()]);
     $this->agreementNew->getAgreementsForm()->fill($this->agreementUpdated);
     $this->agreementNew->getPageActionsBlock()->save();
     return ['agreement' => $this->agreementUpdated];
 }
 /**
  * Create Term Entity test.
  *
  * @param CheckoutAgreementNew $agreementNew
  * @param CheckoutAgreementIndex $agreementIndex
  * @param CheckoutAgreement $agreement
  * @return void
  */
 public function test(CheckoutAgreementNew $agreementNew, CheckoutAgreementIndex $agreementIndex, CheckoutAgreement $agreement)
 {
     // Steps
     $agreementIndex->open();
     $agreementIndex->getPageActionsBlock()->addNew();
     $agreementNew->getAgreementsForm()->fill($agreement);
     $agreementNew->getPageActionsBlock()->save();
 }
 /**
  * Delete terms on backend
  *
  * @return void
  */
 public function run()
 {
     $this->agreementIndex->open();
     $this->agreementIndex->getAgreementGridBlock()->resetFilter();
     while ($this->agreementIndex->getAgreementGridBlock()->isFirstRowVisible()) {
         $this->agreementIndex->getAgreementGridBlock()->openFirstRow();
         $this->agreementNew->getPageActionsBlock()->delete();
         $this->agreementNew->getModalBlock()->acceptAlert();
     }
 }
 /**
  * Update Term Entity test.
  *
  * @param CheckoutAgreementNew $agreementNew
  * @param CheckoutAgreementIndex $agreementIndex
  * @param CheckoutAgreement $agreement
  * @param CheckoutAgreement $agreementOrigin
  * @return void
  */
 public function test(CheckoutAgreementNew $agreementNew, CheckoutAgreementIndex $agreementIndex, CheckoutAgreement $agreement, CheckoutAgreement $agreementOrigin)
 {
     // Precondition
     $agreementOrigin->persist();
     // Steps
     $agreementIndex->open();
     $agreementIndex->getAgreementGridBlock()->searchAndOpen(['name' => $agreementOrigin->getName()]);
     $agreementNew->getAgreementsForm()->fill($agreement);
     $agreementNew->getPageActionsBlock()->save();
 }
 /**
  * Assert that checkout agreement is absent in agreement grid.
  *
  * @param CheckoutAgreementIndex $agreementIndex
  * @param CheckoutAgreement $agreement
  * @return void
  */
 public function processAssert(CheckoutAgreementIndex $agreementIndex, CheckoutAgreement $agreement)
 {
     $agreementIndex->open();
     \PHPUnit_Framework_Assert::assertFalse($agreementIndex->getAgreementGridBlock()->isRowVisible(['name' => $agreement->getName()]), 'Checkout Agreement \'' . $agreement->getName() . '\' is present in agreement grid.');
 }
 /**
  * Assert that after save block successful message appears.
  *
  * @param CheckoutAgreementIndex $agreementIndex
  * @return void
  */
 public function processAssert(CheckoutAgreementIndex $agreementIndex)
 {
     \PHPUnit_Framework_Assert::assertEquals(self::SUCCESS_SAVE_MESSAGE, $agreementIndex->getMessagesBlock()->getSuccessMessage(), 'Wrong success message is displayed.');
 }
 /**
  * Delete checkout agreement.
  *
  * @return array
  */
 public function run()
 {
     $this->agreementIndex->open()->getAgreementGridBlock()->searchAndOpen(['name' => $this->agreement->getName()]);
     $this->agreementNew->getPageActionsBlock()->delete();
     $this->agreementNew->getModalBlock()->acceptAlert();
 }