[ Index ] |
PHP Cross Reference of moodle-2.8 |
[Summary view] [Print] [Text view]
1 @core @core_course 2 Feature: Test we can resort course in the management interface. 3 As a moodle admin 4 I need to test we can resort courses within a category. 5 I need to test we can manually sort courses. 6 7 # Test resorting courses with 8 Scenario Outline: Resort courses. 9 Given the following "categories" exist: 10 | name | category 0| idnumber | 11 | Cat 1 | 0 | CAT1 | 12 And the following "courses" exist: 13 | category | fullname | shortname | idnumber | sortorder | timecreated | 14 | CAT1 | Social studies | Senior school | Ext003 | 1 | 1000000001 | 15 | CAT1 | Applied sciences | Middle school | Sci001 | 2 | 1000000002 | 16 | CAT1 | Extended social studies | Junior school | Ext002 | 3 | 1000000003 | 17 18 And I log in as "admin" 19 And I go to the courses management page 20 And I should see the "Course categories and courses" management page 21 And I click on category "Cat 1" in the management interface 22 # Redirect. 23 And I should see the "Course categories and courses" management page 24 And I should see "Sort courses" in the ".course-listing-actions" "css_element" 25 And I should see "Sort by Course full name ascending" in the ".course-listing-actions" "css_element" 26 And I should see "Sort by Course full name descending" in the ".course-listing-actions" "css_element" 27 And I should see "Sort by Course short name ascending" in the ".course-listing-actions" "css_element" 28 And I should see "Sort by Course short name descending" in the ".course-listing-actions" "css_element" 29 And I should see "Sort by Course ID number ascending" in the ".course-listing-actions" "css_element" 30 And I should see "Sort by Course ID number descending" in the ".course-listing-actions" "css_element" 31 And I should see "Sort by Course time created ascending" in the ".course-listing-actions" "css_element" 32 And I should see "Sort by Course time created descending" in the ".course-listing-actions" "css_element" 33 And I click on <sortby> "link" in the ".course-listing-actions" "css_element" 34 # Redirect. 35 And I should see the "Course categories and courses" management page 36 And I should see course listing <course1> before <course2> 37 And I should see course listing <course2> before <course3> 38 39 Examples: 40 | sortby | course1 | course2 | course3 | 41 | "Sort by Course full name ascending" | "Applied sciences" | "Extended social studies" | "Social studies" | 42 | "Sort by Course full name descending" | "Social studies" | "Extended social studies" | "Applied sciences" | 43 | "Sort by Course short name ascending" | "Extended social studies" | "Applied sciences" | "Social studies" | 44 | "Sort by Course short name descending" | "Social studies" | "Applied sciences" | "Extended social studies" | 45 | "Sort by Course ID number ascending" | "Extended social studies" | "Social studies" | "Applied sciences" | 46 | "Sort by Course ID number descending" | "Applied sciences" | "Social studies" | "Extended social studies" | 47 | "Sort by Course time created ascending" | "Social studies" | "Applied sciences" | "Extended social studies" | 48 | "Sort by Course time created descending" | "Extended social studies" | "Applied sciences" | "Social studies" | 49 50 @javascript 51 Scenario Outline: Resort courses with JavaScript enabled. 52 Given the following "categories" exist: 53 | name | category 0| idnumber | 54 | Cat 1 | 0 | CAT1 | 55 And the following "courses" exist: 56 | category | fullname | shortname | idnumber | sortorder | timecreated | 57 | CAT1 | Social studies | Senior school | Ext003 | 1 | 1000000001 | 58 | CAT1 | Applied sciences | Middle school | Sci001 | 2 | 1000000002 | 59 | CAT1 | Extended social studies | Junior school | Ext002 | 3 | 1000000003 | 60 61 And I log in as "admin" 62 And I go to the courses management page 63 And I should see the "Course categories and courses" management page 64 And I click on category "Cat 1" in the management interface 65 # Redirect. 66 And I should see the "Course categories and courses" management page 67 And I should see "Sort courses" in the ".course-listing-actions" "css_element" 68 And I should not see "Sort by Course full name ascending" in the ".course-listing-actions" "css_element" 69 And I should not see "Sort by Course full name descending" in the ".course-listing-actions" "css_element" 70 And I should not see "Sort by Course short name ascending" in the ".course-listing-actions" "css_element" 71 And I should not see "Sort by Course short name descending" in the ".course-listing-actions" "css_element" 72 And I should not see "Sort by Course ID number ascending" in the ".course-listing-actions" "css_element" 73 And I should not see "Sort by Course ID number descending" in the ".course-listing-actions" "css_element" 74 And I should not see "Sort by Course time created ascending" in the ".course-listing-actions" "css_element" 75 And I should not see "Sort by Course time created descending" in the ".course-listing-actions" "css_element" 76 And I click on "Sort courses" "link" 77 And I should see "Sort by Course full name ascending" in the ".course-listing-actions" "css_element" 78 And I should see "Sort by Course full name descending" in the ".course-listing-actions" "css_element" 79 And I should see "Sort by Course short name ascending" in the ".course-listing-actions" "css_element" 80 And I should see "Sort by Course short name descending" in the ".course-listing-actions" "css_element" 81 And I should see "Sort by Course ID number ascending" in the ".course-listing-actions" "css_element" 82 And I should see "Sort by Course ID number descending" in the ".course-listing-actions" "css_element" 83 And I should see "Sort by Course time created ascending" in the ".course-listing-actions" "css_element" 84 And I should see "Sort by Course time created descending" in the ".course-listing-actions" "css_element" 85 And I click on <sortby> "link" in the ".course-listing-actions" "css_element" 86 # Redirect. 87 And I should see the "Course categories and courses" management page 88 And I should see course listing <course1> before <course2> 89 And I should see course listing <course2> before <course3> 90 91 Examples: 92 | sortby | course1 | course2 | course3 | 93 | "Sort by Course full name ascending" | "Applied sciences" | "Extended social studies" | "Social studies" | 94 | "Sort by Course full name descending" | "Social studies" | "Extended social studies" | "Applied sciences" | 95 | "Sort by Course short name ascending" | "Extended social studies" | "Applied sciences" | "Social studies" | 96 | "Sort by Course short name descending" | "Social studies" | "Applied sciences" | "Extended social studies" | 97 | "Sort by Course ID number ascending" | "Extended social studies" | "Social studies" | "Applied sciences" | 98 | "Sort by Course ID number descending" | "Applied sciences" | "Social studies" | "Extended social studies" | 99 | "Sort by Course time created ascending" | "Social studies" | "Applied sciences" | "Extended social studies" | 100 | "Sort by Course time created descending" | "Extended social studies" | "Applied sciences" | "Social studies" | 101 102 Scenario: Test moving courses up and down by one. 103 Given the following "categories" exist: 104 | name | category | idnumber | 105 | Cat 1 | 0 | CAT1 | 106 And the following "courses" exist: 107 | category | fullname | shortname | idnumber | 108 | CAT1 | Course 1 | Course 1 | C1 | 109 | CAT1 | Course 2 | Course 2 | C2 | 110 | CAT1 | Course 3 | Course 3 | C3 | 111 112 And I log in as "admin" 113 And I go to the courses management page 114 And I should see the "Course categories and courses" management page 115 And I click on category "Cat 1" in the management interface 116 # Redirect. 117 And I should see the "Course categories and courses" management page 118 And I should see "Course categories" in the "#category-listing h3" "css_element" 119 And I should see "Cat 1" in the "#category-listing" "css_element" 120 And I click on "Sort courses" "link" 121 And I click on "Sort by Course ID number ascending" "link" in the ".course-listing-actions" "css_element" 122 # Redirect. 123 And I should see the "Course categories and courses" management page 124 And I should see course listing "Course 1" before "Course 2" 125 And I should see course listing "Course 2" before "Course 3" 126 And I click to move course "C1" down one 127 # Redirect. 128 And I should see the "Course categories and courses" management page with a course selected 129 And I should see course listing "Course 2" before "Course 1" 130 And I should see course listing "Course 1" before "Course 3" 131 And I click to move course "C3" up one 132 # Redirect. 133 And I should see the "Course categories and courses" management page with a course selected 134 And I should see course listing "Course 2" before "Course 3" 135 And I should see course listing "Course 3" before "Course 1" 136 137 # Like the above test but with JavaScript enabled. 138 @javascript 139 Scenario: Test using AJAX to move courses up and down by one. 140 Given the following "categories" exist: 141 | name | category | idnumber | 142 | Cat 1 | 0 | CAT1 | 143 And the following "courses" exist: 144 | category | fullname | shortname | idnumber | 145 | CAT1 | Course 1 | Course 1 | C1 | 146 | CAT1 | Course 2 | Course 2 | C2 | 147 | CAT1 | Course 3 | Course 3 | C3 | 148 149 And I log in as "admin" 150 And I go to the courses management page 151 And I should see the "Course categories and courses" management page 152 And I click on category "Cat 1" in the management interface 153 # Redirect. 154 And I should see the "Course categories and courses" management page 155 And I should see "Course categories" in the "#category-listing h3" "css_element" 156 And I should see "Cat 1" in the "#category-listing" "css_element" 157 And I click on "Sort courses" "link" 158 And I click on "Sort by Course ID number ascending" "link" in the ".course-listing-actions" "css_element" 159 # Redirect. 160 And I should see the "Course categories and courses" management page 161 And I should see course listing "Course 1" before "Course 2" 162 And I should see course listing "Course 2" before "Course 3" 163 And I click to move course "C1" down one 164 # AJAX, no redirect. 165 And I should see course listing "Course 2" before "Course 1" 166 And I should see course listing "Course 1" before "Course 3" 167 And I click to move course "C3" up one 168 # AJAX, no redirect. 169 And I should see course listing "Course 2" before "Course 3" 170 And I should see course listing "Course 3" before "Course 1"
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:29:05 2014 | Cross-referenced by PHPXref 0.7.1 |