1 |
efrain |
1 |
@block @block_course_summary
|
|
|
2 |
Feature: Course summary block used in a course
|
|
|
3 |
In order to help particpants know the summary of a course
|
|
|
4 |
As a teacher
|
|
|
5 |
I can add the course summary block to a course page
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | summary | category |
|
|
|
10 |
| Course 1 | C101 | Proved the course summary block works! |0 |
|
|
|
11 |
And the following "users" exist:
|
|
|
12 |
| username | firstname | lastname | email |
|
|
|
13 |
| student1 | Sam | Student | student1@example.com |
|
|
|
14 |
| teacher1 | Teacher | One | teacher1@example.com |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| student1 | C101 | student |
|
|
|
18 |
| teacher1 | C101 | editingteacher |
|
|
|
19 |
And I enable "course_summary" "block" plugin
|
|
|
20 |
And the following "blocks" exist:
|
|
|
21 |
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
|
|
22 |
| course_summary | Course | C101 | course-view-* | side-pre |
|
|
|
23 |
|
|
|
24 |
Scenario: Student can view course summary
|
|
|
25 |
When I am on the "Course 1" course page logged in as student1
|
|
|
26 |
Then "Course summary" "block" should exist
|
|
|
27 |
And I should see "Course summary" in the "Course summary" "block"
|
|
|
28 |
And I should see "Proved the course summary block works!" in the "Course summary" "block"
|
|
|
29 |
|
|
|
30 |
Scenario: Teacher can not see edit icon when edit mode is off
|
|
|
31 |
When I am on the "Course 1" course page logged in as teacher1
|
|
|
32 |
Then I should see "Proved the course summary block works!" in the "Course summary" "block"
|
|
|
33 |
And I should see "Course summary" in the "Course summary" "block"
|
|
|
34 |
And "Edit" "link" should not exist in the "Course summary" "block"
|