1 |
efrain |
1 |
@mod @mod_unilabel
|
|
|
2 |
Feature: Show teachers and users the unilabel on the course page
|
|
|
3 |
In order to edit the unilabel content
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to see the button "Edit content"
|
|
|
6 |
As a student
|
|
|
7 |
I do not see the button "Edit content"
|
|
|
8 |
|
|
|
9 |
Background:
|
|
|
10 |
Given the following "users" exist:
|
|
|
11 |
| username | firstname | lastname |
|
|
|
12 |
| teacher1 | Teacher | 1 |
|
|
|
13 |
| student1 | Student | 1 |
|
|
|
14 |
And the following "courses" exist:
|
|
|
15 |
| fullname | shortname |
|
|
|
16 |
| Course 1 | C1 |
|
|
|
17 |
And the following "course enrolments" exist:
|
|
|
18 |
| user | course | role |
|
|
|
19 |
| teacher1 | C1 | editingteacher |
|
|
|
20 |
| student1 | C1 | student |
|
|
|
21 |
|
|
|
22 |
@javascript
|
|
|
23 |
Scenario: See the "Edit content" button as teacher
|
|
|
24 |
# Set up a unilabel.
|
|
|
25 |
When I log in as "teacher1"
|
|
|
26 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
27 |
And I add a unilabel to course "Course 1" section "1" and I fill the form with:
|
|
|
28 |
| Name | Testlabel1 |
|
|
|
29 |
| Unilabel text | Hello label |
|
|
|
30 |
| Label type | Simple text |
|
|
|
31 |
|
|
|
32 |
# Should See the unilabel and the button
|
|
|
33 |
Then I should see "Hello label"
|
|
|
34 |
And I should see "Edit content"
|
|
|
35 |
|
|
|
36 |
@javascript
|
|
|
37 |
Scenario: Do not see the "Edit content" button as student
|
|
|
38 |
When I log in as "teacher1"
|
|
|
39 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
40 |
And I add a unilabel to course "Course 1" section "1" and I fill the form with:
|
|
|
41 |
| Name | Testlabel1 |
|
|
|
42 |
| Unilabel text | Hello label |
|
|
|
43 |
| Label type | Simple text |
|
|
|
44 |
And I log out
|
|
|
45 |
And I log in as "student1"
|
|
|
46 |
And I am on "Course 1" course homepage
|
|
|
47 |
|
|
|
48 |
# Should See the unilabel and the button
|
|
|
49 |
Then I should see "Hello label"
|
|
|
50 |
And I should not see "Edit content"
|