MDL-70821 core_completion: Fix completion settings Behat tests

This commit is contained in:
Jun Pataleta
2021-04-13 01:05:01 +08:00
parent c9e92d1f5e
commit ff5955a829
@@ -21,13 +21,16 @@ Feature: Allow teachers to edit the visibility of completion conditions in a cou
Scenario: Completion condition displaying for manual and auto completion
Given I log in as "teacher1"
And I am on "Course 1" course homepage
When I am on "Course 1" course homepage
# The manual completion toggle button should be always displayed in both course homepage and activity view.
Then the manual completion button for "Test choice manual" should be disabled
And I follow "Test choice manual"
And I should see "Mark as done"
And the manual completion button for "Test choice manual" should be disabled
# Automatic completion conditions should be displayed on both activity view page and course homepage if show completion conditions is enabled.
And I am on "Course 1" course homepage
When I follow "Test choice auto"
Then I should see "Make a choice" in the "[data-region=completionrequirements]" "css_element"
# TODO MDL-70821: Check completion conditions display on course homepage.
And "Test choice auto" should have the "Make a choice" completion condition
And I follow "Test choice auto"
And "Test choice auto" should have the "Make a choice" completion condition
Scenario: Completion condition displaying setting can be disabled at course level
Given I log in as "teacher1"
@@ -36,12 +39,16 @@ Feature: Allow teachers to edit the visibility of completion conditions in a cou
When I set the following fields to these values:
| Show completion conditions | No |
And I click on "Save and display" "button"
# Automatic completion conditions should not be displayed on the course homepage if show completion conditions is disabled.
And there should be no completion information shown for "Test choice auto"
# Completion conditions are always shown in the module's view page.
And I follow "Test choice auto"
# Completion conditions are always shown in the module's view page.
Then I should see "Make a choice" in the "[data-region=completionrequirements]" "css_element"
Then "Test choice auto" should have the "Make a choice" completion condition
# The manual completion toggle button should be always displayed in both course homepage and activity view.
And I am on "Course 1" course homepage
And the manual completion button for "Test choice manual" should be disabled
And I follow "Test choice manual"
And I should see "Mark as done"
And the manual completion button for "Test choice manual" should be disabled
Scenario: Default show completion conditions value in course form when default show completion conditions admin setting is set to No
Given I log in as "admin"