Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
|
Classes | |
class | behat_course |
Behat course-related steps definitions. More... | |
Functions | |
actions_menu_should_be_open ($activityname) | |
Checks that the specified activity's action menu is open. | |
actions_menu_should_have_item ($activityname, $menuitem) | |
Checks that the specified activity's action menu contains an item. | |
actions_menu_should_not_have_item ($activityname, $menuitem) | |
Checks that the specified activity's action menu does not contains an item. | |
activity_date_in_activity_should_contain_text (string $activityname, string $text) | |
Checks the presence of the given text in the activity's displayed dates. | |
activity_dates_information_in_activity_should_exist (string $activityname) | |
Checks the presence of activity dates information in the activity information output component. | |
activity_dates_information_in_activity_should_not_exist (string $activityname) | |
Checks the absence of activity dates information in the activity information output component. | |
activity_should_be_available_but_hidden_from_course_page ($activityname) | |
Checks that the specified activity is visible. | |
activity_should_be_hidden ($activityname) | |
Checks that the specified activity is hidden. | |
activity_should_be_visible ($activityname) | |
Checks that the specified activity is visible. | |
category_actions_menu_should_have_item ($name, $menuitem) | |
Checks that the specified category actions menu contains an item. | |
category_actions_menu_should_not_have_item ($name, $menuitem) | |
Checks that the specified category actions menu does not contain an item. | |
category_in_management_listing_should_be_dimmed ($idnumber) | |
Checks that a category within the management interface is dimmed. | |
category_in_management_listing_should_be_visible ($idnumber) | |
Checks that a category within the management interface is visible. | |
course_in_management_listing_should_be_dimmed ($idnumber) | |
Checks that a course within the management interface is dimmed. | |
course_in_management_listing_should_be_visible ($idnumber) | |
Checks that a course within the management interface is visible. | |
get_activity_action_menu_node ($activityname) | |
Returns the DOM node of the activity action menu. | |
get_activity_element ($element, $selectortype, $activityname) | |
Clicks on the specified element inside the activity container. | |
get_activity_name ($activitynode) | |
Gets the activity instance name from the activity node. | |
get_activity_node ($activityname) | |
Returns the DOM node of the activity from . | |
get_course_format () | |
Gets the current course format. | |
get_management_category_listing_node_by_idnumber ($idnumber) | |
Returns the category node from within the listing on the management page. | |
get_management_category_listing_node_by_name ($name, $link=false) | |
Returns a category node from within the management interface. | |
get_management_course_listing_node_by_idnumber ($idnumber) | |
Returns the course node from within the listing on the management page. | |
get_management_course_listing_node_by_name ($name, $link=false) | |
Returns a course node from within the management interface. | |
get_section_activities ($sectionxpath) | |
Gets the section's activites DOM nodes. | |
hide_section_link_exists ($sectionnumber) | |
Returns the hide section icon link if it exists or throws exception. | |
i_add_to_course_section (string $activity, string $coursefullname, string $sectionnum) | |
Open a add activity form page. | |
i_add_to_course_section_and_i_fill_the_form_with ($activity, $coursefullname, $section, TableNode $data) | |
Adds the selected activity/resource filling the form data with the specified field/value pairs. | |
i_add_to_section_using_the_activity_chooser ($activityname, $sectionnum) | |
Opens the activity chooser and opens the activity/resource link form page. | |
i_change_activity_name_to ($activityname, $newactivityname) | |
Edits the activity name through the edit activity; this step only works with Javascript enabled. | |
i_click_on_action_for_item_in_management_category_listing ($action, $name) | |
Locates a category in the course category management interface and then triggers an action for it. | |
i_click_on_action_for_item_in_management_course_listing ($action, $name) | |
Locates a course in the course category management interface and then triggers an action for it. | |
i_click_on_category_in_the_management_category_listing ($name) | |
Clicks on a category in the management interface. | |
i_click_on_category_in_the_management_interface ($name) | |
Clicks on a category in the management interface. | |
i_click_on_course_in_the_management_interface ($name) | |
Clicks on a course in the management interface. | |
i_click_on_in_the_activity ($element, $selectortype, $activityname) | |
Clicks on the specified element of the activity. | |
i_click_to_expand_category_in_the_management_interface ($idnumber) | |
Click to expand a category revealing its sub categories within the management UI. | |
i_click_to_move_category_by_one ($idnumber, $direction) | |
Moves a category displayed in the management interface up or down one place. | |
i_click_to_move_course_by_one ($idnumber, $direction) | |
Moves a course displayed in the management interface up or down one place. | |
i_close_actions_menu ($activityname) | |
Closes an activity actions menu if it is not already closed. | |
i_delete_activity ($activityname) | |
Deletes the activity or resource specified by it's name. | |
i_delete_section ($sectionnumber) | |
Deletes course section. | |
i_duplicate_activity ($activityname) | |
Duplicates the activity or resource specified by it's name. | |
i_duplicate_activity_editing_the_new_copy_with ($activityname, TableNode $data) | |
Duplicates the activity or resource and modifies the new activity with the provided data. | |
i_edit_the_section ($sectionnumber) | |
Go to editing section page for specified section number. | |
i_edit_the_section_and_i_fill_the_form_with ($sectionnumber, TableNode $data) | |
Edit specified section and fill the form data with the specified field/value pairs. | |
i_hide_section ($sectionnumber) | |
Hides the specified visible section. | |
i_indent_left_activity ($activityname) | |
Indents to the left the activity or resource specified by it's name. | |
i_indent_right_activity ($activityname) | |
Indents to the right the activity or resource specified by it's name. | |
i_move_activity_to_section ($activityname, $sectionnumber) | |
Moves the specified activity to the first slot of a section. | |
i_move_activity_to_section_yui ($activityname, $sectionnumber) | |
Moves the specified activity to the first slot of a section using the YUI course format. | |
i_move_category_to_top_level_in_the_management_interface ($name) | |
Move selected categories to top level in the management interface. | |
i_move_down_section ($sectionnumber) | |
Moves down the specified section, this step only works with Javascript disabled. | |
i_move_up_section ($sectionnumber) | |
Moves up the specified section, this step only works with Javascript disabled. | |
i_navigate_to_course_participants () | |
Go to the course participants. | |
i_open_actions_menu ($activityname) | |
Opens an activity actions menu if it is not already opened. | |
i_open_section_edit_menu ($sectionnumber) | |
Opens a section edit menu if it is not already opened. | |
i_open_the_action_menu_for_item_in_management_category_listing ($name) | |
Locates a category in the course category management interface and then opens action menu for it. | |
i_open_the_activity_chooser () | |
Open the activity chooser in a course. | |
i_select_category_in_the_management_interface ($name) | |
Clicks on a category checkbox in the management interface, if not checked. | |
i_select_course_in_the_management_interface ($name) | |
Clicks course checkbox in the management interface, if not checked. | |
i_should_not_see_category_as_subcategory_of_in_the_management_interface ($subcatidnumber, $catidnumber) | |
Checks that a category is not a subcategory of specific category. | |
i_should_not_see_teacher_after ($fteacher, $pteacher) | |
Check that one teacher oes not appears after another in the course contacts. | |
i_should_see_category_as_subcategory_of_in_the_management_interface ($subcatidnumber, $catidnumber) | |
Checks that a category is a subcategory of specific category. | |
i_should_see_category_listing_before ($preceedingcategory, $followingcategory) | |
Check that one category appears before another in the course category management listings. | |
i_should_see_course_listing_before ($preceedingcourse, $followingcourse) | |
Check that one course appears before another in the course category management listings. | |
i_should_see_teacher_before ($pteacher, $fteacher) | |
Check that one teacher appears before another in the course contacts. | |
i_should_see_the_courses_management_page ($mode) | |
Checks that we are on the course management page that we expect to be on and that no course has been selected. | |
i_should_see_the_courses_management_page_with_a_course_selected ($mode) | |
Checks that we are on the course management page that we expect to be on and that a course has been selected. | |
i_show_section ($sectionnumber) | |
Shows the specified hidden section. | |
i_toggle_category_children_visibility_in_frontpage ($categoryname) | |
Clicks to expand or collapse a category displayed on the frontpage. | |
i_toggle_visibility_of_category_in_management_listing ($idnumber) | |
Toggles the visibility of a category in the management UI. | |
i_toggle_visibility_of_course_in_management_listing ($idnumber) | |
Toggles the visibility of a course in the management UI. | |
i_turn_section_highlighting_off ($sectionnumber) | |
Turns course section highlighting off. | |
i_turn_section_highlighting_on ($sectionnumber) | |
Turns course section highlighting on. | |
i_unselect_category_in_the_management_interface ($name) | |
Clicks on a category checkbox in the management interface, if checked. | |
i_unselect_course_in_the_management_interface ($name) | |
Clicks course checkbox in the management interface, if checked. | |
i_wait_until_section_is_available ($sectionnumber) | |
Waits until the section is available to interact with it. | |
is_course_editor () | |
Returns whether the user can edit the course contents or not. | |
is_editing_on () | |
Returns whether the user can edit the course contents and the editing mode is on. | |
label_should_be_hidden ($activityname) | |
Checks that the specified label is hidden from students. | |
listing_is_highlighted ($self, $selector) | |
Used by spin to determine the callback has been highlighted. | |
section_activities_should_be_hidden ($sectionnumber) | |
Checks that all actiities in the specified section are hidden. | |
section_exists ($sectionnumber) | |
Checks if the course section exists. | |
section_should_be_hidden ($sectionnumber) | |
Checks that the specified section is visible. | |
section_should_be_highlighted ($sectionnumber) | |
Checks if the specified course section hightlighting is turned on. | |
section_should_be_visible ($sectionnumber) | |
Checks that the specified section is visible. | |
section_should_not_be_highlighted ($sectionnumber) | |
Checks if the specified course section highlighting is turned off. | |
show_section_link_exists ($sectionnumber) | |
Returns the show section icon or throws an exception. | |
user_clicks_on_management_listing_action ($listingtype, $listingnode, $action) | |
Finds the node to use for a management listitem action and clicks it. | |
user_moves_listing_by_one ($listingtype, $listingnode, $direction, $highlight=true) | |
Moves a course or category listing within the management interface up or down by one. | |
actions_menu_should_be_open | ( | $activityname | ) |
Checks that the specified activity's action menu is open.
@Then /^"(?P<activity_name_string>(?:[^"]|::")*)" actions menu should be open$/
DriverException | The step is not available when Javascript is disabled |
string | $activityname |
actions_menu_should_have_item | ( | $activityname, | |
$menuitem ) |
Checks that the specified activity's action menu contains an item.
@Then /^"(?P<activity_name_string>(?:[^"]|::")*)" actions menu should have "(?P<menu_item_string>(?:[^"]|")*)" item$/
DriverException | The step is not available when Javascript is disabled |
string | $activityname | |
string | $menuitem |
actions_menu_should_not_have_item | ( | $activityname, | |
$menuitem ) |
Checks that the specified activity's action menu does not contains an item.
@Then /^"(?P<activity_name_string>(?:[^"]|::")*)" actions menu should not have "(?P<menu_item_string>(?:[^"]|")*)" item$/
DriverException | The step is not available when Javascript is disabled |
string | $activityname | |
string | $menuitem |
activity_date_in_activity_should_contain_text | ( | string | $activityname, |
string | $text ) |
Checks the presence of the given text in the activity's displayed dates.
@Given /^the activity date in "(?P<activityname>(?:[^"]|::")*)" should contain "(?P<text>(?:[^"]|")*)"$/
string | $activityname | The activity name. |
string | $text | The text to be searched in the activity date. |
activity_dates_information_in_activity_should_exist | ( | string | $activityname | ) |
Checks the presence of activity dates information in the activity information output component.
@Given /^the activity date information in "(?P<activityname>(?:[^"]|::")*)" should exist$/
string | $activityname | The activity name. |
activity_dates_information_in_activity_should_not_exist | ( | string | $activityname | ) |
Checks the absence of activity dates information in the activity information output component.
@Given /^the activity date information in "(?P<activityname>(?:[^"]|::")*)" should not exist$/
string | $activityname | The activity name. |
activity_should_be_available_but_hidden_from_course_page | ( | $activityname | ) |
Checks that the specified activity is visible.
You need to be in the course page. It can be used being logged as a student and as a teacher on editing mode.
@Then /^"(?P<activity_or_resource_string>(?:[^"]|::")*)" activity should be available but hidden from course page$/
string | $activityname |
ExpectationException |
activity_should_be_hidden | ( | $activityname | ) |
Checks that the specified activity is hidden.
You need to be in the course page. It can be used being logged as a student and as a teacher on editing mode.
@Then /^"(?P<activity_or_resource_string>(?:[^"]|::")*)" activity should be hidden$/
string | $activityname |
ExpectationException |
activity_should_be_visible | ( | $activityname | ) |
Checks that the specified activity is visible.
You need to be in the course page. It can be used being logged as a student and as a teacher on editing mode.
@Then /^"(?P<activity_or_resource_string>(?:[^"]|::")*)" activity should be visible$/
string | $activityname |
ExpectationException |
category_actions_menu_should_have_item | ( | $name, | |
$menuitem ) |
Checks that the specified category actions menu contains an item.
@Then /^"(?P<name_string>(?:[^"]|::")*)" category actions menu should have "(?P<menu_item_string>(?:[^"]|")*)" item$/
string | $name | |
string | $menuitem |
Behat\Mink\Exception\ExpectationException |
category_actions_menu_should_not_have_item | ( | $name, | |
$menuitem ) |
Checks that the specified category actions menu does not contain an item.
@Then /^"(?P<name_string>(?:[^"]|::")*)" category actions menu should not have "(?P<menu_item_string>(?:[^"]|")*)" item$/
string | $name | |
string | $menuitem |
Behat\Mink\Exception\ExpectationException |
category_in_management_listing_should_be_dimmed | ( | $idnumber | ) |
Checks that a category within the management interface is dimmed.
@Given /^category in management listing should be dimmed "(?P<idnumber_string>(?:[^"]|::")*)"$/
string | $idnumber |
category_in_management_listing_should_be_visible | ( | $idnumber | ) |
Checks that a category within the management interface is visible.
@Given /^category in management listing should be visible "(?P<idnumber_string>(?:[^"]|::")*)"$/
string | $idnumber |
course_in_management_listing_should_be_dimmed | ( | $idnumber | ) |
Checks that a course within the management interface is dimmed.
@Given /^course in management listing should be dimmed "(?P<idnumber_string>(?:[^"]|::")*)"$/
string | $idnumber |
course_in_management_listing_should_be_visible | ( | $idnumber | ) |
Checks that a course within the management interface is visible.
@Given /^course in management listing should be visible "(?P<idnumber_string>(?:[^"]|::")*)"$/
string | $idnumber |
|
protected |
Returns the DOM node of the activity action menu.
ElementNotFoundException | Thrown by behat_base\find |
string | $activityname | The activity name |
Behat\Mink\Element\NodeElement |
|
protected |
Clicks on the specified element inside the activity container.
ElementNotFoundException |
string | $element | |
string | $selectortype | |
string | $activityname |
NodeElement |
|
protected |
Gets the activity instance name from the activity node.
ElementNotFoundException |
NodeElement | $activitynode |
string |
|
protected |
Returns the DOM node of the activity from .
ElementNotFoundException | Thrown by behat_base\find |
string | $activityname | The activity name |
NodeElement |
|
protected |
Gets the current course format.
ExpectationException | If we are not in the course view page. |
string | The course format in a frankenstyled name. |
|
protected |
Returns the category node from within the listing on the management page.
string | $idnumber |
Behat\Mink\Element\NodeElement |
|
protected |
Returns a category node from within the management interface.
string | $name | The name of the category. |
bool | $link | If set to true we'll resolve to the link rather than just the node. |
Behat\Mink\Element\NodeElement |
|
protected |
Returns the course node from within the listing on the management page.
string | $idnumber |
Behat\Mink\Element\NodeElement |
|
protected |
Returns a course node from within the management interface.
string | $name | The name of the course. |
bool | $link | If set to true we'll resolve to the link rather than just the node. |
Behat\Mink\Element\NodeElement |
|
protected |
Gets the section's activites DOM nodes.
string | $sectionxpath |
array | NodeElement instances |
|
protected |
Returns the hide section icon link if it exists or throws exception.
ElementNotFoundException | Thrown by behat_base\find |
int | $sectionnumber |
NodeElement |
i_add_to_course_section | ( | string | $activity, |
string | $coursefullname, | ||
string | $sectionnum ) |
Open a add activity form page.
@Given I add a :activity activity to course :coursefullname section :sectionnum @Given I add an :activity activity to course :coursefullname section :sectionnum
coding_exception |
string | $activity | The activity name. |
string | $coursefullname | The course full name of the course. |
string | $sectionnum | The section number. |
i_add_to_course_section_and_i_fill_the_form_with | ( | $activity, | |
$coursefullname, | |||
$section, | |||
TableNode | $data ) |
Adds the selected activity/resource filling the form data with the specified field/value pairs.
Sections 0 and 1 are also allowed on frontpage.
@Given I add a :activity activity to course :coursefullname section :sectionnum and I fill the form with: @Given I add an :activity activity to course :coursefullname section :sectionnum and I fill the form with:
string | $activity | The activity name |
string | $coursefullname | The course full name of the course. |
int | $section | The section number |
TableNode | $data | The activity field/value data |
i_add_to_section_using_the_activity_chooser | ( | $activityname, | |
$sectionnum ) |
Opens the activity chooser and opens the activity/resource link form page.
Sections 0 and 1 are also allowed on frontpage.
This step require javascript enabled and it is used mainly to click activities or resources by name, not by plugin name. Use the standard behat_course\i_add_to_course_section step instead unless the plugin create extra entries into the activity chooser (like LTI).
@Given I add a :activityname to section :sectionnum using the activity chooser @Given I add an :activityname to section :sectionnum using the activity chooser
ElementNotFoundException | Thrown by behat_base\find |
string | $activityname | |
int | $sectionnum |
i_change_activity_name_to | ( | $activityname, | |
$newactivityname ) |
Edits the activity name through the edit activity; this step only works with Javascript enabled.
Editing mode should be on.
@Given /^I change "(?P<activity_name_string>(?:[^"]|::")*)" activity name to "(?P<new_name_string>(?:[^"]|")*)"$/
DriverException | Step not available when Javascript is disabled |
string | $activityname | |
string | $newactivityname |
i_click_on_action_for_item_in_management_category_listing | ( | $action, | |
$name ) |
Locates a category in the course category management interface and then triggers an action for it.
@Given /^I click on "(?P<action_string>(?:[^"]|::")*)" action for "(?P<name_string>(?:[^"]|")*)" in management category listing$/
string | $action | The action to take. One of |
string | $name | The name of the category as it is displayed in the management interface. |
i_click_on_action_for_item_in_management_course_listing | ( | $action, | |
$name ) |
Locates a course in the course category management interface and then triggers an action for it.
@Given /^I click on "(?P<action_string>(?:[^"]|::")*)" action for "(?P<name_string>(?:[^"]|")*)" in management course listing$/
string | $action | The action to take. One of |
string | $name | The name of the course as it is displayed in the management interface. |
i_click_on_category_in_the_management_category_listing | ( | $name | ) |
Clicks on a category in the management interface.
@Given /^I click on "(?P<categoryname_string>(?:[^"]|::")*)" category in the management category listing$/
string | $name | The name of the category to click. |
i_click_on_category_in_the_management_interface | ( | $name | ) |
Clicks on a category in the management interface.
@Given /^I click on category "(?P<name_string>(?:[^"]|::")*)" in the management interface$/
string | $name |
i_click_on_course_in_the_management_interface | ( | $name | ) |
Clicks on a course in the management interface.
@Given /^I click on course "(?P<name_string>(?:[^"]|::")*)" in the management interface$/
string | $name |
i_click_on_in_the_activity | ( | $element, | |
$selectortype, | |||
$activityname ) |
Clicks on the specified element of the activity.
You should be in the course page with editing mode turned on.
@Given /^I click on "(?P<element_string>(?:[^"]|::")*)" "(?P<selector_string>(?:[^"]|")*)" in the "(?P<activity_name_string>(?:[^"]|::")*)" activity$/
string | $element | |
string | $selectortype | |
string | $activityname |
i_click_to_expand_category_in_the_management_interface | ( | $idnumber | ) |
Click to expand a category revealing its sub categories within the management UI.
@Given /^I click to expand category "(?P<idnumber_string>(?:[^"]|::")*)" in the management interface$/
string | $idnumber |
i_click_to_move_category_by_one | ( | $idnumber, | |
$direction ) |
Moves a category displayed in the management interface up or down one place.
@Given /^I click to move category "(?P<idnumber_string>(?:[^"]|::")*)" (?P<direction>up|down) one$/
string | $idnumber | The category idnumber |
string | $direction | The direction to move in, either up or down |
i_click_to_move_course_by_one | ( | $idnumber, | |
$direction ) |
Moves a course displayed in the management interface up or down one place.
@Given /^I click to move course "(?P<idnumber_string>(?:[^"]|::")*)" (?P<direction>up|down) one$/
string | $idnumber | The course idnumber |
string | $direction | The direction to move in, either up or down |
i_close_actions_menu | ( | $activityname | ) |
Closes an activity actions menu if it is not already closed.
@Given /^I close "(?P<activity_name_string>(?:[^"]|::")*)" actions menu$/
DriverException | The step is not available when Javascript is disabled |
string | $activityname |
i_delete_activity | ( | $activityname | ) |
Deletes the activity or resource specified by it's name.
This step is experimental when using it in Javascript tests. You should be in the course page with editing mode on.
@Given /^I delete "(?P<activity_name_string>(?:[^"]|::")*)" activity$/
string | $activityname |
i_delete_section | ( | $sectionnumber | ) |
Deletes course section.
@Given /^I delete section "(?P<section_number>::d+)"$/
int | $sectionnumber | The section number |
i_duplicate_activity | ( | $activityname | ) |
Duplicates the activity or resource specified by it's name.
You should be in the course page with editing mode on.
@Given /^I duplicate "(?P<activity_name_string>(?:[^"]|::")*)" activity$/
string | $activityname |
i_duplicate_activity_editing_the_new_copy_with | ( | $activityname, | |
TableNode | $data ) |
Duplicates the activity or resource and modifies the new activity with the provided data.
You should be in the course page with editing mode on.
@Given /^I duplicate "(?P<activity_name_string>(?:[^"]|::")*)" activity editing the new copy with:$/
string | $activityname | |
TableNode | $data |
i_edit_the_section | ( | $sectionnumber | ) |
Go to editing section page for specified section number.
You need to be in the course page and on editing mode.
@Given /^I edit the section "(?P<section_number>::d+)"$/
int | $sectionnumber |
i_edit_the_section_and_i_fill_the_form_with | ( | $sectionnumber, | |
TableNode | $data ) |
Edit specified section and fill the form data with the specified field/value pairs.
@When /^I edit the section "(?P<section_number>::d+)" and I fill the form with:$/
int | $sectionnumber | The section number |
TableNode | $data | The activity field/value data |
i_hide_section | ( | $sectionnumber | ) |
Hides the specified visible section.
You need to be in the course page and on editing mode.
@Given /^I hide section "(?P<section_number>::d+)"$/
int | $sectionnumber |
i_indent_left_activity | ( | $activityname | ) |
Indents to the left the activity or resource specified by it's name.
Editing mode should be on.
@Given /^I indent left "(?P<activity_name_string>(?:[^"]|::")*)" activity$/
string | $activityname |
i_indent_right_activity | ( | $activityname | ) |
Indents to the right the activity or resource specified by it's name.
Editing mode should be on.
@Given /^I indent right "(?P<activity_name_string>(?:[^"]|::")*)" activity$/
string | $activityname |
i_move_activity_to_section | ( | $activityname, | |
$sectionnumber ) |
Moves the specified activity to the first slot of a section.
Editing mode should be on.
@Given /^I move "(?P<activity_name_string>(?:[^"]|::")*)" activity to section "(?P<section_number>\d+)"$/
string | $activityname | The activity name |
int | $sectionnumber | The number of section |
i_move_activity_to_section_yui | ( | $activityname, | |
$sectionnumber ) |
Moves the specified activity to the first slot of a section using the YUI course format.
This step is experimental when using it in Javascript tests. Editing mode should be on.
string | $activityname | The activity name |
int | $sectionnumber | The number of section |
i_move_category_to_top_level_in_the_management_interface | ( | $name | ) |
Move selected categories to top level in the management interface.
@Given /^I move category "(?P<name_string>(?:[^"]|::")*)" to top level in the management interface$/
string | $name |
i_move_down_section | ( | $sectionnumber | ) |
Moves down the specified section, this step only works with Javascript disabled.
Editing mode should be on.
@Given /^I move down section "(?P<section_number>::d+)"$/
DriverException | Step not available when Javascript is enabled |
int | $sectionnumber |
i_move_up_section | ( | $sectionnumber | ) |
Moves up the specified section, this step only works with Javascript disabled.
Editing mode should be on.
@Given /^I move up section "(?P<section_number>::d+)"$/
DriverException | Step not available when Javascript is enabled |
int | $sectionnumber |
i_navigate_to_course_participants | ( | ) |
Go to the course participants.
@Given /^I navigate to course participants$/
i_open_actions_menu | ( | $activityname | ) |
Opens an activity actions menu if it is not already opened.
@Given /^I open "(?P<activity_name_string>(?:[^"]|::")*)" actions menu$/
DriverException | The step is not available when Javascript is disabled |
string | $activityname |
i_open_section_edit_menu | ( | $sectionnumber | ) |
Opens a section edit menu if it is not already opened.
@Given /^I open section "(?P<section_number>::d+)" edit menu$/
DriverException | The step is not available when Javascript is disabled |
string | $sectionnumber |
i_open_the_action_menu_for_item_in_management_category_listing | ( | $name | ) |
Locates a category in the course category management interface and then opens action menu for it.
@Given /^I open the action menu for "(?P<name_string>(?:[^"]|::")*)" in management category listing$/
string | $name | The name of the category as it is displayed in the management interface. |
i_open_the_activity_chooser | ( | ) |
Open the activity chooser in a course.
@Given /^I open the activity chooser$/
i_select_category_in_the_management_interface | ( | $name | ) |
Clicks on a category checkbox in the management interface, if not checked.
@Given /^I select category "(?P<name_string>(?:[^"]|::")*)" in the management interface$/
string | $name |
i_select_course_in_the_management_interface | ( | $name | ) |
Clicks course checkbox in the management interface, if not checked.
@Given /^I select course "(?P<name_string>(?:[^"]|::")*)" in the management interface$/
string | $name |
i_should_not_see_category_as_subcategory_of_in_the_management_interface | ( | $subcatidnumber, | |
$catidnumber ) |
Checks that a category is not a subcategory of specific category.
@Given /^I should not see category "(?P<subcatidnumber_string>(?:[^"]|::")*)" as subcategory of "(?P<catidnumber_string>(?:[^"]|")*)" in the management interface$/
ExpectationException |
string | $subcatidnumber | |
string | $catidnumber |
i_should_not_see_teacher_after | ( | $fteacher, | |
$pteacher ) |
Check that one teacher oes not appears after another in the course contacts.
@Given /^I should not see teacher "(?P<fteacher_string>(?:[^"]|::")*)" after "(?P<pteacher_string>(?:[^"]|")*)" in the course contact listing$/
string | $fteacher | The teacher that should not be found (after the other teacher) |
string | $pteacher | The teacher after who the other should not be found (this teacher must be found!) |
ExpectationException |
i_should_see_category_as_subcategory_of_in_the_management_interface | ( | $subcatidnumber, | |
$catidnumber ) |
Checks that a category is a subcategory of specific category.
@Given /^I should see category "(?P<subcatidnumber_string>(?:[^"]|::")*)" as subcategory of "(?P<catidnumber_string>(?:[^"]|")*)" in the management interface$/
ExpectationException |
string | $subcatidnumber | |
string | $catidnumber |
i_should_see_category_listing_before | ( | $preceedingcategory, | |
$followingcategory ) |
Check that one category appears before another in the course category management listings.
@Given /^I should see category listing "(?P<preceedingcategory_string>(?:[^"]|::")*)" before "(?P<followingcategory_string>(?:[^"]|")*)"$/
string | $preceedingcategory | The first category to find |
string | $followingcategory | The second category to find (should be after the first category) |
ExpectationException |
i_should_see_course_listing_before | ( | $preceedingcourse, | |
$followingcourse ) |
Check that one course appears before another in the course category management listings.
@Given /^I should see course listing "(?P<preceedingcourse_string>(?:[^"]|::")*)" before "(?P<followingcourse_string>(?:[^"]|")*)"$/
string | $preceedingcourse | The first course to find |
string | $followingcourse | The second course to find (should be AFTER the first course) |
ExpectationException |
i_should_see_teacher_before | ( | $pteacher, | |
$fteacher ) |
Check that one teacher appears before another in the course contacts.
@Given /^I should see teacher "(?P<pteacher_string>(?:[^"]|::")*)" before "(?P<fteacher_string>(?:[^"]|")*)" in the course contact listing$/
string | $pteacher | The first teacher to find |
string | $fteacher | The second teacher to find (should be after the first teacher) |
ExpectationException |
i_should_see_the_courses_management_page | ( | $mode | ) |
Checks that we are on the course management page that we expect to be on and that no course has been selected.
@Given /^I should see the "(?P<mode_string>(?:[^"]|::")*)" management page$/
string | $mode | The mode to expected. One of 'Courses', 'Course categories' or 'Course categories and courses' |
i_should_see_the_courses_management_page_with_a_course_selected | ( | $mode | ) |
Checks that we are on the course management page that we expect to be on and that a course has been selected.
@Given /^I should see the "(?P<mode_string>(?:[^"]|::")*)" management page with a course selected$/
string | $mode | The mode to expected. One of 'Courses', 'Course categories' or 'Course categories and courses' |
i_show_section | ( | $sectionnumber | ) |
Shows the specified hidden section.
You need to be in the course page and on editing mode.
@Given /^I show section "(?P<section_number>::d+)"$/
int | $sectionnumber |
i_toggle_category_children_visibility_in_frontpage | ( | $categoryname | ) |
Clicks to expand or collapse a category displayed on the frontpage.
@Given /^I toggle "(?P<categoryname_string>(?:[^"]|::")*)" category children visibility in frontpage$/
ExpectationException |
string | $categoryname |
i_toggle_visibility_of_category_in_management_listing | ( | $idnumber | ) |
Toggles the visibility of a category in the management UI.
If it was visible it will be hidden. If it is hidden it will be made visible.
@Given /^I toggle visibility of category "(?P<idnumber_string>(?:[^"]|::")*)" in management listing$/
i_toggle_visibility_of_course_in_management_listing | ( | $idnumber | ) |
Toggles the visibility of a course in the management UI.
If it was visible it will be hidden. If it is hidden it will be made visible.
@Given /^I toggle visibility of course "(?P<idnumber_string>(?:[^"]|::")*)" in management listing$/
string | $idnumber |
i_turn_section_highlighting_off | ( | $sectionnumber | ) |
Turns course section highlighting off.
@Given /^I turn section "(?P<section_number>::d+)" highlighting off$/
int | $sectionnumber | The section number |
i_turn_section_highlighting_on | ( | $sectionnumber | ) |
Turns course section highlighting on.
@Given /^I turn section "(?P<section_number>::d+)" highlighting on$/
int | $sectionnumber | The section number |
i_unselect_category_in_the_management_interface | ( | $name | ) |
Clicks on a category checkbox in the management interface, if checked.
@Given /^I unselect category "(?P<name_string>(?:[^"]|::")*)" in the management interface$/
string | $name |
i_unselect_course_in_the_management_interface | ( | $name | ) |
Clicks course checkbox in the management interface, if checked.
@Given /^I unselect course "(?P<name_string>(?:[^"]|::")*)" in the management interface$/
string | $name |
i_wait_until_section_is_available | ( | $sectionnumber | ) |
Waits until the section is available to interact with it.
Useful when the section is performing an action and the section is overlayed with a loading layout.
Using the protected method as this method will be usually called by other methods which are not returning a set of steps and performs the actions directly, so it would not be executed if it returns another step.
Hopefully we would not require test writers to use this step and we will manage it from other step definitions.
@Given /^I wait until section "(?P<section_number>::d+)" is available$/
int | $sectionnumber |
void |
|
protected |
Returns whether the user can edit the course contents or not.
bool |
|
protected |
Returns whether the user can edit the course contents and the editing mode is on.
bool |
label_should_be_hidden | ( | $activityname | ) |
Checks that the specified label is hidden from students.
You need to be in the course page.
@Then /^"(?P<activity_or_resource_string>(?:[^"]|::")*)" label should be hidden$/
string | $activityname |
ExpectationException |
|
protected |
Used by spin to determine the callback has been highlighted.
behat_course | $self | A self reference (default first arg from a spin callback) |
Behat\Mink\Element\NodeElement | $selector |
bool |
section_activities_should_be_hidden | ( | $sectionnumber | ) |
Checks that all actiities in the specified section are hidden.
You need to be in the course page. It can be used being logged as a student and as a teacher on editing mode.
@Then /^all activities in section "(?P<section_number>::d+)" should be hidden$/
ExpectationException | |
ElementNotFoundException | Thrown by behat_base\find |
int | $sectionnumber |
|
protected |
Checks if the course section exists.
ElementNotFoundException | Thrown by behat_base\find |
int | $sectionnumber |
string | The xpath of the section. |
section_should_be_hidden | ( | $sectionnumber | ) |
Checks that the specified section is visible.
You need to be in the course page. It can be used being logged as a student and as a teacher on editing mode.
@Then /^section "(?P<section_number>::d+)" should be hidden$/
ExpectationException | |
ElementNotFoundException | Thrown by behat_base\find |
int | $sectionnumber |
section_should_be_highlighted | ( | $sectionnumber | ) |
Checks if the specified course section hightlighting is turned on.
You need to be in the course page on editing mode.
@Then /^section "(?P<section_number>::d+)" should be highlighted$/
ExpectationException |
int | $sectionnumber | The section number |
section_should_be_visible | ( | $sectionnumber | ) |
Checks that the specified section is visible.
You need to be in the course page. It can be used being logged as a student and as a teacher on editing mode.
@Then /^section "(?P<section_number>::d+)" should be visible$/
ExpectationException |
int | $sectionnumber |
section_should_not_be_highlighted | ( | $sectionnumber | ) |
Checks if the specified course section highlighting is turned off.
You need to be in the course page on editing mode.
@Then /^section "(?P<section_number>::d+)" should not be highlighted$/
ExpectationException |
int | $sectionnumber | The section number |
|
protected |
Returns the show section icon or throws an exception.
ElementNotFoundException | Thrown by behat_base\find |
int | $sectionnumber |
NodeElement |
|
protected |
Finds the node to use for a management listitem action and clicks it.
string | $listingtype | Either course or category. |
Behat\Mink\Element\NodeElement | $listingnode | |
string | $action | The action being taken |
Behat\Mink\Exception\ExpectationException |
|
protected |
Moves a course or category listing within the management interface up or down by one.
string | $listingtype | One of course or category |
Behat\Mink\Element\NodeElement | $listingnode | |
string | $direction | One of up or down. |
bool | $highlight | If set to false we don't check the node has been highlighted. |