mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 13:02:07 +02:00
MDL-58826 theme_boost: Prevent fatal errors in action menu behat steps
This commit is contained in:
parent
78ab4f741b
commit
7e732c5d5a
@ -49,6 +49,10 @@ class behat_theme_boost_behat_course extends behat_course {
|
||||
|
||||
// Find the menu.
|
||||
$menunode = $activitynode->find('css', 'a[data-toggle=dropdown]');
|
||||
if (!$menunode) {
|
||||
throw new ExpectationException(sprintf('Could not find actions menu for the activity "%s"', $activityname),
|
||||
$this->getSession());
|
||||
}
|
||||
$expanded = $menunode->getAttribute('aria-expanded');
|
||||
if ($expanded == 'true') {
|
||||
return;
|
||||
@ -71,6 +75,10 @@ class behat_theme_boost_behat_course extends behat_course {
|
||||
$activitynode = $this->get_activity_node($activityname);
|
||||
// Find the menu.
|
||||
$menunode = $activitynode->find('css', 'a[data-toggle=dropdown]');
|
||||
if (!$menunode) {
|
||||
throw new ExpectationException(sprintf('Could not find actions menu for the activity "%s"', $activityname),
|
||||
$this->getSession());
|
||||
}
|
||||
$expanded = $menunode->getAttribute('aria-expanded');
|
||||
if ($expanded != 'true') {
|
||||
return;
|
||||
@ -90,6 +98,10 @@ class behat_theme_boost_behat_course extends behat_course {
|
||||
$activitynode = $this->get_activity_node($activityname);
|
||||
// Find the menu.
|
||||
$menunode = $activitynode->find('css', 'a[data-toggle=dropdown]');
|
||||
if (!$menunode) {
|
||||
throw new ExpectationException(sprintf('Could not find actions menu for the activity "%s"', $activityname),
|
||||
$this->getSession());
|
||||
}
|
||||
$expanded = $menunode->getAttribute('aria-expanded');
|
||||
if ($expanded != 'true') {
|
||||
throw new ExpectationException(sprintf("The action menu for '%s' is not open", $activityname), $this->getSession());
|
||||
|
Loading…
x
Reference in New Issue
Block a user