Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
Public Member Functions | |
actions_menu_should_be_open ($activityname) | |
Checks that the specified activity's action menu is open. More... | |
actions_menu_should_have_item ($activityname, $menuitem) | |
Checks that the specified activity's action menu contains an item. More... | |
actions_menu_should_not_have_item ($activityname, $menuitem) | |
Checks that the specified activity's action menu does not contains an item. More... | |
activity_should_be_available_but_hidden_from_course_page ($activityname) | |
Checks that the specified activity is visible. More... | |
activity_should_be_dimmed ($activityname) | |
Checks that the specified activity is dimmed. More... | |
activity_should_be_hidden ($activityname) | |
Checks that the specified activity is hidden. More... | |
activity_should_be_visible ($activityname) | |
Checks that the specified activity is visible. More... | |
category_actions_menu_should_have_item ($name, $menuitem) | |
Checks that the specified category actions menu contains an item. More... | |
category_actions_menu_should_not_have_item ($name, $menuitem) | |
Checks that the specified category actions menu does not contain an item. More... | |
category_in_management_listing_should_be_dimmed ($idnumber) | |
Checks that a category within the management interface is dimmed. More... | |
category_in_management_listing_should_be_visible ($idnumber) | |
Checks that a category within the management interface is visible. More... | |
course_in_management_listing_should_be_dimmed ($idnumber) | |
Checks that a course within the management interface is dimmed. More... | |
course_in_management_listing_should_be_visible ($idnumber) | |
Checks that a course within the management interface is visible. More... | |
getSession ($name=null) | |
Returns the Mink session. More... | |
i_add_to_section ($activity, $section) | |
Opens the activity chooser and opens the activity/resource form page. More... | |
i_add_to_section_and_i_fill_the_form_with ($activity, $section, TableNode $data) | |
Adds the selected activity/resource filling the form data with the specified field/value pairs. More... | |
i_change_activity_name_to ($activityname, $newactivityname) | |
Edits the activity name through the edit activity; this step only works with Javascript enabled. More... | |
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. More... | |
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. More... | |
i_click_on_category_in_the_management_category_listing ($name) | |
Clicks on a category in the management interface. More... | |
i_click_on_category_in_the_management_interface ($name) | |
Clicks on a category in the management interface. More... | |
i_click_on_course_in_the_management_interface ($name) | |
Clicks on a course in the management interface. More... | |
i_click_on_in_the_activity ($element, $selectortype, $activityname) | |
Clicks on the specified element of the activity. More... | |
i_click_to_expand_category_in_the_management_interface ($idnumber) | |
Click to expand a category revealing its sub categories within the management UI. More... | |
i_click_to_move_category_by_one ($idnumber, $direction) | |
Moves a category displayed in the management interface up or down one place. More... | |
i_click_to_move_course_by_one ($idnumber, $direction) | |
Moves a course displayed in the management interface up or down one place. More... | |
i_close_actions_menu ($activityname) | |
Closes an activity actions menu if it is not already closed. More... | |
i_create_a_course_with (TableNode $table) | |
Creates a new course with the provided table data matching course settings names with the desired values. More... | |
i_delete_activity ($activityname) | |
Deletes the activity or resource specified by it's name. More... | |
i_delete_section ($sectionnumber) | |
Deletes course section. More... | |
i_duplicate_activity ($activityname) | |
Duplicates the activity or resource specified by it's name. More... | |
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. More... | |
i_edit_the_section ($sectionnumber) | |
Go to editing section page for specified section number. More... | |
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. More... | |
i_go_to_the_courses_management_page () | |
Goes to the system courses/categories management page. More... | |
i_hide_section ($sectionnumber) | |
Hides the specified visible section. More... | |
i_indent_left_activity ($activityname) | |
Indents to the left the activity or resource specified by it's name. More... | |
i_indent_right_activity ($activityname) | |
Indents to the right the activity or resource specified by it's name. More... | |
i_move_activity_to_section ($activityname, $sectionnumber) | |
Moves the specified activity to the first slot of a section. More... | |
i_move_category_to_top_level_in_the_management_interface ($name) | |
Move selected categories to top level in the management interface. More... | |
i_move_down_section ($sectionnumber) | |
Moves down the specified section, this step only works with Javascript disabled. More... | |
i_move_up_section ($sectionnumber) | |
Moves up the specified section, this step only works with Javascript disabled. More... | |
i_navigate_to_course_participants () | |
Go to the course participants. More... | |
i_open_actions_menu ($activityname) | |
Opens an activity actions menu if it is not already opened. More... | |
i_open_section_edit_menu ($sectionnumber) | |
Opens a section edit menu if it is not already opened. More... | |
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. More... | |
i_open_the_activity_chooser () | |
Open the activity chooser in a course. More... | |
i_select_category_in_the_management_interface ($name) | |
Clicks on a category checkbox in the management interface, if not checked. More... | |
i_select_course_in_the_management_interface ($name) | |
Clicks course checkbox in the management interface, if not checked. More... | |
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. More... | |
i_should_not_see_teacher_after ($fteacher, $pteacher) | |
Check that one teacher oes not appears after another in the course contacts. More... | |
i_should_see_category_as_subcategory_of_in_the_management_interface ($subcatidnumber, $catidnumber) | |
Checks that a category is a subcategory of specific category. More... | |
i_should_see_category_listing_before ($preceedingcategory, $followingcategory) | |
Check that one category appears before another in the course category management listings. More... | |
i_should_see_course_listing_before ($preceedingcourse, $followingcourse) | |
Check that one course appears before another in the course category management listings. More... | |
i_should_see_teacher_before ($pteacher, $fteacher) | |
Check that one teacher appears before another in the course contacts. More... | |
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. More... | |
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. More... | |
i_show_section ($sectionnumber) | |
Shows the specified hidden section. More... | |
i_toggle_category_children_visibility_in_frontpage ($categoryname) | |
Clicks to expand or collapse a category displayed on the frontpage. More... | |
i_toggle_visibility_of_category_in_management_listing ($idnumber) | |
Toggles the visibility of a category in the management UI. More... | |
i_toggle_visibility_of_course_in_management_listing ($idnumber) | |
Toggles the visibility of a course in the management UI. More... | |
i_turn_editing_mode_off () | |
Turns editing mode off. More... | |
i_turn_editing_mode_on () | |
Turns editing mode on. More... | |
i_turn_section_highlighting_off ($sectionnumber) | |
Turns course section highlighting off. More... | |
i_turn_section_highlighting_on ($sectionnumber) | |
Turns course section highlighting on. More... | |
i_unselect_category_in_the_management_interface ($name) | |
Clicks on a category checkbox in the management interface, if checked. More... | |
i_unselect_course_in_the_management_interface ($name) | |
Clicks course checkbox in the management interface, if checked. More... | |
i_wait_until_section_is_available ($sectionnumber) | |
Waits until the section is available to interact with it. More... | |
section_activities_should_be_hidden ($sectionnumber) | |
Checks that all actiities in the specified section are hidden. More... | |
section_should_be_hidden ($sectionnumber) | |
Checks that the specified section is visible. More... | |
section_should_be_highlighted ($sectionnumber) | |
Checks if the specified course section hightlighting is turned on. More... | |
section_should_be_visible ($sectionnumber) | |
Checks that the specified section is visible. More... | |
section_should_not_be_highlighted ($sectionnumber) | |
Checks if the specified course section highlighting is turned off. More... | |
Static Public Member Functions | |
static | get_named_replacements () |
Return a list of the Mink named replacements for the component. More... | |
static | get_partial_named_selectors () |
Return the list of partial named selectors. More... | |
Public Attributes | |
const | EXTENDED_TIMEOUT = 10 |
And extended timeout for specific cases. More... | |
const | PAGE_READY_JS |
The JS code to check that the page is ready. More... | |
const | REDUCED_TIMEOUT = 2 |
Small timeout. More... | |
const | TIMEOUT = 6 |
The timeout for each Behat step (load page, wait for an element to load...). More... | |
Protected Member Functions | |
get_activity_element ($element, $selectortype, $activityname) | |
Clicks on the specified element inside the activity container. More... | |
get_activity_name ($activitynode) | |
Gets the activity instance name from the activity node. More... | |
get_activity_node ($activityname) | |
Returns the DOM node of the activity from . More... | |
get_course_format () | |
Gets the current course format. More... | |
get_management_category_listing_node_by_idnumber ($idnumber) | |
Returns the category node from within the listing on the management page. More... | |
get_management_category_listing_node_by_name ($name, $link=false) | |
Returns a category node from within the management interface. More... | |
get_management_course_listing_node_by_idnumber ($idnumber) | |
Returns the course node from within the listing on the management page. More... | |
get_management_course_listing_node_by_name ($name, $link=false) | |
Returns a course node from within the management interface. More... | |
get_section_activities ($sectionxpath) | |
Gets the section's activites DOM nodes. More... | |
hide_section_link_exists ($sectionnumber) | |
Returns the hide section icon link if it exists or throws exception. More... | |
is_course_editor () | |
Returns whether the user can edit the course contents or not. More... | |
is_editing_on () | |
Returns whether the user can edit the course contents and the editing mode is on. More... | |
listing_is_highlighted ($self, $selector) | |
Used by spin to determine the callback has been highlighted. More... | |
section_exists ($sectionnumber) | |
Checks if the course section exists. More... | |
show_section_link_exists ($sectionnumber) | |
Returns the show section icon or throws an exception. More... | |
user_clicks_on_management_listing_action ($listingtype, $listingnode, $action) | |
Finds the node to use for a management listitem action and clicks it. More... | |
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. More... | |
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::activity_should_be_dimmed | ( | $activityname | ) |
Checks that the specified activity is dimmed.
You need to be in the course page.
@Then /^"(?P<activity_or_resource_string>(?:[^"]|::")*)" activity should be dimmed$/
string | $activityname |
ExpectationException |
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::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 |
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 |
|
static |
Return a list of the Mink named replacements for the component.
Named replacements allow you to define parts of an xpath that can be reused multiple times, or in multiple xpaths.
This method should return a list of behat_component_named_replacement and the docs on that class explain how it works.
behat_component_named_replacement[] |
|
static |
Return the list of partial named selectors.
array |
|
protected |
Gets the section's activites DOM nodes.
string | $sectionxpath |
array | NodeElement instances |
|
inherited |
Returns the Mink session.
string | null | $name | name of the session OR active session will be used |
Behat::Mink::Session |
Implemented in behat_form_field.
|
protected |
Returns the hide section icon link if it exists or throws exception.
ElementNotFoundException | Thrown by behat_base::find |
int | $sectionnumber |
NodeElement |
behat_course::i_add_to_section | ( | $activity, | |
$section | |||
) |
Opens the activity chooser and opens the activity/resource form page.
Sections 0 and 1 are also allowed on frontpage.
@Given /^I add a "(?P<activity_or_resource_name_string>(?:[^"]|::")*)" to section "(?P<section_number>\d+)"$/
ElementNotFoundException | Thrown by behat_base::find |
string | $activity | |
int | $section |
behat_course::i_add_to_section_and_i_fill_the_form_with | ( | $activity, | |
$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.
@When /^I add a "(?P<activity_or_resource_name_string>(?:[^"]|::")*)" to section "(?P<section_number>\d+)" and I fill the form with:$/
string | $activity | The activity name |
int | $section | The section number |
TableNode | $data | The activity field/value data |
behat_course::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 |
behat_course::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. |
behat_course::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. |
behat_course::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. |
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::i_create_a_course_with | ( | TableNode | $table | ) |
Creates a new course with the provided table data matching course settings names with the desired values.
@Given /^I create a course with:$/
TableNode | $table | The course data |
behat_course::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 |
behat_course::i_delete_section | ( | $sectionnumber | ) |
Deletes course section.
@Given /^I delete section "(?P<section_number>::d+)"$/
int | $sectionnumber | The section number |
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::i_go_to_the_courses_management_page | ( | ) |
Goes to the system courses/categories management page.
@Given /^I go to the courses management page$/
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::i_move_activity_to_section | ( | $activityname, | |
$sectionnumber | |||
) |
Moves the specified activity to the first slot of a section.
This step is experimental when using it in Javascript tests. 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 |
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::i_navigate_to_course_participants | ( | ) |
Go to the course participants.
@Given /^I navigate to course participants$/
Reimplemented in behat_theme_classic_behat_course.
behat_course::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 |
behat_course::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 |
behat_course::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. |
behat_course::i_open_the_activity_chooser | ( | ) |
Open the activity chooser in a course.
@Given /^I open the activity chooser$/
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::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' |
behat_course::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' |
behat_course::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 |
behat_course::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 |
behat_course::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$/
behat_course::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 |
behat_course::i_turn_editing_mode_off | ( | ) |
Turns editing mode off.
@Given /^I turn editing mode off$/
behat_course::i_turn_editing_mode_on | ( | ) |
Turns editing mode on.
@Given /^I turn editing mode on$/
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::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 |
|
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 |
behat_course::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. |
behat_course::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 |
behat_course::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 |
behat_course::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 |
behat_course::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. |
|
inherited |
And extended timeout for specific cases.
|
inherited |
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.
|
inherited |
Small timeout.
A reduced timeout for cases where self::TIMEOUT is too much and a simple $this->getSession()->getPage()->find() could not be enough.
|
inherited |
The timeout for each Behat step (load page, wait for an element to load...).