Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_data
2
Feature: Teachers can enable comments only if comments are enabled at site level
3
  In order to enable comments on entries
4
  As an admin
5
  I need to enable comments at site level
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email |
10
      | teacher1 | Teacher | 1 | teacher1@example.com |
11
    And the following "courses" exist:
12
      | fullname | shortname | category |
13
      | Course 1 | C1 | 0 |
14
    And the following "course enrolments" exist:
15
      | user | course | role |
16
      | teacher1 | C1 | editingteacher |
17
    When I log in as "teacher1"
18
    And I am on "Course 1" course homepage
19
    And I turn editing mode on
20
 
21
  @javascript
22
  Scenario: Teacher can enable comments if they are enabled at site level
23
    Given I press "Add an activity or resource"
24
    And I click on "Add a new Database" "link" in the "Add an activity or resource" "dialogue"
25
    When I expand all fieldsets
26
    And "Allow comments on entries" "field" should exist
27
    And I set the field "Name" to "Test Database name"
28
    And I set the field "Allow comments on entries" to "Yes"
29
    And I press "Save and return to course"
30
    And I should see "Test Database name"
31
 
32
  @javascript
33
  Scenario: Teacher cannot enable comments if they are disabled at site level
34
    # Disable comments in site config.
35
    Given the following config values are set as admin:
36
      | usecomments | 0 |
37
    And I press "Add an activity or resource"
38
    And I click on "Add a new Database" "link" in the "Add an activity or resource" "dialogue"
39
    When I expand all fieldsets
40
    And I set the field "Name" to "Test Database name 2"
41
    And "Allow comments on entries" "field" should not exist
42
    Then I should see "No" in the "//*[@id=\"fitem_id_comments\"]/*[@data-fieldtype=\"selectyesno\"]" "xpath_element"
43
    And I press "Save and return to course"
44
    And I should see "Test Database name 2"