Merge branch 'MDL-58490-master' of git://github.com/lameze/moodle
[moodle.git] / blocks / navigation / tests / behat / participants_link.feature
CommitLineData
57b81c93
DM
1@block @block_navigation
2Feature: Displaying the link to the Participants page
3 In order to see the course / site participants
4 As a student / admin respectively
5 I need a link to the Participants page be displayed (but only if I can access that page)
6
7 Background:
8 Given the following "users" exist:
9 | username | firstname | lastname | email |
10 | student1 | Student | One | student1@example.com |
11 | student2 | Student | Two | student2@example.com |
12 And the following "courses" exist:
13 | fullname | shortname |
14 | Course1 | C1 |
15 And the following "course enrolments" exist:
16 | user | course | role |
17 | student1 | C1 | student |
50bd633d
MG
18 And I log in as "admin"
19 And I am on site homepage
20 And I turn editing mode on
21 And I add the "Navigation" block if not present
22 And I configure the "Navigation" block
23 And I set the following fields to these values:
24 | Page contexts | Display throughout the entire site |
25 And I press "Save changes"
26 And I log out
57b81c93
DM
27
28 @javascript
29 Scenario: Course participants link is displayed to enrolled students after expanding the course node
30 When I log in as "student1"
31 And I expand "C1" node
32 Then "Participants" "link" should exist in the "Navigation" "block"
50bd633d 33 And I click on "Participants" "link" in the "Navigation" "block"
57b81c93
DM
34 And I should see "Participants"
35 And "Student One" "link" should exist
36 And "Student Two" "link" should not exist
37
38 Scenario: Site participants link is displayed to admins
39 When I log in as "admin"
40 Then "Participants" "link" should exist in the "Navigation" "block"
50bd633d 41 And I click on "Participants" "link" in the "Navigation" "block"
57b81c93
DM
42 And I should see "Participants"
43 And "Student One" "link" should exist
44 And "Student Two" "link" should exist
45
46 @javascript
47 Scenario: Site participants link is not displayed to students (MDL-55667)
48 Given I log in as "admin"
49 And I set the following administration settings values:
50 | defaultfrontpageroleid | Student (student) |
51 And I log out
52 When I log in as "student2"
53 And I expand "Site pages" node
54 Then "Participants" "link" should not exist in the "Navigation" "block"