1 |
efrain |
1 |
@javascript @theme_boost
|
|
|
2 |
Feature: Primary navigation
|
|
|
3 |
To navigate in boost theme
|
|
|
4 |
As a user
|
|
|
5 |
I need to use the primary navigation
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| user1 | User | One | user1@example.com |
|
|
|
11 |
|
|
|
12 |
@javascript @theme_boost
|
|
|
13 |
Scenario Outline: Admin sets defaulthomepage and verify the landing page and site home link
|
|
|
14 |
Given I log in as "admin"
|
|
|
15 |
And the following config values are set as admin:
|
|
|
16 |
| defaulthomepage | <defaulthomepageset> |
|
|
|
17 |
And I am on homepage
|
|
|
18 |
And I should see "<homepage>" in the "a.nav-link.active:not([tabindex])" "css_element"
|
|
|
19 |
And I should see "<sitehome>" in the "<linkelement>" "css_element"
|
|
|
20 |
|
|
|
21 |
Examples:
|
|
|
22 |
| defaulthomepageset | homepage | sitehome | linkelement |
|
|
|
23 |
| 0 | Home | Home | a.nav-link.active:not([tabindex]):not([href*='redirect=0']) |
|
|
|
24 |
| 1 | Dashboard | Home | a.nav-link[tabindex='-1'][href$='redirect=0'] |
|
|
|
25 |
| 3 | My courses | Home | a.nav-link[tabindex='-1'][href$='redirect=0'] |
|
|
|
26 |
|
|
|
27 |
@javascript @theme_boost
|
|
|
28 |
Scenario Outline: Admin sets defaulthomepage to user preference and verifies the landing page based on it
|
|
|
29 |
Given I log in as "admin"
|
|
|
30 |
And I navigate to "Appearance > Navigation" in site administration
|
|
|
31 |
And I set the field "Start page for users" to "User preference"
|
|
|
32 |
And I press "Save changes"
|
|
|
33 |
And I follow "Preferences" in the user menu
|
|
|
34 |
And I follow "Start page"
|
|
|
35 |
And I set the field "Start page" to "<userpreference>"
|
|
|
36 |
And I press "Save changes"
|
|
|
37 |
And the following config values are set as admin:
|
|
|
38 |
| defaulthomepage | 2 |
|
|
|
39 |
And I log out
|
|
|
40 |
And I log in as "admin"
|
|
|
41 |
And I should see "<homepage>" in the "a.nav-link.active:not([tabindex])" "css_element"
|
|
|
42 |
|
|
|
43 |
Examples:
|
|
|
44 |
| userpreference | homepage |
|
|
|
45 |
| Home | Home |
|
|
|
46 |
| Dashboard | Dashboard |
|
|
|
47 |
| My courses | My courses |
|
|
|
48 |
|
|
|
49 |
@javascript @theme_boost
|
|
|
50 |
Scenario: Users could use primary nav menu on mobile size screens
|
|
|
51 |
Given I change window size to "mobile"
|
|
|
52 |
And I am on the "My courses" page logged in as "user1"
|
|
|
53 |
Then "Home" "link" should not be visible
|
|
|
54 |
And "Side panel" "button" should exist
|
|
|
55 |
And I click on "Side panel" "button"
|
|
|
56 |
And I should see "Home" in the "theme_boost-drawers-primary" "region"
|
|
|
57 |
|
|
|
58 |
@theme_boost
|
|
|
59 |
Scenario: Guest users can only see the Home item in the primary navigation menu
|
|
|
60 |
Given I log in as "guest"
|
|
|
61 |
When I am on site homepage
|
|
|
62 |
Then I should see "Home" in the ".primary-navigation" "css_element"
|
|
|
63 |
And I should not see "Dashboard" in the ".primary-navigation" "css_element"
|
|
|
64 |
And I should not see "My courses" in the ".primary-navigation" "css_element"
|
|
|
65 |
And I should not see "Site administration" in the ".primary-navigation" "css_element"
|
|
|
66 |
|
|
|
67 |
Scenario: Dashboard is not displayed in the primary navigation when it is disabled
|
|
|
68 |
Given the following config values are set as admin:
|
|
|
69 |
| enabledashboard | 0 |
|
|
|
70 |
When I am on the "My courses" page logged in as "user1"
|
|
|
71 |
Then I should not see "Dashboard"
|
|
|
72 |
And the following config values are set as admin:
|
|
|
73 |
| enabledashboard | 1 |
|
|
|
74 |
# We need to reload the page to skip the "Welcome, xxxx!" and display the real page title.
|
|
|
75 |
And I reload the page
|
|
|
76 |
And I should see "Dashboard"
|
|
|
77 |
|
|
|
78 |
Scenario: Start page when default home is dashboard but dashboard is disabled
|
|
|
79 |
Given the following config values are set as admin:
|
|
|
80 |
| enabledashboard | 0 |
|
|
|
81 |
# 1 = Dashboard.
|
|
|
82 |
| defaulthomepage | 1 |
|
|
|
83 |
When I log in as "admin"
|
|
|
84 |
# We need to reload the page to skip the "Welcome, xxxx!" and display the real page title.
|
|
|
85 |
And I reload the page
|
|
|
86 |
Then I should not see "Dashboard" in the "page-header" "region"
|
|
|
87 |
And I should see "My courses" in the "page-header" "region"
|
|
|
88 |
And I log out
|
|
|
89 |
# Check dashboard is displayed when it's re-enabled.
|
|
|
90 |
And the following config values are set as admin:
|
|
|
91 |
| enabledashboard | 1 |
|
|
|
92 |
And I log in as "admin"
|
|
|
93 |
# We need to reload the page to skip the "Welcome, xxxx!" and display the real page title.
|
|
|
94 |
And I reload the page
|
|
|
95 |
And I should see "Dashboard" in the "page-header" "region"
|
|
|
96 |
And I should not see "My courses" in the "page-header" "region"
|
|
|
97 |
|
|
|
98 |
Scenario: Start page when default home is user preference set to dashboard but dashboard is disabled
|
|
|
99 |
Given the following config values are set as admin:
|
|
|
100 |
| enabledashboard | 0 |
|
|
|
101 |
# 2 = User preference.
|
|
|
102 |
| defaulthomepage | 2 |
|
|
|
103 |
# 1 = Dashboard.
|
|
|
104 |
And the following "user preferences" exist:
|
|
|
105 |
| user | preference | value |
|
|
|
106 |
| admin | user_home_page_preference | 1 |
|
|
|
107 |
When I log in as "admin"
|
|
|
108 |
# We need to reload the page to skip the "Welcome, xxxx!" and display the real page title.
|
|
|
109 |
And I reload the page
|
|
|
110 |
Then I should not see "Dashboard"
|
|
|
111 |
And I should see "My courses" in the "page-header" "region"
|
|
|
112 |
And I log out
|
|
|
113 |
# Check dashboard is displayed when it's re-enabled.
|
|
|
114 |
And the following config values are set as admin:
|
|
|
115 |
| enabledashboard | 1 |
|
|
|
116 |
And I log in as "admin"
|
|
|
117 |
# We need to reload the page to skip the "Welcome, xxxx!" and display the real page title.
|
|
|
118 |
And I reload the page
|
|
|
119 |
And I should see "Dashboard" in the "page-header" "region"
|
|
|
120 |
And I should not see "My courses" in the "page-header" "region"
|