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
@core @core_courseformat @show_editor
2
Feature: Verify edit utils availability
3
  In order to edit the course activities
4
  As a student with capability 'moodle/course:manageactivities'
5
  I need to be able to use the edit utils.
6
 
7
  Background:
8
    Given the following "course" exists:
9
      | fullname     | Course 1 |
10
      | shortname    | C1       |
11
      | category     | 0        |
12
      | numsections  | 3        |
13
      | initsections | 1        |
14
    And the following "activities" exist:
15
      | activity | name              | intro                       | course | idnumber | section |
16
      | assign   | Activity sample 1 | Test assignment description | C1     | sample1  | 1       |
17
    And the following "users" exist:
18
      | username | firstname | lastname | email                |
19
      | teacher1 | Teacher   | 1        | teacher1@example.com |
20
      | student1 | Student   | 1        | student1@example.com |
21
      | author1  | Author    | 1        | author1@example.com  |
22
    And the following "roles" exist:
23
      | shortname | name   | archetype |
24
      | author    | Author | student   |
25
    And the following "permission overrides" exist:
26
      | capability                     | permission | role   | contextlevel | reference |
27
      | moodle/course:manageactivities | Allow      | author | Course       | C1        |
28
    And the following "course enrolments" exist:
29
      | user     | course | role           |
30
      | teacher1 | C1     | editingteacher |
31
      | author1  | C1     | author         |
32
      | student1 | C1     | student        |
33
 
34
  @javascript
35
  Scenario: Edit tools should be available to teachers.
36
    Given I log in as "teacher1"
37
    When I am on "Course 1" course homepage
38
    And I turn editing mode on
1441 ariadna 39
    And I open the activity chooser
1 efrain 40
    Then I should see "Add an activity or resource"
1441 ariadna 41
    And I click on "Close" "button" in the "Add an activity or resource" "dialogue"
1 efrain 42
    And I open "Activity sample 1" actions menu
43
    And I should see "Edit settings"
44
    And ".section_action_menu" "css_element" should exist in the "Section 1" "section"
45
    And I click on ".section_action_menu" "css_element" in the "Section 1" "section"
46
    And I should see "Edit settings"
47
 
48
  @javascript
49
  Scenario: Edit mode should not be available to students.
50
    Given I log in as "student1"
51
    When I am on "Course 1" course homepage
52
    Then I should not see "Edit mode"
53
 
54
  @javascript
55
  Scenario: Edit tools should be available to students with manageactivities capability but not allowed to add sections without course:update
56
    Given I log in as "author1"
57
    When I am on "Course 1" course homepage
58
    And I turn editing mode on
59
    Then I should see "Add an activity or resource"
60
    But I should not see "Add section"
61
    And I open "Activity sample 1" actions menu
62
    And I should see "Edit settings"
63
    And I open section "1" edit menu
64
    And I should not see "Edit settings"
65
    And I should see "View"
66
 
67
  @javascript
68
  Scenario: Section adding should be available to students if they also have the capability 'moodle/course:update'.
69
    Given the following "permission overrides" exist:
70
      | capability           | permission | role   | contextlevel | reference |
71
      | moodle/course:update | Allow      | author | Course       | C1        |
72
    And I log in as "author1"
73
    When I am on "Course 1" course homepage
74
    And I turn editing mode on
75
    Then I should see "Add an activity or resource"
76
    And I should see "Add section"
77
    And I open "Activity sample 1" actions menu
78
    And I should see "Edit settings"
79
    And ".section_action_menu" "css_element" should exist in the "Section 1" "section"
80
    And I click on ".section_action_menu" "css_element" in the "Section 1" "section"
81
    And I should see "Edit settings"