Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
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"
1441 ariadna 57
    And I click on "[data-region='site-home-link']" "css_element"
58
    And I should see "Dashboard" in the "page-header" "region"
1 efrain 59
 
60
  @theme_boost
1441 ariadna 61
  Scenario: Guest users can only see the Home and Calendar items in the primary navigation menu
1 efrain 62
    Given I log in as "guest"
63
    When I am on site homepage
64
    Then I should see "Home" in the ".primary-navigation" "css_element"
1441 ariadna 65
    And I should see "Calendar" in the ".primary-navigation" "css_element"
1 efrain 66
    And I should not see "Dashboard" in the ".primary-navigation" "css_element"
67
    And I should not see "My courses" in the ".primary-navigation" "css_element"
68
    And I should not see "Site administration" in the ".primary-navigation" "css_element"
69
 
70
  Scenario: Dashboard is not displayed in the primary navigation when it is disabled
71
    Given the following config values are set as admin:
72
      | enabledashboard | 0 |
73
    When I am on the "My courses" page logged in as "user1"
74
    Then I should not see "Dashboard"
75
    And the following config values are set as admin:
76
      | enabledashboard | 1 |
77
# We need to reload the page to skip the "Welcome, xxxx!" and display the real page title.
78
    And I reload the page
79
    And I should see "Dashboard"
80
 
81
  Scenario: Start page when default home is dashboard but dashboard is disabled
82
    Given the following config values are set as admin:
83
      | enabledashboard | 0 |
84
# 1 = Dashboard.
85
      | defaulthomepage | 1 |
86
    When I log in as "admin"
87
# We need to reload the page to skip the "Welcome, xxxx!" and display the real page title.
88
    And I reload the page
89
    Then I should not see "Dashboard" in the "page-header" "region"
90
    And I should see "My courses" in the "page-header" "region"
91
    And I log out
92
# Check dashboard is displayed when it's re-enabled.
93
    And the following config values are set as admin:
94
      | enabledashboard | 1 |
95
    And I log in as "admin"
96
# We need to reload the page to skip the "Welcome, xxxx!" and display the real page title.
97
    And I reload the page
98
    And I should see "Dashboard" in the "page-header" "region"
99
    And I should not see "My courses" in the "page-header" "region"
100
 
101
  Scenario: Start page when default home is user preference set to dashboard but dashboard is disabled
102
    Given the following config values are set as admin:
103
      | enabledashboard | 0 |
104
# 2 = User preference.
105
      | defaulthomepage | 2 |
106
# 1 = Dashboard.
107
    And the following "user preferences" exist:
108
      | user      | preference                       | value |
109
      | admin     | user_home_page_preference        | 1     |
110
    When I log in as "admin"
111
# We need to reload the page to skip the "Welcome, xxxx!" and display the real page title.
112
    And I reload the page
113
    Then I should not see "Dashboard"
114
    And I should see "My courses" in the "page-header" "region"
115
    And I log out
116
# Check dashboard is displayed when it's re-enabled.
117
    And the following config values are set as admin:
118
      | enabledashboard | 1 |
119
    And I log in as "admin"
120
# We need to reload the page to skip the "Welcome, xxxx!" and display the real page title.
121
    And I reload the page
122
    And I should see "Dashboard" in the "page-header" "region"
123
    And I should not see "My courses" in the "page-header" "region"