Skip to content

Commit 2fbc2e4

Browse files
author
David Monllaó
committed
Merge branch 'MDL-64673-master' of git://github.com/aanabit/moodle
2 parents 471b4e3 + a58fbd4 commit 2fbc2e4

File tree

2 files changed

+96
-1
lines changed

2 files changed

+96
-1
lines changed

lib/behat/classes/partial_named_selector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public function __construct() {
168168
//div[@data-region='empty-message-container' and not(contains(@class, 'hidden')) and contains(., %locator%)]
169169
XPATH
170170
, 'group_message_tab' => <<<XPATH
171-
.//*[@data-region='message-drawer']//button[@data-toggle='collapse']//*[text()[contains(., %locator%)]]/..
171+
.//*[@data-region='message-drawer']//button[@data-toggle='collapse' and contains(string(), %locator%)]
172172
XPATH
173173
, 'icon' => <<<XPATH
174174
.//*[contains(concat(' ', normalize-space(@class), ' '), ' icon ') and ( contains(normalize-space(@title), %locator%))]
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
@core @core_message @javascript
2+
Feature: Star and unstar conversations
3+
In order to manage a course group in a course
4+
As a user
5+
I need to be able to star and unstar conversations
6+
7+
Background:
8+
Given the following "courses" exist:
9+
| fullname | shortname | category | groupmode |
10+
| Course 1 | C1 | 0 | 1 |
11+
And the following "users" exist:
12+
| username | firstname | lastname | email |
13+
| student1 | Student | 1 | student1@example.com |
14+
| student2 | Student | 2 | student2@example.com |
15+
And the following "course enrolments" exist:
16+
| user | course | role |
17+
| student1 | C1 | student |
18+
| student2 | C1 | student |
19+
And the following "groups" exist:
20+
| name | course | idnumber | enablemessaging |
21+
| Group 1 | C1 | G1 | 1 |
22+
And the following "group members" exist:
23+
| user | group |
24+
| student1 | G1 |
25+
| student2 | G1 |
26+
And the following config values are set as admin:
27+
| messaging | 1 |
28+
29+
Scenario: Star a group conversation
30+
Given I log in as "student1"
31+
Then I open messaging
32+
And "Group 1" "group_message" should exist
33+
And I select "Group 1" conversation in messaging
34+
And I open contact menu
35+
And I click on "Star" "link" in the "//div[@data-region='header-container']" "xpath_element"
36+
And I go back in "view-conversation" message drawer
37+
And I open the "Starred" conversations list
38+
And I should see "Group 1" in the "//div[@data-region='view-overview-favourites']" "xpath_element"
39+
And I open the "Group" conversations list
40+
And I should not see "Group 1" in the "//div[@data-region='view-overview-group-messages']" "xpath_element"
41+
42+
Scenario: Unstar a group conversation
43+
Given I log in as "student1"
44+
Then I open messaging
45+
And "Group 1" "group_message" should exist
46+
And I select "Group 1" conversation in messaging
47+
And I open contact menu
48+
And I click on "Star" "link" in the "//div[@data-region='header-container']" "xpath_element"
49+
And I go back in "view-conversation" message drawer
50+
And I open the "Starred" conversations list
51+
And I should see "Group 1" in the "//div[@data-region='view-overview-favourites']" "xpath_element"
52+
And I select "Group 1" conversation in messaging
53+
And I open contact menu
54+
And I click on "Unstar" "link" in the "//div[@data-region='header-container']" "xpath_element"
55+
And I go back in "view-conversation" message drawer
56+
And I open the "Starred" conversations list
57+
And I should not see "Group 1" in the "//div[@data-region='view-overview-favourites']" "xpath_element"
58+
And I open the "Group" conversations list
59+
And I should see "Group 1" in the "//div[@data-region='view-overview-group-messages']" "xpath_element"
60+
61+
Scenario: Star a private conversation
62+
Given the following "private messages" exist:
63+
| user | contact | message |
64+
| student1 | student2 | Hi! |
65+
Then I log in as "student1"
66+
And I open messaging
67+
And I open the "Private" conversations list
68+
And "Student 2" "group_message" should exist
69+
And I select "Student 2" conversation in messaging
70+
And I open contact menu
71+
And I click on "Star" "link" in the "//div[@data-region='header-container']" "xpath_element"
72+
And I go back in "view-conversation" message drawer
73+
And I open the "Starred" conversations list
74+
And I should see "Student 2" in the "//div[@data-region='view-overview-favourites']" "xpath_element"
75+
And I open the "Private" conversations list
76+
And I should not see "Student 2" in the "//div[@data-region='view-overview-messages']" "xpath_element"
77+
78+
Scenario: Unstar a private conversation
79+
Given the following "private messages" exist:
80+
| user | contact | message |
81+
| student1 | student2 | Hi! |
82+
Given the following "favourite conversations" exist:
83+
| user | contact |
84+
| student1 | student2 |
85+
Then I log in as "student1"
86+
And I open messaging
87+
And I should see "Student 2" in the "//div[@data-region='view-overview-favourites']" "xpath_element"
88+
And I select "Student 2" conversation in messaging
89+
And I open contact menu
90+
And I click on "Unstar" "link" in the "//div[@data-region='header-container']" "xpath_element"
91+
And I go back in "view-conversation" message drawer
92+
And I open the "Starred" conversations list
93+
And I should not see "Group 1" in the "//div[@data-region='view-overview-favourites']" "xpath_element"
94+
And I open the "Private" conversations list
95+
And I should see "Student 2" in the "//div[@data-region='view-overview-messages']" "xpath_element"

0 commit comments

Comments
 (0)