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
 /**
  * Proceeds to the confirmation page with login
  * @param string $eMail
  * @param string $password
  */
 public function proceedToOrderConfirmationWithLogin($eMail, $password)
 {
     if ($this->verifyPage()) {
         Helper::clickNamedLink($this, 'checkout');
     }
     $this->getPage('Account')->login($eMail, $password);
     $this->getPage('CheckoutConfirm')->verifyPage();
 }
 /**
  * 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
 /**
  * @When /^I order the article on position (?P<position>\d+)$/
  */
 public function iOrderTheArticleOnPosition($position)
 {
     /** @var Listing $page */
     $page = $this->getPage('Listing');
     /** @var ArticleBox $articleBox */
     $articleBox = $this->getMultipleElement($page, 'ArticleBox', $position);
     Helper::clickNamedLink($articleBox, 'order');
 }
Exemplo n.º 5
0
 /**
  * @Given /^I click to read the blog article on position (\d+)$/
  */
 public function iClickToReadTheBlogArticleOnPosition($position)
 {
     /** @var Blog $page */
     $page = $this->getPage('Blog');
     /** @var BlogBox $blogBox */
     $blogBox = $this->getMultipleElement($page, 'BlogBox', $position);
     Helper::clickNamedLink($blogBox, 'readMore');
 }
Exemplo n.º 6
0
 private function clickActionLink($position, $name)
 {
     /** @var Note $page */
     $page = $this->getPage('Note');
     /** @var NotePosition $notePosition */
     $notePosition = $this->getMultipleElement($page, 'NotePosition', $position);
     Helper::clickNamedLink($notePosition, $name);
 }
Exemplo n.º 7
0
 /**
  * @Given /^my finished order should look like this:$/
  */
 public function myFinishedOrderShouldLookLikeThis(TableNode $positions)
 {
     $orderNumber = $this->getPage('CheckoutConfirm')->getOrderNumber();
     $values = $positions->getHash();
     /** @var \Shopware\Tests\Mink\Page\Emotion\Account $page */
     $page = $this->getPage('Account');
     $page->open();
     Helper::clickNamedLink($page, 'myOrdersLink');
     /** @var \Shopware\Tests\Mink\Element\Emotion\AccountOrder $order */
     $order = $this->getMultipleElement($page, 'AccountOrder');
     $page->checkOrder($order, $orderNumber, $values);
 }
Exemplo n.º 8
0
 /**
  * @When /^I follow the link "(?P<linkName>[^"]*)" of the element "(?P<elementClass>[^"]*)"$/
  * @When /^I follow the link "(?P<linkName>[^"]*)" of the element "(?P<elementClass>[^"]*)" on position (?P<position>\d+)$/
  */
 public function iFollowTheLinkOfTheElementOnPosition($linkName, $elementClass, $position = 1)
 {
     /** @var HelperSelectorInterface $element */
     $element = $this->getElement($elementClass);
     if ($element instanceof MultipleElement) {
         /** @var Homepage $page */
         $page = $this->getPage('Homepage');
         /** @var MultipleElement $element */
         $element->setParent($page);
         $element = $element->setInstance($position);
     }
     if (empty($linkName)) {
         $element->click();
         return;
     }
     Helper::clickNamedLink($element, $linkName);
 }
Exemplo n.º 9
0
 /**
  * Helper method checks the ESD articles
  * @param string $date
  * @param array $articles
  * @throws \Exception
  */
 private function checkEsdArticles($date, array $articles)
 {
     $esd = array();
     foreach ($articles as $key => $article) {
         if (empty($article['esd'])) {
             continue;
         }
         $esd[] = $article['product'];
     }
     if (empty($esd)) {
         return;
     }
     $language = Helper::getCurrentLanguage($this);
     Helper::clickNamedLink($this, 'myEsdDownloads', $language);
     $locators = array('esdDownloads');
     $elements = Helper::findAllOfElements($this, $locators);
     $locator = Helper::getRequiredSelector($this, 'esdDownloadName');
     $downloads = array();
     /** @var NodeElement $esdDownload */
     foreach ($elements['esdDownloads'] as $esdDownload) {
         if (strpos($esdDownload->getText(), $date) !== false) {
             $downloads[] = $this->find('css', $locator)->getText();
         }
     }
     foreach ($esd as $givenEsd) {
         foreach ($downloads as $download) {
             if ($givenEsd === $download) {
                 break;
             }
             if ($download === end($downloads)) {
                 $message = sprintf('ESD-Article "%s" not found in account!', $givenEsd);
                 Helper::throwException($message);
             }
         }
     }
 }
Exemplo n.º 10
0
 /**
  * Proceeds to the confirmation page with registration
  * @param array $data
  */
 public function proceedToOrderConfirmationWithRegistration(array $data)
 {
     if ($this->verifyPage()) {
         Helper::clickNamedLink($this, 'checkout');
     }
     $this->getPage('Account')->register($data);
 }
Exemplo n.º 11
0
 /**
  * Proceeds to the confirmation page with registration
  * @param array $data
  */
 public function proceedToOrderConfirmationWithRegistration(array $data)
 {
     $language = Helper::getCurrentLanguage($this);
     if ($this->verifyPage($language)) {
         Helper::clickNamedLink($this, 'checkout', $language);
     }
     $this->getPage('Account')->register($data);
 }
 /**
  * @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.º 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
 /**
  * @When /^I follow the link "(?P<linkName>[^"]*)" of the page "(?P<pageClass>[^"]*)"$/
  */
 public function iFollowTheLinkOfThePage($linkName, $pageClass)
 {
     $page = $this->getPage($pageClass);
     Helper::clickNamedLink($page, $linkName);
 }