1 |
efrain |
1 |
@core @core_courseformat @javascript
|
|
|
2 |
Feature: Activity type tooltip.
|
|
|
3 |
In order to see the activity type
|
|
|
4 |
As a Teacher
|
|
|
5 |
I need to be able to see a tooltip with the plugin name in editing mode.
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "course" exists:
|
|
|
9 |
| fullname | Course 1 |
|
|
|
10 |
| shortname | C1 |
|
|
|
11 |
| category | 0 |
|
|
|
12 |
| numsections | 1 |
|
|
|
13 |
And the following "activities" exist:
|
|
|
14 |
| activity | name | intro | course | idnumber | section |
|
|
|
15 |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
|
|
|
16 |
| page | Activity sample 2 | Test page description | C1 | sample2 | 1 |
|
|
|
17 |
And the following "users" exist:
|
|
|
18 |
| username | firstname | lastname | email |
|
|
|
19 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
20 |
| student1 | Student | 1 | student1@example.com |
|
|
|
21 |
And the following "course enrolments" exist:
|
|
|
22 |
| user | course | role |
|
|
|
23 |
| teacher1 | C1 | editingteacher |
|
|
|
24 |
| student1 | C1 | student |
|
|
|
25 |
|
|
|
26 |
Scenario: Teacher can see the activity type tooltip only while editing.
|
|
|
27 |
Given I am on the "C1" "Course" page logged in as "teacher1"
|
|
|
28 |
And the "title" attribute of "Activity sample 1" "core_courseformat > Activity icon" should not be set
|
|
|
29 |
And the "title" attribute of "Activity sample 2" "core_courseformat > Activity icon" should not be set
|
|
|
30 |
And I turn editing mode on
|
|
|
31 |
Then the "title" attribute of "Activity sample 1" "core_courseformat > Activity icon" should contain "Assignment"
|
|
|
32 |
And the "title" attribute of "Activity sample 2" "core_courseformat > Activity icon" should contain "Page"
|
|
|
33 |
|
|
|
34 |
Scenario: Student cannot see the activity type tooltip.
|
|
|
35 |
Given I am on the "C1" "Course" page logged in as "student1"
|
|
|
36 |
Then the "title" attribute of "Activity sample 1" "core_courseformat > Activity icon" should not be set
|
|
|
37 |
|
|
|
38 |
Scenario: Student cannot see the activity icon link if does not have access.
|
|
|
39 |
Given I am on the "Activity sample 2" "page activity editing" page logged in as "admin"
|
|
|
40 |
When I expand all fieldsets
|
|
|
41 |
And I press "Add restriction..."
|
|
|
42 |
And I click on "Date" "button" in the "Add restriction..." "dialogue"
|
|
|
43 |
And I set the field "direction" to "until"
|
|
|
44 |
And I set the field "x[year]" to "2013"
|
|
|
45 |
And I set the field "x[month]" to "March"
|
|
|
46 |
And I press "Save and return to course"
|
|
|
47 |
And I log out
|
|
|
48 |
And I am on the "C1" "Course" page logged in as "student1"
|
|
|
49 |
Then "Page icon" "link" should not exist in the "Activity sample 2" "activity"
|