Skip to content

Commit bccd506

Browse files
author
Dmytro Aponasenko
committed
MTA-2726: Functional test maintenance. Part 3
1 parent c6f19bb commit bccd506

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

dev/tests/functional/lib/Magento/Mtf/Client/Element/DropdownmultiselectElement.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
*/
1414
class DropdownmultiselectElement extends MultiselectElement
1515
{
16+
/**
17+
* Selector for expanding dropdown.
18+
*
19+
* @var string
20+
*/
21+
protected $toggle = 'div';
22+
1623
/**
1724
* Selected option selector.
1825
*
@@ -36,7 +43,7 @@ class DropdownmultiselectElement extends MultiselectElement
3643
public function setValue($values)
3744
{
3845
$this->eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]);
39-
$this->click();
46+
$this->find($this->toggle)->click();
4047
$this->deselectAll();
4148
$values = is_array($values) ? $values : [$values];
4249
foreach ($values as $value) {
@@ -45,7 +52,7 @@ public function setValue($values)
4552
Locator::SELECTOR_XPATH
4653
)->click();
4754
}
48-
$this->click();
55+
$this->find($this->toggle)->click();
4956
}
5057

5158
/**
@@ -57,12 +64,12 @@ public function getValue()
5764
{
5865
$this->eventManager->dispatchEvent(['get_value'], [__METHOD__, $this->getAbsoluteSelector()]);
5966
$values = [];
60-
$this->click();
67+
$this->find($this->toggle)->click();
6168
$options = $this->getElements($this->selectedValue);
6269
foreach ($options as $option) {
6370
$values[] = $option->getText();
6471
}
65-
$this->click();
72+
$this->find($this->toggle)->click();
6673

6774
return $values;
6875
}

0 commit comments

Comments
 (0)