Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_user
2
Feature: Set the site home page and dashboard as the default home page
3
  In order to set a page as my default home page
4
  As a user
5
  I need to choose which page I want and set it as my home page
6
 
7
  Background:
8
    Given the following "courses" exist:
9
      | fullname | shortname | category | groupmode |
10
      | Course 1 | C1 | 0 | 1 |
11
    And the following "users" exist:
12
      | username | firstname | lastname | email             |
13
      | user1    | User      | One      | user1@example.com |
14
    And the following "course enrolments" exist:
15
      | user     | course | role           |
16
      | user1    | C1     | student        |
17
 
18
  Scenario: Admin sets the site page and then the dashboard as the default home page
19
    # This functionality does not work without the administration block.
20
    Given I log in as "admin"
21
    And I am on site homepage
22
    And I turn editing mode on
23
    And the following config values are set as admin:
24
      | unaddableblocks | | theme_boost|
25
    And I add the "Navigation" block if not present
26
    And I configure the "Navigation" block
27
    And I set the following fields to these values:
28
      | Page contexts | Display throughout the entire site |
29
    And I press "Save changes"
30
    And I add the "Administration" block if not present
31
    And I configure the "Administration" block
32
    And I set the following fields to these values:
33
      | Page contexts | Display throughout the entire site |
34
    And I press "Save changes"
35
    And I navigate to "Appearance > Navigation" in site administration
36
    And I set the field "Start page for users" to "User preference"
37
    And I press "Save changes"
38
    And I am on site homepage
39
    And I follow "Make this my home page"
40
    And I should not see "Make this my home page"
41
    And I am on "Course 1" course homepage
42
    And I should see "Home" in the "Navigation" "block"
43
    And I should not see "Site home" in the "Navigation" "block"
44
    And I am on site homepage
45
    And I follow "Dashboard"
46
    And I follow "Make this my home page"
47
    And I should not see "Make this my home page"
48
    And I am on "Course 1" course homepage
49
    Then I should not see "Home" in the "Navigation" "block"
50
    And I should see "Site home" in the "Navigation" "block"
51
 
52
  Scenario: User cannot configure their preferred default home page unless allowed by admin
53
    Given I log in as "user1"
54
    When I follow "Preferences" in the user menu
55
    Then I should not see "Home page"
56
 
57
  Scenario Outline: User can configure their preferred default home page when allowed by admin
58
    Given I log in as "admin"
59
    And I navigate to "Appearance > Navigation" in site administration
60
    And I set the field "Start page for users" to "User preference"
61
    And I press "Save changes"
62
    And I log out
63
    When I log in as "user1"
64
    And I follow "Preferences" in the user menu
65
    And I follow "Start page"
66
    And I set the field "Start page" to "<preference>"
67
    And I press "Save changes"
68
    And I log out
69
    And I log in as "user1"
70
    Then I should see "<breadcrumb>" is active in navigation
71
 
72
    Examples:
73
      | preference | breadcrumb |
74
      | Home       | Home       |
75
      | Dashboard  | Dashboard  |
76
      | My courses | My courses |