Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_choice
2
Feature: Editing choice block
3
  In order to customise choice page
4
  As a teacher or admin
5
  I need to add remove block from the choice page
6
 
7
  # This tests that the hacky block editing is not borked by legacy forms in choice activity.
8
  Scenario: Add a choice activity as admin and check blog menu block should contain link.
9
    Given the following "courses" exist:
10
      | fullname | shortname | category |
11
      | Course 1 | C1 | 0 |
12
    And the following "activity" exists:
13
      | activity | choice               |
14
      | course   | C1                   |
15
      | idnumber | choice1              |
16
      | name     | Choice name 1        |
17
      | intro    | Choice Description 1 |
18
      | section  | 1                    |
19
      | option   | Option 1, Option 2   |
20
    And the following "blocks" exist:
21
      | blockname | contextlevel    | reference | pagetypepattern | defaultregion |
22
      | blog_menu | Activity module | choice1   | mod-choice-*    | side-pre      |
23
    And I log in as "admin"
24
    And I am on "Course 1" course homepage with editing mode on
25
    And I follow "Choice name 1"
26
    And I should see "View all entries about this Choice"
27
    When I configure the "Blog menu" block
28
    And I press "Save changes"
29
    Then I should see "View all entries about this Choice"
30
    And I open the "Blog menu" blocks action menu
31
    And I click on "Delete" "link" in the "Blog menu" "block"
32
    And I press "Yes"
33
    And I should not see "View all entries about this Choice"
34
    And I should see "Choice Description 1"
35
 
36
  Scenario: Add a choice activity as teacher and check blog menu block contain choice link.
37
    Given the following "users" exist:
38
      | username | firstname | lastname | email |
39
      | teacher1 | Teacher | 1 | teacher1@example.com |
40
      | student1 | Student | 1 | student1@example.com |
41
    And the following "courses" exist:
42
      | fullname | shortname | category |
43
      | Course 1 | C1 | 0 |
44
    And the following "course enrolments" exist:
45
      | user | course | role |
46
      | teacher1 | C1 | editingteacher |
47
      | student1 | C1 | student |
48
    And the following "activity" exists:
49
      | activity | choice               |
50
      | course   | C1                   |
51
      | idnumber | choice1              |
52
      | name     | Choice name 1        |
53
      | intro    | Choice Description 1 |
54
      | section  | 1                    |
55
      | option   | Option 1, Option 2   |
56
    And the following "blocks" exist:
57
      | blockname | contextlevel    | reference | pagetypepattern | defaultregion |
58
      | blog_menu | Activity module | choice1   | mod-choice-*    | side-pre      |
59
    And I log in as "teacher1"
60
    And I am on "Course 1" course homepage with editing mode on
61
    And I follow "Choice name 1"
62
    And I should see "View all entries about this Choice"
63
    When I configure the "Blog menu" block
64
    And I press "Save changes"
65
    Then I should see "View all entries about this Choice"
66
    And I open the "Blog menu" blocks action menu
67
    And I click on "Delete" "link" in the "Blog menu" "block"
68
    And I press "Yes"
69
    And I should not see "View all entries about this Choice"
70
    And I should see "Choice Description 1"
71
 
72
  Scenario: Add a choice activity as teacher (with dual role) and check blog menu block contain choice link.
73
    Given the following "users" exist:
74
      | username | firstname | lastname | email |
75
      | teacher1 | Teacher | 1 | teacher1@example.com |
76
    And the following "courses" exist:
77
      | fullname | shortname | category |
78
      | Course 1 | C1 | 0 |
79
    And the following "course enrolments" exist:
80
      | user | course | role |
81
      | teacher1 | C1 | editingteacher |
82
      | teacher1 | C1 | student |
83
    And the following "activity" exists:
84
      | activity | choice               |
85
      | course   | C1                   |
86
      | idnumber | choice1              |
87
      | name     | Choice name 1        |
88
      | intro    | Choice Description 1 |
89
      | section  | 1                    |
90
      | option   | Option 1, Option 2   |
91
    And the following "blocks" exist:
92
      | blockname | contextlevel    | reference | pagetypepattern | defaultregion |
93
      | blog_menu | Activity module | choice1   | mod-choice-*    | side-pre      |
94
    And I log in as "teacher1"
95
    And I am on "Course 1" course homepage with editing mode on
96
    And I follow "Choice name 1"
97
    And I should see "View all entries about this Choice"
98
    When I configure the "Blog menu" block
99
    And I press "Save changes"
100
    Then I should see "View all entries about this Choice"
101
    And I open the "Blog menu" blocks action menu
102
    And I click on "Delete" "link" in the "Blog menu" "block"
103
    And I press "Yes"
104
    And I should not see "View all entries about this Choice"
105
    And I should see "Choice Description 1"