} else {
$course = null;
$courseid = null;
- $category = null;
- $categoryid = null;
- if ($viewmode === 'default') {
- $viewmode = 'categories';
- }
+ $category = coursecat::get_default();
+ $categoryid = $category->id;
$context = $systemcontext;
}
break;
case "Course categories":
$return[] = new Given('"#category-listing" "css_element" should exist');
- $return[] = new Given('"#course-listing" "css_element" should not exist');
+ $return[] = new Given('"#course-listing" "css_element" should exist');
break;
case "Courses categories and courses":
default:
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
And category in management listing should be visible "CAT1"
And I toggle visibility of category "CAT1" in management listing
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
And category in management listing should be visible "CAT1"
And I toggle visibility of category "CAT1" in management listing
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
And I should not see "Cat 2" in the "#category-listing ul.ml" "css_element"
And category in management listing should be visible "CAT1"
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
And I should not see "Cat 2" in the "#category-listing ul.ml" "css_element"
And category in management listing should be visible "CAT1"
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
# Redirect.
And I should see the "Course categories and courses" management page
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
# Redirect.
And I should see the "Course categories and courses" management page
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
# Redirect
And I should see the "Course categories and courses" management page
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on "edit" action for "Cat 1" in management category listing
# Redirect
And I should see "Edit category settings"
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
And I should see "Cat 2" in the "#category-listing ul.ml" "css_element"
And I should see "Cat 3" in the "#category-listing ul.ml" "css_element"
And I should see "Deleted course category Cat 2"
And I press "Continue"
# Redirect
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
And I should not see "Cat 2" in the "#category-listing ul.ml" "css_element"
And I should see "Cat 3" in the "#category-listing ul.ml" "css_element"
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on "assignroles" action for "Cat 1" in management category listing
# Redirect
And I should see "Assign roles in Category: Cat 1"
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on "permissions" action for "Cat 1" in management category listing
# Redirect
And I should see "Permissions in Category: Cat 1"
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on "cohorts" action for "Cat 1" in management category listing
# Redirect
And I should see "Category: Cat 1: available cohorts"
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on "filters" action for "Cat 1" in management category listing
# Redirect
And I should see "Filter settings in Category: Cat 1"
| Cat 1 | 0 | CAT1 |
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on "Create new category" "link" in the ".category-listing-actions" "css_element"
# Redirect.
And I should see "Add new category"
And I set the following fields to these values:
+ | Parent category | Top |
| Category name | Test category 2 |
| Category ID number | TC2 |
And I press "Create category"
# Redirect
And I should see "Add new category"
And I set the following fields to these values:
+ | Parent category | Top |
| Category name | Test category 3 |
| Category ID number | TC3 |
And I press "Create category"
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
And I should see "Cat 2" in the "#category-listing ul.ml" "css_element"
And I should see "Cat 3" in the "#category-listing ul.ml" "css_element"
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#category-listing ul.ml" "css_element"
And I should see "Cat 2" in the "#category-listing ul.ml" "css_element"
And I should see "Cat 3" in the "#category-listing ul.ml" "css_element"
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I set the field "menuselectsortby" to "All categories"
And I set the field "menuresortcategoriesby" to <sortby>
And I press "Sort"
# Redirect.
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I should see category listing <cat1> before <cat2>
And I should see category listing <cat2> before <cat3>
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on "Test category" "link"
# Redirect.
And I should see the "Course categories and courses" management page
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on "Master cat" "link"
# Redirect.
And I should see the "Course categories and courses" management page
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on "Master cat" category in the management category listing
# Redirect.
And I should see the "Course categories and courses" management page
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
# Redirect. We should a 1, 1a, 1b, 1c, 2.
And I should see the "Course categories and courses" management page
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
# Redirect.
And I should see the "Course categories and courses" management page
And I should see "Course and category management" in the "h2" "css_element"
And I should see "Course categories" in the ".view-mode-selector" "css_element"
And I should see "Course categories" in the "h3" "css_element"
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
@javascript
Scenario: Test view mode functionality
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I should see "Course categories" in the "#category-listing h3" "css_element"
And I should see "Cat 1" in the "#category-listing" "css_element"
And I should see "Course categories" in the ".view-mode-selector" "css_element"
# Redirect.
And I should see the "Course categories and courses" management page
And I should see "Course categories" in the "#category-listing h3" "css_element"
- And I should see "Courses" in the "#course-listing h3" "css_element"
+ And I should see "Miscellaneous" in the "#course-listing h3" "css_element"
And I should see "Cat 1" in the "#category-listing" "css_element"
- And I should see "Please select a category" in the "#course-listing" "css_element"
+ And I should see "No courses in this category" in the "#course-listing" "css_element"
And I click on category "Cat 1" in the management interface
# Redirect.
And I should see the "Course categories and courses" management page
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
And I should not see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
And I should not see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I set the field "menuselectsortby" to "All categories"
And I set the field "menuresortcategoriesby" to <sortby>
And I press "Sort"
# Redirect.
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I should see category listing <cat1> before <cat2>
And I should see category listing <cat2> before <cat3>
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on "Master cat" category in the management category listing
# Redirect.
And I should see the "Course categories and courses" management page
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on "Cat 1" "link"
# Redirect.
And I should see the "Course categories and courses" management page
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on "Cat 1" "link"
# Redirect.
And I should see the "Course categories and courses" management page
| CAT1 | Course 5 | Course 5 | C5 |
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on "Cat 1" "link"
# Redirect.
And I should see the "Course categories and courses" management page
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on "Cat 1" "link"
# Redirect.
And I should see the "Course categories and courses" management page
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
And I click on "edit" action for "Course 1" in management course listing
# Redirect
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element"
And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element"
And I should not see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element"
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I should see "Cat A (1)" in the "#course-category-listings ul.ml" "css_element"
And I should see "Cat B (2)" in the "#course-category-listings ul.ml" "css_element"
And I should not see "Cat C (1-1)" in the "#course-category-listings ul.ml" "css_element"
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
# Redirect.
And I should see the "Course categories and courses" management page
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
# Redirect.
And I should see the "Course categories and courses" management page
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
# Redirect.
And I should see the "Course categories and courses" management page
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
# Redirect.
And I should see the "Course categories and courses" management page
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
# Redirect.
And I should see the "Course categories and courses" management page
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
# Redirect.
And I should see the "Course categories and courses" management page
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
# Redirect
And I should see the "Course categories and courses" management page
And I press "Save changes"
# Redirect
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
# Redirect
And I should see the "Course categories and courses" management page
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
# Redirect
And I should see the "Course categories and courses" management page
And I log in as "admin"
And I go to the courses management page
- And I should see the "Course categories" management page
+ And I should see the "Course categories and courses" management page
And I click on category "Cat 1" in the management interface
# Redirect
And I should see the "Course categories and courses" management page