From fafb221336eed3825d4e4ea9ab297985d8cc9801 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Mon, 1 Dec 2014 16:01:13 +1300 Subject: [PATCH] MDL-48425 course: management behat tests improved --- .../behat/category_change_visibility.feature | 44 ++++--- course/tests/behat/category_resort.feature | 15 ++- ...course_category_management_listing.feature | 109 +++++++++++------- .../behat/course_change_visibility.feature | 20 ++-- course/tests/behat/course_resort.feature | 18 ++- 5 files changed, 129 insertions(+), 77 deletions(-) diff --git a/course/tests/behat/category_change_visibility.feature b/course/tests/behat/category_change_visibility.feature index ceccb9eaa7011..4b41415df35b8 100644 --- a/course/tests/behat/category_change_visibility.feature +++ b/course/tests/behat/category_change_visibility.feature @@ -36,14 +36,15 @@ Feature: We can change the visibility of categories in the management interface. And I log in as "admin" And I go to the courses management page + And I start watching to see if a new page loads 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 - # AJAX updated. + And a new page should not have loaded since I started watching And category in management listing should be dimmed "CAT1" And I toggle visibility of category "CAT1" in management listing - # AJAX updated. + And a new page should not have loaded since I started watching And category in management listing should be visible "CAT1" # Tests hiding and then showing a subcategory. @@ -91,20 +92,21 @@ Feature: We can change the visibility of categories in the management interface. And I log in as "admin" And I go to the courses management page + And I start watching to see if a new page loads 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 click to expand category "CAT1" in the management interface - # AJAX loads sub category. + And a new page should not have loaded since I started watching And category in management listing should be visible "CAT1" And category in management listing should be visible "CAT2" And I toggle visibility of category "CAT2" in management listing - # AJAX hides the subcategory. + And a new page should not have loaded since I started watching And category in management listing should be visible "CAT1" And category in management listing should be dimmed "CAT2" And I toggle visibility of category "CAT2" in management listing - # AJAX reveals the subcategory. + And a new page should not have loaded since I started watching And category in management listing should be visible "CAT1" And category in management listing should be visible "CAT2" @@ -199,9 +201,11 @@ Feature: We can change the visibility of categories in the management interface. And I log in as "admin" And I go to the courses management page + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I click on category "Cat 1" in the management interface - # Redirect. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads 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" @@ -218,13 +222,13 @@ Feature: We can change the visibility of categories in the management interface. And course in management listing should be visible "C2" And course in management listing should be visible "C3" And I toggle visibility of course "C2" in management listing - # AJAX action - no redirect. + And a new page should not have loaded since I started watching And I should see "Cat 3" in the "#category-listing ul.ml" "css_element" And course in management listing should be visible "C1" And course in management listing should be dimmed "C2" And course in management listing should be visible "C3" And I toggle visibility of category "CAT3" in management listing - # AJAX action - no redirect. + And a new page should not have loaded since I started watching And category in management listing should be visible "CAT1" And category in management listing should be visible "CAT2" And category in management listing should be dimmed "CAT3" @@ -233,7 +237,7 @@ Feature: We can change the visibility of categories in the management interface. And course in management listing should be dimmed "C2" And course in management listing should be visible "C3" And I toggle visibility of category "CAT1" in management listing - # AJAX action - no redirect. + And a new page should not have loaded since I started watching And category in management listing should be dimmed "CAT1" And category in management listing should be visible "CAT2" And category in management listing should be dimmed "CAT3" @@ -242,7 +246,7 @@ Feature: We can change the visibility of categories in the management interface. And course in management listing should be dimmed "C2" And course in management listing should be dimmed "C3" And I toggle visibility of category "CAT1" in management listing - # AJAX action - no redirect. + And a new page should not have loaded since I started watching And category in management listing should be visible "CAT1" And category in management listing should be visible "CAT2" And category in management listing should be dimmed "CAT3" @@ -264,46 +268,50 @@ Feature: We can change the visibility of categories in the management interface. And I log in as "admin" And I go to the courses management page + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I click on category "Cat 1" in the management interface - # Redirect + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I click on category "Cat 2" in the management interface - # Redirect + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I click on category "Cat 3" in the management interface - # Redirect + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And category in management listing should be visible "CAT1" And category in management listing should be visible "CAT2" And category in management listing should be visible "CAT3" And course in management listing should be visible "C1" And I toggle visibility of category "CAT1" in management listing - # AJAX action - no redirect. + And a new page should not have loaded since I started watching And category in management listing should be dimmed "CAT1" And category in management listing should be dimmed "CAT2" And category in management listing should be dimmed "CAT3" And course in management listing should be dimmed "C1" And I toggle visibility of category "CAT1" in management listing - # AJAX action - no redirect. + And a new page should not have loaded since I started watching And category in management listing should be visible "CAT1" And category in management listing should be visible "CAT2" And category in management listing should be visible "CAT3" And course in management listing should be visible "C1" And I toggle visibility of course "C1" in management listing - # AJAX action - no redirect. + And a new page should not have loaded since I started watching And category in management listing should be visible "CAT1" And category in management listing should be visible "CAT2" And category in management listing should be visible "CAT3" And course in management listing should be dimmed "C1" And I toggle visibility of category "CAT1" in management listing - # AJAX action - no redirect. + And a new page should not have loaded since I started watching And category in management listing should be dimmed "CAT1" And category in management listing should be dimmed "CAT2" And category in management listing should be dimmed "CAT3" And course in management listing should be dimmed "C1" And I toggle visibility of category "CAT1" in management listing - # AJAX action - no redirect. + And a new page should not have loaded since I started watching And category in management listing should be visible "CAT1" And category in management listing should be visible "CAT2" And category in management listing should be visible "CAT3" diff --git a/course/tests/behat/category_resort.feature b/course/tests/behat/category_resort.feature index 781186ad72d76..dc35898d0dfad 100644 --- a/course/tests/behat/category_resort.feature +++ b/course/tests/behat/category_resort.feature @@ -97,12 +97,15 @@ Feature: Test we can resort categories in the management interface. And I log in as "admin" And I go to the courses management page + And I start watching to see if a new page loads 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 a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I click on action for "Master cat" in management category listing - # Redirect. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I should see category listing before And I should see category listing before @@ -186,22 +189,24 @@ Feature: Test we can resort categories in the management interface. And I log in as "admin" And I go to the courses management page + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I click on category "Cat 1" in the management interface - # Redirect. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I should see category listing "Cat 1" before "Cat 1a" And I should see category listing "Cat 1a" before "Cat 1b" And I should see category listing "Cat 1b" before "Cat 1c" And I should see category listing "Cat 1c" before "Cat 2" And I click to move category "CATA" down one - # AJAX request. No redirect.We should a 1, 1b, 1a, 1c, 2. + And a new page should not have loaded since I started watching And I should see category listing "Cat 1" before "Cat 1b" And I should see category listing "Cat 1b" before "Cat 1a" And I should see category listing "Cat 1a" before "Cat 1c" And I should see category listing "Cat 1c" before "Cat 2" And I click to move category "CATC" up one - # AJAX request. No redirect. We should a 1, 1b, 1c, 1a, 2. + And a new page should not have loaded since I started watching And I should see category listing "Cat 1" before "Cat 1b" And I should see category listing "Cat 1b" before "Cat 1c" And I should see category listing "Cat 1c" before "Cat 1a" diff --git a/course/tests/behat/course_category_management_listing.feature b/course/tests/behat/course_category_management_listing.feature index 6871aae36849f..78c85b331ee08 100644 --- a/course/tests/behat/course_category_management_listing.feature +++ b/course/tests/behat/course_category_management_listing.feature @@ -35,18 +35,21 @@ Feature: Course category management interface performs as expected And I should not see "Course categories" in the ".view-mode-selector .menu" "css_element" And I should not see "Courses" in the ".view-mode-selector .menu" "css_element" When I click on "Course categories" "link" in the ".view-mode-selector" "css_element" + And I start watching to see if a new page loads Then I should see "Course categories and courses" in the ".view-mode-selector .menu" "css_element" And I should see "Course categories" in the ".view-mode-selector .menu" "css_element" And I should see "Courses" in the ".view-mode-selector .menu" "css_element" And I click on "Course categories and courses" "link" in the ".view-mode-selector .menu" "css_element" - # Redirect. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads 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 "Miscellaneous" in the "#course-listing h3" "css_element" And I should see "Cat 1" in the "#category-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 a new page should have loaded since I started watching + And I start watching to see if a new page loads 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 "#course-listing h3" "css_element" @@ -55,12 +58,13 @@ Feature: Course category management interface performs as expected When I click on "Course categories" "link" in the ".view-mode-selector" "css_element" Then I should see "Courses" in the ".view-mode-selector .menu" "css_element" And I click on "Courses" "link" in the ".view-mode-selector .menu" "css_element" - # Redirect. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see the "Courses" management page And I should see "Cat 1" in the "#course-listing h3" "css_element" And I should see "Course 1" in the "#course-listing" "css_element" And I click on course "Course 1" in the management interface - # Redirect. + And a new page should have loaded since I started watching And I should see the "Courses" management page with a course selected And I should see "Cat 1" in the "#course-listing h3" "css_element" And I should see "Course 1" in the "#course-listing" "css_element" @@ -164,6 +168,7 @@ Feature: Course category management interface performs as expected And I log in as "admin" And I go to the courses management page + And I start watching to see if a new page loads 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" @@ -174,7 +179,7 @@ Feature: Course category management interface performs as expected And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element" And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element" And I click to expand category "CAT1" in the management interface - # AJAX action - no redirect. + And a new page should not have loaded since I started watching 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 see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element" @@ -184,7 +189,7 @@ Feature: Course category management interface performs as expected And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element" And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element" And I click to expand category "CAT3" in the management interface - # AJAX action - no redirect. + And a new page should not have loaded since I started watching 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 see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element" @@ -194,7 +199,7 @@ Feature: Course category management interface performs as expected And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element" And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element" And I click to expand category "CAT2" in the management interface - # AJAX action - no redirect. + And a new page should not have loaded since I started watching 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 see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element" @@ -204,7 +209,7 @@ Feature: Course category management interface performs as expected And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element" And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element" And I click to expand category "CAT7" in the management interface - # AJAX action - no redirect. + And a new page should not have loaded since I started watching 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 see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element" @@ -214,7 +219,7 @@ Feature: Course category management interface performs as expected And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element" And I should see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element" And I click to expand category "CAT1" in the management interface - # AJAX action - no redirect. + And a new page should not have loaded since I started watching 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" @@ -224,7 +229,7 @@ Feature: Course category management interface performs as expected And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element" And I should see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element" And I click to expand category "CAT1" in the management interface - # AJAX action - no redirect. + And a new page should not have loaded since I started watching 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 see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element" @@ -244,11 +249,12 @@ Feature: Course category management interface performs as expected And I log in as "admin" And I go to the courses management page + And I start watching to see if a new page loads 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 And I press "Sort" - # Redirect. + And a new page should have loaded since I started watching And I should see the "Course categories and courses" management page And I should see category listing before And I should see category listing before @@ -271,12 +277,14 @@ Feature: Course category management interface performs as expected And I log in as "admin" And I go to the courses management page + And I start watching to see if a new page loads 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 a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I click on action for "Master cat" in management category listing - # Redirect. + And a new page should have loaded since I started watching And I should see the "Course categories and courses" management page And I should see category listing before And I should see category listing before @@ -301,9 +309,11 @@ Feature: Course category management interface performs as expected And I log in as "admin" And I go to the courses management page + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I click on "Cat 1" "link" - # Redirect. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I click on "Sort courses" "link" And I should see "Sort by Course full name ascending" in the ".course-listing-actions" "css_element" @@ -315,7 +325,7 @@ Feature: Course category management interface performs as expected And I should see "Sort by Course time created ascending" in the ".course-listing-actions" "css_element" And I should see "Sort by Course time created descending" in the ".course-listing-actions" "css_element" And I click on "link" in the ".course-listing-actions" "css_element" - # Redirect. + And a new page should have loaded since I started watching And I should see the "Course categories and courses" management page And I should see course listing before And I should see course listing before @@ -353,13 +363,16 @@ Feature: Course category management interface performs as expected And I log in as "admin" And I go to the courses management page + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I click on "Cat 1" "link" - # Redirect. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I click on "Sort courses" "link" And I click on "Sort by Course ID number ascending" "link" in the ".course-listing-actions" "css_element" - # Redirect. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see "Per page: 20" in the ".course-listing-actions" "css_element" And I should see course listing "Course 1" before "Course 2" And I should see course listing "Course 2" before "Course 3" @@ -379,7 +392,8 @@ Feature: Course category management interface performs as expected And I should see "20" in the ".courses-per-page" "css_element" And I should see "All" in the ".courses-per-page" "css_element" And I click on "5" "link" in the ".courses-per-page" "css_element" - # Redirect. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I should see "Per page: 5" in the ".course-listing-actions" "css_element" And I should see course listing "Course 1" before "Course 2" @@ -403,7 +417,8 @@ Feature: Course category management interface performs as expected And I should see "Next" in the "#course-listing .listing-pagination" "css_element" And I should see "Last" in the "#course-listing .listing-pagination" "css_element" And I click on "2" "link" in the "#course-listing .listing-pagination" "css_element" - # Redirect. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I should see "Per page: 5" in the ".course-listing-actions" "css_element" And I should see "Course 10" in the "#course-listing" "css_element" @@ -427,7 +442,8 @@ Feature: Course category management interface performs as expected And I should see "Next" in the "#course-listing .listing-pagination" "css_element" And I should see "Last" in the "#course-listing .listing-pagination" "css_element" And I click on "Next" "link" in the "#course-listing .listing-pagination" "css_element" - # Redirect. Test next link. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I should see "Per page: 5" in the ".course-listing-actions" "css_element" And I should see "Course 11" @@ -451,7 +467,8 @@ Feature: Course category management interface performs as expected And I should not see "Next" in the "#course-listing .listing-pagination" "css_element" And I should not see "Last" in the "#course-listing .listing-pagination" "css_element" And I click on "First" "link" in the "#course-listing .listing-pagination" "css_element" - # Redirect. Test first link. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I should see "Per page: 5" in the ".course-listing-actions" "css_element" And I should see course listing "Course 1" before "Course 2" @@ -475,7 +492,8 @@ Feature: Course category management interface performs as expected And I should see "Next" in the "#course-listing .listing-pagination" "css_element" And I should see "Last" in the "#course-listing .listing-pagination" "css_element" And I click on "Last" "link" in the "#course-listing .listing-pagination" "css_element" - # Redirect. Test last link. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I should see "Per page: 5" in the ".course-listing-actions" "css_element" And I should see "Course 11" in the "#course-listing" "css_element" @@ -499,7 +517,7 @@ Feature: Course category management interface performs as expected And I should not see "Next" in the "#course-listing .listing-pagination" "css_element" And I should not see "Last" in the "#course-listing .listing-pagination" "css_element" And I click on "Prev" "link" in the "#course-listing .listing-pagination" "css_element" - # Redirect. Test prev link. + And a new page should have loaded since I started watching And I should see the "Course categories and courses" management page And I should see "Per page: 5" in the ".course-listing-actions" "css_element" And I should see "Course 10" in the "#course-listing" "css_element" @@ -601,13 +619,16 @@ Feature: Course category management interface performs as expected And I log in as "admin" And I go to the courses management page + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I click on "Cat 1" "link" - # Redirect. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I click on "Sort courses" "link" And I click on "Sort by Course ID number ascending" "link" in the ".course-listing-actions" "css_element" - # Redirect. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I should see "Per page: 20" in the ".course-listing-actions" "css_element" And I should see course listing "Course 1" before "Course 2" @@ -616,7 +637,8 @@ Feature: Course category management interface performs as expected And I should see "Showing courses 1 to 20 of 32 courses" And I click on "Per page: 20" "link" in the ".course-listing-actions" "css_element" And I click on "100" "link" in the ".courses-per-page" "css_element" - # Redirect. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I should see "Per page: 100" in the ".course-listing-actions" "css_element" And I should see course listing "Course 1" before "Course 2" @@ -626,7 +648,8 @@ Feature: Course category management interface performs as expected And "#course-listing .listing-pagination" "css_element" should not exist And I click on "Per page: 100" "link" in the ".course-listing-actions" "css_element" And I click on "5" "link" in the ".courses-per-page" "css_element" - # Redirect. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I should see "Per page: 5" in the ".course-listing-actions" "css_element" And I should see course listing "Course 1" before "Course 2" @@ -645,7 +668,8 @@ Feature: Course category management interface performs as expected And I should see "Next" in the "#course-listing .listing-pagination" "css_element" And I should see "Last" in the "#course-listing .listing-pagination" "css_element" And I click on "Last" "link" in the "#course-listing .listing-pagination" "css_element" - # Redirect. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I should see "Per page: 5" in the ".course-listing-actions" "css_element" And I should not see "Course 30" @@ -663,7 +687,7 @@ Feature: Course category management interface performs as expected And I should not see "Next" in the "#course-listing .listing-pagination" "css_element" And I should not see "Last" in the "#course-listing .listing-pagination" "css_element" And I click on "4" "link" in the "#course-listing .listing-pagination" "css_element" - # Redirect. + And a new page should have loaded since I started watching And I should see the "Course categories and courses" management page And I should see "Per page: 5" in the ".course-listing-actions" "css_element" And I should not see "Course 15" @@ -720,6 +744,7 @@ Feature: Course category management interface performs as expected And I log in as "admin" And I go to the courses management page + And I start watching to see if a new page loads 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" @@ -727,11 +752,11 @@ Feature: Course category management interface performs as expected And I should not see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element" And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element" And I click to expand category "CAT2" in the management interface - # AJAX action - no redirect. + And a new page should not have loaded since I started watching And I click to expand category "CAT7" in the management interface - # AJAX action - no redirect. + And a new page should not have loaded since I started watching And I click to expand category "CAT9" in the management interface - # AJAX action - no redirect. + And a new page should not have loaded since I started watching 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" @@ -742,7 +767,8 @@ Feature: Course category management interface performs as expected And I should not see "Cat 2-1-1-1" in the "#course-category-listings ul.ml" "css_element" And I should see "Cat 2-1-2-1" in the "#course-category-listings ul.ml" "css_element" And I click on "Cat 1" category in the management category listing - # Redirect. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads 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" @@ -754,7 +780,7 @@ Feature: Course category management interface performs as expected And I should not see "Cat 2-1-1-1" in the "#course-category-listings ul.ml" "css_element" And I should see "Cat 2-1-2-1" in the "#course-category-listings ul.ml" "css_element" And I click on "resortbyidnumber" action for "Cat 1" in management category listing - # Redirect. + And a new page should have loaded since I started watching 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" @@ -778,6 +804,7 @@ Feature: Course category management interface performs as expected And I log in as "admin" And I go to the courses management page + And I start watching to see if a new page loads 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" @@ -786,23 +813,25 @@ Feature: Course category management interface performs as expected And I should not see "Cat E (2-1-1)" in the "#course-category-listings ul.ml" "css_element" And I click to expand category "CAT1" in the management interface And I should see "Cat C (1-1)" in the "#course-category-listings ul.ml" "css_element" - # AJAX action - no redirect. + And a new page should not have loaded since I started watching And I click to expand category "CAT2" in the management interface And I should see "Cat D (2-1)" in the "#course-category-listings ul.ml" "css_element" - # AJAX action - no redirect. + And a new page should not have loaded since I started watching And I click to expand category "CAT4" in the management interface And I should see "Cat E (2-1-1)" in the "#course-category-listings ul.ml" "css_element" - # AJAX action - no redirect. + And a new page should not have loaded since I started watching And I click on "delete" action for "Cat B (2)" in management category listing - # Redirect. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see "Delete category: Cat B (2)" And I should see "Contents of Cat B (2)" And I press "Delete" - # Redirect + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see "Delete category: Cat B (2)" And I should see "Deleted course category Cat B (2)" And I press "Continue" - # Redirect. + And a new page should have loaded since I started watching 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 not see "Cat B (2)" in the "#course-category-listings ul.ml" "css_element" diff --git a/course/tests/behat/course_change_visibility.feature b/course/tests/behat/course_change_visibility.feature index eedf984392069..6311d8bd5248d 100644 --- a/course/tests/behat/course_change_visibility.feature +++ b/course/tests/behat/course_change_visibility.feature @@ -62,42 +62,46 @@ Feature: We can change the visibility of courses in the management interface. And I log in as "admin" And I go to the courses management page + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I click on category "Cat 1" in the management interface - # Redirect. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads 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 "Course 1" in the "#course-listing ul.ml" "css_element" And category in management listing should be visible "CAT1" And course in management listing should be visible "C1" And I toggle visibility of course "C1" in management listing - # AJAX updates the visibility + And a new page should not have loaded since I started watching And category in management listing should be visible "CAT1" And course in management listing should be dimmed "C1" And I toggle visibility of course "C1" in management listing - # AJAX updates the visibility + And a new page should not have loaded since I started watching And category in management listing should be visible "CAT1" And course in management listing should be visible "C1" And I toggle visibility of course "C1" in management listing - # AJAX updates the visibility + And a new page should not have loaded since I started watching And category in management listing should be visible "CAT1" And course in management listing should be dimmed "C1" And I toggle visibility of category "CAT1" in management listing - # AJAX updates the visibility + And a new page should not have loaded since I started watching And category in management listing should be dimmed "CAT1" And course in management listing should be dimmed "C1" And I toggle visibility of category "CAT1" in management listing - # AJAX updates the visibility + And a new page should not have loaded since I started watching And category in management listing should be visible "CAT1" And course in management listing should be dimmed "C1" And I toggle visibility of category "CAT1" in management listing And I toggle visibility of course "C1" in management listing And I click on "Course categories and courses" "link" in the ".view-mode-selector" "css_element" And I click on "Courses" "link" - # Redirect + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see "Course 1" in the "#course-listing ul.ml" "css_element" And I toggle visibility of course "C1" in management listing - # AJAX updates the visibility + And a new page should not have loaded since I started watching And course in management listing should be dimmed "C1" And I toggle visibility of course "C1" in management listing And course in management listing should be visible "C1" + And a new page should not have loaded since I started watching diff --git a/course/tests/behat/course_resort.feature b/course/tests/behat/course_resort.feature index 4558c8995581e..cee3ccd72a2c2 100644 --- a/course/tests/behat/course_resort.feature +++ b/course/tests/behat/course_resort.feature @@ -60,9 +60,11 @@ Feature: Test we can resort course in the management interface. And I log in as "admin" And I go to the courses management page + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I click on category "Cat 1" in the management interface - # Redirect. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I should see "Sort courses" in the ".course-listing-actions" "css_element" And I should not see "Sort by Course full name ascending" in the ".course-listing-actions" "css_element" @@ -83,7 +85,8 @@ Feature: Test we can resort course in the management interface. And I should see "Sort by Course time created ascending" in the ".course-listing-actions" "css_element" And I should see "Sort by Course time created descending" in the ".course-listing-actions" "css_element" And I click on "link" in the ".course-listing-actions" "css_element" - # Redirect. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I should see course listing before And I should see course listing before @@ -148,23 +151,26 @@ Feature: Test we can resort course in the management interface. And I log in as "admin" And I go to the courses management page + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I click on category "Cat 1" in the management interface - # Redirect. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads 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 click on "Sort courses" "link" And I click on "Sort by Course ID number ascending" "link" in the ".course-listing-actions" "css_element" - # Redirect. + And a new page should have loaded since I started watching + And I start watching to see if a new page loads And I should see the "Course categories and courses" management page And I should see course listing "Course 1" before "Course 2" And I should see course listing "Course 2" before "Course 3" And I click to move course "C1" down one - # AJAX, no redirect. + And a new page should not have loaded since I started watching And I should see course listing "Course 2" before "Course 1" And I should see course listing "Course 1" before "Course 3" And I click to move course "C3" up one - # AJAX, no redirect. + And a new page should not have loaded since I started watching And I should see course listing "Course 2" before "Course 3" And I should see course listing "Course 3" before "Course 1" \ No newline at end of file