Skip to content

Commit 4a777a5

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-66711' into 2.1.8-develop-pr20
2 parents 356b1e0 + e2fb00b commit 4a777a5

File tree

1 file changed

+36
-0
lines changed
  • dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order

1 file changed

+36
-0
lines changed

dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Grid.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ class Grid extends DataGrid
7676
*/
7777
protected $firstRowSelector = '//tbody/tr[1]/td[contains(@class,"data-grid-actions-cell")]/a';
7878

79+
/**
80+
* Global seach block selector.
81+
*
82+
* @var string
83+
*/
84+
private $globalSearch = '.search-global';
85+
7986
/**
8087
* Start to create new order.
8188
*
@@ -106,4 +113,33 @@ public function getPurchasePointStoreGroups()
106113

107114
return $result;
108115
}
116+
117+
/**
118+
* {@inheritdoc}
119+
*/
120+
public function selectItems(array $items, $isSortable = true)
121+
{
122+
if ($isSortable) {
123+
$this->sortGridByField('ID');
124+
}
125+
foreach ($items as $item) {
126+
//Hover on search block is made to avoid click on invisible element currentPage
127+
$searchBlock = $this->browser->find($this->globalSearch);
128+
$searchBlock->hover();
129+
$this->_rootElement->find($this->currentPage, Locator::SELECTOR_XPATH)->setValue('');
130+
$this->waitLoader();
131+
$selectItem = $this->getRow($item)->find($this->selectItem);
132+
do {
133+
if ($selectItem->isVisible()) {
134+
if (!$selectItem->isSelected()) {
135+
$selectItem->click();
136+
}
137+
break;
138+
}
139+
} while ($this->nextPage());
140+
if (!$selectItem->isVisible()) {
141+
throw new \Exception("Searched item was not found\n" . print_r($item, true));
142+
}
143+
}
144+
}
109145
}

0 commit comments

Comments
 (0)