[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/mod/book/tests/behat/ -> create_chapters.feature (source)

   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    Scenario: create chapters and sub chapters and naviagte between them
   8      Given the following "courses" exist:
   9        | fullname | shortname | category | groupmode |
  10        | Course 1 | C1 | 0 | 1 |
  11      And the following "users" exist:
  12        | username | firstname | lastname | email |
  13        | teacher1 | Teacher | 1 | [email protected] |
  14      And the following "course enrolments" exist:
  15        | user | course | role |
  16        | teacher1 | C1 | editingteacher |
  17      And I log in as "teacher1"
  18      And I follow "Course 1"
  19      And I turn editing mode on
  20      When I add a "Book" to section "1" and I fill the form with:
  21        | Name | Test book |
  22        | Description | A book about dreams! |
  23      And I follow "Test book"
  24      Then I should see "Add new chapter"
  25      And I set the following fields to these values:
  26        | Chapter title | Dummy first chapter |
  27        | Content | Dream is the start of a journey |
  28      And I press "Save changes"
  29      And I should see "1 Dummy first chapter" in the "Table of contents" "block"
  30      And I click on "Add new chapter" "link" in the "Table of contents" "block"
  31      And I set the following fields to these values:
  32        | Chapter title | Dummy second chapter |
  33        | Content | The path is the second part |
  34      And I press "Save changes"
  35      And I should see "2 Dummy second chapter" in the "Table of contents" "block"
  36      And I click on "Add new chapter" "link" in the "Table of contents" "block"
  37      And I set the following fields to these values:
  38        | Chapter title | Dummy first subchapter |
  39        | Content | The path is the second part |
  40        | Subchapter | true |
  41      And I press "Save changes"
  42      And I should see "1.1 Dummy first subchapter" in the "Table of contents" "block"
  43      And I should see "1 Dummy first chapter" in the ".book_content" "css_element"
  44      And I should see "1.1 Dummy first subchapter" in the ".book_content" "css_element"
  45      And I click on "Next" "link"
  46      And I should see "2 Dummy second chapter" in the ".book_content" "css_element"
  47      And I should see "2 Dummy second chapter" in the "strong" "css_element"
  48      And I should not see "Next" in the ".book_content" "css_element"
  49      And I click on "Exit book" "link"
  50      And I should see "Test book" in the "#section-1" "css_element"
  51      And I follow "Test book"
  52      And I should not see "Previous" in the ".book_content" "css_element"
  53      And I should see "1 Dummy first chapter" in the "strong" "css_element"
  54      And I click on "Next" "link"
  55      And I should see "1.1 Dummy first subchapter" in the ".book_content" "css_element"
  56      And I should see "1.1 Dummy first subchapter" in the "strong" "css_element"
  57      And I click on "Previous" "link"
  58      And I should see "1 Dummy first chapter" in the ".book_content" "css_element"
  59      And I should see "1 Dummy first chapter" in the "strong" "css_element"


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1