Class Search Block for "Search" section
Definition at line 16 of file Search.php.
◆ clickSuggestedText()
clickSuggestedText |
( |
|
$text | ) |
|
Click on suggested text.
- Parameters
-
- Returns
- void
Definition at line 155 of file Search.php.
◆ fillSearch()
Fill "Search" field with correspondent text.
- Parameters
-
- Returns
- void
Definition at line 89 of file Search.php.
91 $this->_rootElement->find($this->searchInput)->setValue(
$text);
waitUntilSearchPrepared()
◆ isPlaceholderContains()
isPlaceholderContains |
( |
|
$placeholderText | ) |
|
Check if placeholder contains correspondent text or not.
- Parameters
-
- Returns
- bool
Definition at line 121 of file Search.php.
123 $field = $this->_rootElement->find(sprintf($this->placeholder, $placeholderText), Locator::SELECTOR_XPATH);
124 return $field->isVisible();
◆ isSuggestSearchVisible()
isSuggestSearchVisible |
( |
|
$text, |
|
|
|
$amount = null |
|
) |
| |
Check if "Suggest Search" block visible or not.
- Parameters
-
string | $text | |
int | null | $amount | |
- Returns
- bool
Definition at line 134 of file Search.php.
141 $rootElement = $this->_rootElement;
142 return (
bool)$this->_rootElement->waitUntil(
144 return $rootElement->find(
$searchAutocomplete, Locator::SELECTOR_XPATH)->isVisible() ? true :
null;
◆ search()
search |
( |
|
$keyword, |
|
|
|
$length = null |
|
) |
| |
Perform search by a keyword.
- Parameters
-
string | $keyword | |
string | null | $length | |
- Returns
- void
Definition at line 74 of file Search.php.
77 $keyword = substr($keyword, 0, $length);
80 $this->_rootElement->find($this->searchButton)->click();
◆ waitUntilSearchPrepared()
waitUntilSearchPrepared |
( |
| ) |
|
Wait until "Suggest Search" block will be prepared.
- Returns
- bool
Definition at line 100 of file Search.php.
102 $this->browser->waitUntil(
104 $count = count($this->_rootElement->getElements($this->searchListItems, Locator::SELECTOR_XPATH));
106 $newCount = count($this->_rootElement->getElements($this->searchListItems, Locator::SELECTOR_XPATH));
107 return $this->browser->find($this->selectorAriaBusy, Locator::SELECTOR_XPATH)->isVisible()
◆ $placeholder
$placeholder = '//input[@id="search" and contains(@placeholder, "%s")]' |
|
protected |
◆ $searchAutocomplete
$searchAutocomplete = './/div[@id="search_autocomplete"]//li[span[text()[normalize-space()="%s"]]]' |
|
protected |
◆ $searchInput
◆ $searchItemAmount
$searchItemAmount = '/span[contains(@class,"amount") and text()="%d"]' |
|
protected |
The documentation for this class was generated from the following file:
- vendor/magento/magento2-base/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Search.php