1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-24 09:55:33 +02:00

MDL-75830 behat: Book behat tests optimised

Replace steps that manually add Book instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
Additionally, performed Behat cleanup and optimisation to affected
files.
This commit is contained in:
Angelia Dela Cruz 2022-09-27 09:59:14 +08:00
parent 880462a168
commit 710607ce5f
23 changed files with 111 additions and 246 deletions

@ -37,7 +37,7 @@ Feature: The recently accessed items block allows users to easily access their m
Given the following "activities" exist:
| activity | name | intro | course | idnumber |
| assign | Test assignment name | Test assignment description | C1 | assign1 |
| book | Test book name | Test book description | C1 | book1 |
| book | Test book name | | C1 | book1 |
| choice | Test choice name | Test choice description | C1 | choice1 |
| data | Test database name | Test database description | C1 | data1 |
And I change window size to "large"

@ -15,16 +15,13 @@ Feature: Block appearances
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | description | course | idnumber | section | template |
| survey | Test survey name | | C1 | survey1 | 1 | 4 |
| book | Test book name | Test book description | C1 | book1 | 1 | |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I click on "Test book name" "link" in the "region-main" "region"
And I set the following fields to these values:
| Chapter title | Book title |
| Content | Book content test test |
And I press "Save changes"
| activity | name | course | idnumber | template |
| survey | Test survey name | C1 | survey1 | 4 |
| book | Test book name | C1 | book1 | |
And the following "mod_book > chapter" exists:
| book | Test book name |
| title | Book title |
| content | Book content test test |
And I am on the "Course 1" course page logged in as teacher1
And I turn editing mode on
And I add the "Comments" block

@ -17,17 +17,11 @@ Feature: Block region moving
And the following "activities" exist:
| activity | course | name | template |
| survey | C1 | Test survey name | 4 |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Book" to section "1" and I fill the form with:
| Name | Test book name |
| Description | Test book description |
And I follow "Test book name"
And I set the following fields to these values:
| Chapter title | Book title |
| Content | Book content test test |
And I press "Save changes"
And I log out
| book | C1 | Test book name | |
And the following "mod_book > chapter" exists:
| book | Test book name |
| title | Book title |
| content | Book content test test |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Comments" block

@ -18,7 +18,7 @@ Feature: Course content collapsed user preferences
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
| book | Activity sample 2 | Test book description | C1 | sample2 | 2 |
| book | Activity sample 2 | | C1 | sample2 | 2 |
| choice | Activity sample 3 | Test choice description | C1 | sample3 | 3 |
| assign | Activity sample 4 | Test assignment description | C1 | sample1 | 4 |
| assign | Activity sample 5 | Test assignment description | C1 | sample1 | 5 |

@ -18,7 +18,7 @@ Feature: Course index depending on role
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
| book | Activity sample 2 | Test book description | C1 | sample2 | 2 |
| book | Activity sample 2 | | C1 | sample2 | 2 |
| choice | Activity sample 3 | Test choice description | C1 | sample3 | 3 |
And the following "course enrolments" exist:
| user | course | role |
@ -129,10 +129,9 @@ Feature: Course index depending on role
@javascript
Scenario: Course index toggling
Given the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| book | Second activity in section 1 | Test book description | C1 | sample4 | 1 |
And I log in as "teacher1"
When I am on "Course 1" course homepage
| activity | name | course | idnumber | section |
| book | Second activity in section 1 | C1 | sample4 | 1 |
When I am on the "Course 1" course page logged in as teacher1
# Sections should be opened by default.
Then I should see "Topic 1" in the "courseindex-content" "region"
And I should see "Activity sample 1" in the "courseindex-content" "region"

@ -14,7 +14,7 @@ Feature: Verify that courseindex is usable with the keyboard
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
| book | Activity sample 2 | Test book description | C1 | sample2 | 2 |
| book | Activity sample 2 | | C1 | sample2 | 2 |
| choice | Activity sample 3 | Test choice description | C1 | sample3 | 3 |
Given I am on the "C1" "Course" page logged in as "admin"
And I change window size to "large"

@ -14,7 +14,7 @@ Feature: Move activity using keyboard
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
| book | Activity sample 2 | Test book description | C1 | sample2 | 2 |
| book | Activity sample 2 | | C1 | sample2 | 2 |
| choice | Activity sample 3 | Test choice description | C1 | sample3 | 3 |
| choice | Other sample 3 | Test choice description | C1 | sample31 | 3 |
And I log in as "admin"

