Exemplo n.º 1
0
 /**
  * Changes the shipping method
  * @param array $data
  */
 public function changeShippingMethod(array $data = [])
 {
     $element = $this->getElement('CheckoutPayment');
     Helper::clickNamedLink($element, 'changeButton');
     Helper::fillForm($this, 'shippingPaymentForm', $data);
     Helper::pressNamedButton($this, 'changePaymentButton');
 }
Exemplo n.º 2
0
 /**
  * @param array $data
  */
 public function unsubscribeNewsletter(array $data)
 {
     $mode = array(array('field' => 'subscribeToNewsletter', 'value' => -1));
     $data = array_merge($data, $mode);
     Helper::fillForm($this, 'newsletterForm', $data);
     Helper::pressNamedButton($this, 'newsletterFormSubmit');
 }
 /**
  * Changes the shipping method
  * @param array $data
  */
 public function changeShippingMethod($data = array())
 {
     $element = $this->getElement('CheckoutPayment');
     $language = Helper::getCurrentLanguage($this);
     Helper::clickNamedLink($element, 'changeButton', $language);
     Helper::fillForm($this, 'shippingPaymentForm', $data);
     Helper::pressNamedButton($this, 'changePaymentButton');
 }
Exemplo n.º 4
0
 /**
  * Searches the given term in the shop
  * @param string $searchTerm
  */
 public function searchFor($searchTerm)
 {
     $data = [['field' => 'sSearch', 'value' => $searchTerm]];
     $searchForm = $this->getElement('SearchForm');
     Helper::fillForm($searchForm, 'searchForm', $data);
     Helper::pressNamedButton($searchForm, 'searchButton');
     $this->verifyResponse();
 }
Exemplo n.º 5
0
 /**
  * Searches the given term in the shop
  * @param string $searchTerm
  */
 public function searchFor($searchTerm)
 {
     $data = array(array('field' => 'sSearch', 'value' => $searchTerm));
     $searchForm = $this->getElement('SearchForm');
     $language = Helper::getCurrentLanguage($this);
     Helper::fillForm($searchForm, 'searchForm', $data);
     Helper::pressNamedButton($searchForm, 'searchButton', $language);
     $this->verifyResponse();
 }
Exemplo n.º 6
0
 /**
  * Fills out the comment form and submits it
  * @param array $data
  */
 public function writeComment(array $data)
 {
     $writeCommentLink = $this->getSession()->getPage()->find("css", ".blog--comments-form a.btn--create-entry");
     if ($writeCommentLink) {
         $writeCommentLink->click();
     }
     Helper::fillForm($this, 'commentForm', $data);
     Helper::pressNamedButton($this, 'commentFormSubmit');
 }
Exemplo n.º 7
0
 /**
  * Changes the shipping method
  * @param array $data
  */
 public function changeShippingMethod($data = [])
 {
     Helper::fillForm($this, 'shippingPaymentForm', $data);
     Helper::pressNamedButton($this, 'changePaymentButton');
 }
Exemplo n.º 8
0
 /**
  * @param array $data
  */
 public function writeComment(array $data)
 {
     Helper::fillForm($this, 'commentForm', $data);
     Helper::pressNamedButton($this, 'commentFormSubmit');
 }
Exemplo n.º 9
0
 /**
  * Fills the notification form and submits it
  * @param string $email
  */
 public function submitNotification($email)
 {
     $data = [['field' => 'sNotificationEmail', 'value' => $email]];
     Helper::fillForm($this, 'notificationForm', $data);
     Helper::pressNamedButton($this, 'notificationFormSubmit');
 }
Exemplo n.º 10
0
 /**
  * @param AddressBox $addresses
  * @param string $name
  * @throws \Exception
  */
 protected function searchAddress(AddressBox $addresses, $name)
 {
     /** @var AddressBox $address */
     foreach ($addresses as $address) {
         if (strpos($address->getProperty('title'), $name) === false) {
             continue;
         }
         $language = Helper::getCurrentLanguage($this);
         Helper::pressNamedButton($address, 'chooseButton', $language);
         return;
     }
     $messages = array('The address "' . $name . '" is not available. Available are:');
     /** @var AddressBox $address */
     foreach ($addresses as $address) {
         $messages[] = $address->getProperty('title');
     }
     Helper::throwException($messages);
 }
 /**
  * @param array $data
  */
 public function changeShippingAddress($data = array())
 {
     $element = $this->getElement('CheckoutShipping');
     $language = Helper::getCurrentLanguage($this);
     Helper::clickNamedLink($element, 'changeButton', $language);
     $account = $this->getPage('Account');
     Helper::fillForm($account, 'shippingForm', $data);
     Helper::pressNamedButton($account, 'changeShippingButton', $language);
 }
Exemplo n.º 12
0
 /**
  * @param $data
  */
 public function register($data)
 {
     $this->verifyPage();
     Helper::fillForm($this, 'registrationForm', $data);
     Helper::pressNamedButton($this, 'sendButton');
 }
Exemplo n.º 13
0
 /**
  * Changes the shipping address
  * @param array $data
  */
 public function changeShippingAddress(array $data = [])
 {
     $element = $this->getElement('CheckoutShipping');
     Helper::clickNamedLink($element, 'changeButton');
     $account = $this->getPage('Account');
     Helper::fillForm($account, 'shippingForm', $data);
     Helper::pressNamedButton($account, 'changeShippingButton');
 }
Exemplo n.º 14
0
 /**
  * Fills the fields of the inquiry form with $data and submits it
  * @param array $data
  */
 public function submitInquiryForm(array $data)
 {
     Helper::fillForm($this, 'inquiryForm', $data);
     Helper::pressNamedButton($this, 'submitButton');
 }