Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_book
2
Feature: Display the book description in the book and optionally in the course
3
  In order to display the the book description in the course
4
  As a teacher
5
  I need to enable the 'Display description on course page' setting.
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                |
10
      | teacher1 | Teacher   | 1        | teacher1@example.com |
11
      | student1 | Student   | 1        | student1@example.com |
12
    And the following "courses" exist:
13
      | fullname | shortname | format |
14
      | Course 1 | C1        | topics |
15
    And the following "course enrolments" exist:
16
      | user     | course | role           |
17
      | teacher1 | C1     | editingteacher |
18
      | student1 | C1     | student        |
19
    And the following "activities" exist:
20
      | activity | name      | intro                | course | idnumber |
21
      | book     | Test book | A book about dreams! | C1     | book1    |
22
    And the following "mod_book > chapter" exists:
23
      | book    | Test book                       |
24
      | title   | Dummy first chapter             |
25
      | content | Dream is the start of a journey |
26
 
27
  Scenario: Description is displayed in the book
28
    When I am on the "Test book" "book activity" page logged in as teacher1
29
    Then I should see "A book about dreams!"
30
 
31
  Scenario: Show book description in the course homepage
32
    Given I am on the "Test book" "book activity editing" page logged in as teacher1
33
    And the following fields match these values:
34
      | Display description on course page |  |
35
    And I set the following fields to these values:
36
      | Display description on course page | 1 |
37
    When I press "Save and return to course"
38
    Then I should see "A book about dreams!"
39
 
40
  Scenario: Hide book description in the course homepage
41
    Given I am on the "Test book" "book activity editing" page logged in as teacher1
42
    And the following fields match these values:
43
      | Display description on course page |  |
44
    When I press "Save and return to course"
45
    Then I should not see "A book about dreams!"
46
 
47
  @javascript
48
  Scenario: Description is displayed in the book for students when there are no chapters added yet
49
    Given I log in as "teacher1"
50
    And I am on "Course 1" course homepage with editing mode on
51
    And I am on the "Test book" "book activity" page
52
    And I click on "Delete chapter \"1. Dummy first chapter\"" "link" in the "Table of contents" "block"
53
    And I click on "Yes" "button" in the "Confirmation" "dialogue"
54
    And I am on the "Test book" "book activity" page logged in as student1
55
    Then I should see "A book about dreams!"