Skip to content

Commit

Permalink
MDL-74087 theme_boost: Add behat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihail Geshoski committed Mar 10, 2022
1 parent bc0cb6b commit 748ce93
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 15 deletions.
15 changes: 0 additions & 15 deletions course/tests/behat/course_category_breadcrumbs.feature
Expand Up @@ -244,18 +244,3 @@ Feature: Course category breadcrumbs navigation
And I should see "Cat 1" in the ".page-context-header" "css_element"
And I should see "Content bank" in the "region-main" "region"
And I should see "Cat 1" in the ".block_navigation .active_tree_node" "css_element"

Scenario: Admin user changes the default home page and navigates to 'course category management' page
Given I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
And I follow "Cat 1"
And I should not see "My courses" in the ".breadcrumb" "css_element"
And the following config values are set as admin:
| defaulthomepage | 3 |
And I navigate to "Courses > Manage courses and categories" in site administration
When I follow "Cat 1"
Then I should see "My courses" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".breadcrumb" "css_element"
And I should see "Manage courses and categories" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".page-context-header" "css_element"
And I should see "Manage course categories and courses" in the "region-main" "region"
45 changes: 45 additions & 0 deletions theme/boost/tests/behat/breadcrumb.feature
Expand Up @@ -31,3 +31,48 @@ Feature: Breadcrumbs navigation
Then I should see "Caching" in the ".breadcrumb" "css_element"
Then I should see "Cache stores" in the ".breadcrumb" "css_element"
And I should see "Memcached" in the ".breadcrumb" "css_element"

Scenario: Admin user changes the default home page and navigates to 'course category management' page
Given the following config values are set as admin:
| defaulthomepage | 3 |
And the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
When I follow "Cat 1"
Then I should not see "My courses" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".breadcrumb" "css_element"
And I should see "Manage courses and categories" in the ".breadcrumb" "css_element"

Scenario: Admin user sets the default home page to 'Site' and navigates to its 'Preferences' page
Given the following config values are set as admin:
| defaulthomepage | 0 |
And I log in as "admin"
When I follow "Preferences" in the user menu
# There should be no breadcrumbs on this page.
Then ".breadcrumb-item" "css_element" should not exist in the ".breadcrumb" "css_element"

Scenario: Admin user sets the default home page to 'Dashboard' and navigates to its 'Preferences' page
Given the following config values are set as admin:
| defaulthomepage | 1 |
And I log in as "admin"
When I follow "Preferences" in the user menu
# There should be no breadcrumbs on this page.
Then ".breadcrumb-item" "css_element" should not exist in the ".breadcrumb" "css_element"

Scenario: Admin user sets the default home page to 'User preference' and navigates to its 'Preferences' page
Given the following config values are set as admin:
| defaulthomepage | 2 |
And I log in as "admin"
When I follow "Preferences" in the user menu
# There should be no breadcrumbs on this page.
Then ".breadcrumb-item" "css_element" should not exist in the ".breadcrumb" "css_element"

Scenario: Admin user sets the default home page to 'My courses' and navigates to its 'Preferences' page
Given the following config values are set as admin:
| defaulthomepage | 3 |
And I log in as "admin"
When I follow "Preferences" in the user menu
# There should be no breadcrumbs on this page.
Then ".breadcrumb-item" "css_element" should not exist in the ".breadcrumb" "css_element"

0 comments on commit 748ce93

Please sign in to comment.