[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/course/tests/behat/ -> category_change_visibility.feature (source)

   1  @core @core_course
   2  Feature: We can change the visibility of categories in the management interface.
   3    As a moodle admin
   4    I need to test hiding and showing a category.
   5    I need to test hiding and showing a sub category.
   6    I need to test visibility is applied to sub categories.
   7    I need to test visibility is applied to courses.
   8    I need to test visibility of children is reset when changing back.
   9  
  10    # Tests hiding and then showing a single category.
  11    Scenario: Test making a category hidden and then visible again.
  12      Given the following "categories" exist:
  13        | name | category | idnumber |
  14        | Cat 1 | 0 | CAT1 |
  15  
  16      And I log in as "admin"
  17      And I go to the courses management page
  18      And I should see the "Course categories and courses" management page
  19      And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
  20      And category in management listing should be visible "CAT1"
  21      And I toggle visibility of category "CAT1" in management listing
  22      # Redirect.
  23      And I should see the "Course categories and courses" management page
  24      And category in management listing should be dimmed "CAT1"
  25      And I toggle visibility of category "CAT1" in management listing
  26      # Redirect.
  27      And I should see the "Course categories and courses" management page
  28      And category in management listing should be visible "CAT1"
  29  
  30    # Tests hiding and then showing a single category.
  31    @javascript
  32    Scenario: Test using AJAX to make a category hidden and then visible again.
  33      Given the following "categories" exist:
  34        | name | category | idnumber |
  35        | Cat 1 | 0 | CAT1 |
  36  
  37      And I log in as "admin"
  38      And I go to the courses management page
  39      And I start watching to see if a new page loads
  40      And I should see the "Course categories and courses" management page
  41      And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
  42      And category in management listing should be visible "CAT1"
  43      And I toggle visibility of category "CAT1" in management listing
  44      And a new page should not have loaded since I started watching
  45      And category in management listing should be dimmed "CAT1"
  46      And I toggle visibility of category "CAT1" in management listing
  47      And a new page should not have loaded since I started watching
  48      And category in management listing should be visible "CAT1"
  49  
  50    # Tests hiding and then showing a subcategory.
  51    Scenario: Test making a subcategory hidden and then visible again.
  52      Given the following "categories" exist:
  53        | name | category | idnumber |
  54        | Cat 1 | 0 | CAT1 |
  55        | Cat 2 | CAT1 | CAT2 |
  56  
  57      And I log in as "admin"
  58      And I go to the courses management page
  59      And I should see the "Course categories and courses" management page
  60      And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
  61      And I should not see "Cat 2" in the "#category-listing ul.ml" "css_element"
  62      And category in management listing should be visible "CAT1"
  63      And I click on category "Cat 1" in the management interface
  64      # Redirect.
  65      And I should see the "Course categories and courses" management page
  66      And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
  67      And I should see "Cat 2" in the "#category-listing ul.ml" "css_element"
  68      And category in management listing should be visible "CAT1"
  69      And category in management listing should be visible "CAT2"
  70      And I toggle visibility of category "CAT2" in management listing
  71      # Redirect.
  72      And I should see the "Course categories and courses" management page
  73      And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
  74      And I should see "Cat 2" in the "#category-listing ul.ml" "css_element"
  75      And category in management listing should be visible "CAT1"
  76      And category in management listing should be dimmed "CAT2"
  77      And I toggle visibility of category "CAT2" in management listing
  78      # Redirect.
  79      And I should see the "Course categories and courses" management page
  80      And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
  81      And I should see "Cat 2" in the "#category-listing ul.ml" "css_element"
  82      And category in management listing should be visible "CAT1"
  83      And category in management listing should be visible "CAT2"
  84  
  85    # Tests hiding and then showing a subcategory.
  86    @javascript
  87    Scenario: Test using AJAX to make a subcategory hidden and then visible again.
  88      Given the following "categories" exist:
  89        | name | category | idnumber |
  90        | Cat 1 | 0 | CAT1 |
  91        | Cat 2 | CAT1 | CAT2 |
  92  
  93      And I log in as "admin"
  94      And I go to the courses management page
  95      And I start watching to see if a new page loads
  96      And I should see the "Course categories and courses" management page
  97      And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
  98      And I should not see "Cat 2" in the "#category-listing ul.ml" "css_element"
  99      And category in management listing should be visible "CAT1"
 100      And I click to expand category "CAT1" in the management interface
 101      And a new page should not have loaded since I started watching
 102      And category in management listing should be visible "CAT1"
 103      And category in management listing should be visible "CAT2"
 104      And I toggle visibility of category "CAT2" in management listing
 105      And a new page should not have loaded since I started watching
 106      And category in management listing should be visible "CAT1"
 107      And category in management listing should be dimmed "CAT2"
 108      And I toggle visibility of category "CAT2" in management listing
 109      And a new page should not have loaded since I started watching
 110      And category in management listing should be visible "CAT1"
 111      And category in management listing should be visible "CAT2"
 112  
 113    # The test below this is identical except with JavaScript enabled.
 114    Scenario: Test relation between category and course when changing visibility.
 115      Given the following "categories" exist:
 116        | name | category | idnumber |
 117        | Cat 1 | 0 | CAT1 |
 118        | Cat 2 | 0 | CAT2 |
 119        | Cat 3 | CAT1 | CAT3 |
 120        | Cat 4 | CAT1 | CAT4 |
 121      And the following "courses" exist:
 122        | category | fullname | shortname | idnumber |
 123        | CAT1 | Course 1 | Course 1 | C1 |
 124        | CAT1 | Course 2 | Course 2 | C2 |
 125        | CAT1 | Course 3 | Course 3 | C3 |
 126  
 127      And I log in as "admin"
 128      And I go to the courses management page
 129      And I should see the "Course categories and courses" management page
 130      And I click on category "Cat 1" in the management interface
 131      # Redirect.
 132      And I should see the "Course categories and courses" management page
 133      And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
 134      And I should see "Cat 2" in the "#category-listing ul.ml" "css_element"
 135      And I should see "Cat 3" in the "#category-listing ul.ml" "css_element"
 136      And I should see "Cat 4" in the "#category-listing ul.ml" "css_element"
 137      And I should see "Course 1" in the "#course-listing ul.ml" "css_element"
 138      And I should see "Course 2" in the "#course-listing ul.ml" "css_element"
 139      And I should see "Course 3" in the "#course-listing ul.ml" "css_element"
 140      And category in management listing should be visible "CAT1"
 141      And category in management listing should be visible "CAT2"
 142      And category in management listing should be visible "CAT3"
 143      And category in management listing should be visible "CAT4"
 144      And course in management listing should be visible "C1"
 145      And course in management listing should be visible "C2"
 146      And course in management listing should be visible "C3"
 147      And I toggle visibility of course "C2" in management listing
 148      # Redirect.
 149      And I should see the "Course categories and courses" management page with a course selected
 150      And course in management listing should be visible "C1"
 151      And course in management listing should be dimmed "C2"
 152      And course in management listing should be visible "C3"
 153      And I toggle visibility of category "CAT3" in management listing
 154      # Redirect.
 155      And I should see the "Course categories and courses" management page
 156      And I click on "Cat 1" "link"
 157      # Redirect.
 158      And I should see the "Course categories and courses" management page
 159      And category in management listing should be visible "CAT1"
 160      And category in management listing should be visible "CAT2"
 161      And category in management listing should be dimmed "CAT3"
 162      And category in management listing should be visible "CAT4"
 163      And course in management listing should be visible "C1"
 164      And course in management listing should be dimmed "C2"
 165      And course in management listing should be visible "C3"
 166      And I toggle visibility of category "CAT1" in management listing
 167      # Redirect.
 168      And I should see the "Course categories and courses" management page
 169      And category in management listing should be dimmed "CAT1"
 170      And category in management listing should be visible "CAT2"
 171      And category in management listing should be dimmed "CAT3"
 172      And category in management listing should be dimmed "CAT4"
 173      And course in management listing should be dimmed "C1"
 174      And course in management listing should be dimmed "C2"
 175      And course in management listing should be dimmed "C3"
 176      And I toggle visibility of category "CAT1" in management listing
 177      # Redirect.
 178      And I should see the "Course categories and courses" management page
 179      And category in management listing should be visible "CAT1"
 180      And category in management listing should be visible "CAT2"
 181      And category in management listing should be dimmed "CAT3"
 182      And category in management listing should be visible "CAT4"
 183      And course in management listing should be visible "C1"
 184      And course in management listing should be dimmed "C2"
 185      And course in management listing should be visible "C3"
 186  
 187    # The test above this is identical except without JavaScript enabled.
 188    @javascript @_cross_browser
 189    Scenario: Test the relation between category and course when changing visibility with AJAX
 190      Given the following "categories" exist:
 191        | name | category | idnumber |
 192        | Cat 1 | 0 | CAT1 |
 193        | Cat 2 | 0 | CAT2 |
 194        | Cat 3 | CAT1 | CAT3 |
 195        | Cat 4 | CAT1 | CAT4 |
 196      And the following "courses" exist:
 197        | category | fullname | shortname | idnumber |
 198        | CAT1 | Course 1 | Course 1 | C1 |
 199        | CAT1 | Course 2 | Course 2 | C2 |
 200        | CAT1 | Course 3 | Course 3 | C3 |
 201  
 202      And I log in as "admin"
 203      And I go to the courses management page
 204      And I start watching to see if a new page loads
 205      And I should see the "Course categories and courses" management page
 206      And I click on category "Cat 1" in the management interface
 207      And a new page should have loaded since I started watching
 208      And I start watching to see if a new page loads
 209      And I should see the "Course categories and courses" management page
 210      And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
 211      And I should see "Cat 2" in the "#category-listing ul.ml" "css_element"
 212      And I should see "Cat 3" in the "#category-listing ul.ml" "css_element"
 213      And I should see "Cat 4" in the "#category-listing ul.ml" "css_element"
 214      And I should see "Course 1" in the "#course-listing ul.ml" "css_element"
 215      And I should see "Course 2" in the "#course-listing ul.ml" "css_element"
 216      And I should see "Course 3" in the "#course-listing ul.ml" "css_element"
 217      And category in management listing should be visible "CAT1"
 218      And category in management listing should be visible "CAT2"
 219      And category in management listing should be visible "CAT3"
 220      And category in management listing should be visible "CAT4"
 221      And course in management listing should be visible "C1"
 222      And course in management listing should be visible "C2"
 223      And course in management listing should be visible "C3"
 224      And I toggle visibility of course "C2" in management listing
 225      And a new page should not have loaded since I started watching
 226      And I should see "Cat 3" in the "#category-listing ul.ml" "css_element"
 227      And course in management listing should be visible "C1"
 228      And course in management listing should be dimmed "C2"
 229      And course in management listing should be visible "C3"
 230      And I toggle visibility of category "CAT3" in management listing
 231      And a new page should not have loaded since I started watching
 232      And category in management listing should be visible "CAT1"
 233      And category in management listing should be visible "CAT2"
 234      And category in management listing should be dimmed "CAT3"
 235      And category in management listing should be visible "CAT4"
 236      And course in management listing should be visible "C1"
 237      And course in management listing should be dimmed "C2"
 238      And course in management listing should be visible "C3"
 239      And I toggle visibility of category "CAT1" in management listing
 240      And a new page should not have loaded since I started watching
 241      And category in management listing should be dimmed "CAT1"
 242      And category in management listing should be visible "CAT2"
 243      And category in management listing should be dimmed "CAT3"
 244      And category in management listing should be dimmed "CAT4"
 245      And course in management listing should be dimmed "C1"
 246      And course in management listing should be dimmed "C2"
 247      And course in management listing should be dimmed "C3"
 248      And I toggle visibility of category "CAT1" in management listing
 249      And a new page should not have loaded since I started watching
 250      And category in management listing should be visible "CAT1"
 251      And category in management listing should be visible "CAT2"
 252      And category in management listing should be dimmed "CAT3"
 253      And category in management listing should be visible "CAT4"
 254      And course in management listing should be visible "C1"
 255      And course in management listing should be dimmed "C2"
 256      And course in management listing should be visible "C3"
 257  
 258      @javascript @_cross_browser
 259      Scenario: Test courses are hidden when selected category parent is hidden.
 260        Given the following "categories" exist:
 261          | name | category | idnumber |
 262          | Cat 1 | 0 | CAT1 |
 263          | Cat 2 | CAT1 | CAT2 |
 264          | Cat 3 | CAT2 | CAT3 |
 265        And the following "courses" exist:
 266          | category | fullname | shortname | idnumber |
 267          | CAT3 | Course 1 | Course 1 | C1 |
 268  
 269        And I log in as "admin"
 270        And I go to the courses management page
 271        And I start watching to see if a new page loads
 272        And I should see the "Course categories and courses" management page
 273        And I click on category "Cat 1" in the management interface
 274        And a new page should have loaded since I started watching
 275        And I start watching to see if a new page loads
 276        And I should see the "Course categories and courses" management page
 277        And I click on category "Cat 2" in the management interface
 278        And a new page should have loaded since I started watching
 279        And I start watching to see if a new page loads
 280        And I should see the "Course categories and courses" management page
 281        And I click on category "Cat 3" in the management interface
 282        And a new page should have loaded since I started watching
 283        And I start watching to see if a new page loads
 284        And I should see the "Course categories and courses" management page
 285        And category in management listing should be visible "CAT1"
 286        And category in management listing should be visible "CAT2"
 287        And category in management listing should be visible "CAT3"
 288        And course in management listing should be visible "C1"
 289        And I toggle visibility of category "CAT1" in management listing
 290        And a new page should not have loaded since I started watching
 291        And category in management listing should be dimmed "CAT1"
 292        And category in management listing should be dimmed "CAT2"
 293        And category in management listing should be dimmed "CAT3"
 294        And course in management listing should be dimmed "C1"
 295        And I toggle visibility of category "CAT1" in management listing
 296        And a new page should not have loaded since I started watching
 297        And category in management listing should be visible "CAT1"
 298        And category in management listing should be visible "CAT2"
 299        And category in management listing should be visible "CAT3"
 300        And course in management listing should be visible "C1"
 301        And I toggle visibility of course "C1" in management listing
 302        And a new page should not have loaded since I started watching
 303        And category in management listing should be visible "CAT1"
 304        And category in management listing should be visible "CAT2"
 305        And category in management listing should be visible "CAT3"
 306        And course in management listing should be dimmed "C1"
 307        And I toggle visibility of category "CAT1" in management listing
 308        And a new page should not have loaded since I started watching
 309        And category in management listing should be dimmed "CAT1"
 310        And category in management listing should be dimmed "CAT2"
 311        And category in management listing should be dimmed "CAT3"
 312        And course in management listing should be dimmed "C1"
 313        And I toggle visibility of category "CAT1" in management listing
 314        And a new page should not have loaded since I started watching
 315        And category in management listing should be visible "CAT1"
 316        And category in management listing should be visible "CAT2"
 317        And category in management listing should be visible "CAT3"
 318        And course in management listing should be dimmed "C1"


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1