moodle/course/tests/behat/add_activities.feature
Tim Hunt 8babdbd396 MDL-74608 activities: a new option to force the activity language
For a long time, Moodle has had the feature to force the language
for a whole course. This change adds the same feature at activity
level.

The course-level feature was controlled by a capability
moodle/course:setforcedlanguage, and I decided to use the same
capability to control this feature. I think a new capability would be
overkill.
2022-08-15 22:15:52 +01:00

50 lines
2.1 KiB
Gherkin
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@core @core_course
Feature: Add activities to courses
In order to provide tools for students learning
As a teacher
I need to add activites to a course
Background:
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | Course 1 | topics |
@javascript
Scenario: Add an activity to a course
Given I am on the "Course 1" Course page logged in as admin
And I am on "Course 1" course homepage with editing mode on
When I add a "Database" to section "3" and I fill the form with:
| Name | Test name |
| Description | Test database description |
| ID number | TESTNAME |
| Allow comments on entries | Yes |
| Force language | English |
And I turn editing mode off
Then I should not see "Adding a new"
And I turn editing mode on
And I open "Test name" actions menu
And I click on "Edit settings" "link" in the "Test name" activity
And the following fields match these values:
| Name | Test name |
| ID number | TESTNAME |
| Allow comments on entries | Yes |
| Force language | English (en) |
@javascript
Scenario: Add an activity supplying only the name
Given I am on the "Course 1" Course page logged in as admin
And I am on "Course 1" course homepage with editing mode on
When I add a "Database" to section "3" and I fill the form with:
| Name | Test name |
Then I should see "Test name"
@javascript
Scenario: Set activity description to required then add an activity supplying only the name
Given the following config values are set as admin:
| requiremodintro | 1 |
And I am on the "Course 1" Course page logged in as admin
And I am on "Course 1" course homepage with editing mode on
And I add a "Database" to section "3" and I fill the form with:
| Name | Test name |
Then I should see "Required"