Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
behat_grades Class Reference
Inheritance diagram for behat_grades:
behat_base behat_session_interface

Public Member Functions

 getSession ($name=null)
 Returns the Mink session.
 
 i_click_on_grade_item_menu (string $itemname, string $itemtype, string $page)
 Clicks on given grade item menu.
 
 i_select_in_the ($value, $element, $selectortype)
 Select a given element within a specific container instance.
 

Static Public Member Functions

static get_partial_named_selectors ()
 Return the list of partial named selectors.
 

Public Attributes

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

Protected Member Functions

 get_course_grade_category_id (string $coursename)
 Gets course grade category id from coursename.
 
 get_grade_category_id (string $categoryname)
 Gets grade category id from its name.
 
 get_grade_item_id (string $itemname)
 Gets the grade item id from its name.
 
 resolve_page_instance_url (string $type, string $identifier)
 Convert page names to URLs for steps like 'When I am on the "[identifier]" "[page type]" page'.
 

Member Function Documentation

◆ get_course_grade_category_id()

behat_grades::get_course_grade_category_id ( string $coursename)
protected

Gets course grade category id from coursename.

Exceptions
Exception
Parameters
string$coursename
Return values
int

◆ get_grade_category_id()

behat_grades::get_grade_category_id ( string $categoryname)
protected

Gets grade category id from its name.

Exceptions
Exception
Parameters
string$categoryname
Return values
int

◆ get_grade_item_id()

behat_grades::get_grade_item_id ( string $itemname)
protected

Gets the grade item id from its name.

Exceptions
Exception
Parameters
string$itemnameItem name
Return values
int

◆ get_partial_named_selectors()

static behat_grades::get_partial_named_selectors ( )
static

Return the list of partial named selectors.

Return values
array

◆ 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_click_on_grade_item_menu()

behat_grades::i_click_on_grade_item_menu ( string $itemname,
string $itemtype,
string $page )

Clicks on given grade item menu.

@Given /^I click on grade item menu "([^"]*)" of type "([^"]*)" on "([^"]*)" page$/

Parameters
string$itemnameItem name
string$itemtypeItem type - grade item, category or course
string$pagePage - setup or grader
Exceptions
Exception

◆ i_select_in_the()

behat_grades::i_select_in_the ( $value,
$element,
$selectortype )

Select a given element within a specific container instance.

@Given /^I select "(?P<input_value>(?:[^"]|::")*)" in the "(?P<instance>(?:[^"]|")*)" "(?P<instance_type>(?:[^"]|::")*)"$/

Parameters
string$valueThe Needle
string$elementThe Haystack to select within
string$selectortypeWhat type of haystack we are looking in

◆ resolve_page_instance_url()

behat_grades::resolve_page_instance_url ( string $type,
string $identifier )
protected

Convert page names to URLs for steps like 'When I am on the "[identifier]" "[page type]" page'.

Recognised page names are: | pagetype | name meaning | description | | [report] view | Course name | The view page for the specified course and report | | gradebook setup | Course name | The gradebook setup page for the specified course | | course grade settings | Course name | The grade settings page | | outcomes | Course name | The grade outcomes page | | scales | Course name | The grade scales page |

Parameters
string$typeidentifies which type of page this is - for example "Grader > View"
string$identifieridentifies the particular page - for example "Course name"
Return values
moodle_urlthe corresponding URL.

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: