Proyectos de Subversion Moodle

Rev

Ir a la última revisión | | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_message @javascript
2
Feature: Manage contacts
3
  In order to communicate with fellow users
4
  As a user
5
  I need to be able to add, decline and remove users
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                |
10
      | student1 | Student   | 1        | student1@example.com |
11
      | student2 | Student   | 2        | student2@example.com |
12
      | student3 | Student   | 3        | student3@example.com |
13
      | student4 | Student   | 4        | student4@example.com |
14
    And the following "courses" exist:
15
      | fullname | shortname |
16
      | course1 | C1 |
17
    And the following "course enrolments" exist:
18
      | user | course | role |
19
      | student1 | C1 | student |
20
      | student2 | C1 | student |
21
      | student3 | C1 | student |
22
      | student4 | C1 | student |
23
    And the following "message contacts" exist:
24
      | user     | contact |
25
      | student1 | student2 |
26
    And the following config values are set as admin:
27
      | messaging         | 1 |
28
      | messagingallusers | 1 |
29
      | messagingminpoll  | 1 |
30
 
31
  Scenario: Send a 'contact request' to someone to add a contact
32
    Given I log in as "student1"
33
    Then I open messaging
34
    And I select "Student 4" user in messaging
35
    And I open contact menu
36
    And I click on "Add to contacts" "link"
37
    And I click on "Add" "button"
38
    And I log out
39
    And I log in as "student3"
40
    And I select "Student 4" user in messaging
41
    And I open contact menu
42
    And I click on "Add to contacts" "link"
43
    And I click on "Add" "button"
44
    And I should see "Contact request sent"
45
    And I log out
46
    And I log in as "student4"
47
    Then I should see "2" in the "//div[@data-region='popover-region-messages']//*[@data-region='count-container']" "xpath_element"
48
    And I open messaging
49
    And I click on "Contacts" "link"
50
    Then I should see "2" in the "//div[@data-region='view-contacts']//*[@data-region='contact-request-count']" "xpath_element"
51
    And I click on "Requests" "link_or_button"
52
    And I click on "Student 1 Would like to contact you" "link"
53
    Then I should see "Accept and add to contacts"
54
    And I click on "Accept and add to contacts" "link_or_button"
55
    And I should not see "Accept and add to contacts"
56
    And I log out
57
    And I log in as "student1"
58
    And I open messaging
59
    And I click on "Contacts" "link"
60
    And I should see "Student 4" in the "//*[@data-section='contacts']" "xpath_element"
61
 
62
  Scenario: Decline a 'contact request' from someone
63
    Given I log in as "student1"
64
    Then I open messaging
65
    And I select "Student 3" user in messaging
66
    And I open contact menu
67
    And I click on "Add to contacts" "link"
68
    And I click on "Add" "button"
69
    And I should see "Contact request sent"
70
    And I log out
71
    And I log in as "student3"
72
    Then I should see "1" in the "//div[@data-region='popover-region-messages']//*[@data-region='count-container']" "xpath_element"
73
    And I open messaging
74
    And I click on "Contacts" "link"
75
    Then I should see "1" in the "//div[@data-region='view-contacts']//*[@data-region='contact-request-count']" "xpath_element"
76
    And I click on "Requests" "link_or_button"
77
    And I click on "Student 1 Would like to contact you" "link"
78
    Then I should see "Accept and add to contacts"
79
    And I click on "Decline" "link_or_button"
80
    And I should not see "Accept and add to contacts"
81
    And I open contact menu
82
    Then I should see "Add to contacts" in the "//div[@data-region='header-container']" "xpath_element"
83
 
84
  Scenario: Remove existing contact
85
    Given I log in as "student1"
86
    Then I open messaging
87
    And I click on "Contacts" "link"
88
    And I click on "Student 2" "link" in the "//*[@data-section='contacts']" "xpath_element"
89
    And I open contact menu
90
    And I click on "Remove from contacts" "link"
91
    And I click on "Remove" "button"
92
    And I go back in "view-conversation" message drawer
93
    And I should see "No contacts" in the "//*[@data-region='empty-message-container']" "xpath_element"