MDL-59726 behat: Fix Behat tests affected by the new participants filter
[moodle.git] / blocks / participants / tests / behat / block_participants_course.feature
CommitLineData
16a87642
DP
1@block @block_participants
2Feature: People Block used in a course
3 In order to view participants in a course
4 As a teacher
5 I can add the people block to a course
6
7 Background:
8 Given the following "courses" exist:
9 | fullname | shortname | category |
10 | Course 1 | C101 | 0 |
11 And the following "users" exist:
12 | username | firstname | lastname | email |
0fe86bbd 13 | student1 | Sam | Student | student1@example.com |
16a87642
DP
14 And the following "course enrolments" exist:
15 | user | course | role |
16 | student1 | C101 | student |
17 And I log in as "admin"
fdeeaff9 18 And I am on "Course 1" course homepage with editing mode on
16a87642
DP
19 And I add the "People" block
20 And I log out
21
22 Scenario: Student can view participants link
23 When I log in as "student1"
fdeeaff9 24 And I am on "Course 1" course homepage
16a87642
DP
25 Then "People" "block" should exist
26 And I should see "Participants" in the "People" "block"
27
28 Scenario: Student can follow participants link and be directed to the correct page
29 When I log in as "student1"
fdeeaff9 30 And I am on "Course 1" course homepage
16a87642 31 And I click on "Participants" "link" in the "People" "block"
f156e3dd 32 Then I should see "Participants" in the "#page-content" "css_element"
16a87642
DP
33
34 Scenario: Student without permission can not view participants link
35 Given the following "permission overrides" exist:
36 | capability | permission | role | contextlevel | reference |
37 | moodle/course:viewparticipants | Prevent | student | Course | C101 |
38 When I log in as "student1"
fdeeaff9 39 And I am on "Course 1" course homepage
16a87642 40 Then "People" "block" should not exist