@ -14,7 +14,7 @@ Feature: Move a section using keyboard
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
| book | Activity sample 2 | Test book description | C1 | sample2 | 2 |
| book | Activity sample 2 | | C1 | sample2 | 2 |
| choice | Activity sample 3 | Test choice description | C1 | sample3 | 3 |
| choice | Other sample 3 | Test choice description | C1 | sample31 | 3 |
And I log in as "admin"

@ -14,7 +14,7 @@ Feature: Sections can be edited and deleted in topics format
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Test assignment name | Test assignment description | C1 | assign1 | 0 |
| book | Test book name | Test book description | C1 | book1 | 1 |
| book | Test book name | | C1 | book1 | 1 |
| chat | Test chat name | Test chat description | C1 | chat1 | 4 |
| choice | Test choice name | Test choice description | C1 | choice1 | 5 |
And the following "course enrolments" exist:

@ -14,7 +14,7 @@ Feature: Sections can be edited and deleted in weeks format
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Test assignment name | Test assignment description | C1 | assign1 | 0 |
| book | Test book name | Test book description | C1 | book1 | 1 |
| book | Test book name | | C1 | book1 | 1 |
| chat | Test chat name | Test chat description | C1 | chat1 | 4 |
| choice | Test choice name | Test choice description | C1 | choice1 | 5 |
And the following "course enrolments" exist:

@ -22,8 +22,8 @@ Feature: Collapse course sections
| activity | name | intro | course | idnumber | section | completion |
| assign | Assignment 1 | Test assignment description1 | C1 | assign1 | 1 | 1 |
| assign | Assignment 2 | Test assignment description2 | C1 | assign2 | 2 | 1 |
| book | Book 2 | Test book description2 | C1 | book2 | 2 | 1 |
| book | Book 3 | Test book description3 | C1 | book3 | 3 | 1 |
| book | Book 2 | | C1 | book2 | 2 | 1 |
| book | Book 3 | | C1 | book3 | 3 | 1 |
| forum | Forum 4 | Test forum description4 | C1 | forum4 | 4 | 1 |
| forum | Forum 5 | Test forum description5 | C1 | forum5 | 5 | 1 |
And the following "course enrolments" exist:
@ -58,8 +58,7 @@ Feature: Collapse course sections
@javascript
Scenario: Expand/collapse sections for Topics format.
Given I log in as "student1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as student1
And "[data-toggle=collapse]" "css_element" should exist in the "region-main" "region"
And I should see "Assignment 1" in the "region-main" "region"
And I should see "Assignment 2" in the "region-main" "region"
@ -97,8 +96,7 @@ Feature: Collapse course sections
@javascript
Scenario: Expand/collapse sections for Weeks format.
Given I log in as "teacher1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as teacher1
When I navigate to "Settings" in current page administration
And I expand all fieldsets
And I set the following fields to these values:

@ -21,7 +21,6 @@ Feature: View activity completion information in the book activity
| course | C1 |
| idnumber | mh1 |
| name | Music history |
| section | 1 |
| completion | 2 |
| completionview | 1 |
@ -32,7 +31,6 @@ Feature: View activity completion information in the book activity
| 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
And I log out
# 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"
@ -50,7 +48,6 @@ Feature: View activity completion information in the book activity
And I am on the "Music history" "book activity" page
# Teacher view.
And the manual completion button for "Music history" should be disabled
And I log out
# 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"

@ -17,18 +17,17 @@ Feature: In a book, create chapters and sub chapters
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | section |
| book | Test book | A book about dreams! | C1 | 1 |
| 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 I am on the "Test book" Activity page
And I should see "Add new chapter"
And I set the following fields to these values:
| Chapter title | Dummy first chapter |
| Content | Dream is the start of a journey |
And I press "Save changes"
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"
@ -65,12 +64,11 @@ Feature: In a book, create chapters and sub chapters
And I should see "1. Dummy first chapter" in the "strong" "css_element"
Scenario: Change editing mode for an individual chapter
Given I am on the "Test book" Activity page
And I should see "Add new chapter"
And I set the following fields to these values:
| Chapter title | Dummy first chapter |
| Content | Dream is the start of a journey |
And I press "Save changes"
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"

