当前位置: 首页>>代码示例>>PHP>>正文


PHP Helper::findElements方法代码示例

本文整理汇总了PHP中Shopware\Tests\Mink\Helper::findElements方法的典型用法代码示例。如果您正苦于以下问题:PHP Helper::findElements方法的具体用法?PHP Helper::findElements怎么用?PHP Helper::findElements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Shopware\Tests\Mink\Helper的用法示例。


在下文中一共展示了Helper::findElements方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: submitNotification

 /**
  * Fills the notification form and submits it
  * @param string $email
  */
 public function submitNotification($email)
 {
     $data = [['field' => 'sNotificationEmail', 'value' => $email]];
     Helper::fillForm($this, 'notificationForm', $data);
     $elements = Helper::findElements($this, ['notificationSubmit']);
     $elements['notificationSubmit']->press();
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:11,代码来源:Detail.php

示例2: pressShowResults

 /**
  * @throws \Exception
  */
 private function pressShowResults()
 {
     $elements = Helper::findElements($this, ['filterShowResults']);
     /** @var NodeElement $showResults */
     $showResults = $elements['filterShowResults'];
     $showResults->press();
 }
开发者ID:BucherStoerzbachGbR,项目名称:shopware,代码行数:10,代码来源:Listing.php

示例3: subscribeNewsletter

 /**
  * @param array $data
  */
 public function subscribeNewsletter(array $data)
 {
     Helper::fillForm($this, 'newsletterForm', $data);
     $locators = array('newsletterFormSubmit');
     $elements = Helper::findElements($this, $locators);
     $elements['newsletterFormSubmit']->press();
 }
开发者ID:BucherStoerzbachGbR,项目名称:shopware,代码行数:10,代码来源:Homepage.php

示例4: getPaymentMethodProperty

 /**
  * Returns the current payment method
  * @return string
  */
 public function getPaymentMethodProperty()
 {
     $element = Helper::findElements($this, ['currentMethod']);
     $currentMethod = $element['currentMethod']->getText();
     $currentMethod = str_word_count($currentMethod, 1);
     return $currentMethod[0];
 }
开发者ID:BucherStoerzbachGbR,项目名称:shopware,代码行数:11,代码来源:CheckoutPayment.php

示例5: pressShowResults

 /**
  * Submits the filters
  * @throws \Exception
  */
 private function pressShowResults()
 {
     $this->getSession()->wait(5000, "\$('.filter--btn-apply:not(.is--loading):not([disabled=disabled])').length > 0");
     $elements = Helper::findElements($this, ['filterShowResults']);
     /** @var NodeElement $showResults */
     $showResults = $elements['filterShowResults'];
     $showResults->press();
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:12,代码来源:Listing.php

示例6: submitNotification

 /**
  * Fills the notification form and submits it
  * @param string $email
  */
 public function submitNotification($email)
 {
     $data = array(array('field' => 'sNotificationEmail', 'value' => $email));
     Helper::fillForm($this, 'notificationForm', $data);
     $locators = array('notificationSubmit');
     $elements = Helper::findElements($this, $locators);
     $elements['notificationSubmit']->press();
 }
开发者ID:BucherStoerzbachGbR,项目名称:shopware,代码行数:12,代码来源:Detail.php

示例7: getProperties

 /**
  * @param array $locators
  * @return array
  */
 public function getProperties(array $locators)
 {
     $return = array();
     $elements = Helper::findElements($this, $locators);
     foreach ($elements as $locator => $element) {
         $funcName = 'get' . ucfirst($locator);
         $return[$locator] = $this->{$funcName}($element);
     }
     return $return;
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:14,代码来源:BlogComment.php

示例8: setProperty

 /**
  * @param string $propertyName
  * @return bool
  */
 public function setProperty($propertyName)
 {
     $elements = Helper::findElements($this, ['properties']);
     /** @var NodeElement $propertyContainer */
     $propertyContainer = $elements['properties'];
     if (!$propertyContainer->hasLink($propertyName)) {
         return false;
     }
     $propertyContainer->clickLink($propertyName);
     return true;
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:15,代码来源:FilterGroup.php

示例9: checkRating

 /**
  * @inheritdoc
  */
 protected function checkRating(BlogComment $blogComments, $average)
 {
     $elements = Helper::findElements($this, ['articleRating', 'articleRatingCount']);
     $check = ['articleRating' => [$elements['articleRating']->getAttribute('content'), $average], 'articleRatingCount' => [$elements['articleRatingCount']->getText(), count($blogComments)]];
     $check = Helper::floatArray($check);
     $result = Helper::checkArray($check);
     if ($result !== true) {
         $message = sprintf('There was a different value of the rating! (%s: "%s" instead of "%s")', $result, $check[$result][0], $check[$result][1]);
         Helper::throwException($message);
     }
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:14,代码来源:Blog.php

示例10: checkCaptcha

 public function checkCaptcha()
 {
     $locators = array('captchaPlaceholder', 'captchaImage', 'captchaHidden');
     $element = Helper::findElements($this, $locators);
     $captchaPlaceholder = $element['captchaPlaceholder']->getAttribute('data-src');
     $captchaImage = $element['captchaImage']->getAttribute('src');
     $captchaHidden = $element['captchaHidden']->getValue();
     if ($captchaPlaceholder !== '/shopware/widgets/Captcha/refreshCaptcha' || strpos($captchaImage, 'data:image/png;base64') === false || empty($captchaHidden)) {
         $message = 'There is no capture in this form!';
         Helper::throwException($message);
     }
 }
开发者ID:BucherStoerzbachGbR,项目名称:shopware,代码行数:12,代码来源:Form.php

示例11: checkRobots

 /**
  * Checks if the robots meta exists and matches the expected content
  *
  * @param $content
  */
 public function checkRobots($content = [])
 {
     $elements = Helper::findElements($this, ['robots']);
     $robotsElement = $elements['robots'];
     $robotsValue = $robotsElement->getAttribute('content');
     $robotsParts = explode(',', $robotsValue);
     $robotsParts = array_map('trim', $robotsParts);
     if (empty($robotsParts)) {
         Helper::throwException(['Missing robots data']);
     }
     if ($robotsParts != $content) {
         $message = sprintf('Canonical link "%s" does not match expected value "%s"', implode(', ', $robotsParts), implode(', ', $content));
         Helper::throwException([$message]);
     }
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:20,代码来源:GenericPage.php

示例12: moveDirection

 /**
  * @param $direction
  * @param int $steps
  */
 public function moveDirection($direction, $steps = 1)
 {
     $locator = array(strtolower($direction));
     $elements = Helper::findElements($this, $locator);
     for ($i = 0; $i < $steps; $i++) {
         $result = Helper::countElements($this, $direction, 1);
         if ($result !== true) {
             $result = Helper::countElements($this, $direction, 2);
         }
         if ($result !== true) {
             Helper::throwException(array(sprintf('There is no more "%s" button! (after %d steps)', $direction, $i)));
         }
         $elements[$direction]->click();
     }
 }
开发者ID:BucherStoerzbachGbR,项目名称:shopware,代码行数:19,代码来源:Paging.php

示例13: checkCaptcha

 /**
  * Checks, whether a captcha exists and has loaded correctly
  * @throws \Exception
  */
 public function checkCaptcha()
 {
     $placeholderSelector = Helper::getRequiredSelector($this, 'captchaPlaceholder');
     if (!$this->getSession()->wait(5000, "\$('{$placeholderSelector}').children().length > 0")) {
         $message = 'The captcha was not loaded or does not exist!';
         Helper::throwException($message);
     }
     $element = Helper::findElements($this, ['captchaPlaceholder', 'captchaImage', 'captchaHidden']);
     $captchaPlaceholder = $element['captchaPlaceholder']->getAttribute('data-src');
     $captchaImage = $element['captchaImage']->getAttribute('src');
     $captchaHidden = $element['captchaHidden']->getValue();
     if (strpos($captchaPlaceholder, '/widgets/Captcha/refreshCaptcha') === false || strpos($captchaImage, 'data:image/png;base64') === false || empty($captchaHidden)) {
         $message = 'The captcha was not loaded correctly!';
         Helper::throwException($message);
     }
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:20,代码来源:Form.php

示例14: getImageProperty

 /**
  * @return string
  */
 public function getImageProperty()
 {
     $element = Helper::findElements($this, ['thumbnailImage']);
     return $element['thumbnailImage']->getAttribute('srcset');
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:8,代码来源:NotePosition.php

示例15: getCodeProperty

 /**
  * Returns the video code
  * @return array
  */
 public function getCodeProperty()
 {
     $elements = Helper::findElements($this, ['code']);
     return $elements['code']->getAttribute('src');
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:9,代码来源:YouTube.php


注:本文中的Shopware\Tests\Mink\Helper::findElements方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。