本文整理汇总了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();
}
示例2: pressShowResults
/**
* @throws \Exception
*/
private function pressShowResults()
{
$elements = Helper::findElements($this, ['filterShowResults']);
/** @var NodeElement $showResults */
$showResults = $elements['filterShowResults'];
$showResults->press();
}
示例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();
}
示例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];
}
示例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();
}
示例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();
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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]);
}
}
示例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();
}
}
示例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);
}
}
示例14: getImageProperty
/**
* @return string
*/
public function getImageProperty()
{
$element = Helper::findElements($this, ['thumbnailImage']);
return $element['thumbnailImage']->getAttribute('srcset');
}
示例15: getCodeProperty
/**
* Returns the video code
* @return array
*/
public function getCodeProperty()
{
$elements = Helper::findElements($this, ['code']);
return $elements['code']->getAttribute('src');
}