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: In a book, create chapters and sub chapters
3
  In order to create chapters and subchapters
4
  As a teacher
5
  I need to add chapters and subchapters to a book.
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 "course" exists:
13
      | fullname    | Course 1 |
14
      | shortname   | C1       |
15
      | format      | topics   |
16
      | numsections | 1        |
17
    And the following "course enrolments" exist:
18
      | user | course | role |
19
      | teacher1 | C1 | editingteacher |
20
      | student1 | C1 | student        |
21
    And the following "activities" exist:
22
      | activity | name      | course | section |
23
      | book     | Test book | C1     | 1       |
24
    And I log in as "teacher1"
25
    And I am on "Course 1" course homepage with editing mode on
26
 
27
  Scenario: Create chapters and sub chapters and navigate between them
28
    Given the following "mod_book > chapter" exists:
29
      | book    | Test book                       |
30
      | title   | Dummy first chapter             |
31
      | content | Dream is the start of a journey |
32
    And I am on the "Test book" "book activity" page
33
    And I should not see "No content has been added to this book yet."
34
    And I should see "1. Dummy first chapter" in the "Table of contents" "block"
35
    And I click on "Add new chapter after \"Dummy first chapter\"" "link" in the "Table of contents" "block"
36
    And I should see "Dummy first chapter"
37
    And I set the following fields to these values:
38
      | Chapter title | Dummy second chapter |
39
      | Content | The path is the second part |
40
    And I press "Save changes"
41
    And I should see "2. Dummy second chapter" in the "Table of contents" "block"
42
    And I click on "Add new chapter after \"Dummy first chapter\"" "link" in the "Table of contents" "block"
43
    And I should see "Dummy first chapter"
44
    And I set the following fields to these values:
45
      | Chapter title | Dummy first subchapter |
46
      | Content | The path is the second part |
47
      | Subchapter | true |
48
    And I press "Save changes"
49
    And I should see "1.1. Dummy first subchapter" in the "Table of contents" "block"
50
    And I should see "1. Dummy first chapter" in the ".book_content" "css_element"
51
    And I should see "1.1. Dummy first subchapter" in the ".book_content" "css_element"
52
    And I click on "Next" "link"
53
    And I should see "2. Dummy second chapter" in the ".book_content" "css_element"
54
    And I should see "2. Dummy second chapter" in the "strong" "css_element"
55
    And I should not see "Next" in the ".book_content" "css_element"
56
    And I am on "Course 1" course homepage
57
    And I should see "Test book" in the "New section" "section"
58
    And I click on "Test book" "link" in the "New section" "section"
59
    And I should not see "Previous" in the ".book_content" "css_element"
60
    And I should see "1. Dummy first chapter" in the "strong" "css_element"
61
    When I click on "Next" "link"
62
    Then I should see "1.1. Dummy first subchapter" in the ".book_content" "css_element"
63
    And I should see "1.1. Dummy first subchapter" in the "strong" "css_element"
64
    And I click on "Previous" "link"
65
    And I should see "1. Dummy first chapter" in the ".book_content" "css_element"
66
    And I should see "1. Dummy first chapter" in the "strong" "css_element"
67
 
68
  Scenario: Change editing mode for an individual chapter
69
    Given the following "mod_book > chapter" exists:
70
      | book    | Test book                       |
71
      | title   | Dummy first chapter             |
72
      | content | Dream is the start of a journey |
73
    And I am on the "Test book" "book activity" page
74
    And I should see "1. Dummy first chapter" in the "Table of contents" "block"
75
    And "Edit chapter \"1. Dummy first chapter\"" "link" should exist in the "Table of contents" "block"
76
    And "Delete chapter \"1. Dummy first chapter\"" "link" should exist in the "Table of contents" "block"
77
    And "Hide chapter \"1. Dummy first chapter\"" "link" should exist in the "Table of contents" "block"
78
    And "Add new chapter" "link" should exist in the "Table of contents" "block"
79
    When I turn editing mode off
80
    Then "Edit chapter \"1. Dummy first chapter\"" "link" should not exist in the "Table of contents" "block"
81
    And "Delete chapter \"1. Dummy first chapter\"" "link" should not exist in the "Table of contents" "block"
82
    And "Hide chapter \"1. Dummy first chapter\"" "link" should not exist in the "Table of contents" "block"
83
    And "Add new chapter after \"Dummy first chapter\"" "link" should not exist in the "Table of contents" "block"
84
 
85
  Scenario: When chapters are not created yet, students can see a notification in the book activity
86
    Given I am on the "Test book" "book activity" page logged in as student1
87
    Then I should see "No content has been added to this book yet." in the ".alert-info" "css_element"
88
    And I should not see "Table of contents"