Skip to content

Commit

Permalink
MDL-82034 core_course: Fix Activity chooser opening issues on behat
Browse files Browse the repository at this point in the history
  • Loading branch information
Amaia Anabitarte committed Dec 20, 2024
1 parent 4c2b992 commit f87d36d
Show file tree
Hide file tree
Showing 28 changed files with 108 additions and 93 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ Feature: Make test scenario can execute specific steps
And I press "Import"
And I should see "Scenario: Course with some disabled plugins"
When I am on "C1" course homepage with editing mode on
And I click on "Add an activity or resource" "button" in the "Section 1" "section"
And I open the activity chooser
Then I should see "Page" in the "Add an activity or resource" "dialogue"
And I should not see "Book" in the "Add an activity or resource" "dialogue"
9 changes: 6 additions & 3 deletions completion/tests/behat/default_activity_completion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ Feature: Allow teachers to edit the default activity completion rules in a cours
| completionview_assign | 0 |
And I click on "Save changes" "button" in the "[data-region='activitycompletion-assign']" "css_element"
And I am on "Course 1" course homepage with editing mode on
And I click on "Add an activity or resource" "button" in the "New section" "section"
And I click on "Add content" "button" in the "New section" "section"
And I click on "Activity or resource" "button" in the "New section" "section"
And I click on "Add a new Assignment" "link" in the "Add an activity or resource" "dialogue"
And I expand all fieldsets
# Completion tracking 2 = Add requirements.
Expand Down Expand Up @@ -83,7 +84,8 @@ Feature: Allow teachers to edit the default activity completion rules in a cours
And I click on "Save changes" "button" in the "[data-region='activitycompletion-forum']" "css_element"
Then I should see "Changes saved"
And I am on "Course 1" course homepage with editing mode on
And I click on "Add an activity or resource" "button" in the "New section" "section"
And I click on "Add content" "button" in the "New section" "section"
And I click on "Activity or resource" "button" in the "New section" "section"
And I click on "Add a new Forum" "link" in the "Add an activity or resource" "dialogue"
And I expand all fieldsets
# Completion tracking 2 = Add requirements.
Expand Down Expand Up @@ -122,7 +124,8 @@ Feature: Allow teachers to edit the default activity completion rules in a cours
And I click on "Save changes" "button" in the "[data-region='activitycompletion-glossary']" "css_element"
Then I should see "Changes saved"
And I am on "Course 1" course homepage with editing mode on
And I click on "Add an activity or resource" "button" in the "New section" "section"
And I click on "Add content" "button" in the "New section" "section"
And I click on "Activity or resource" "button" in the "New section" "section"
And I click on "Add a new Glossary" "link" in the "Add an activity or resource" "dialogue"
And I expand all fieldsets
# Completion tracking 2 = Add requirements.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Feature: Courses can be created in Single Activity mode
| moodle/course:manageactivities | allow |
| moodle/course:viewparticipants | allow |
| moodle/role:assign | allow |
And I enable "subsection" "mod" plugin
When I log in as "kevin"
And I am on site homepage
And I press "Add a new course"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Feature: Edit format course to Single Activity format
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I enable "subsection" "mod" plugin
And I log in as "teacher1"
And I am on "Course 1" course homepage
When I navigate to "Settings" in current page administration
Expand Down
2 changes: 2 additions & 0 deletions course/format/tests/behat/course_manageactivities.feature
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ Feature: Verify edit utils availability
Given I log in as "teacher1"
When I am on "Course 1" course homepage
And I turn editing mode on
And I open the activity chooser
Then I should see "Add an activity or resource"
And I click on "Close" "button" in the "Add an activity or resource" "dialogue"
And I open "Activity sample 1" actions menu
And I should see "Edit settings"
And ".section_action_menu" "css_element" should exist in the "Section 1" "section"
Expand Down
4 changes: 4 additions & 0 deletions course/templates/activitychooserbutton.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
type="button"
id="dropdownMenuButton-{{#modid}}{{modid}}{{/modid}}{{^modid}}{{uniqid}}{{/modid}}"
data-toggle="dropdown"
data-action="open-addingcontent"
{{#modid}}
data-beforemod="{{modid}}"
{{/modid}}
aria-haspopup="true"
aria-expanded="false"
aria-label="{{#str}}insertcontentbefore, core, { "activityname": {{#quote}} {{activityname}} {{/quote}} } {{/str}}"
Expand Down
Loading

0 comments on commit f87d36d

Please sign in to comment.