@ -17,50 +17,39 @@ Feature: Display the book description in the book and optionally in the course
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| book | Test book | A book about dreams! | C1 | book1 | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I am on the "Test book" "book activity" page
And I should see "Add new chapter"
And I set the following fields to these values:
| Chapter title | Dummy first chapter |
| Content | Dream is the start of a journey |
And I press "Save changes"
| 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
Given I am on "Course 1" course homepage
When I am on the "Test book" "book activity" page
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 "Course 1" course homepage
And I am on the "Test book" "book activity" page
And I navigate to "Settings" in current page administration
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 |
And I press "Save and return to course"
When I am on "Course 1" course homepage
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 "Course 1" course homepage
And I am on the "Test book" "book activity" page
And I navigate to "Settings" in current page administration
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 press "Save and return to course"
When I am on "Course 1" course homepage
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 am on "Course 1" course homepage with editing mode on
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 log out
And I am on the "Test book" "book activity" page logged in as student1
Then I should see "A book about dreams!"

@ -19,8 +19,8 @@ Feature: In a book, change the navigation options
# The option to "Style of navigation" is removed from the settings.
Scenario: Change navigation options
Given the following "activities" exist:
| activity | name | intro | course | idnumber | section | navstyle |
| book | Test book | A book about lorem ipsum | C1 | book1 | 1 | 0 |
| 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"

@ -17,7 +17,6 @@ Feature: Edited book chapters handle tags correctly
| course | C1 |
| idnumber | book1 |
| name | Test book |
| description | A book about dreams |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
@ -48,7 +47,6 @@ Feature: Edited book chapters handle tags correctly
And I follow "Add standard tags"
And I set the field "Enter comma-separated list of new tags" to "OT1, OT2, OT3"
And I press "Continue"
And I log out
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"

@ -14,7 +14,7 @@ Feature: In a book, verify log entries
| activity | book |
| name | Test book |
And I am on the "Course 1" course page logged in as admin
And I am on "Course 1" course homepage with editing mode on
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 |

@ -15,44 +15,22 @@ Feature: In a book, chapters and subchapters can be rearranged
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| book | Test book | A book about rearrangements! | C1 | book1 | 1 |
| 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"
And I should see "Add new chapter"
And I set the following fields to these values:
| Chapter title | Originally first chapter |
| Content | #1 chapter content |
And I press "Save changes"
And I click on "Add new chapter after \"Originally first chapter\"" "link"
And I set the following fields to these values:
| Chapter title | A great second chapter |
| Content | #2 chapter content |
And I press "Save changes"
And I click on "Add new chapter after \"A great second chapter\"" "link"
And I set the following fields to these values:
| Chapter title | Second chapter, subchapter 1 |
| Content | #21 subchapter content |
| Subchapter | 1 |
And I press "Save changes"
And I click on "Add new chapter after \"Second chapter, subchapter 1\"" "link"
And I set the following fields to these values:
| Chapter title | Second chapter, subchapter 2 |
| Content | #22 subchapter content |
| Subchapter | 1 |
And I press "Save changes"
And I click on "Add new chapter after \"Second chapter, subchapter 2\"" "link"
And I set the following fields to these values:
| Chapter title | There aren't 2 without 3 |
| Content | #3 subchapter content |
| Subchapter | 0 |
And I press "Save changes"
Scenario: Moving chapters down rearranges them properly
Given I click on "Move chapter down \"1. Originally first chapter\"" "link"
When I am on "Course 1" course homepage
And I follow "Test book"
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"
@ -62,8 +40,7 @@ Feature: In a book, chapters and subchapters can be rearranged
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 "Course 1" course homepage
And I follow "Test book"
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"

@ -20,36 +20,17 @@ Feature: Book activity chapter visibility management
| course | C1 |
| activity | book |
| name | Test book |
And I am on the "Test book" "book activity" page logged in as teacher1
And I set the following fields to these values:
| Chapter title | First chapter |
| Content | First chapter |
And I press "Save changes"
And I am on "Course 1" course homepage
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 click on "Test book" "link" in the "region-main" "region"
And I click on "Add new chapter after \"First chapter\"" "link"
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 "Add new chapter after \"Second chapter\"" "link"
And I set the following fields to these values:
| Chapter title | Sub chapter |
| subchapter | 1 |
| Content | Sub chapter |
And I press "Save changes"
And I click on "Add new chapter after \"Sub chapter\"" "link"
And I set the following fields to these values:
| Chapter title | Third chapter |
| subchapter | 0 |
| Content | Third chapter |
And I press "Save changes"
And I click on "Add new chapter after \"Third chapter\"" "link"
And I set the following fields to these values:
| Chapter title | Fourth chapter |
| Content | Fourth chapter |
And I press "Save changes"
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
@ -61,8 +42,7 @@ Feature: Book activity chapter visibility management
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
And I turn editing mode on
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"
@ -72,7 +52,6 @@ Feature: Book activity chapter visibility management
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 log out
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"

