Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@block @block_myoverview @javascript
2
Feature: The my overview block allows users to hide their courses
3
  In order to enable the my overview block in a course
4
  As a student
5
  I can add the my overview block to my dashboard
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                | idnumber |
10
      | student1 | Student   | X        | student1@example.com | S1       |
11
    And the following "courses" exist:
12
      | fullname | shortname | category |
13
      | Course 1 | C1        | 0        |
14
      | Course 2 | C2        | 0        |
15
      | Course 3 | C3        | 0        |
16
      | Course 4 | C4        | 0        |
17
      | Course 5 | C5        | 0        |
18
    And the following "course enrolments" exist:
19
      | user | course | role |
20
      | student1 | C1 | student |
21
      | student1 | C2 | student |
22
      | student1 | C3 | student |
23
      | student1 | C4 | student |
24
      | student1 | C5 | student |
25
 
26
  Scenario: Test hide toggle functionality
27
    Given I am on the "My courses" page logged in as "student1"
28
    And I click on "All" "button" in the "Course overview" "block"
29
    When I click on "All" "link" in the "Course overview" "block"
30
    And I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
31
    And I click on "Remove from view" "link" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
32
    And I reload the page
33
    Then I should not see "Course 2" in the "Course overview" "block"
34
 
35
  Scenario: Test hide toggle functionality w/ favorites
36
    Given I am on the "My courses" page logged in as "student1"
37
    And I click on "All" "button" in the "Course overview" "block"
38
    And I click on "All" "link" in the "Course overview" "block"
39
    And I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
40
    And I click on "Star this course" "link" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
41
    And I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
42
    And I click on "Remove from view" "link" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
43
    When I reload the page
44
    And I should not see "Course 2" in the "Course overview" "block"
45
    And I click on "All" "button" in the "Course overview" "block"
46
    And I click on "Starred" "link" in the "Course overview" "block"
47
    Then I should not see "Course 2" in the "Course overview" "block"
48
    And I click on "Starred" "button" in the "Course overview" "block"
49
    And I click on "Removed from view" "link" in the "Course overview" "block"
50
    And I should see "Course 2" in the "Course overview" "block"
51
 
52
  Scenario: Test show toggle functionality
53
    Given I am on the "My courses" page logged in as "student1"
54
    And I click on "All" "button" in the "Course overview" "block"
55
    And I click on "All" "link" in the "Course overview" "block"
56
    And I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
57
    And I click on "Remove from view" "link" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
58
    And I click on "All" "button" in the "Course overview" "block"
59
    And I click on "Removed from view" "link" in the "Course overview" "block"
60
    And I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
61
    And I click on "Restore to view" "link" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
62
    And I reload the page
63
    And I should not see "Course 2" in the "Course overview" "block"
64
    And I click on "Removed from view" "button" in the "Course overview" "block"
65
    When I click on "All" "link" in the "Course overview" "block"
66
    And I reload the page
67
    Then I should see "Course 2" in the "Course overview" "block"
68
 
69
  Scenario: Test star and unstar functionality
70
    Given I am on the "My courses" page logged in as "student1"
71
    And I click on "All" "button" in the "Course overview" "block"
72
    And I click on "All" "link" in the "Course overview" "block"
73
    And I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
74
    And I click on "Star this course" "link" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
75
    And I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
76
    And I click on "Remove from view" "link" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
77
    And I click on "All" "button" in the "Course overview" "block"
78
    And I click on "Removed from view" "link" in the "Course overview" "block"
79
    And I should see "Course 2" in the "Course overview" "block"
80
    And I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
81
    And I click on "Restore to view" "link" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
82
    When I reload the page
83
    Then I should not see "Course 2" in the "Course overview" "block"
84
    And I click on "Removed from view" "button" in the "Course overview" "block"
85
    And I click on "All" "link" in the "Course overview" "block"
86
    And I should see "Course 2" in the "Course overview" "block"
87
    And I click on "All" "button" in the "Course overview" "block"
88
    And I click on "Starred" "link" in the "Course overview" "block"
89
    And I should see "Course 2" in the "Course overview" "block"
90
 
91
  Scenario: Test a course is hidden directly with "All" courses
92
    Given I am on the "My courses" page logged in as "student1"
93
    And I click on "All" "button" in the "Course overview" "block"
94
    When I click on "All" "link" in the "Course overview" "block"
95
    And I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
96
    And I click on "Remove from view" "link" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
97
    Then I should not see "Course 2" in the "Course overview" "block"
98
 
99
  Scenario: Test a course is never hidden with "All (including removed from view)" courses
100
    Given the following config values are set as admin:
101
      | config                            | value | plugin           |
102
      | displaygroupingallincludinghidden | 1     | block_myoverview |
103
    And I am on the "My courses" page logged in as "student1"
104
    And I click on "All" "button" in the "Course overview" "block"
105
    # We have to click on the data attribute instead of the button element text as we might risk to click on the false positive "All (except hidden)" element instead
106
    When I click on "[data-value='allincludinghidden']" "css_element" in the "Course overview" "block"
107
    And I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
108
    And I click on "Remove from view" "link" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
109
    Then I should see "Course 2" in the "Course overview" "block"
110
    And I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
111
    And I should not see "Remove from view" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
112
    And I should see "Restore to view" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
113
    And I click on "Restore to view" "link" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
114
    And I should see "Course 2" in the "Course overview" "block"
115
    And I click on ".coursemenubtn" "css_element" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
116
    And I should see "Remove from view" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"
117
    And I should not see "Restore to view" in the "//div[contains(@class, 'course-card') and contains(.,'Course 2')]" "xpath_element"