Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
behat_action_menu Class Reference

Steps definitions to open and close action menus. More...

Inheritance diagram for behat_action_menu:
behat_base behat_session_interface

Public Member Functions

 getSession ($name=null)
 Returns the Mink session.
 
 i_choose_in_the_named_menu (string $item, string $actionmenu)
 Select a specific item in an action menu.
 
 i_choose_in_the_named_menu_in_container (string $item, string $actionmenu, $locator, $selector)
 Select a specific item in an action menu within a container.
 
 i_choose_in_the_open_action_menu ($menuitemstring)
 When an action menu is open, follow one of the items in it.
 
 i_open_the_action_menu_in ($element, $selectortype)
 Open the action menu in.
 
 item_should_exist (string $item, string $actionmenu)
 The action menu item should exist.
 
 item_should_exist_in_the (string $item, string $actionmenu, $locator, $selector)
 The action menu item should exist within a container.
 
 item_should_not_exist (string $item, string $actionmenu)
 The action menu item should not exist.
 
 item_should_not_exist_in_the (string $item, string $actionmenu, $locator, $selector)
 The action menu item should not exist within a container.
 

Public Attributes

const PAGE_READY_JS
 The JS code to check that the page is ready.
 

Protected Member Functions

 select_item_in_action_menu (string $item, NodeElement $menu)
 Select an item in the specified menu.
 

Detailed Description

Steps definitions to open and close action menus.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ getSession()

behat_session_interface::getSession ( $name = null)
inherited

Returns the Mink session.

Parameters
string | null$namename of the session OR active session will be used
Return values
Behat\Mink\Session

Implemented in behat_form_field.

◆ i_choose_in_the_named_menu()

behat_action_menu::i_choose_in_the_named_menu ( string $item,
string $actionmenu )

Select a specific item in an action menu.

@When /^I choose the "(?P<item_string>(?:[^"]|::")*)" item in the "(?P<actionmenu_string>(?:[^"]|")*)" action menu$/

Parameters
string$itemThe item to choose
string$actionmenuThe text used in the description of the action menu

◆ i_choose_in_the_named_menu_in_container()

behat_action_menu::i_choose_in_the_named_menu_in_container ( string $item,
string $actionmenu,
$locator,
$selector )

Select a specific item in an action menu within a container.

@When /^I choose the "(?P<item_string>(?:[^"]|::")*)" item in the "(?P<actionmenu_string>(?:[^"]|")*)" action menu of the "(?P<locator_string>(?:[^"]|::")*)" "(?P<type_string>(?:[^"]|\")*)"$/

Parameters
string$itemThe item to choose
string$actionmenuThe text used in the description of the action menu
string | NodeElement$locatorThe identifer used for the container
string$selectorThe type of container to locate

◆ i_choose_in_the_open_action_menu()

behat_action_menu::i_choose_in_the_open_action_menu ( $menuitemstring)

When an action menu is open, follow one of the items in it.

The > is used to indicate a sub-menu. For example "Group mode > Visible groups" will do two clicks, one on the Group mode menu item, and one on the Visible groups link in the sub-menu.

@Given /^I choose "(?P<link_string>(?:[^"]|::")*)" in the open action menu$/

Parameters
string$linkstring
Return values
void

◆ i_open_the_action_menu_in()

behat_action_menu::i_open_the_action_menu_in ( $element,
$selectortype )

Open the action menu in.

@Given /^I open the action menu in "(?P<element_string>(?:[^"]|::")*)" "(?P<selector_string>[^"]*)"$/

Parameters
string$element
string$selector
Return values
void

◆ item_should_exist()

behat_action_menu::item_should_exist ( string $item,
string $actionmenu )

The action menu item should exist.

@Then /^the "(?P<item_string>(?:[^"]|::")*)" item should exist in the "(?P<actionmenu_string>(?:[^"]|")*)" action menu$/

Parameters
string$itemThe item to check
string$actionmenuThe text used in the description of the action menu

◆ item_should_exist_in_the()

behat_action_menu::item_should_exist_in_the ( string $item,
string $actionmenu,
$locator,
$selector )

The action menu item should exist within a container.

@Then /^the "(?P<item_string>(?:[^"]|::")*)" item should exist in the "(?P<actionmenu_string>(?:[^"]|")*)" action menu of the "(?P<locator_string>(?:[^"]|::")*)" "(?P<type_string>(?:[^"]|\")*)"$/

Parameters
string$itemThe item to check
string$actionmenuThe text used in the description of the action menu
string | NodeElement$locatorThe identifer used for the container
string$selectorThe type of container to locate

◆ item_should_not_exist()

behat_action_menu::item_should_not_exist ( string $item,
string $actionmenu )

The action menu item should not exist.

@Then /^the "(?P<item_string>(?:[^"]|::")*)" item should not exist in the "(?P<actionmenu_string>(?:[^"]|")*)" action menu$/

Parameters
string$itemThe item to check
string$actionmenuThe text used in the description of the action menu

◆ item_should_not_exist_in_the()

behat_action_menu::item_should_not_exist_in_the ( string $item,
string $actionmenu,
$locator,
$selector )

The action menu item should not exist within a container.

@Then /^the "(?P<item_string>(?:[^"]|::")*)" item should not exist in the "(?P<actionmenu_string>(?:[^"]|")*)" action menu of the "(?P<locator_string>(?:[^"]|::")*)" "(?P<type_string>(?:[^"]|\")*)"$/

Parameters
string$itemThe item to check
string$actionmenuThe text used in the description of the action menu
string | NodeElement$locatorThe identifer used for the container
string$selectorThe type of container to locate

◆ select_item_in_action_menu()

behat_action_menu::select_item_in_action_menu ( string $item,
NodeElement $menu )
protected

Select an item in the specified menu.

Note: This step does work both with, and without, JavaScript.

Parameters
string$itemItem string value
NodeElement$menuThe menu NodeElement to select from

Member Data Documentation

◆ PAGE_READY_JS

const behat_session_interface::PAGE_READY_JS
inherited
Initial value:
= "document.readyState === 'complete' && " .
"(typeof M !== 'object' || typeof M.util !== 'object' || " .
"typeof M.util.pending_js === 'undefined' || M.util.pending_js.length === 0)"

The JS code to check that the page is ready.

The document must be complete and either M.util.pending_js must be empty, or it must not be defined at all.


The documentation for this class was generated from the following file: