first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
@@ -0,0 +1,84 @@
@mod @mod_book @core_completion
Feature: View activity completion information in the book activity
In order to have visibility of book completion requirements
As a student
I need to be able to view my book completion progress
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Vinnie | Student1 | student1@example.com |
| teacher1 | Darrell | Teacher1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | enablecompletion | showcompletionconditions |
| Course 1 | C1 | 1 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
And the following "activity" exists:
| activity | book |
| course | C1 |
| idnumber | mh1 |
| name | Music history |
| completion | 2 |
| completionview | 1 |
Scenario: View automatic completion items
Given the following "mod_book > chapter" exists:
| book | Music history |
| title | Drum theory |
| content | Rudiments are important |
And I am on the "Music history" "book activity" page logged in as teacher1
And "Music history" should have the "View" completion condition
# Student view.
When I am on the "Music history" "book activity" page logged in as student1
Then the "View" completion condition of "Music history" is displayed as "done"
Scenario: View automatic completion items with last section hidden
Given the following "activity" exists:
| activity | book |
| course | C1 |
| idnumber | arth1 |
| name | Art history |
| completion | 2 |
| completionview | 1 |
And the following "mod_book > chapters" exist:
| book | title | content | pagenum | subchapter | hidden |
| Art history | First chapter | First chapter | 1 | 0 | 0 |
| Art history | Second chapter | Second chapter | 2 | 0 | 0 |
| Art history | Sub chapter 1 | Sub chapter | 3 | 1 | 0 |
| Art history | Sub chapter 2 | Sub chapter | 4 | 1 | 0 |
| Art history | Sub chapter 3 | Sub chapter | 5 | 1 | 1 |
When I am on the "Art history" "book activity" page logged in as student1
And I should see "First chapter"
And the "View" completion condition of "Art history" is displayed as "todo"
And I follow "Next"
And I should see "Second chapter"
And the "View" completion condition of "Art history" is displayed as "todo"
And I follow "Next"
And I should see "Sub chapter 1"
And the "View" completion condition of "Art history" is displayed as "todo"
And I follow "Next"
And I should see "Sub chapter 2"
And I should not see "Next"
Then the "View" completion condition of "Art history" is displayed as "done"
@javascript
Scenario: Use manual completion
Given I am on the "Music history" "book activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the field "Students must manually mark the activity as done" to "1"
And I press "Save and display"
And I set the following fields to these values:
| Chapter title | Drum theory |
| Content | Rudiments are important |
And I press "Save changes"
And I am on the "Music history" "book activity" page
# Teacher view.
And the manual completion button for "Music history" should be disabled
# Student view.
Given I am on the "Music history" "book activity" page logged in as student1
Then the manual completion button of "Music history" is displayed as "Mark as done"
And I toggle the manual completion state of "Music history"
And the manual completion button of "Music history" is displayed as "Done"
@@ -0,0 +1,88 @@
@mod @mod_book
Feature: In a book, create chapters and sub chapters
In order to create chapters and subchapters
As a teacher
I need to add chapters and subchapters to a book.
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| format | topics |
| numsections | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | name | course | section |
| book | Test book | C1 | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
Scenario: Create chapters and sub chapters and navigate between them
Given the following "mod_book > chapter" exists:
| book | Test book |
| title | Dummy first chapter |
| content | Dream is the start of a journey |
And I am on the "Test book" "book activity" page
And I should not see "No content has been added to this book yet."
And I should see "1. Dummy first chapter" in the "Table of contents" "block"
And I click on "Add new chapter after \"Dummy first chapter\"" "link" in the "Table of contents" "block"
And I should see "Dummy first chapter"
And I set the following fields to these values:
| Chapter title | Dummy second chapter |
| Content | The path is the second part |
And I press "Save changes"
And I should see "2. Dummy second chapter" in the "Table of contents" "block"
And I click on "Add new chapter after \"Dummy first chapter\"" "link" in the "Table of contents" "block"
And I should see "Dummy first chapter"
And I set the following fields to these values:
| Chapter title | Dummy first subchapter |
| Content | The path is the second part |
| Subchapter | true |
And I press "Save changes"
And I should see "1.1. Dummy first subchapter" in the "Table of contents" "block"
And I should see "1. Dummy first chapter" in the ".book_content" "css_element"
And I should see "1.1. Dummy first subchapter" in the ".book_content" "css_element"
And I click on "Next" "link"
And I should see "2. Dummy second chapter" in the ".book_content" "css_element"
And I should see "2. Dummy second chapter" in the "strong" "css_element"
And I should not see "Next" in the ".book_content" "css_element"
And I am on "Course 1" course homepage
And I should see "Test book" in the "New section" "section"
And I click on "Test book" "link" in the "New section" "section"
And I should not see "Previous" in the ".book_content" "css_element"
And I should see "1. Dummy first chapter" in the "strong" "css_element"
When I click on "Next" "link"
Then I should see "1.1. Dummy first subchapter" in the ".book_content" "css_element"
And I should see "1.1. Dummy first subchapter" in the "strong" "css_element"
And I click on "Previous" "link"
And I should see "1. Dummy first chapter" in the ".book_content" "css_element"
And I should see "1. Dummy first chapter" in the "strong" "css_element"
Scenario: Change editing mode for an individual chapter
Given the following "mod_book > chapter" exists:
| book | Test book |
| title | Dummy first chapter |
| content | Dream is the start of a journey |
And I am on the "Test book" "book activity" page
And I should see "1. Dummy first chapter" in the "Table of contents" "block"
And "Edit chapter \"1. Dummy first chapter\"" "link" should exist in the "Table of contents" "block"
And "Delete chapter \"1. Dummy first chapter\"" "link" should exist in the "Table of contents" "block"
And "Hide chapter \"1. Dummy first chapter\"" "link" should exist in the "Table of contents" "block"
And "Add new chapter" "link" should exist in the "Table of contents" "block"
When I turn editing mode off
Then "Edit chapter \"1. Dummy first chapter\"" "link" should not exist in the "Table of contents" "block"
And "Delete chapter \"1. Dummy first chapter\"" "link" should not exist in the "Table of contents" "block"
And "Hide chapter \"1. Dummy first chapter\"" "link" should not exist in the "Table of contents" "block"
And "Add new chapter after \"Dummy first chapter\"" "link" should not exist in the "Table of contents" "block"
Scenario: When chapters are not created yet, students can see a notification in the book activity
Given I am on the "Test book" "book activity" page logged in as student1
Then I should see "No content has been added to this book yet." in the ".alert-info" "css_element"
And I should not see "Table of contents"
@@ -0,0 +1,55 @@
@mod @mod_book
Feature: Display the book description in the book and optionally in the course
In order to display the the book description in the course
As a teacher
I need to enable the 'Display description on course page' setting.
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| book | Test book | A book about dreams! | C1 | book1 |
And the following "mod_book > chapter" exists:
| book | Test book |
| title | Dummy first chapter |
| content | Dream is the start of a journey |
Scenario: Description is displayed in the book
When I am on the "Test book" "book activity" page logged in as teacher1
Then I should see "A book about dreams!"
Scenario: Show book description in the course homepage
Given I am on the "Test book" "book activity editing" page logged in as teacher1
And the following fields match these values:
| Display description on course page | |
And I set the following fields to these values:
| Display description on course page | 1 |
When I press "Save and return to course"
Then I should see "A book about dreams!"
Scenario: Hide book description in the course homepage
Given I am on the "Test book" "book activity editing" page logged in as teacher1
And the following fields match these values:
| Display description on course page | |
When I press "Save and return to course"
Then I should not see "A book about dreams!"
@javascript
Scenario: Description is displayed in the book for students when there are no chapters added yet
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I am on the "Test book" "book activity" page
And I click on "Delete chapter \"1. Dummy first chapter\"" "link" in the "Table of contents" "block"
And I click on "Yes" "button" in the "Confirmation" "dialogue"
And I am on the "Test book" "book activity" page logged in as student1
Then I should see "A book about dreams!"
@@ -0,0 +1,43 @@
@mod @mod_book
Feature: In a book, change the navigation options
In order to change the way a book's chapters can be traversed
As a teacher
I need to change navigation options on a book
Background:
Given the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
# The option to "Style of navigation" is removed from the settings.
Scenario: Change navigation options
Given the following "activities" exist:
| activity | name | course | idnumber | navstyle |
| book | Test book | C1 | book1 | 0 |
And I am on "Course 1" course homepage with editing mode on
And I follow "Test book"
And I should see "Add new chapter"
And I set the following fields to these values:
| Chapter title | Test chapter 1 |
| Content | Lorem ipsum dolor sit amet |
And I press "Save changes"
And I should see "Test book"
And I should see "1. Test chapter 1"
And I click on "Add new chapter" "link" in the "Table of contents" "block"
And I set the following fields to these values:
| Chapter title | Test chapter 2 |
| Content | consectetur adipiscing elit |
And I press "Save changes"
And I should see "Test book"
And I should see "2. Test chapter 2"
And I click on "1. Test chapter 1" "link" in the "Table of contents" "block"
And "Next" "link" should exist
And I click on "2. Test chapter 2" "link" in the "Table of contents" "block"
And "Previous" "link" should exist
+65
View File
@@ -0,0 +1,65 @@
@mod @mod_book @core_tag @javascript
Feature: Edited book chapters handle tags correctly
In order to get book chapters properly labelled
As a user
I need to introduce the tags while editing
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "activity" exists:
| activity | book |
| course | C1 |
| idnumber | book1 |
| name | Test book |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
Scenario: Book chapter edition of custom tags works as expected
Given I am on the "Test book" "book activity" page logged in as teacher1
And I set the following fields to these values:
| Chapter title | Dummy first chapter |
| Content | Dream is the start of a journey |
| Tags | Example, Chapter, Cool |
And I press "Save changes"
Then I should see "Example" in the ".book-tags" "css_element"
And I should see "Chapter" in the ".book-tags" "css_element"
And I should see "Cool" in the ".book-tags" "css_element"
And I turn editing mode on
And I follow "Edit chapter \"1. Dummy first chapter\""
Then I should see "Example" in the ".form-autocomplete-selection" "css_element"
Then I should see "Chapter" in the ".form-autocomplete-selection" "css_element"
Then I should see "Cool" in the ".form-autocomplete-selection" "css_element"
@javascript
Scenario: Book chapter edition of standard tags works as expected
Given the following "tags" exist:
| name | isstandard |
| OT1 | 1 |
| OT2 | 1 |
| OT3 | 1 |
And I am on the "Test book" "book activity" page logged in as teacher1
And I open the autocomplete suggestions list
And I should see "OT1" in the ".form-autocomplete-suggestions" "css_element"
And I should see "OT2" in the ".form-autocomplete-suggestions" "css_element"
And I should see "OT3" in the ".form-autocomplete-suggestions" "css_element"
When I set the following fields to these values:
| Chapter title | Dummy first chapter |
| Content | Dream is the start of a journey |
| Tags | OT1, OT3 |
And I press "Save changes"
Then I should see "OT1" in the ".book-tags" "css_element"
And I should see "OT3" in the ".book-tags" "css_element"
And I should not see "OT2" in the ".book-tags" "css_element"
And I turn editing mode on
And I follow "Edit chapter \"1. Dummy first chapter\""
And I should see "OT1" in the ".form-autocomplete-selection" "css_element"
And I should see "OT3" in the ".form-autocomplete-selection" "css_element"
And I should not see "OT2" in the ".form-autocomplete-selection" "css_element"
+69
View File
@@ -0,0 +1,69 @@
@mod @mod_book
Feature: In a book, verify log entries
In order to create log entries
As an admin
I need to perform various actions in a book.
@javascript @_switch_window
Scenario: perform various book actions and verify log entries.
Given the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
And the following "activity" exists:
| course | C1 |
| activity | book |
| name | Test book |
And I am on the "Course 1" course page logged in as admin
And I turn editing mode on
And I am on the "Test book" "book activity" page
And I set the following fields to these values:
| Chapter title | First chapter |
| Content | First chapter |
And I press "Save changes"
And I click on "Add new chapter" "link" in the "Table of contents" "block"
And I set the following fields to these values:
| Chapter title | Second chapter |
| Content | Second chapter |
And I press "Save changes"
And I click on "Edit" "link" in the "Table of contents" "block"
And I set the following fields to these values:
| Chapter title | First chapter edited |
| Content | First chapter edited |
And I press "Save changes"
And I click on "Next" "link"
And I click on "Previous" "link"
And I navigate to "Print book" in current page administration
And I am on the "Test book" "book activity" page
And I navigate to "Download IMS CP" in current page administration
And I navigate to "Reports > Logs" in site administration
And I set the field "menuid" to "Course 1"
And I press "Get these logs"
Then I should see "Book exported"
And I should see "Book printed"
And I should see "Chapter viewed" in the "#report_log_r4_c5" "css_element"
And I should see "Chapter viewed" in the "#report_log_r5_c5" "css_element"
And I should see "Chapter viewed" in the "#report_log_r6_c5" "css_element"
And I should see "Chapter updated" in the "#report_log_r7_c5" "css_element"
And I should see "Chapter viewed" in the "#report_log_r8_c5" "css_element"
And I should see "Chapter created" in the "#report_log_r9_c5" "css_element"
And I click on "Chapter viewed" "link" in the "#report_log_r4_c5" "css_element"
And I switch to "action" window
And I change window size to "large"
And I should see "1. First chapter edited" in the ".book_content" "css_element"
And I switch to the main window
And I click on "Chapter viewed" "link" in the "#report_log_r5_c5" "css_element"
And I switch to "action" window
And I should see "2. Second chapter" in the ".book_content" "css_element"
And I switch to the main window
And I click on "Chapter updated" "link" in the "#report_log_r7_c5" "css_element"
And I switch to "action" window
And I should see "1. First chapter edited" in the ".book_content" "css_element"
And I switch to the main window
And I click on "Chapter created" "link" in the "#report_log_r9_c5" "css_element"
And I switch to "action" window
And I should see "2. Second chapter" in the ".book_content" "css_element"
And I switch to the main window
And I click on "Chapter created" "link" in the "#report_log_r11_c5" "css_element"
And I switch to "action" window
And I should see "1. First chapter edited" in the ".book_content" "css_element"
And I switch to the main window
@@ -0,0 +1,75 @@
@mod @mod_book
Feature: In a book, chapters and subchapters can be rearranged
In order to rearrange chapters and subchapters
As a teacher
I need to move chapters and subchapters up and down.
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | course | idnumber |
| book | Test book | C1 | book1 |
And the following "mod_book > chapters" exist:
| book | title | content | pagenum |subchapter |
| Test book | Originally first chapter | #1 chapter content | 1 | 0 |
| Test book | A great second chapter | #2 chapter content | 2 | 0 |
| Test book | Second chapter, subchapter 1 | #21 subchapter content | 3 | 1 |
| Test book | Second chapter, subchapter 2 | #22 subchapter content | 4 | 1 |
| Test book | There aren't 2 without 3 | #3 subchapter content | 5 | 0 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test book"
Scenario: Moving chapters down rearranges them properly
Given I click on "Move chapter down \"1. Originally first chapter\"" "link"
When I am on the "Test book" "book activity" page
Then I should see "1. A great second chapter"
And I should see "#2 chapter content"
And I should see "1.1. Second chapter, subchapter 1"
And I should see "1.2. Second chapter, subchapter 2"
And I should see "2. Originally first chapter"
And I should see "3. There aren't 2 without 3"
Scenario: Moving chapters up rearranges them properly
Given I click on "Move chapter up \"3. There aren't 2 without 3\"" "link"
When I am on the "Test book" "book activity" page
Then I should see "1. Originally first chapter"
And I should see "#1 chapter content"
And I should see "2. There aren't 2 without 3"
And I should see "3. A great second chapter"
And I should see "3.1. Second chapter, subchapter 1"
And I should see "3.2. Second chapter, subchapter 2"
Scenario: Moving subchapters down within chapter rearranges them properly
Given I click on "Move chapter down \"2.1. Second chapter, subchapter 1\"" "link"
When I should see "2.1. Second chapter, subchapter 2"
Then I should see "2.2. Second chapter, subchapter 1"
Scenario: Moving subchapters down out of chapter rearranges them properly
Given I click on "Move chapter down \"2.2. Second chapter, subchapter 2\"" "link"
When I should see "3.1. Second chapter, subchapter 2"
Then I click on "Move chapter down \"3. There aren't 2 without 3\"" "link"
And I should not see "4. There aren't 2 without 3"
And I should see "3. There aren't 2 without 3"
And I should see "3.1. Second chapter, subchapter 2"
Scenario: Moving subchapters up within chapter rearranges them properly
Given I click on "Move chapter up \"2.2. Second chapter, subchapter 2\"" "link"
When I should see "2.1. Second chapter, subchapter 2"
Then I should see "2.2. Second chapter, subchapter 1"
Scenario: Moving subchapters up out of chapter rearranges them properly
Given I click on "Move chapter up \"2.1. Second chapter, subchapter 1\"" "link"
When I should see "1.1. Second chapter, subchapter 1"
Then I click on "Move chapter up \"1.1. Second chapter, subchapter 1\"" "link"
And I should not see "1.1. Second chapter, subchapter 1"
And I should see "1. Second chapter, subchapter 1"
And I should see "2. Originally first chapter"
@@ -0,0 +1,59 @@
@mod @mod_book
Feature: Book activity chapter visibility management
In order to properly manage chapters in a book activity
As a teacher
I need to be able to show or hide chapters.
Background:
Given the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 2 | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activity" exists:
| course | C1 |
| activity | book |
| name | Test book |
And the following "mod_book > chapters" exist:
| book | title | content | pagenum |subchapter |
| Test book | First chapter | First chapter | 1 | 0 |
| Test book | Second chapter | Second chapter | 2 | 0 |
| Test book | Sub chapter | Sub chapter | 3 | 1 |
| Test book | Third chapter | Third chapter | 4 | 0 |
| Test book | Fourth chapter | Fourth chapter | 5 | 0 |
And I am on the "Course 1" course page logged in as teacher1
And I turn editing mode on
And I am on the "Test book" "book activity" page
And I click on "4. Fourth chapter" "link" in the "Table of contents" "block"
@javascript
Scenario: Show/hide chapters and subchapters
When I follow "Hide chapter \"2. Second chapter\""
And I follow "Hide chapter \"2. Third chapter\""
And I am on the "Test book" "book activity" page
And I am on "Course 1" course homepage
And I turn editing mode off
And I click on "Test book" "link" in the "region-main" "region"
Then the "class" attribute of "a[title='Second chapter']" "css_element" should contain "dimmed_text"
And the "class" attribute of "a[title='Third chapter']" "css_element" should contain "dimmed_text"
And I am on "Course 1" course homepage with editing mode on
And I click on "Test book" "link" in the "region-main" "region"
And I follow "Next"
And I should see "Second chapter" in the ".book_content" "css_element"
And I follow "Next"
And I should see "Sub chapter" in the ".book_content" "css_element"
And I follow "Next"
And I should see "Third chapter" in the ".book_content" "css_element"
And I follow "Next"
And I should see "Fourth chapter" in the ".book_content" "css_element"
And I am on the "Test book" "book activity" page logged in as student1
And I should not see "Second chapter" in the "Table of contents" "block"
And I should not see "Third chapter" in the "Table of contents" "block"
And I follow "Next"
And I should see "Fourth chapter" in the ".book_content" "css_element"