Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@block @block_site_main_menu
2
Feature: Add URL to main menu block
3
  In order to add helpful resources for students
4
  As a admin
5
  I need to add URLs to the main menu block and check it works.
6
 
7
  Background:
8
    Given the following "courses" exist:
9
      | fullname | shortname | category | enablecompletion |
10
      | Course 1 | C1        | 0        | 1                |
11
      | Course 2 | C2        | 0        |                  |
12
    And the following "blocks" exist:
13
      | blockname      | contextlevel | reference | pagetypepattern | defaultregion |
14
      | site_main_menu | System       | 1         | site-index      | side-pre      |
15
 
16
  @javascript
17
  Scenario: Add a URL in menu block and ensure it appears
18
    Given I log in as "admin"
19
    And I am on site homepage
20
    And the following "activity" exists:
21
      | activity    | url                   |
22
      | course      | Acceptance test site  |
23
      | name        | reference link        |
24
      | intro       | mooooooooodle         |
25
      | externalurl | http://www.moodle.com |
26
      | section     | 0                     |
27
    When I am on the "reference link" "url activity editing" page
28
    And I expand all fieldsets
29
    And I set the following fields to these values:
30
      | id_display | In pop-up |
31
    And I press "Save and return to course"
32
    And I turn editing mode on
33
    Then "reference link" "link" should exist in the "Main menu" "block"
34
    And "Add an activity or resource" "button" should exist in the "Main menu" "block"
35
 
36
  @javascript
37
  Scenario: Add a URL in menu block can appear in the entire site
38
    When I log in as "admin"
39
    And I am on site homepage
40
    And I turn editing mode on
41
    And I configure the "Main menu" block
42
    And I set the following fields to these values:
43
      | Page contexts | Display throughout the entire site |
44
    And I press "Save changes"
45
    And the following "activity" exists:
46
      | activity    | url                   |
47
      | course      | Acceptance test site  |
48
      | name        | reference link        |
49
      | intro       | mooooooooodle         |
50
      | externalurl | http://www.moodle.com |
51
      | section     | 0                     |
52
    And I am on the "reference link" "url activity editing" page
53
    And I expand all fieldsets
54
    And I set the following fields to these values:
55
      | id_display | Embed |
56
    And I press "Save and return to course"
57
    Then I click on "reference link" "link" in the "Main menu" "block"
58
    And "reference link" "link" should exist in the "Main menu" "block"
59
    And I am on the "C1" "Course" page
60
    And "reference link" "link" should exist in the "Main menu" "block"
61
    And I navigate to "Badges > Add a new badge" in site administration
62
    And "reference link" "link" should exist in the "Main menu" "block"
63
 
64
  @javascript
65
  Scenario: Add a URL in menu block can appear in any front page
66
    When I log in as "admin"
67
    And I am on site homepage
68
    And I turn editing mode on
69
    And I configure the "Main menu" block
70
    And I set the following fields to these values:
71
      | Page contexts | Display on the site home and any pages added to the site home. |
72
    And I press "Save changes"
73
    And the following "activity" exists:
74
      | activity    | url                   |
75
      | course      | Acceptance test site  |
76
      | name        | reference link        |
77
      | intro       | mooooooooodle         |
78
      | externalurl | http://www.moodle.com |
79
      | section     | 0                     |
80
    And I am on the "reference link" "url activity editing" page
81
    And I expand all fieldsets
82
    And I set the following fields to these values:
83
      | id_display | Embed |
84
    And I press "Save and return to course"
85
    Then I click on "reference link" "link" in the "Main menu" "block"
86
    And "reference link" "link" should exist in the "Main menu" "block"
87
    And I am on the "C1" "Course" page
88
    And "Main menu" "block" should not exist
89
    And I navigate to "Badges > Add a new badge" in site administration
90
    And "Main menu" "block" should not exist
91
 
92
  @javascript
93
  Scenario: When the "Main Menu" block is displayed throrought the entire site, adding an URL in a course
94
  results in adding it in the course and not in the frontpage
95
    Given I log in as "admin"
96
    And I am on site homepage
97
    And I turn editing mode on
98
    And I configure the "Main menu" block
99
    And I set the following fields to these values:
100
      | Page contexts | Display throughout the entire site |
101
    And I press "Save changes"
102
    When the following "activity" exists:
103
      | activity        | url                   |
104
      | course          | C2                    |
105
      | name            | reference link        |
106
      | intro           | mooooooooodle         |
107
      | externalurl     | http://www.moodle.com |
108
      | section         | 0                     |
109
      | showdescription | 1                     |
110
    And I am on the "reference link" "url activity editing" page
111
    And I expand all fieldsets
112
    And I set the following fields to these values:
113
      | id_display | In pop-up |
114
    And I press "Save and return to course"
115
    Then "reference link" "link" should not exist in the "Main menu" "block"
116
    And I should see "mooooooooodle" in the "region-main" "region"