@ -21,30 +21,22 @@ Feature: Filter an outline report
And the following "activities" exist:
| activity | name | description | course | idnumber | section |
| forum | Forum name | Forum description | C1 | FORUM01 | 1 |
| book | Book name | Book description | C1 | BOOK01 | 1 |
When I log in as "admin"
And I am on "Course 1" course homepage
| book | Book name | | C1 | BOOK01 | 1 |
When I am on the "Course 1" course page logged in as admin
Scenario: Filter the outline report by start date
Given I navigate to "Plugins > Logging > Manage log stores" in site administration
And "Enable" "link" should exist in the "Legacy log" "table_row"
And "Disable" "link" should exist in the "Standard log" "table_row"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student1
And I follow "Forum name"
And the log timestamp for "student1" and "FORUM01" is set to "12 June 2017 12:49:00"
And I am on "Course 1" course homepage
And I follow "Book name"
And the log timestamp for "student1" and "BOOK01" is set to "10 June 2017 14:01:00"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Book name"
And I am on the "Book name" "book activity" page logged in as student2
And the log timestamp for "student2" and "BOOK01" is set to "14 June 2017 11:02:00"
And I log out
And I log in as "admin"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as admin
And I navigate to "Reports" in current page administration
And I click on "Activity report" "link"
And I should see "2 views by 2 users" in the "Book name" "table_row"
@ -62,22 +54,15 @@ Feature: Filter an outline report
Given I navigate to "Plugins > Logging > Manage log stores" in site administration
And "Enable" "link" should exist in the "Legacy log" "table_row"
And "Disable" "link" should exist in the "Standard log" "table_row"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student1
And I follow "Forum name"
And the log timestamp for "student1" and "FORUM01" is set to "12 June 2017 12:49:00"
And I am on "Course 1" course homepage
And I follow "Book name"
And the log timestamp for "student1" and "BOOK01" is set to "10 June 2017 14:01:00"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Book name"
And I am on the "Book name" "book activity" page logged in as student2
And the log timestamp for "student2" and "BOOK01" is set to "14 June 2017 11:02:00"
And I log out
And I log in as "admin"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as admin
And I navigate to "Reports" in current page administration
And I click on "Activity report" "link"
And I should see "2 views by 2 users" in the "Book name" "table_row"

@ -21,9 +21,8 @@ Feature: View an outline report
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| forum | Forum name | Forum description | C1 | forum1 |
| book | Book name | Book description | C1 | book1 |
When I log in as "admin"
And I am on "Course 1" course homepage
| book | Book name | | C1 | book1 |
When I am on the "Course 1" course page logged in as admin
Scenario: View the outline report when only the legacy log reader is enabled
Given I navigate to "Plugins > Logging > Manage log stores" in site administration
@ -31,19 +30,13 @@ Feature: View an outline report
And I click on "Disable" "link" in the "Standard log" "table_row"
And the following config values are set as admin:
| loglegacy | 1 | logstore_legacy |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student1
And I follow "Forum name"
And I am on "Course 1" course homepage
And I follow "Book name"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student2
And I follow "Book name"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as teacher1
When I navigate to "Reports" in current page administration
And I click on "Activity report" "link"
Then I should see "2 views by 2 users" in the "Book name" "table_row"
@ -53,19 +46,13 @@ Feature: View an outline report
Given I navigate to "Plugins > Logging > Manage log stores" in site administration
And "Enable" "link" should exist in the "Legacy log" "table_row"
And "Disable" "link" should exist in the "Standard log" "table_row"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student1
And I follow "Forum name"
And I am on "Course 1" course homepage
And I follow "Book name"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student2
And I follow "Book name"
And I log out
And I log in as "admin"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as admin
When I navigate to "Reports" in current page administration
And I click on "Activity report" "link"
Then I should see "2 views by 2 users" in the "Book name" "table_row"
@ -77,19 +64,13 @@ Feature: View an outline report
And "Disable" "link" should exist in the "Standard log" "table_row"
And the following config values are set as admin:
| loglegacy | 1 | logstore_legacy |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student1
And I follow "Forum name"
And I am on "Course 1" course homepage
And I follow "Book name"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student2
And I follow "Book name"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as teacher1
When I navigate to "Reports" in current page administration
And I click on "Activity report" "link"
Then I should see "2 views by 2 users" in the "Book name" "table_row"
@ -105,54 +86,42 @@ Feature: View an outline report
Then I should see "No log reader enabled"
Scenario: Multiple views from a single user are identified as not distinct
Given I log out
And I log in as "student1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as student1
And I follow "Forum name"
And I am on "Course 1" course homepage
And I follow "Forum name"
And I am on "Course 1" course homepage
And I follow "Forum name"
And I am on site homepage
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as teacher1
And I navigate to "Reports" in current page administration
And I click on "Activity report" "link"
Then I should see "3 views by 1 users" in the "Forum name" "table_row"
And I should see "-" in the "Book name" "table_row"
Scenario: Multiple views from multiple users are identified as not distinct
Given I log out
And I log in as "student1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as student1
And I follow "Forum name"
And I am on "Course 1" course homepage
And I follow "Forum name"
And I am on "Course 1" course homepage
And I follow "Forum name"
And I am on site homepage
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as student2
And I follow "Forum name"
And I am on "Course 1" course homepage
And I follow "Forum name"
And I am on "Course 1" course homepage
And I follow "Forum name"
And I am on site homepage
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as teacher1
And I navigate to "Reports" in current page administration
And I click on "Activity report" "link"
Then I should see "6 views by 2 users" in the "Forum name" "table_row"
And I should see "-" in the "Book name" "table_row"
Scenario: No views from any users
Given I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as teacher1
And I navigate to "Reports" in current page administration
And I click on "Activity report" "link"
Then I should see "-" in the "Forum name" "table_row"

