2021-06-01 15:18:22 +00:00
|
|
|
@mod @mod_chat @app @javascript
|
2020-02-27 10:41:03 +00:00
|
|
|
Feature: Test basic usage of chat in app
|
|
|
|
As a student
|
|
|
|
I need basic chat functionality to work
|
|
|
|
|
|
|
|
Background:
|
|
|
|
Given the following "courses" exist:
|
|
|
|
| fullname | shortname |
|
|
|
|
| Course 1 | C1 |
|
|
|
|
And the following "users" exist:
|
|
|
|
| username | firstname | lastname |
|
|
|
|
| student1 | david | student |
|
|
|
|
| student2 | pau | student2 |
|
|
|
|
And the following "course enrolments" exist:
|
|
|
|
| user | course | role |
|
|
|
|
| student1 | C1 | student |
|
|
|
|
| student2 | C1 | student |
|
|
|
|
And the following "activities" exist:
|
|
|
|
| activity | name | intro | course | idnumber | groupmode |
|
|
|
|
| chat | Test chat name | Test chat | C1 | chat | 0 |
|
|
|
|
|
2020-06-15 15:11:16 +00:00
|
|
|
Scenario: Receive and send messages & See connected users, beep and talk to
|
2020-06-04 11:19:15 +00:00
|
|
|
# Send messages as student1
|
2020-02-27 10:41:03 +00:00
|
|
|
When I enter the app
|
|
|
|
And I log in as "student1"
|
|
|
|
And I press "Course 1" near "Course overview" in the app
|
|
|
|
And I press "Test chat name" in the app
|
2021-06-01 15:18:22 +00:00
|
|
|
Then I should find "Click here to enter the chat now" in the app
|
|
|
|
And I should find "View past chat sessions" in the app
|
2020-06-04 11:19:15 +00:00
|
|
|
|
|
|
|
When I press "Click here to enter the chat now" in the app
|
2021-06-01 15:18:22 +00:00
|
|
|
And I set the field "New message" to "Hi!" in the app
|
2020-02-27 10:41:03 +00:00
|
|
|
And I press "Send" in the app
|
2021-06-01 15:18:22 +00:00
|
|
|
Then I should find "Hi!" in the app
|
|
|
|
|
|
|
|
When I set the field "New message" to "I am David" in the app
|
2020-02-27 10:41:03 +00:00
|
|
|
And I press "Send" in the app
|
2021-06-01 15:18:22 +00:00
|
|
|
Then I should find "Hi!" in the app
|
|
|
|
And I should find "I am David" in the app
|
2020-06-04 11:19:15 +00:00
|
|
|
|
|
|
|
# Read messages, view connected users, send beep and reply as student2
|
2020-02-27 10:41:03 +00:00
|
|
|
When I enter the app
|
|
|
|
And I log in as "student2"
|
|
|
|
And I press "Course 1" near "Course overview" in the app
|
|
|
|
And I press "Test chat name" in the app
|
|
|
|
And I press "Click here to enter the chat now" in the app
|
2021-06-01 15:18:22 +00:00
|
|
|
Then I should find "Hi!" in the app
|
|
|
|
And I should find "I am David" in the app
|
2020-06-04 11:19:15 +00:00
|
|
|
|
2021-06-01 15:18:22 +00:00
|
|
|
When I press "Users" in the app
|
|
|
|
Then I should find "david student" in the app
|
2020-06-04 11:19:15 +00:00
|
|
|
|
|
|
|
When I press "Beep" in the app
|
2021-06-01 15:18:22 +00:00
|
|
|
Then I should find "You beeped david student" in the app
|
2020-06-04 11:19:15 +00:00
|
|
|
|
2021-06-01 15:18:22 +00:00
|
|
|
When I set the field "New message" to "Hi David, I am Pau." in the app
|
2020-02-27 10:41:03 +00:00
|
|
|
And I press "Send" in the app
|
2021-06-01 15:18:22 +00:00
|
|
|
Then I should find "Hi David, I am Pau." in the app
|
2020-02-27 10:41:03 +00:00
|
|
|
|
2021-11-29 09:02:27 +00:00
|
|
|
Scenario: Past sessions shown
|
2020-06-04 11:19:15 +00:00
|
|
|
# Send messages as student1
|
|
|
|
Given I enter the app
|
2020-02-27 10:41:03 +00:00
|
|
|
And I log in as "student1"
|
|
|
|
And I press "Course 1" near "Course overview" in the app
|
|
|
|
And I press "Test chat name" in the app
|
|
|
|
And I press "Click here to enter the chat now" in the app
|
2021-06-01 15:18:22 +00:00
|
|
|
And I set the field "New message" to "Hi!" in the app
|
2020-02-27 10:41:03 +00:00
|
|
|
And I press "Send" in the app
|
2021-06-01 15:18:22 +00:00
|
|
|
Then I should find "Hi!" in the app
|
|
|
|
|
|
|
|
When I set the field "New message" to "I am David" in the app
|
2020-02-27 10:41:03 +00:00
|
|
|
And I press "Send" in the app
|
2021-06-01 15:18:22 +00:00
|
|
|
Then I should find "I am David" in the app
|
2020-06-04 11:19:15 +00:00
|
|
|
|
|
|
|
# Read messages from past sessions as student2
|
2020-02-27 10:41:03 +00:00
|
|
|
When I enter the app
|
|
|
|
And I log in as "student2"
|
|
|
|
And I press "Course 1" near "Course overview" in the app
|
|
|
|
And I press "Test chat name" in the app
|
|
|
|
And I press "View past chat sessions" in the app
|
|
|
|
And I press "Show incomplete sessions" in the app
|
2021-06-01 15:18:22 +00:00
|
|
|
And I press "david student" near "(2)" in the app
|
|
|
|
Then I should find "Hi!" in the app
|
|
|
|
And I should find "I am David" in the app
|