1 |
efrain |
1 |
@communication
|
|
|
2 |
Feature: Access the communication configuration page
|
|
|
3 |
As an editing teacher
|
|
|
4 |
See dynamic form fields based on selected provider
|
|
|
5 |
|
|
|
6 |
Background: Set up teachers and course for the communication confifiguration page
|
|
|
7 |
Given I enable communication experimental feature
|
|
|
8 |
And the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
| teacher2 | Teacher | 2 | teacher2@example.com |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| fullname | shortname | category | selectedcommunication |
|
|
|
14 |
| Test course | Test course | 0 | none |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | Test course | editingteacher |
|
|
|
18 |
| teacher2 | Test course | teacher |
|
|
|
19 |
|
|
|
20 |
Scenario: A teacher with the correct capability can access the communication configuration page
|
|
|
21 |
Given I am on the "Test course" "Course" page logged in as "teacher1"
|
|
|
22 |
When I navigate to "Communication" in current page administration
|
|
|
23 |
Then I should see "Communication"
|
|
|
24 |
|
|
|
25 |
Scenario: A teacher without the correct capability cannot access the communication configuration page
|
|
|
26 |
Given I am on the "Test course" "Course" page logged in as "teacher2"
|
|
|
27 |
Then "Communication" "link" should not exist in current page administration
|
|
|
28 |
|
|
|
29 |
Scenario: I cannot see the communication link when communication provider is disabled
|
|
|
30 |
Given I disable communication experimental feature
|
|
|
31 |
And I am on the "Test course" "Course" page logged in as "teacher1"
|
|
|
32 |
Then "Communication" "link" should not exist in current page administration
|
|
|
33 |
|
|
|
34 |
@javascript
|
|
|
35 |
Scenario: The communication form fields toggle dynamically when valid provider is set
|
|
|
36 |
Given a Matrix mock server is configured
|
|
|
37 |
And I am on the "Test course" "Course" page logged in as "teacher1"
|
|
|
38 |
When I navigate to "Communication" in current page administration
|
|
|
39 |
And I set the following fields to these values:
|
|
|
40 |
| selectedcommunication | communication_matrix |
|
|
|
41 |
Then I should see "Room name"
|
|
|
42 |
And I should see "Room topic"
|