Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 310 and 400] [Versions 311 and 400] [Versions 39 and 400]

Navigation step definition overrides for the Classic theme.

Copyright: 2019 Michael Hawkins
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 431 lines (19 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 lib/tests/behat/behat_navigation.php

Defines 1 class


Class: behat_theme_classic_behat_navigation  - X-Ref

Step definitions and overrides to navigate through the navigation tree nodes in the Classic theme.

i_navigate_to_in_current_page_administration($nodetext)   X-Ref
Navigate to an item in a current page administration menu.

return: void
param: string $nodetext The navigation node/path to follow, eg "Course administration > Edit settings"

i_navigate_to_in_site_administration($nodetext)   X-Ref
Navigate to an item within the site administration menu.

return: void
param: string $nodetext The navigation node/path to follow, excluding "Site administration" itself, eg "Grades > Scales"

get_top_navigation_node($nodetext)   X-Ref
Helper function to get top navigation node in the tree.

return: NodeElement
param: string $nodetext name of top navigation node in tree.

should_exist_in_current_page_administration($element, $selectortype)   X-Ref
Check that current page administration contains an element.

return: void
param: string $element The locator of the specified selector.
param: string $selectortype The selector type (link or text)

should_not_exist_in_current_page_administration($element, $selectortype)   X-Ref
Check that current page administration does not contains an element.

return: void
param: string $element The locator of the specified selector.
param: string $selectortype The selector type (link or text)

page_administration_exists()   X-Ref
Check that the page administration menu exists on the page.

This confirms the existence of the menu, which authorised users should have access to.
return: void

page_administration_does_not_exist()   X-Ref
Check that the page administration menu does not exist on the page.

This confirms the absence of the menu, which unauthorised users should not have access to.
return: void

find_page_administration_menu($mustexist = false)   X-Ref
Locate the administration menu on the page (but not in the header) and return its xpath.

return: null|string
param: bool $mustexist If true, throws an exception if menu is not found

i_turn_editing_mode_off()   X-Ref
Turns editing mode off.


i_turn_editing_mode_on()   X-Ref
Turns editing mode on.


select_on_administration_page($nodelist)   X-Ref
Finds and clicks a link on the admin page (site administration or course administration)

param: array $nodelist

find_header_administration_menu($mustexist = false)   X-Ref
Locates the administration menu in the <header> element and returns its xpath

return: null|string
param: bool $mustexist if specified throws an exception if menu is not found

toggle_page_administration_menu($menuxpath = null)   X-Ref
Toggles administration menu

param: string $menuxpath (optional) xpath to the page administration menu if already known

select_from_administration_menu($nodelist)   X-Ref
Finds a page edit cog and select an item from it

If the page edit cog is in the page header and the item is not found there, click "More..." link
and find the item on the course/frontpage administration page

param: array $nodelist