Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@block @block_dash
2
Feature: Add user contacts widget in dash block
3
  In order to enable the contacts widgets in dash block on the dashboard
4
  As an admin
5
  I can add the dash block to the dashboard
6
 
7
  Background:
8
    Given the following "categories" exist:
9
      | name        | category | idnumber |
10
      | Category 1  | 0        | CAT1     |
11
      | Category 2  | 0        | CAT2     |
12
      | Category 3  | CAT2     | CAT3     |
13
    And the following "courses" exist:
14
      | fullname | shortname | category | enablecompletion|
15
      | Course 1 | C1        | 0        | 1 |
16
      | Course 2 | C2        | CAT1     | 0 |
17
      | Course 3 | C3        | CAT2     | 1 |
18
      | Course 4 | C4        | CAT3     | 1 |
19
    And the following "users" exist:
20
      | username | firstname | lastname | email                |
21
      | student1 | Student   | First    | student1@example.com |
22
      | student2 | Student   | Two   | student2@example.com |
23
      | student3 | Student   | Three   | student3@example.com |
24
      | teacher1 | Teacher   | First    | teacher1@example.com |
25
      | user1    | user      | First    | teacher1@example.com |
26
      | student4 | Student   | Four    | student2@example.com |
27
      | student5 | Student   | Five   | student3@example.com |
28
    And the following "course enrolments" exist:
29
      | user | course | role           |
30
      | student1 | C1 | student |
31
      | student2 | C1 | teacher |
32
      | user1    | C1 | student |
33
      | student1 | C2 | student |
34
      | student1 | C3 | student |
35
    And the following "cohorts" exist:
36
      | name | idnumber |
37
      | Cohort 1 | CH1 |
38
    And the following "cohort members" exist:
39
      | user  | cohort |
40
      | student3 | CH1    |
41
      | user1    | CH1    |
42
    And the following "groups" exist:
43
      | name    | course | idnumber | enablemessaging |
44
      | Group 1 | C1     | G1       | 1               |
45
    And the following "group members" exist:
46
      | user     | group |
47
      | student1 | G1 |
48
      | student2 | G1 |
49
      | user1 | G1 |
50
    And the following "group messages" exist:
51
      | user     | group  | message                   |
52
      | student1 | G1     | Hi!                       |
53
      | student2 | G1     | How are you?              |
54
      | student1 | G1     | Can somebody help me?     |
55
    And the following "message contacts" exist:
56
      | user     | contact |
57
      | student1 | student2 |
58
      | student1 | student3 |
59
 
60
    And the following "private messages" exist:
61
      | user     | contact  | message       |
62
      | student1 | student2 | Hi!           |
63
      | student2 | student1 | Hello!        |
64
      | student1 | student2 | Are you free? |
65
 
66
    And I log in as "admin"
67
    And I navigate to "Appearance > Default Dashboard page" in site administration
68
    And I turn dash block editing mode on
69
    And I add the "Dash" block
70
    And I click on "#id_config_data_source_idnumber_block_dashlocalwidgetcontactscontacts_widget" "css_element"
71
    And I click on "Reset Dashboard for all users" "button"
72
    And I log out
73
 
74
  @javascript
75
  Scenario: Confirm the user contact list and course
76
    Given I log in as "student1"
77
    And I should see "Student Two" in the "New Dash" "block"
78
    And I should see "Student Three" in the "New Dash" "block"
79
    And I should see "2" in the ".block_dash-community-block .contact-element .row div.col-xl-3:nth-child(1) .badge-block" "css_element"
80
    And ".badge-block" "css_element" should not exist in the ".block_dash-community-block .contact-element .row div:nth-child(2)" "css_element"
81
    And I hover ".block_dash-community-block .contact-element .row div.col-xl-3:nth-child(1)" "css_element"
82
    And I click on ".contact-widget-viewgroup" "css_element" in the ".block_dash-community-block .contact-element .row div.col-xl-3:nth-child(1)" "css_element"
83
    And I should see "Groups" in the ".modal-title" "css_element"
84
    And "Group 1" "table_row" should exist
85
    And I click on ".close" "css_element" in the ".modal-header" "css_element"
86
    And I hover ".block_dash-community-block .contact-element .row div.col-xl-3:nth-child(2)" "css_element"
87
    And I click on ".contact-widget-viewgroup" "css_element" in the ".block_dash-community-block .contact-element .row div.col-xl-3:nth-child(2)" "css_element"
88
    And I should see "Groups" in the ".modal-title" "css_element"
89
    Then I should see "Nothing to display" in the ".modal-body h2" "css_element"
90
 
91
  @javascript
92
  Scenario: Check the suggest user display options
93
    Given I log in as "user1"
94
    And I should not see "Student First" in the "New Dash" "block"
95
    And I should not see "Student Two" in the "New Dash" "block"
96
    And I should not see "Student Three" in the "New Dash" "block"
97
    And I should not see "Student Four" in the "New Dash" "block"
98
    And I should not see "Student Five" in the "New Dash" "block"
99
    Then I log in as "admin"
100
    Then I navigate to "Plugins > Blocks > Dash" in site administration
101
    Then I should see "Suggest users that have same groups"
102
    And I set the field "Suggest users that have same groups" to "5"
103
    And I press "Save changes"
104
    Then I log in as "user1"
105
    And I should see "Student First" in the "New Dash" "block"
106
    And I should see "Student Two" in the "New Dash" "block"
107
    Then I log in as "admin"
108
    Then I navigate to "Plugins > Blocks > Dash" in site administration
109
    Then I should see "Suggest users that have same cohort"
110
    And I set the field "Suggest users that have same cohort" to "5"
111
    And I press "Save changes"
112
    Then I log in as "user1"
113
    And I should see "Student Three" in the "New Dash" "block"
114
    Then I log in as "admin"
115
    Then I navigate to "Plugins > Blocks > Dash" in site administration
116
    Then I should see "Suggest users that have same users"
117
    And I set the field "Suggest users that have same users" to "Student Four"
118
    And I press "Save changes"
119
    Then I log in as "user1"
120
    And I should see "Student Four" in the "New Dash" "block"