2013-04-23 12:56:40 +08:00
|
|
|
@core @core_course
|
2013-01-25 16:00:14 +08:00
|
|
|
Feature: Add activities to courses
|
|
|
|
In order to provide tools for students learning
|
|
|
|
As a teacher
|
|
|
|
I need to add activites to a course
|
|
|
|
|
2013-03-28 18:02:30 +08:00
|
|
|
Background:
|
2014-02-21 15:18:07 +08:00
|
|
|
Given the following "users" exist:
|
2013-01-25 16:00:14 +08:00
|
|
|
| username | firstname | lastname | email |
|
|
|
|
| student1 | Student | 1 | student1@asd.com |
|
|
|
|
| student2 | Student | 2 | student2@asd.com |
|
2014-02-21 15:18:07 +08:00
|
|
|
And the following "courses" exist:
|
2013-01-25 16:00:14 +08:00
|
|
|
| fullname | shortname | format |
|
|
|
|
| Course 1 | C1 | topics |
|
2014-02-21 15:18:07 +08:00
|
|
|
And the following "course enrolments" exist:
|
2013-01-25 16:00:14 +08:00
|
|
|
| user | course | role |
|
|
|
|
| student1 | C1 | student |
|
|
|
|
| student2 | C1 | student |
|
|
|
|
And I log in as "admin"
|
|
|
|
And I follow "Course 1"
|
2013-03-28 18:02:30 +08:00
|
|
|
And I turn editing mode on
|
|
|
|
|
|
|
|
@javascript
|
|
|
|
Scenario: Add an activity to a course
|
|
|
|
When I add a "Database" to section "3" and I fill the form with:
|
2013-01-25 16:00:14 +08:00
|
|
|
| Name | Test name |
|
2013-03-07 12:04:41 +08:00
|
|
|
| Description | Test database description |
|
2013-04-04 13:54:40 +08:00
|
|
|
| Entries required for completion | 9 |
|
|
|
|
| Allow comments on entries | Yes |
|
2013-02-05 16:49:47 +08:00
|
|
|
And I turn editing mode off
|
2013-01-25 16:00:14 +08:00
|
|
|
Then I should not see "Adding a new"
|
|
|
|
And I follow "Test name"
|
2013-11-04 19:33:36 +08:00
|
|
|
And I click on "Edit settings" "link" in the "Administration" "block"
|
2013-04-04 13:54:40 +08:00
|
|
|
And I expand all fieldsets
|
2014-01-30 15:19:21 +08:00
|
|
|
And the field "Name" matches value "Test name"
|
|
|
|
And the field "Entries required for completion" matches value "9"
|
|
|
|
And the field "Allow comments on entries" matches value "Yes"
|
2013-01-25 16:00:14 +08:00
|
|
|
|
|
|
|
@javascript
|
|
|
|
Scenario: Add an activity without the required fields
|
2013-03-28 18:02:30 +08:00
|
|
|
When I add a "Database" to section "3" and I fill the form with:
|
2013-01-25 16:00:14 +08:00
|
|
|
| Name | Test name |
|
2013-10-31 15:32:11 +08:00
|
|
|
And I press "Save and return to course"
|
2013-01-25 16:00:14 +08:00
|
|
|
Then I should see "Adding a new"
|
|
|
|
And I should see "Required"
|
2013-10-31 15:32:11 +08:00
|
|
|
And I press "Cancel"
|
2013-03-28 18:02:30 +08:00
|
|
|
|
|
|
|
Scenario: Add an activity to a course with Javascript disabled
|
|
|
|
Then I should see "Add a resource to section 'Topic 1'"
|
|
|
|
And I should see "Add an activity to section 'Topic 1'"
|
|
|
|
And I should see "Add a resource to section 'Topic 2'"
|
|
|
|
And I should see "Add an activity to section 'Topic 2'"
|
|
|
|
And I should see "Add a resource to section 'Topic 3'"
|
|
|
|
And I should see "Add an activity to section 'Topic 3'"
|
|
|
|
And I add a "Label" to section "2"
|
|
|
|
And I should see "Adding a new Label to Topic 2"
|
2014-01-30 15:19:21 +08:00
|
|
|
And I set the following fields to these values:
|
2013-03-28 18:02:30 +08:00
|
|
|
| Label text | I'm a label |
|
|
|
|
And I press "Save and return to course"
|
|
|
|
And I add a "Database" to section "3"
|
|
|
|
And I should see "Adding a new Database to Topic 3"
|
2014-01-30 15:19:21 +08:00
|
|
|
And I set the following fields to these values:
|
2013-03-28 18:02:30 +08:00
|
|
|
| Name | Test database name |
|
|
|
|
| Description | Test database description |
|
|
|
|
And I press "Save and return to course"
|
|
|
|
And I should not see "Adding a new"
|
|
|
|
And I should see "Test database name"
|
|
|
|
And I should see "I'm a label"
|