[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

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

   1  @core @core_course
   2  Feature: Course category management interface performs as expected
   3    In order to test JS enhanced display of categories and subcategories.
   4    As a moodle admin
   5    I need to expand and collapse categories.
   6  
   7    @javascript
   8    Scenario: Test general look of management interface
   9      Given the following "categories" exist:
  10        | name | category | idnumber |
  11        | Cat 1 | 0 | CAT1 |
  12      And I log in as "admin"
  13      And I go to the courses management page
  14      And I should see "Course and category management" in the "h2" "css_element"
  15      And I should see "Course categories" in the ".view-mode-selector" "css_element"
  16      And I should see "Course categories" in the "h3" "css_element"
  17      And I should see the "Course categories and courses" management page
  18  
  19    @javascript
  20    Scenario: Test view mode functionality
  21      Given the following "categories" exist:
  22        | name | category | idnumber |
  23        | Cat 1 | 0 | CAT1 |
  24      And the following "courses" exist:
  25        | fullname | shortname | category | format |
  26        | Course 1 | C1 | CAT1 | topics |
  27  
  28      And I log in as "admin"
  29      And I go to the courses management page
  30      And I should see the "Course categories and courses" management page
  31      And I should see "Course categories" in the "#category-listing h3" "css_element"
  32      And I should see "Cat 1" in the "#category-listing" "css_element"
  33      And I should see "Course categories" in the ".view-mode-selector" "css_element"
  34      And I should not see "Course categories and courses" in the ".view-mode-selector .menu" "css_element"
  35      And I should not see "Course categories" in the ".view-mode-selector .menu" "css_element"
  36      And I should not see "Courses" in the ".view-mode-selector .menu" "css_element"
  37      When I click on "Course categories" "link" in the ".view-mode-selector" "css_element"
  38      And I start watching to see if a new page loads
  39      Then I should see "Course categories and courses" in the ".view-mode-selector .menu" "css_element"
  40      And I should see "Course categories" in the ".view-mode-selector .menu" "css_element"
  41      And I should see "Courses" in the ".view-mode-selector .menu" "css_element"
  42      And I click on "Course categories and courses" "link" in the ".view-mode-selector .menu" "css_element"
  43      And a new page should have loaded since I started watching
  44      And I start watching to see if a new page loads
  45      And I should see the "Course categories and courses" management page
  46      And I should see "Course categories" in the "#category-listing h3" "css_element"
  47      And I should see "Miscellaneous" in the "#course-listing h3" "css_element"
  48      And I should see "Cat 1" in the "#category-listing" "css_element"
  49      And I should see "No courses in this category" in the "#course-listing" "css_element"
  50      And I click on category "Cat 1" in the management interface
  51      And a new page should have loaded since I started watching
  52      And I start watching to see if a new page loads
  53      And I should see the "Course categories and courses" management page
  54      And I should see "Course categories" in the "#category-listing h3" "css_element"
  55      And I should see "Cat 1" in the "#course-listing h3" "css_element"
  56      And I should see "Cat 1" in the "#category-listing" "css_element"
  57      And I should see "Course 1" in the "#course-listing" "css_element"
  58      When I click on "Course categories" "link" in the ".view-mode-selector" "css_element"
  59      Then I should see "Courses" in the ".view-mode-selector .menu" "css_element"
  60      And I click on "Courses" "link" in the ".view-mode-selector .menu" "css_element"
  61      And a new page should have loaded since I started watching
  62      And I start watching to see if a new page loads
  63      And I should see the "Courses" management page
  64      And I should see "Cat 1" in the "#course-listing h3" "css_element"
  65      And I should see "Course 1" in the "#course-listing" "css_element"
  66      And I click on course "Course 1" in the management interface
  67      And a new page should have loaded since I started watching
  68      And I should see the "Courses" management page with a course selected
  69      And I should see "Cat 1" in the "#course-listing h3" "css_element"
  70      And I should see "Course 1" in the "#course-listing" "css_element"
  71      And I should see "Course 1" in the "#course-detail h3" "css_element"
  72      And I should see "C1" in the "#course-detail .shortname" "css_element"
  73      And I should see "Course 1" in the "#course-detail .fullname" "css_element"
  74      And I should see "Topics" in the "#course-detail .format" "css_element"
  75      And I should see "Cat 1" in the "#course-detail .category" "css_element"
  76  
  77    Scenario: Test displaying of sub categories
  78      Given the following "categories" exist:
  79        | name | category | idnumber |
  80        | Cat 1 | 0 | CAT1 |
  81        | Cat 2 | 0 | CAT2 |
  82        | Cat 1-1 | CAT1 | CAT3 |
  83        | Cat 1-2 | CAT1 | CAT4 |
  84        | Cat 1-1-1 | CAT3 | CAT5 |
  85        | Cat 1-1-2 | CAT3 | CAT6 |
  86        | Cat 2-1 | CAT2 | CAT7 |
  87        | Cat 2-1-1 | CAT7 | CAT8 |
  88      And the following "courses" exist:
  89        | fullname | shortname | category |
  90        | Course 1 | C1 | CAT1 |
  91        | Course 2 | C2 | CAT1 |
  92        | Course 3 | C3 | CAT3 |
  93        | Course 4 | C4 | CAT3 |
  94        | Course 5 | C5 | CAT5 |
  95        | Course 6 | C6 | CAT5 |
  96        | Course 7 | C7 | CAT8 |
  97        | Course 8 | C8 | CAT8 |
  98  
  99      And I log in as "admin"
 100      And I go to the courses management page
 101      And I should see the "Course categories and courses" management page
 102      And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
 103      And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
 104      And I should not see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
 105      And I should not see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
 106      And I should not see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element"
 107      And I should not see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element"
 108      And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
 109      And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
 110      And I click on "Cat 1" "link"
 111      # Redirect.
 112      And I should see the "Course categories and courses" management page
 113      And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
 114      And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
 115      And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
 116      And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
 117      And I should not see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element"
 118      And I should not see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element"
 119      And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
 120      And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
 121      And I click on "Cat 1-1" "link"
 122      # Redirect.
 123      And I should see the "Course categories and courses" management page
 124      And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
 125      And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
 126      And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
 127      And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
 128      And I should see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element"
 129      And I should see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element"
 130      And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
 131      And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
 132      And I click on "Cat 2" "link"
 133      # Redirect.
 134      And I should see the "Course categories and courses" management page
 135      And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
 136      And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
 137      And I should not see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
 138      And I should not see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
 139      And I should not see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element"
 140      And I should not see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element"
 141      And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
 142      And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
 143  
 144    # This is similar to the above scenario except here we are going to use AJAX
 145    # to load the categories.
 146    @javascript @_cross_browser
 147    Scenario: Test AJAX loading of sub categories
 148      Given the following "categories" exist:
 149        | name | category | idnumber |
 150        | Cat 1 | 0 | CAT1 |
 151        | Cat 2 | 0 | CAT2 |
 152        | Cat 1-1 | CAT1 | CAT3 |
 153        | Cat 1-2 | CAT1 | CAT4 |
 154        | Cat 1-1-1 | CAT3 | CAT5 |
 155        | Cat 1-1-2 | CAT3 | CAT6 |
 156        | Cat 2-1 | CAT2 | CAT7 |
 157        | Cat 2-1-1 | CAT7 | CAT8 |
 158      And the following "courses" exist:
 159        | fullname | shortname | category |
 160        | Course 1 | C1 | CAT1 |
 161        | Course 2 | C2 | CAT1 |
 162        | Course 3 | C3 | CAT3 |
 163        | Course 4 | C4 | CAT3 |
 164        | Course 5 | C5 | CAT5 |
 165        | Course 6 | C6 | CAT5 |
 166        | Course 7 | C7 | CAT8 |
 167        | Course 8 | C8 | CAT8 |
 168  
 169      And I log in as "admin"
 170      And I go to the courses management page
 171      And I start watching to see if a new page loads
 172      And I should see the "Course categories and courses" management page
 173      And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
 174      And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
 175      And I should not see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
 176      And I should not see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
 177      And I should not see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element"
 178      And I should not see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element"
 179      And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
 180      And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
 181      And I click to expand category "CAT1" in the management interface
 182      And a new page should not have loaded since I started watching
 183      And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
 184      And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
 185      And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
 186      And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
 187      And I should not see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element"
 188      And I should not see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element"
 189      And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
 190      And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
 191      And I click to expand category "CAT3" in the management interface
 192      And a new page should not have loaded since I started watching
 193      And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
 194      And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
 195      And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
 196      And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
 197      And I should see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element"
 198      And I should see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element"
 199      And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
 200      And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
 201      And I click to expand category "CAT2" in the management interface
 202      And a new page should not have loaded since I started watching
 203      And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
 204      And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
 205      And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
 206      And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
 207      And I should see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element"
 208      And I should see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element"
 209      And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
 210      And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
 211      And I click to expand category "CAT7" in the management interface
 212      And a new page should not have loaded since I started watching
 213      And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
 214      And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
 215      And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
 216      And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
 217      And I should see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element"
 218      And I should see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element"
 219      And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
 220      And I should see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
 221      And I click to expand category "CAT1" in the management interface
 222      And a new page should not have loaded since I started watching
 223      And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
 224      And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
 225      And I should not see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
 226      And I should not see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
 227      And I should not see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element"
 228      And I should not see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element"
 229      And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
 230      And I should see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
 231      And I click to expand category "CAT1" in the management interface
 232      And a new page should not have loaded since I started watching
 233      And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
 234      And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
 235      And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
 236      And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
 237      And I should see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element"
 238      And I should see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element"
 239      And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
 240      And I should see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
 241  
 242    @javascript
 243    Scenario Outline: Top level categories are displayed correctly when resorted
 244      Given the following "categories" exist:
 245        | category | name | idnumber | sortorder |
 246        | 0 | Social studies | Ext003 | 1 |
 247        | 0 | Applied sciences | Sci001 | 2 |
 248        | 0 | Extended social studies | Ext002 | 3 |
 249  
 250      And I log in as "admin"
 251      And I go to the courses management page
 252      And I start watching to see if a new page loads
 253      And I should see the "Course categories and courses" management page
 254      And I set the field "menuselectsortby" to "All categories"
 255      And I set the field "menuresortcategoriesby" to <sortby>
 256      And I press "Sort"
 257      And a new page should have loaded since I started watching
 258      And I should see the "Course categories and courses" management page
 259      And I should see category listing <cat1> before <cat2>
 260      And I should see category listing <cat2> before <cat3>
 261  
 262    Examples:
 263      | sortby | cat1 | cat2 | cat3 |
 264      | "Sort by Category name ascending"       | "Applied sciences"        | "Extended social studies" | "Social studies" |
 265      | "Sort by Category name descending"      | "Social studies"          | "Extended social studies" | "Applied sciences" |
 266      | "Sort by Category ID number ascending"  | "Extended social studies" | "Social studies"          | "Applied sciences" |
 267      | "Sort by Category ID number descending" | "Applied sciences"        | "Social studies"          | "Extended social studies" |
 268  
 269    @javascript
 270    Scenario Outline: Sub categories are displayed correctly when resorted
 271      Given the following "categories" exist:
 272        | category | name | idnumber | sortorder |
 273        | 0 | Master cat  | CAT1 | 1 |
 274        | CAT1 | Social studies | Ext003 | 1 |
 275        | CAT1 | Applied sciences | Sci001 | 2 |
 276        | CAT1 | Extended social studies | Ext002 | 3 |
 277  
 278      And I log in as "admin"
 279      And I go to the courses management page
 280      And I start watching to see if a new page loads
 281      And I should see the "Course categories and courses" management page
 282      And I click on "Master cat" category in the management category listing
 283      And a new page should have loaded since I started watching
 284      And I start watching to see if a new page loads
 285      And I should see the "Course categories and courses" management page
 286      And I click on <sortby> action for "Master cat" in management category listing
 287      And a new page should have loaded since I started watching
 288      And I should see the "Course categories and courses" management page
 289      And I should see category listing <cat1> before <cat2>
 290      And I should see category listing <cat2> before <cat3>
 291  
 292    Examples:
 293      | sortby | cat1 | cat2 | cat3 |
 294      | "resortbyname"         | "Applied sciences"        | "Extended social studies" | "Social studies" |
 295      | "resortbynamedesc"     | "Social studies"          | "Extended social studies" | "Applied sciences" |
 296      | "resortbyidnumber"     | "Extended social studies" | "Social studies"          | "Applied sciences" |
 297      | "resortbyidnumberdesc" | "Applied sciences"        | "Social studies"          | "Extended social studies" |
 298  
 299    @javascript
 300    Scenario Outline: Test courses are displayed correctly after being resorted.
 301      Given the following "categories" exist:
 302        | name | category 0| idnumber |
 303        | Cat 1 | 0 | CAT1 |
 304      And the following "courses" exist:
 305        | category | fullname | shortname | idnumber | sortorder | timecreated |
 306        | CAT1 | Social studies | Senior school | Ext003 | 1 | 1000000001 |
 307        | CAT1 | Applied sciences  | Middle school | Sci001 | 2 | 1000000002 |
 308        | CAT1 | Extended social studies  | Junior school | Ext002 | 3 | 1000000003 |
 309  
 310      And I log in as "admin"
 311      And I go to the courses management page
 312      And I start watching to see if a new page loads
 313      And I should see the "Course categories and courses" management page
 314      And I click on "Cat 1" "link"
 315      And a new page should have loaded since I started watching
 316      And I start watching to see if a new page loads
 317      And I should see the "Course categories and courses" management page
 318      And I click on "Sort courses" "link"
 319      And I should see "Sort by Course full name ascending" in the ".course-listing-actions" "css_element"
 320      And I should see "Sort by Course full name descending" in the ".course-listing-actions" "css_element"
 321      And I should see "Sort by Course short name ascending" in the ".course-listing-actions" "css_element"
 322      And I should see "Sort by Course short name descending" in the ".course-listing-actions" "css_element"
 323      And I should see "Sort by Course ID number ascending" in the ".course-listing-actions" "css_element"
 324      And I should see "Sort by Course ID number descending" in the ".course-listing-actions" "css_element"
 325      And I should see "Sort by Course time created ascending" in the ".course-listing-actions" "css_element"
 326      And I should see "Sort by Course time created descending" in the ".course-listing-actions" "css_element"
 327      And I click on <sortby> "link" in the ".course-listing-actions" "css_element"
 328      And a new page should have loaded since I started watching
 329      And I should see the "Course categories and courses" management page
 330      And I should see course listing <course1> before <course2>
 331      And I should see course listing <course2> before <course3>
 332  
 333    Examples:
 334      | sortby | course1 | course2 | course3 |
 335      | "Sort by Course full name ascending"     | "Applied sciences"        | "Extended social studies" | "Social studies" |
 336      | "Sort by Course full name descending"    | "Social studies"          | "Extended social studies" | "Applied sciences" |
 337      | "Sort by Course short name ascending"    | "Extended social studies" | "Applied sciences"        | "Social studies" |
 338      | "Sort by Course short name descending"   | "Social studies"          | "Applied sciences"        | "Extended social studies" |
 339      | "Sort by Course ID number ascending"     | "Extended social studies" | "Social studies"          | "Applied sciences" |
 340      | "Sort by Course ID number descending"    | "Applied sciences"        | "Social studies"          | "Extended social studies" |
 341      | "Sort by Course time created ascending"  | "Social studies"          | "Applied sciences"        | "Extended social studies" |
 342      | "Sort by Course time created descending" | "Extended social studies" | "Applied sciences"        | "Social studies" |
 343  
 344    @javascript
 345    Scenario: Test course pagination
 346      Given the following "categories" exist:
 347        | name | category | idnumber |
 348        | Cat 1 | 0 | CAT1 |
 349      And the following "courses" exist:
 350        | category | fullname | shortname | idnumber |
 351        | CAT1 | Course 1 | Course 1 | C1 |
 352        | CAT1 | Course 2 | Course 2 | C2 |
 353        | CAT1 | Course 3 | Course 3 | C3 |
 354        | CAT1 | Course 4 | Course 4 | C4 |
 355        | CAT1 | Course 5 | Course 5 | C5 |
 356        | CAT1 | Course 6 | Course 6 | C6 |
 357        | CAT1 | Course 7 | Course 7 | C7 |
 358        | CAT1 | Course 8 | Course 8 | C8 |
 359        | CAT1 | Course 9 | Course 9 | C9 |
 360        | CAT1 | Course 10 | Course 10 | C10 |
 361        | CAT1 | Course 11 | Course 11 | C11 |
 362        | CAT1 | Course 12 | Course 12 | C12 |
 363  
 364      And I log in as "admin"
 365      And I go to the courses management page
 366      And I start watching to see if a new page loads
 367      And I should see the "Course categories and courses" management page
 368      And I click on "Cat 1" "link"
 369      And a new page should have loaded since I started watching
 370      And I start watching to see if a new page loads
 371      And I should see the "Course categories and courses" management page
 372      And I click on "Sort courses" "link"
 373      And I click on "Sort by Course ID number ascending" "link" in the ".course-listing-actions" "css_element"
 374      And a new page should have loaded since I started watching
 375      And I start watching to see if a new page loads
 376      And I should see "Per page: 20" in the ".course-listing-actions" "css_element"
 377      And I should see course listing "Course 1" before "Course 2"
 378      And I should see course listing "Course 2" before "Course 3"
 379      And I should see course listing "Course 3" before "Course 4"
 380      And I should see course listing "Course 4" before "Course 5"
 381      And I should see course listing "Course 5" before "Course 6"
 382      And I should see course listing "Course 6" before "Course 7"
 383      And I should see course listing "Course 7" before "Course 8"
 384      And I should see course listing "Course 8" before "Course 9"
 385      And I should see course listing "Course 9" before "Course 10"
 386      And I should see course listing "Course 10" before "Course 11"
 387      And I should see course listing "Course 11" before "Course 12"
 388      And "#course-listing .listing-pagination" "css_element" should not exist
 389      And I click on "Per page: 20" "link" in the ".course-listing-actions" "css_element"
 390      And I should see "5" in the ".courses-per-page" "css_element"
 391      And I should see "10" in the ".courses-per-page" "css_element"
 392      And I should see "20" in the ".courses-per-page" "css_element"
 393      And I should see "All" in the ".courses-per-page" "css_element"
 394      And I click on "5" "link" in the ".courses-per-page" "css_element"
 395      And a new page should have loaded since I started watching
 396      And I start watching to see if a new page loads
 397      And I should see the "Course categories and courses" management page
 398      And I should see "Per page: 5" in the ".course-listing-actions" "css_element"
 399      And I should see course listing "Course 1" before "Course 2"
 400      And I should see course listing "Course 2" before "Course 3"
 401      And I should see course listing "Course 3" before "Course 4"
 402      And I should see course listing "Course 4" before "Course 5"
 403      And I should not see "Course 6"
 404      And I should not see "Course 7"
 405      And I should not see "Course 8"
 406      And I should not see "Course 9"
 407      And I should not see "Course 10"
 408      And I should not see "Course 11"
 409      And I should not see "Course 12"
 410      And "#course-listing .listing-pagination" "css_element" should exist
 411      And I should see "Showing courses 1 to 5 of 12 courses"
 412      And I should not see "First" in the "#course-listing .listing-pagination" "css_element"
 413      And I should not see "Prev" in the "#course-listing .listing-pagination" "css_element"
 414      And I should see "1" in the "#course-listing .listing-pagination" "css_element"
 415      And I should see "2" in the "#course-listing .listing-pagination" "css_element"
 416      And I should see "3" in the "#course-listing .listing-pagination" "css_element"
 417      And I should see "Next" in the "#course-listing .listing-pagination" "css_element"
 418      And I should see "Last" in the "#course-listing .listing-pagination" "css_element"
 419      And I click on "2" "link" in the "#course-listing .listing-pagination" "css_element"
 420      And a new page should have loaded since I started watching
 421      And I start watching to see if a new page loads
 422      And I should see the "Course categories and courses" management page
 423      And I should see "Per page: 5" in the ".course-listing-actions" "css_element"
 424      And I should see "Course 10" in the "#course-listing" "css_element"
 425      And I should not see "Course 2" in the "#course-listing" "css_element"
 426      And I should not see "Course 3" in the "#course-listing" "css_element"
 427      And I should not see "Course 4" in the "#course-listing" "css_element"
 428      And I should not see "Course 5" in the "#course-listing" "css_element"
 429      And I should see course listing "Course 6" before "Course 7"
 430      And I should see course listing "Course 7" before "Course 8"
 431      And I should see course listing "Course 8" before "Course 9"
 432      And I should see course listing "Course 9" before "Course 10"
 433      And I should not see "Course 11"
 434      And I should not see "Course 12"
 435      And "#course-listing .listing-pagination" "css_element" should exist
 436      And I should see "Showing courses 6 to 10 of 12 courses"
 437      And I should see "First" in the "#course-listing .listing-pagination" "css_element"
 438      And I should see "Prev" in the "#course-listing .listing-pagination" "css_element"
 439      And I should see "1" in the "#course-listing .listing-pagination" "css_element"
 440      And I should see "2" in the "#course-listing .listing-pagination" "css_element"
 441      And I should see "3" in the "#course-listing .listing-pagination" "css_element"
 442      And I should see "Next" in the "#course-listing .listing-pagination" "css_element"
 443      And I should see "Last" in the "#course-listing .listing-pagination" "css_element"
 444      And I click on "Next" "link" in the "#course-listing .listing-pagination" "css_element"
 445      And a new page should have loaded since I started watching
 446      And I start watching to see if a new page loads
 447      And I should see the "Course categories and courses" management page
 448      And I should see "Per page: 5" in the ".course-listing-actions" "css_element"
 449      And I should see "Course 11"
 450      And I should not see "Course 2" in the "#course-listing" "css_element"
 451      And I should not see "Course 3" in the "#course-listing" "css_element"
 452      And I should not see "Course 4" in the "#course-listing" "css_element"
 453      And I should not see "Course 5" in the "#course-listing" "css_element"
 454      And I should not see "Course 6" in the "#course-listing" "css_element"
 455      And I should not see "Course 7" in the "#course-listing" "css_element"
 456      And I should not see "Course 8" in the "#course-listing" "css_element"
 457      And I should not see "Course 9" in the "#course-listing" "css_element"
 458      And I should not see "Course 10" in the "#course-listing" "css_element"
 459      And I should see course listing "Course 11" before "Course 12"
 460      And "#course-listing .listing-pagination" "css_element" should exist
 461      And I should see "Showing courses 11 to 12 of 12 courses"
 462      And I should see "First" in the "#course-listing .listing-pagination" "css_element"
 463      And I should see "Prev" in the "#course-listing .listing-pagination" "css_element"
 464      And I should see "1" in the "#course-listing .listing-pagination" "css_element"
 465      And I should see "2" in the "#course-listing .listing-pagination" "css_element"
 466      And I should see "3" in the "#course-listing .listing-pagination" "css_element"
 467      And I should not see "Next" in the "#course-listing .listing-pagination" "css_element"
 468      And I should not see "Last" in the "#course-listing .listing-pagination" "css_element"
 469      And I click on "First" "link" in the "#course-listing .listing-pagination" "css_element"
 470      And a new page should have loaded since I started watching
 471      And I start watching to see if a new page loads
 472      And I should see the "Course categories and courses" management page
 473      And I should see "Per page: 5" in the ".course-listing-actions" "css_element"
 474      And I should see course listing "Course 1" before "Course 2"
 475      And I should see course listing "Course 2" before "Course 3"
 476      And I should see course listing "Course 3" before "Course 4"
 477      And I should see course listing "Course 4" before "Course 5"
 478      And I should not see "Course 6" in the "#course-listing" "css_element"
 479      And I should not see "Course 7" in the "#course-listing" "css_element"
 480      And I should not see "Course 8" in the "#course-listing" "css_element"
 481      And I should not see "Course 9" in the "#course-listing" "css_element"
 482      And I should not see "Course 10" in the "#course-listing" "css_element"
 483      And I should not see "Course 11" in the "#course-listing" "css_element"
 484      And I should not see "Course 12" in the "#course-listing" "css_element"
 485      And "#course-listing .listing-pagination" "css_element" should exist
 486      And I should see "Showing courses 1 to 5 of 12 courses"
 487      And I should not see "First" in the "#course-listing .listing-pagination" "css_element"
 488      And I should not see "Prev" in the "#course-listing .listing-pagination" "css_element"
 489      And I should see "1" in the "#course-listing .listing-pagination" "css_element"
 490      And I should see "2" in the "#course-listing .listing-pagination" "css_element"
 491      And I should see "3" in the "#course-listing .listing-pagination" "css_element"
 492      And I should see "Next" in the "#course-listing .listing-pagination" "css_element"
 493      And I should see "Last" in the "#course-listing .listing-pagination" "css_element"
 494      And I click on "Last" "link" in the "#course-listing .listing-pagination" "css_element"
 495      And a new page should have loaded since I started watching
 496      And I start watching to see if a new page loads
 497      And I should see the "Course categories and courses" management page
 498      And I should see "Per page: 5" in the ".course-listing-actions" "css_element"
 499      And I should see "Course 11" in the "#course-listing" "css_element"
 500      And I should not see "Course 2" in the "#course-listing" "css_element"
 501      And I should not see "Course 3" in the "#course-listing" "css_element"
 502      And I should not see "Course 4" in the "#course-listing" "css_element"
 503      And I should not see "Course 5" in the "#course-listing" "css_element"
 504      And I should not see "Course 6" in the "#course-listing" "css_element"
 505      And I should not see "Course 7" in the "#course-listing" "css_element"
 506      And I should not see "Course 8" in the "#course-listing" "css_element"
 507      And I should not see "Course 9" in the "#course-listing" "css_element"
 508      And I should not see "Course 10" in the "#course-listing" "css_element"
 509      And I should see course listing "Course 11" before "Course 12"
 510      And "#course-listing .listing-pagination" "css_element" should exist
 511      And I should see "Showing courses 11 to 12 of 12 courses"
 512      And I should see "First" in the "#course-listing .listing-pagination" "css_element"
 513      And I should see "Prev" in the "#course-listing .listing-pagination" "css_element"
 514      And I should see "1" in the "#course-listing .listing-pagination" "css_element"
 515      And I should see "2" in the "#course-listing .listing-pagination" "css_element"
 516      And I should see "3" in the "#course-listing .listing-pagination" "css_element"
 517      And I should not see "Next" in the "#course-listing .listing-pagination" "css_element"
 518      And I should not see "Last" in the "#course-listing .listing-pagination" "css_element"
 519      And I click on "Prev" "link" in the "#course-listing .listing-pagination" "css_element"
 520      And a new page should have loaded since I started watching
 521      And I should see the "Course categories and courses" management page
 522      And I should see "Per page: 5" in the ".course-listing-actions" "css_element"
 523      And I should see "Course 10" in the "#course-listing" "css_element"
 524      And I should not see "Course 2" in the "#course-listing" "css_element"
 525      And I should not see "Course 3" in the "#course-listing" "css_element"
 526      And I should not see "Course 4" in the "#course-listing" "css_element"
 527      And I should not see "Course 5" in the "#course-listing" "css_element"
 528      And I should see course listing "Course 6" before "Course 7"
 529      And I should see course listing "Course 7" before "Course 8"
 530      And I should see course listing "Course 8" before "Course 9"
 531      And I should see course listing "Course 9" before "Course 10"
 532      And I should not see "Course 11"
 533      And I should not see "Course 12"
 534      And "#course-listing .listing-pagination" "css_element" should exist
 535      And I should see "Showing courses 6 to 10 of 12 courses"
 536      And I should see "First" in the "#course-listing .listing-pagination" "css_element"
 537      And I should see "Prev" in the "#course-listing .listing-pagination" "css_element"
 538      And I should see "1" in the "#course-listing .listing-pagination" "css_element"
 539      And I should see "2" in the "#course-listing .listing-pagination" "css_element"
 540      And I should see "3" in the "#course-listing .listing-pagination" "css_element"
 541      And I should see "Next" in the "#course-listing .listing-pagination" "css_element"
 542      And I should see "Last" in the "#course-listing .listing-pagination" "css_element"
 543  
 544    Scenario: Test pagination is only shown when required
 545      Given the following "categories" exist:
 546        | name | category | idnumber |
 547        | Cat 1 | 0 | CAT1 |
 548      And the following "courses" exist:
 549        | category | fullname | shortname | idnumber |
 550        | CAT1 | Course 1 | Course 1 | C1 |
 551        | CAT1 | Course 2 | Course 2 | C2 |
 552        | CAT1 | Course 3 | Course 3 | C3 |
 553        | CAT1 | Course 4 | Course 4 | C4 |
 554        | CAT1 | Course 5 | Course 5 | C5 |
 555      And I log in as "admin"
 556      And I go to the courses management page
 557      And I should see the "Course categories and courses" management page
 558      And I click on "Cat 1" "link"
 559      # Redirect.
 560      And I should see the "Course categories and courses" management page
 561      And I click on "Sort courses" "link"
 562      And I click on "Sort by Course ID number ascending" "link" in the ".course-listing-actions" "css_element"
 563      # Redirect.
 564      And I should see "Per page: 20" in the ".course-listing-actions" "css_element"
 565      And I should see course listing "Course 1" before "Course 2"
 566      And I should see course listing "Course 2" before "Course 3"
 567      And I should see course listing "Course 3" before "Course 4"
 568      And I should see course listing "Course 4" before "Course 5"
 569      And "#course-listing .listing-pagination" "css_element" should not exist
 570      And I click on "5" "link" in the ".course-listing-actions" "css_element"
 571      # Redirect
 572      And I should see "Per page: 5" in the ".course-listing-actions" "css_element"
 573      And I should see course listing "Course 1" before "Course 2"
 574      And I should see course listing "Course 2" before "Course 3"
 575      And I should see course listing "Course 3" before "Course 4"
 576      And I should see course listing "Course 4" before "Course 5"
 577      And "#course-listing .listing-pagination" "css_element" should not exist
 578  
 579    # We need at least 30 courses for this next test.
 580    @javascript
 581    Scenario: Test many course pagination
 582      Given the following "categories" exist:
 583        | name | category 0| idnumber |
 584        | Cat 1 | 0 | CAT1 |
 585      And the following "courses" exist:
 586        | category | fullname | shortname | idnumber |
 587        | CAT1 | Course 1 | Course 1 | C1 |
 588        | CAT1 | Course 2 | Course 2 | C2 |
 589        | CAT1 | Course 3 | Course 3 | C3 |
 590        | CAT1 | Course 4 | Course 4 | C4 |
 591        | CAT1 | Course 5 | Course 5 | C5 |
 592        | CAT1 | Course 6 | Course 6 | C6 |
 593        | CAT1 | Course 7 | Course 7 | C7 |
 594        | CAT1 | Course 8 | Course 8 | C8 |
 595        | CAT1 | Course 9 | Course 9 | C9 |
 596        | CAT1 | Course 10 | Course 10 | C10 |
 597        | CAT1 | Course 11 | Course 11 | C11 |
 598        | CAT1 | Course 12 | Course 12 | C12 |
 599        | CAT1 | Course 13 | Course 13 | C13 |
 600        | CAT1 | Course 14 | Course 14 | C14 |
 601        | CAT1 | Course 15 | Course 15 | C15 |
 602        | CAT1 | Course 16 | Course 16 | C16 |
 603        | CAT1 | Course 17 | Course 17 | C17 |
 604        | CAT1 | Course 18 | Course 18 | C18 |
 605        | CAT1 | Course 19 | Course 19 | C19 |
 606        | CAT1 | Course 20 | Course 20 | C20 |
 607        | CAT1 | Course 21 | Course 21 | C21 |
 608        | CAT1 | Course 22 | Course 22 | C22 |
 609        | CAT1 | Course 23 | Course 23 | C23 |
 610        | CAT1 | Course 24 | Course 24 | C24 |
 611        | CAT1 | Course 25 | Course 25 | C25 |
 612        | CAT1 | Course 26 | Course 26 | C26 |
 613        | CAT1 | Course 27 | Course 27 | C27 |
 614        | CAT1 | Course 28 | Course 28 | C28 |
 615        | CAT1 | Course 29 | Course 29 | C29 |
 616        | CAT1 | Course 30 | Course 30 | C30 |
 617        | CAT1 | Course 31 | Course 31 | C31 |
 618        | CAT1 | Course 32 | Course 32 | C32 |
 619  
 620      And I log in as "admin"
 621      And I go to the courses management page
 622      And I start watching to see if a new page loads
 623      And I should see the "Course categories and courses" management page
 624      And I click on "Cat 1" "link"
 625      And a new page should have loaded since I started watching
 626      And I start watching to see if a new page loads
 627      And I should see the "Course categories and courses" management page
 628      And I click on "Sort courses" "link"
 629      And I click on "Sort by Course ID number ascending" "link" in the ".course-listing-actions" "css_element"
 630      And a new page should have loaded since I started watching
 631      And I start watching to see if a new page loads
 632      And I should see the "Course categories and courses" management page
 633      And I should see "Per page: 20" in the ".course-listing-actions" "css_element"
 634      And I should see course listing "Course 1" before "Course 2"
 635      And I should see course listing "Course 19" before "Course 20"
 636      And I should not see "Course 21"
 637      And I should see "Showing courses 1 to 20 of 32 courses"
 638      And I click on "Per page: 20" "link" in the ".course-listing-actions" "css_element"
 639      And I click on "100" "link" in the ".courses-per-page" "css_element"
 640      And a new page should have loaded since I started watching
 641      And I start watching to see if a new page loads
 642      And I should see the "Course categories and courses" management page
 643      And I should see "Per page: 100" in the ".course-listing-actions" "css_element"
 644      And I should see course listing "Course 1" before "Course 2"
 645      And I should see course listing "Course 19" before "Course 20"
 646      And I should see course listing "Course 21" before "Course 22"
 647      And I should see course listing "Course 31" before "Course 32"
 648      And "#course-listing .listing-pagination" "css_element" should not exist
 649      And I click on "Per page: 100" "link" in the ".course-listing-actions" "css_element"
 650      And I click on "5" "link" in the ".courses-per-page" "css_element"
 651      And a new page should have loaded since I started watching
 652      And I start watching to see if a new page loads
 653      And I should see the "Course categories and courses" management page
 654      And I should see "Per page: 5" in the ".course-listing-actions" "css_element"
 655      And I should see course listing "Course 1" before "Course 2"
 656      And I should see course listing "Course 4" before "Course 5"
 657      And I should not see "Course 6"
 658      And I should see "Showing courses 1 to 5 of 32 courses"
 659      And I should not see "First" in the "#course-listing .listing-pagination" "css_element"
 660      And I should not see "Prev" in the "#course-listing .listing-pagination" "css_element"
 661      And I should see "1" in the "#course-listing .listing-pagination" "css_element"
 662      And I should see "2" in the "#course-listing .listing-pagination" "css_element"
 663      And I should see "3" in the "#course-listing .listing-pagination" "css_element"
 664      And I should see "4" in the "#course-listing .listing-pagination" "css_element"
 665      And I should see "5" in the "#course-listing .listing-pagination" "css_element"
 666      And I should not see "6" in the "#course-listing .listing-pagination" "css_element"
 667      And I should not see "7" in the "#course-listing .listing-pagination" "css_element"
 668      And I should see "Next" in the "#course-listing .listing-pagination" "css_element"
 669      And I should see "Last" in the "#course-listing .listing-pagination" "css_element"
 670      And I click on "Last" "link" in the "#course-listing .listing-pagination" "css_element"
 671      And a new page should have loaded since I started watching
 672      And I start watching to see if a new page loads
 673      And I should see the "Course categories and courses" management page
 674      And I should see "Per page: 5" in the ".course-listing-actions" "css_element"
 675      And I should not see "Course 30"
 676      And I should see course listing "Course 31" before "Course 32"
 677      And I should see "Showing courses 31 to 32 of 32 courses"
 678      And I should see "First" in the "#course-listing .listing-pagination" "css_element"
 679      And I should see "Prev" in the "#course-listing .listing-pagination" "css_element"
 680      And I should not see "1" in the "#course-listing .listing-pagination" "css_element"
 681      And I should not see "2" in the "#course-listing .listing-pagination" "css_element"
 682      And I should see "3" in the "#course-listing .listing-pagination" "css_element"
 683      And I should see "4" in the "#course-listing .listing-pagination" "css_element"
 684      And I should see "5" in the "#course-listing .listing-pagination" "css_element"
 685      And I should see "6" in the "#course-listing .listing-pagination" "css_element"
 686      And I should see "7" in the "#course-listing .listing-pagination" "css_element"
 687      And I should not see "Next" in the "#course-listing .listing-pagination" "css_element"
 688      And I should not see "Last" in the "#course-listing .listing-pagination" "css_element"
 689      And I click on "4" "link" in the "#course-listing .listing-pagination" "css_element"
 690      And a new page should have loaded since I started watching
 691      And I should see the "Course categories and courses" management page
 692      And I should see "Per page: 5" in the ".course-listing-actions" "css_element"
 693      And I should not see "Course 15"
 694      And I should see course listing "Course 16" before "Course 17"
 695      And I should see course listing "Course 17" before "Course 18"
 696      And I should see course listing "Course 18" before "Course 19"
 697      And I should see course listing "Course 19" before "Course 20"
 698      And I should not see "Course 21"
 699      And I should see "Showing courses 16 to 20 of 32 courses"
 700      And I should see "First" in the "#course-listing .listing-pagination" "css_element"
 701      And I should see "Prev" in the "#course-listing .listing-pagination" "css_element"
 702      And I should not see "1" in the "#course-listing .listing-pagination" "css_element"
 703      And I should see "2" in the "#course-listing .listing-pagination" "css_element"
 704      And I should see "3" in the "#course-listing .listing-pagination" "css_element"
 705      And I should see "4" in the "#course-listing .listing-pagination" "css_element"
 706      And I should see "5" in the "#course-listing .listing-pagination" "css_element"
 707      And I should see "6" in the "#course-listing .listing-pagination" "css_element"
 708      And I should not see "7" in the "#course-listing .listing-pagination" "css_element"
 709      And I should see "Next" in the "#course-listing .listing-pagination" "css_element"
 710      And I should see "Last" in the "#course-listing .listing-pagination" "css_element"
 711  
 712    Scenario: Test clicking to edit a course.
 713      Given the following "categories" exist:
 714        | name | category | idnumber |
 715        | Cat 1 | 0 | CAT1 |
 716      And the following "courses" exist:
 717        | category | fullname | shortname | idnumber |
 718        | CAT1 | Course 1 | Course 1 | C1 |
 719  
 720      And I log in as "admin"
 721      And I go to the courses management page
 722      And I should see the "Course categories and courses" management page
 723      And I click on category "Cat 1" in the management interface
 724      And I click on "edit" action for "Course 1" in management course listing
 725      # Redirect
 726      And I should see "Edit course settings"
 727      And I should see "Course 1"
 728  
 729    @javascript
 730    Scenario: Test AJAX expanded categories stay open.
 731      Given the following "categories" exist:
 732        | name | category | idnumber |
 733        | Cat 1 | 0 | CAT1 |
 734        | Cat 2 | 0 | CAT2 |
 735        | Cat 1-1 | CAT1 | CAT3 |
 736        | Cat 1-2 | CAT1 | CAT4 |
 737        | Cat 1-1-1 | CAT3 | CAT5 |
 738        | Cat 1-1-2 | CAT3 | CAT6 |
 739        | Cat 2-1 | CAT2 | CAT7 |
 740        | Cat 2-1-1 | CAT7 | CAT8 |
 741        | Cat 2-1-1-1 | CAT8 | CAT10 |
 742        | Cat 2-1-2 | CAT7 | CAT9 |
 743        | Cat 2-1-2-1 | CAT9 | CAT11 |
 744  
 745      And I log in as "admin"
 746      And I go to the courses management page
 747      And I start watching to see if a new page loads
 748      And I should see the "Course categories and courses" management page
 749      And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
 750      And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
 751      And I should not see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
 752      And I should not see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
 753      And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
 754      And I click to expand category "CAT2" in the management interface
 755      And a new page should not have loaded since I started watching
 756      And I click to expand category "CAT7" in the management interface
 757      And a new page should not have loaded since I started watching
 758      And I click to expand category "CAT9" in the management interface
 759      And a new page should not have loaded since I started watching
 760      And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
 761      And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
 762      And I should not see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
 763      And I should not see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
 764      And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
 765      And I should see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
 766      And I should see "Cat 2-1-2" in the "#course-category-listings ul.ml" "css_element"
 767      And I should not see "Cat 2-1-1-1" in the "#course-category-listings ul.ml" "css_element"
 768      And I should see "Cat 2-1-2-1" in the "#course-category-listings ul.ml" "css_element"
 769      And I click on "Cat 1" category in the management category listing
 770      And a new page should have loaded since I started watching
 771      And I start watching to see if a new page loads
 772      And I should see the "Course categories and courses" management page
 773      And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
 774      And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
 775      And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
 776      And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
 777      And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
 778      And I should see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
 779      And I should see "Cat 2-1-2" in the "#course-category-listings ul.ml" "css_element"
 780      And I should not see "Cat 2-1-1-1" in the "#course-category-listings ul.ml" "css_element"
 781      And I should see "Cat 2-1-2-1" in the "#course-category-listings ul.ml" "css_element"
 782      And I click on "resortbyidnumber" action for "Cat 1" in management category listing
 783      And a new page should have loaded since I started watching
 784      And I should see the "Course categories and courses" management page
 785      And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
 786      And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
 787      And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
 788      And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element"
 789      And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element"
 790      And I should see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element"
 791      And I should see "Cat 2-1-2" in the "#course-category-listings ul.ml" "css_element"
 792      And I should not see "Cat 2-1-1-1" in the "#course-category-listings ul.ml" "css_element"
 793      And I should see "Cat 2-1-2-1" in the "#course-category-listings ul.ml" "css_element"
 794  
 795    @javascript
 796    Scenario: Test category expansion after deletion
 797      Given the following "categories" exist:
 798        | name | category | idnumber |
 799        | Cat A (1) | 0 | CAT1 |
 800        | Cat B (2) | 0 | CAT2 |
 801        | Cat C (1-1) | CAT1 | CAT3 |
 802        | Cat D (2-1) | CAT2 | CAT4 |
 803        | Cat E (2-1-1) | CAT4 | CAT5 |
 804  
 805      And I log in as "admin"
 806      And I go to the courses management page
 807      And I start watching to see if a new page loads
 808      And I should see the "Course categories and courses" management page
 809      And I should see "Cat A (1)" in the "#course-category-listings ul.ml" "css_element"
 810      And I should see "Cat B (2)" in the "#course-category-listings ul.ml" "css_element"
 811      And I should not see "Cat C (1-1)" in the "#course-category-listings ul.ml" "css_element"
 812      And I should not see "Cat D (2-1)" in the "#course-category-listings ul.ml" "css_element"
 813      And I should not see "Cat E (2-1-1)" in the "#course-category-listings ul.ml" "css_element"
 814      And I click to expand category "CAT1" in the management interface
 815      And I should see "Cat C (1-1)" in the "#course-category-listings ul.ml" "css_element"
 816      And a new page should not have loaded since I started watching
 817      And I click to expand category "CAT2" in the management interface
 818      And I should see "Cat D (2-1)" in the "#course-category-listings ul.ml" "css_element"
 819      And a new page should not have loaded since I started watching
 820      And I click to expand category "CAT4" in the management interface
 821      And I should see "Cat E (2-1-1)" in the "#course-category-listings ul.ml" "css_element"
 822      And a new page should not have loaded since I started watching
 823      And I click on "delete" action for "Cat B (2)" in management category listing
 824      And a new page should have loaded since I started watching
 825      And I start watching to see if a new page loads
 826      And I should see "Delete category: Cat B (2)"
 827      And I should see "Contents of Cat B (2)"
 828      And I press "Delete"
 829      And a new page should have loaded since I started watching
 830      And I start watching to see if a new page loads
 831      And I should see "Delete category: Cat B (2)"
 832      And I should see "Deleted course category Cat B (2)"
 833      And I press "Continue"
 834      And a new page should have loaded since I started watching
 835      And I should see the "Course categories and courses" management page
 836      And I should see "Cat A (1)" in the "#course-category-listings ul.ml" "css_element"
 837      And I should not see "Cat B (2)" in the "#course-category-listings ul.ml" "css_element"


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