[ Index ]

PHP Cross Reference of moodle-2.8

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


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1