1 |
efrain |
1 |
@communication @communication_customlink @javascript
|
|
|
2 |
Feature: Communication custom link
|
|
|
3 |
In order to facilitate easy access to an existing communication platform
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to be able to make a custom communication link available in my course
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
| student1 | Student | 1 | student1@example.com |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| fullname | shortname |
|
|
|
14 |
| Course 1 | C1 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
| student1 | C1 | student |
|
|
|
19 |
And the following config values are set as admin:
|
|
|
20 |
| enablecommunicationsubsystem | 1 |
|
|
|
21 |
|
|
|
22 |
Scenario: As a teacher I can configure a custom communication provider for my course
|
|
|
23 |
Given I am on the "Course 1" "Course" page logged in as "teacher1"
|
|
|
24 |
And "Chat to course participants" "button" should not be visible
|
|
|
25 |
When I navigate to "Communication" in current page administration
|
|
|
26 |
And the "Provider" select box should contain "Custom link"
|
|
|
27 |
And I should not see "Custom link URL"
|
|
|
28 |
And I select "Custom link" from the "Provider" singleselect
|
|
|
29 |
And I should see "Custom link URL"
|
|
|
30 |
And I set the following fields to these values:
|
11 |
efrain |
31 |
| communication_customlinkroomname | Test URL |
|
|
|
32 |
| customlinkurl | #wwwroot#/communication/provider/customlink/tests/behat/fixtures/custom_link_test_page.php |
|
1 |
efrain |
33 |
And I press "Save changes"
|
|
|
34 |
Then "Chat to course participants" "button" should be visible
|
|
|
35 |
And I click on "Chat to course participants" "button"
|
|
|
36 |
# Check the link hits the expected destination.
|
|
|
37 |
And I switch to a second window
|
|
|
38 |
And I should see "Example messaging service - teacher1" in the "region-main" "region"
|
|
|
39 |
And I close all opened windows
|
|
|
40 |
# Ensure any communication subsystem tasks have no impact on availability.
|
|
|
41 |
And I run all adhoc tasks
|
|
|
42 |
And I am on the "Course 1" course page
|
|
|
43 |
And "Chat to course participants" "button" should be visible
|
|
|
44 |
And I click on "Chat to course participants" "button"
|
|
|
45 |
And I switch to a second window
|
|
|
46 |
And I should see "Example messaging service - teacher1" in the "region-main" "region"
|
|
|
47 |
And I close all opened windows
|
|
|
48 |
And I log out
|
|
|
49 |
# Confirm student also has access to the custom link.
|
|
|
50 |
And I am on the "Course 1" "Course" page logged in as "student1"
|
|
|
51 |
And "Chat to course participants" "button" should be visible
|
|
|
52 |
And I click on "Chat to course participants" "button"
|
|
|
53 |
And I switch to a second window
|
|
|
54 |
And I should see "Example messaging service - student1" in the "region-main" "region"
|
|
|
55 |
|
|
|
56 |
Scenario: As a teacher I can disable and re-enable a custom communication provider for my course
|
|
|
57 |
Given I am on the "Course 1" "Course" page logged in as "teacher1"
|
|
|
58 |
And "Chat to course participants" "button" should not be visible
|
|
|
59 |
When I navigate to "Communication" in current page administration
|
|
|
60 |
And I select "Custom link" from the "Provider" singleselect
|
|
|
61 |
And I set the following fields to these values:
|
11 |
efrain |
62 |
| communication_customlinkroomname | Test URL |
|
|
|
63 |
| customlinkurl | #wwwroot#/communication/provider/customlink/tests/behat/fixtures/custom_link_test_page.php |
|
1 |
efrain |
64 |
And I press "Save changes"
|
|
|
65 |
And "Chat to course participants" "button" should be visible
|
|
|
66 |
And I run all adhoc tasks
|
|
|
67 |
And I navigate to "Communication" in current page administration
|
|
|
68 |
And I select "None" from the "Provider" singleselect
|
|
|
69 |
And I press "Save changes"
|
|
|
70 |
And "Chat to course participants" "button" should not be visible
|
|
|
71 |
And I run all adhoc tasks
|
|
|
72 |
And I am on the "Course 1" course page
|
|
|
73 |
And "Chat to course participants" "button" should not be visible
|
|
|
74 |
And I navigate to "Communication" in current page administration
|
|
|
75 |
And I select "Custom link" from the "Provider" singleselect
|
|
|
76 |
And I set the following fields to these values:
|
11 |
efrain |
77 |
| communication_customlinkroomname | Test URL |
|
|
|
78 |
| customlinkurl | #wwwroot#/communication/provider/customlink/tests/behat/fixtures/custom_link_test_page.php |
|
1 |
efrain |
79 |
And I press "Save changes"
|
|
|
80 |
And "Chat to course participants" "button" should be visible
|
|
|
81 |
And I run all adhoc tasks
|
|
|
82 |
And I am on the "Course 1" course page
|
|
|
83 |
And "Chat to course participants" "button" should be visible
|
|
|
84 |
And I click on "Chat to course participants" "button"
|
|
|
85 |
And I switch to a second window
|
|
|
86 |
And I should see "Example messaging service - teacher1" in the "region-main" "region"
|