[ Index ]

PHP Cross Reference of Unnamed Project

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    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 | format |
  13        | Course 1 | C1 | topics |
  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      And I add a "Book" to section "1" and I fill the form with:
  21        | Name | Test book |
  22        | Description | A book about dreams! |
  23  
  24    Scenario: Create chapters and sub chapters and navigate between them
  25      Given I follow "Test book"
  26      And I should see "Add new chapter"
  27      And I set the following fields to these values:
  28        | Chapter title | Dummy first chapter |
  29        | Content | Dream is the start of a journey |
  30      And I press "Save changes"
  31      And I should see "1 Dummy first chapter" in the "Table of contents" "block"
  32      And I click on "Add new chapter" "link" in the "Table of contents" "block"
  33      And I set the following fields to these values:
  34        | Chapter title | Dummy second chapter |
  35        | Content | The path is the second part |
  36      And I press "Save changes"
  37      And I should see "2 Dummy second chapter" in the "Table of contents" "block"
  38      And I click on "Add new chapter" "link" in the "Table of contents" "block"
  39      And I set the following fields to these values:
  40        | Chapter title | Dummy first subchapter |
  41        | Content | The path is the second part |
  42        | Subchapter | true |
  43      And I press "Save changes"
  44      And I should see "1.1 Dummy first subchapter" in the "Table of contents" "block"
  45      And I should see "1 Dummy first chapter" in the ".book_content" "css_element"
  46      And I should see "1.1 Dummy first subchapter" in the ".book_content" "css_element"
  47      And I click on "Next" "link"
  48      And I should see "2 Dummy second chapter" in the ".book_content" "css_element"
  49      And I should see "2 Dummy second chapter" in the "strong" "css_element"
  50      And I should not see "Next" in the ".book_content" "css_element"
  51      And I click on "Exit book" "link"
  52      And I should see "Test book" in the "Topic 1" "section"
  53      And I follow "Test book"
  54      And I should not see "Previous" in the ".book_content" "css_element"
  55      And I should see "1 Dummy first chapter" in the "strong" "css_element"
  56      When I click on "Next" "link"
  57      Then I should see "1.1 Dummy first subchapter" in the ".book_content" "css_element"
  58      And I should see "1.1 Dummy first subchapter" in the "strong" "css_element"
  59      And I click on "Previous" "link"
  60      And I should see "1 Dummy first chapter" in the ".book_content" "css_element"
  61      And I should see "1 Dummy first chapter" in the "strong" "css_element"
  62  
  63    Scenario: Change editing mode for an individual chapter
  64      Given I follow "Test book"
  65      And I should see "Add new chapter"
  66      And I set the following fields to these values:
  67        | Chapter title | Dummy first chapter |
  68        | Content | Dream is the start of a journey |
  69      And I press "Save changes"
  70      And I should see "1 Dummy first chapter" in the "Table of contents" "block"
  71      And "Edit chapter \"1 Dummy first chapter\"" "link" should exist in the "Table of contents" "block"
  72      And "Delete chapter \"1 Dummy first chapter\"" "link" should exist in the "Table of contents" "block"
  73      And "Hide chapter \"1 Dummy first chapter\"" "link" should exist in the "Table of contents" "block"
  74      And "Add new chapter" "link" should exist in the "Table of contents" "block"
  75      When I click on "Turn editing off" "link" in the "Administration" "block"
  76      Then "Edit chapter \"1 Dummy first chapter\"" "link" should not exist in the "Table of contents" "block"
  77      And "Delete chapter \"1 Dummy first chapter\"" "link" should not exist in the "Table of contents" "block"
  78      And "Hide chapter \"1 Dummy first chapter\"" "link" should not exist in the "Table of contents" "block"
  79      And "Add new chapter" "link" should not exist in the "Table of contents" "block"


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1