Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
abias committed Apr 20, 2024
1 parent e0e4298 commit 997e019
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
15 changes: 6 additions & 9 deletions tests/behat/behat_theme_boost_union_behat_navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,38 +43,35 @@
class behat_theme_boost_union_behat_navigation extends behat_theme_boost_behat_navigation {

/**
* Changes the course format options.
* Set the course format options to one page per section.
*
* @Given /^"(?P<coursefullname_string>(?:[^"]|\\")*)" has been set to one page per section$/
* @throws coding_exception
* @param string $coursefullname The full name of the course.
* @return void
*/
public function has_been_set_to_one_page_per_section(string $coursefullname) {
$courseid = $this->get_course_id($coursefullname);
/** @var \format_topics $format */
$format = course_get_format($courseid);
$sectionsperpage = new stdClass();
$sectionsperpage->coursedisplay = COURSE_DISPLAY_MULTIPAGE;
$format->update_course_format_options($sectionsperpage);
}

/**
* Opens the second section of the course.
* Opens the nth section of the course.
*
* @When /^I am in the second section of "(?P<coursefullname_string>(?:[^"]|\\")*)" course$/
* @throws coding_exception
* @When /^I am on section "(?P<section_int>(?:[^"]|\\")*)" page of "(?P<coursefullname_string>(?:[^"]|\\")*)" course$/
* @param int $section The ID of the section.
* @param string $coursefullname The full name of the course.
* @return void
*/
public function i_am_in_the_second_section_of_course(string $coursefullname) {
public function i_am_on_the_nth_section_page_of_course(int $section, string $coursefullname) {
$courseid = $this->get_course_id($coursefullname);
$urlparams = [
'id' => $courseid,
'section' => 1,
'section' => $section,
];
$url = new moodle_url('/course/view.php', $urlparams);
$this->execute('behat_general::i_visit', [$url]);
}

}
12 changes: 7 additions & 5 deletions tests/behat/theme_boost_union_feelsettings_navigation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ Feature: Configuring the theme_boost_union plugin for the "Navigation" tab on th
| yes | should |
| no | should not |

Scenario: Setting: Course category breadcrumbs and course sections
Scenario: Setting: Course category breadcrumbs (verify that course sections are properly displayed _after_ the categories)
Given the following "categories" exist:
| name | category | idnumber | category |
| Category E | 0 | CE | 0 |
Expand All @@ -224,15 +224,17 @@ Feature: Configuring the theme_boost_union plugin for the "Navigation" tab on th
And "Course C1" has been set to one page per section
And "Course C2" has been set to one page per section
When I log in as "teacher1"
And I am in the second section of "Course C1" course
And I am on section "1" page of "Course C1" course
Then "Category E" "link" should exist in the ".breadcrumb" "css_element"
And "Enrolment options" "text" should exist in the ".breadcrumb" "css_element"
And "Enrolment options" "text" should appear after "Category E" "link" in the ".breadcrumb" "css_element"
And "Topic 1" "link" should not exist in the ".breadcrumb" "css_element"
And I am in the second section of "Course C2" course
And I am on section "1" page of "Course C2" course
And "Category E" "link" should exist in the ".breadcrumb" "css_element"
And "Category ED" "link" should exist in the ".breadcrumb" "css_element"
And "Topic 1" "link" should exist in the ".breadcrumb" "css_element"
And "Topic 1" "link" should appear after "Category E" "link"
And "Topic 1" "link" should appear after "Category ED" "link"
And "Category ED" "link" should appear after "Category E" "link" in the ".breadcrumb" "css_element"
And "Topic 1" "link" should appear after "Category ED" "link" in the ".breadcrumb" "css_element"

@javascript
Scenario: Setting: back to top button - Enable "Back to top button"
Expand Down

0 comments on commit 997e019

Please sign in to comment.