MDL-56614 behat: new steps for navigation without blocks
[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 |
18
19 @javascript
20 Scenario: Course participants link is displayed to enrolled students after expanding the course node
21 When I log in as "student1"
22 And I expand "C1" node
23 Then "Participants" "link" should exist in the "Navigation" "block"
24 And I navigate to "Participants" node in "My courses > C1"
25 And I should see "Participants"
26 And "Student One" "link" should exist
27 And "Student Two" "link" should not exist
28
29 Scenario: Site participants link is displayed to admins
30 When I log in as "admin"
31 Then "Participants" "link" should exist in the "Navigation" "block"
32 And I navigate to "Participants" node in "Site pages"
33 And I should see "Participants"
34 And "Student One" "link" should exist
35 And "Student Two" "link" should exist
36
37 @javascript
38 Scenario: Site participants link is not displayed to students (MDL-55667)
39 Given I log in as "admin"
40 And I set the following administration settings values:
41 | defaultfrontpageroleid | Student (student) |
42 And I log out
43 When I log in as "student2"
44 And I expand "Site pages" node
45 Then "Participants" "link" should not exist in the "Navigation" "block"