@ -20,13 +20,11 @@ Feature: In a participation report, admin can filter student actions
| course | C1 |
| activity | book |
| name | Test book name |
| description | Test book |
| idnumber | book1 |
And I am on the "Test book name" "book activity" page logged in as teacher1
And I set the following fields to these values:
| Chapter title | Test chapter |
| Content | Test chapter content |
And I log out
And the following "mod_book > chapter" exists:
| book | Test book name |
| title | Test chapter |
| content | Test chapter content |
@javascript
Scenario: Filter participation report when only legacy log reader is enabled
@ -36,10 +34,8 @@ Feature: In a participation report, admin can filter student actions
And I click on "Enable" "link" in the "Legacy log" "table_row"
And the following config values are set as admin:
| loglegacy | 1 | logstore_legacy |
And I log out
And I am on the "Test book name" "book activity" page logged in as student1
And I log out
When I am on the "Course 1" course page logged in as admin
When I navigate to "Reports" in current page administration
@ -57,7 +53,6 @@ Feature: In a participation report, admin can filter student actions
And I click on "Enable" "link" in the "Legacy log" "table_row"
And the following config values are set as admin:
| loglegacy | 1 | logstore_legacy |
And I log out
And I am on the "Test book name" "book activity" page logged in as student1
And I log out
@ -65,13 +60,10 @@ Feature: In a participation report, admin can filter student actions
And I log in as "admin"
And I navigate to "Plugins > Logging > Manage log stores" in site administration
And I click on "Enable" "link" in the "Standard log" "table_row"
And I log out
And I am on the "Test book name" "book activity" page logged in as student1
And I log out
And I log in as "admin"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as admin
When I navigate to "Reports" in current page administration
And I click on "Course participation" "link"
And I set the field "instanceid" to "Test book name"
@ -82,10 +74,8 @@ Feature: In a participation report, admin can filter student actions
@javascript
Scenario: Filter participation report when only standard log reader is enabled by default
Given I am on the "Test book name" "book activity" page logged in as student1
And I log out
And I log in as "admin"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as admin
And I navigate to "Reports" in current page administration
And I click on "Course participation" "link"
And I set the field "instanceid" to "Test book name"

@ -25,14 +25,11 @@ Feature: Use the particiaption report to message groups of students
| activity | book |
| name | Test book name |
| idnumber | Test book name |
| description | Test book |
| idnumber | book1 |
And I am on the "Test book name" "book activity" page logged in as student1
And I log out
Scenario: Message all students from the participation report
Given I log in as "teacher1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as teacher1
And I navigate to "Reports" in current page administration
And I click on "Course participation" "link"
And I set the field "instanceid" to "Test book name"
@ -46,8 +43,7 @@ Feature: Use the particiaption report to message groups of students
And I should see "Message sent to 3 people"
Scenario: Message students who have not participated in book
Given I log in as "teacher1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as teacher1
And I navigate to "Reports" in current page administration
And I click on "Course participation" "link"
And I set the field "instanceid" to "Test book name"
@ -66,8 +62,7 @@ Feature: Use the particiaption report to message groups of students
Scenario: Ensure no message options when messaging is disabled
Given the following config values are set as admin:
| messaging | 0 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as teacher1
And I navigate to "Reports" in current page administration
And I click on "Course participation" "link"
When I set the field "instanceid" to "Test book name"