Commits
xxxxxxxxxx
95
95
$items = [$items];
96
96
}
97
97
98
98
$name = array_shift($items);
99
99
$element = $this->query('xpath', './li/a[text()='.CXPathHelper::escapeQuotes($name).']')->one(false);
100
100
if (!$element->isValid()) {
101
101
throw new Exception('Failed to find menu item by name: "'.$name.'".');
102
102
}
103
103
104
104
if ($items) {
105
-
$element->hover();
106
-
$element->parents()->query('class:menu-popup')->asPopupMenu()
107
-
->waitUntilPresent()->one()->select($items);
105
+
$parents = $element->parents('tag:li')->one()->hover();
106
+
$parents->query('class:menu-popup')->asPopupMenu()->waitUntilVisible()->one()->select($items);
108
107
}
109
108
else {
110
109
$element->click();
111
110
}
112
111
113
112
return $this;
114
113
}
115
114
116
115
/**
117
116
* Alias for select.