MDL-72179 behat: Make use of page resolvers

This commit is contained in:
Andrew Nicols
2021-07-21 11:36:34 +08:00
parent 9f99c226dd
commit 82e63108fa
146 changed files with 1300 additions and 2219 deletions
+1
View File
@@ -0,0 +1 @@
mod/forum/tests/behat/forum_subscriptions_default.feature
@@ -48,7 +48,7 @@ Feature: Verify that all form fields values can be get and set
And the "Unenrol users" select box should not contain "Baker"
And the "Unenrol users" select box should not contain "President, Baker"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I press "Create page"
# Text (textarea & editor) & Select (multi-select) - Checking "I set the following fields to these values".
When I set the following fields to these values:
@@ -61,8 +61,7 @@ Feature: Verify that all form fields values can be get and set
# Checkbox - Checking "I set the field" and "The field matches value" ticked.
And I set the field "Force format" to "1"
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And the field "Force format" matches value "1"
@@ -70,8 +69,7 @@ Feature: Verify that all form fields values can be get and set
# Checkbox - Checking "I set the field" and "The field matches value" unticked.
And I set the field "Force format" to ""
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And the field "Force format" matches value ""
@@ -80,8 +78,7 @@ Feature: Verify that all form fields values can be get and set
And I set the following fields to these values:
| Force format | 1 |
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And the following fields match these values:
@@ -92,8 +89,7 @@ Feature: Verify that all form fields values can be get and set
And I set the following fields to these values:
| Force format | |
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And the following fields match these values:
@@ -115,20 +111,21 @@ Feature: Verify that all form fields values can be get and set
| Wiki name | Test this one baby |
| Default format | HTML |
And I press "Cancel"
And I am on "Course 1" course homepage
# Radio - Checking "I set the field" and "the field matches value".
And I add a "Choice" to section "1" and I fill the form with:
| Choice name | Test choice name |
| Description | Test choice description |
| Allow choice to be updated | Yes |
| Option 1 | one |
| Option 2 | two |
| Option 3 | three |
And I follow "Test choice name"
And I set the field "one" to "1"
And the following "activity" exists:
| activity | choice |
| course | C1 |
| idnumber | choice1 |
| intro | Test choice description |
| name | Test choice name |
| option | Option 1, Option 2, Option 3 |
| section | 1 |
| allowupdate | 1 |
And I am on the "Test choice name" "choice activity" page
And I set the field "Option 1" to "1"
And I press "Save my choice"
And the field "one" matches value "1"
And the field "two" matches value ""
And the field "Option 1" matches value "1"
And the field "Option 2" matches value ""
# Check if field xpath set/match works.
And I am on "Course 1" course homepage
And I navigate to "Edit settings" in current page administration
@@ -174,31 +171,23 @@ Feature: Verify that all form fields values can be get and set
And I press "Cancel"
# Advanced checkbox requires real browser to allow uncheck to work. MDL-58681. MDL-55386.
# Advanced checkbox - Checking "I set the field" and "The field matches value" ticked.
And I am on "Course 1" course homepage
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And I set the field "Display description on course page" to "1"
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And the field "Display description on course page" matches value "1"
And the field "Display description on course page" does not match value ""
# Advanced checkbox - Checking "I set the field" and "The field matches value" unticked.
And I set the field "Display description on course page" to ""
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And the field "Display description on course page" matches value ""
And the field "Display description on course page" does not match value "1"
# Advanced checkbox - Checking "I set the following fields to these values:" and "The following fields match these values" ticked.
And I set the following fields to these values:
| Display description on course page | 1 |
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And the following fields match these values:
| Display description on course page | 1 |
And the following fields do not match these values:
@@ -207,9 +196,7 @@ Feature: Verify that all form fields values can be get and set
And I set the following fields to these values:
| Display description on course page | |
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And the following fields match these values:
| Display description on course page | |
And the following fields do not match these values:
@@ -24,9 +24,7 @@ Feature: See the competencies for an activity on the course competencies page.
| activity | name | intro | course | idnumber | completion | completionview |
| page | PageName1 | PageDesc1 | C1 | PAGE1 | 1 | 1 |
| page | PageName2 | PageDesc2 | C1 | PAGE2 | 1 | 1 |
And I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I am on the "Course 1" course page logged in as admin
And I follow "Competencies"
And I press "Add competencies to course"
And "Competency picker" "dialogue" should be visible
@@ -36,9 +34,7 @@ Feature: See the competencies for an activity on the course competencies page.
And "Competency picker" "dialogue" should be visible
And I select "Test-Comp2" of the competency tree
And I click on "Add" "button" in the "Competency picker" "dialogue"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
And I am on the PageName1 "page activity editing" page
And I follow "Expand all"
And I set the field "Course competencies" to "Test-Comp1"
And I press "Save and return to course"
@@ -46,10 +42,8 @@ Feature: See the competencies for an activity on the course competencies page.
@javascript
Scenario: Go to the competency course competencies page.
When I log in as "student1"
And I am on site homepage
And I follow "Course 1"
And I follow "Competencies"
Given I am on the "Course 1" course page logged in as student1
When I follow "Competencies"
Then I should see "Test-Comp1"
And I should see "Test-Comp2"
And I set the field "Filter competencies by resource or activity" to "PageName1"
@@ -64,12 +58,5 @@ Feature: See the competencies for an activity on the course competencies page.
@javascript
Scenario: None course competencies page.
When I log in as "student1"
And I am on site homepage
And I follow "Course 1"
And I follow "PageName1"
Then I should see "Test page content"
And I am on site homepage
And I follow "Course 1"
And I follow "PageName1"
When I am on the PageName1 "page activity" page logged in as student1
Then I should see "Test page content"
@@ -42,9 +42,7 @@ Feature: Backup user data
| Feedback for the response 'True'. | So you think it is true |
| Feedback for the response 'False'. | So you think it is false |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Quiz 1"
When I am on the "Quiz 1" "quiz activity" page logged in as student1
And I press "Attempt quiz now"
And I click on "True" "radio" in the "First question" "question"
And I click on "False" "radio" in the "Second question" "question"
@@ -48,10 +48,10 @@ Feature: Confirm that conditions on completion no longer cause a bug
And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
And I set the field with xpath "//div[contains(concat(' ', normalize-space(@class), ' '), ' availability-item ')][preceding-sibling::div]//select[@name='cm']" to "Page2"
And I press "Save and return to course"
And I should see "Not available unless:" in the ".activity.glossary" "css_element"
Then I should see "Not available unless:" in the ".activity.glossary" "css_element"
And I should see "The activity Page1 is marked complete" in the ".activity.glossary" "css_element"
And I should see "The activity Page2 is marked complete" in the ".activity.glossary" "css_element"
And I follow "TestGlossary"
# Behat will automatically check there is no error on this page.
Then I should see "TestGlossary"
And I am on the TestGlossary "glossary activity" page
And I should see "TestGlossary"
@@ -86,13 +86,12 @@ Feature: availability_grade
And I set the field "Minimum grade percentage (inclusive)" to "10"
And I press "Save and return to course"
And I log out
# Log in as student without a grade yet.
When I log out
And I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "A1" "assign activity" page logged in as student1
# Do the assignment.
And I follow "A1"
And I click on "Add submission" "button"
And I set the field "Online text" to "Q"
And I click on "Save changes" "button"
@@ -103,25 +102,22 @@ Feature: availability_grade
And I should not see "P3" in the "region-main" "region"
And I should not see "P4" in the "region-main" "region"
And I should see "A1" in the "region-main" "region"
And I log out
# Log back in as teacher.
When I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
When I am on the "A1" "assign activity" page logged in as teacher1
# Give the assignment 40%.
And I follow "A1"
And I navigate to "View all submissions" in current page administration
# Pick the grade link in the row that has s@example.com in it.
And I click on "Grade" "link" in the "s@example.com" "table_row"
And I set the field "Grade out of 100" to "40"
And I click on "Save changes" "button"
And I click on "Edit settings" "link"
And I log out
# Log back in as student.
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
# Check pages are visible.
Then I should see "P2" in the "region-main" "region"
@@ -95,8 +95,7 @@ Feature: availability_profile
And I click on "Save and return to course" "button"
# Edit it again and check the setting still works.
When I follow "P1"
And I navigate to "Edit settings" in current page administration
When I am on the P1 "page activity editing" page
And I expand all fieldsets
Then the field "User profile field" matches value "Super field"
And the field "Value to compare against" matches value "Bananaman"
+5 -5
View File
@@ -51,18 +51,18 @@ Feature: Award badges based on activity completion
And I log out
Scenario: Student earns a badge using activity completion, but does not get passing grade
When I log in as "student1"
Given I log in as "student1"
And I am on "Course 1" course homepage
And the "Test quiz name" "quiz" activity with "auto" completion should be marked as not complete
And I follow "Test quiz name"
When I am on the "Test quiz name" "quiz activity" page
And I press "Re-attempt quiz"
And I set the field "False" to "1"
And I press "Finish attempt ..."
And I press "Submit all and finish"
And I click on "Submit all and finish" "button" in the "Confirmation" "dialogue"
And I log out
Then 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 "Badges > Manage badges" in current page administration
And I follow "Course Badge"
And I should see "Recipients (1)"
Then I should see "Recipients (1)"
@@ -27,9 +27,7 @@ Feature: Course overview block show users their progress on courses
Then I should not see "0%" in the "Course overview" "block"
Scenario: User complete activity and verify his progress
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test choice 1"
Given I am on the "Test choice 1" "choice activity" page logged in as teacher1
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Completion tracking | Show activity as complete when conditions are met |
@@ -40,8 +38,8 @@ Feature: Course overview block show users their progress on courses
And I click on "All (except removed from view)" "button" in the "Course overview" "block"
Then I should see "Course 1" in the "Course overview" "block"
And I should see "0%" in the "Course overview" "block"
And I am on "Course 1" course homepage
And I follow "Test choice 1"
And I am on the "Test choice 1" "choice activity" page
And I follow "Dashboard" in the user menu
And I click on "All (except removed from view)" "button" in the "Course overview" "block"
And I should see "100%" in the "Course overview" "block"
@@ -19,7 +19,7 @@ Feature: The private files block allows users to store files privately in moodle
| page | C1 | page1 | Test page name | Test page description |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test page name"
And I am on the "Test page name" "page activity" page
And I add the "Private files" block
And I should see "No files available" in the "Private files" "block"
When I follow "Manage private files..."
@@ -16,24 +16,20 @@ Feature: The recently accessed items block allows users to easily access their m
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
And I log in as "admin"
And I am on "Course 1" course homepage
And I turn editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Forum type | Standard forum for general use |
| Description | Test forum description |
And I log out
And the following "activity" exists:
| course | C1 |
| activity | forum |
| idnumber | Test forum name |
| name | Test forum name |
And I log in as "student1"
When I press "Customise this page"
And I press "Customise this page"
And I add the "Recently accessed items" block
Scenario: User has not accessed any item
Then I should see "No recent items" in the "Recently accessed items" "block"
Scenario: User has accessed some items
Given I am on "Course 1" course homepage
When I follow "Test forum name"
Given I change window size to "large"
When I am on the "Test forum name" "forum activity" page
And I follow "Dashboard" in the user menu
And I change window size to "large"
Then I should see "Test forum name" in the "Recently accessed items" "block"
@@ -36,12 +36,10 @@ Feature: Restrict activity availability through date conditions
| x[year] | 2037 |
And I press "Save and return to course"
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as student1
Then I should see "Available from 31 December 2037"
And "Test assignment 1" "link" should not exist in the "page" "region"
And "Test assignment 1" activity should be dimmed
And "Test assignment 1" "link" should not exist
And I log out
@javascript
Scenario: Show activity hidden to students when available until date is in past
@@ -60,6 +58,5 @@ Feature: Restrict activity availability through date conditions
And I click on ".availability-item .availability-eye img" "css_element"
And I press "Save and return to course"
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
Then I should not see "Test assignment 2"
When I am on the "Course 1" course page logged in as student1
Then I should not see "Test assignment 2" in the "page" "region"
@@ -17,13 +17,16 @@ Feature: Restrict activity availability through grade conditions
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And the following "activity" exists:
| course | C1 |
| activity | assign |
| idnumber | Grade assignment |
| name | Grade assignment |
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
| submissiondrafts | 0 |
And I am on the "Course 1" course page logged in as teacher1
And I am on "Course 1" course homepage with editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Grade assignment |
| Description | Grade this assignment to revoke restriction on restricted assignment |
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
# Adding the page like this because id_availableform_enabled needs to be clicked to trigger the action.
And I add a "Page" to section "2"
And I expand all fieldsets
@@ -31,15 +34,15 @@ Feature: Restrict activity availability through grade conditions
And I click on "Grade" "button" in the "Add restriction..." "dialogue"
And I click on "min" "checkbox"
And I set the following fields to these values:
| Name | Test page name |
| Description | Restricted page, till grades in Grade assignment is at least 20% |
| Page content | Test page contents |
| id | Grade assignment |
| minval | 20 |
| Name | Test page name |
| Description | Restricted page, till grades in Grade assignment is at least 20% |
| Page content | Test page contents |
| id | Grade assignment |
| minval | 20 |
And I press "Save and return to course"
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as student1
Then I should see "Not available unless: You achieve a required score in Grade assignment"
And "Test page name" activity should be dimmed
And "Test page name" "link" should not exist
@@ -50,9 +53,8 @@ Feature: Restrict activity availability through grade conditions
And I press "Save changes"
And I should see "Submitted for grading"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Grade assignment"
And I am on the "Grade assignment" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student First" "table_row"
And I set the following fields to these values:
@@ -60,7 +62,7 @@ Feature: Restrict activity availability through grade conditions
And I press "Save changes"
And I follow "Edit settings"
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 "Test page name" activity should be visible
And I should not see "Not available unless: You achieve a required score in Grade assignment"
@@ -76,16 +76,14 @@ Feature: Restrict sections availability through completion or grade conditions
And I am on "Course 1" course homepage
Then I should see "Not available unless: You achieve a required score in Grade assignment"
And "Test page name" activity should be hidden
And I follow "Grade assignment"
And I am on the "Grade assignment" "assign activity" page
And I press "Add submission"
And I set the following fields to these values:
| Online text | I'm the student submission |
And I press "Save changes"
And I should see "Submitted for grading"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Grade assignment"
And I am on the "Grade assignment" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student First" "table_row"
And I set the following fields to these values:
@@ -93,7 +91,6 @@ Feature: Restrict sections availability through completion or grade conditions
And I press "Save changes"
And I follow "Edit settings"
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 "Test page name" activity should be visible
And I should not see "Not available unless: You achieve a required score in Grade assignment"
@@ -45,9 +45,7 @@ Feature: Activity navigation involving activities with access restrictions
@javascript
Scenario: Activity navigation involving activities with access restrictions
Given I log in as "student1"
And I am on "Course 1" course homepage
When I follow "Page 1"
Given I am on the "Page 1" "page activity" page logged in as student1
Then I should see "Page 2" in the "#next-activity-link" "css_element"
# Activity that has access restriction should not show up in the dropdown.
And the "Jump to..." select box should not contain "Page 3"
@@ -56,7 +54,7 @@ Feature: Activity navigation involving activities with access restrictions
And I should see "Page 2" in the "#prev-activity-link" "css_element"
And the "Jump to..." select box should not contain "Page 3"
# Navigate to Page 2.
And I follow "Page 2"
And I click on "Page 2" "link" in the "page-content" "region"
# Since Page 2 has now been viewed and deemed completed, Page 3 can now be accessed.
And I should see "Page 3" in the "#next-activity-link" "css_element"
And the "Jump to..." select box should contain "Page 3"
+2 -5
View File
@@ -20,15 +20,12 @@ Feature: Managers can create courses
When I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Latest announcements" block
Then "Latest announcements" "block" should exist
And I follow "Announcements"
And I am on the Announcements "forum activity" page
And "Add a new topic" "link" should exist
And "Subscription mode > Forced subscription" "link" should not exist in current page administration
And "Subscription mode > Forced subscription" "text" should exist in current page administration
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Announcements"
And I am on the Announcements "forum activity" page logged in as student1
And "Add a new topic" "link" should not exist
And "Forced subscription" "text" should exist in current page administration
@@ -20,8 +20,7 @@ Feature: View subfolders in a course in-line
| Name | Test folder |
| Display folder contents | On a separate page |
| Show subfolders expanded | |
And I should see "Test folder"
And I follow "Test folder"
And I am on the "Test folder" "folder activity" page
And I press "Edit"
And I press "Create folder"
And I set the field "New folder name" to "Test subfolder 1"
@@ -32,7 +31,7 @@ Feature: View subfolders in a course in-line
Scenario: Add a folder with two subfolders - view on separate page
Given I am on "Course 1" course homepage
And I should not see "Test subfolder 1"
And I follow "Test folder"
And I am on the "Test folder" "folder activity" page
And I should see "Test subfolder 1"
And I press "Edit"
And I press "Create folder"
@@ -41,13 +40,13 @@ Feature: View subfolders in a course in-line
And I press "Save changes"
When I am on "Course 1" course homepage
Then I should not see "Test subfolder 2"
And I follow "Test folder"
And I am on the "Test folder" "folder activity" page
And I should see "Test subfolder 2"
Given I navigate to "Edit settings" in current page administration
And I am on the "Test folder" "folder activity editing" page
And I set the field "Show subfolders expanded" to "1"
When I am on "Course 1" course homepage
Then I should not see "Test subfolder 2"
And I follow "Test folder"
And I am on the "Test folder" "folder activity" page
And I should see "Test subfolder 2"
@javascript
@@ -63,8 +62,7 @@ Feature: View subfolders in a course in-line
And I press "Save and return to course"
Then I should see "Test subfolder 1"
And I should not see "Test sub subfolder"
Given I open "Test folder" actions menu
When I click on "Edit settings" "link" in the "Test folder" activity
And I am on the "Test folder" "folder activity editing" page
And I set the field "Show subfolders expanded" to "1"
And I press "Save and return to course"
Then I should see "Test subfolder 1"
@@ -24,10 +24,7 @@ Feature: Render H5P content using filters
@javascript @external
Scenario: Render an external H5P content URL.
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
Given I am on the PageName1 "page activity editing" page logged in as teacher1
And I set the field "Page content" to "<div>Go for it</div>https://moodle.h5p.com/content/1290772960722742119/embed"
When I click on "Save and display" "button"
And I wait until the page is ready
@@ -36,10 +33,7 @@ Feature: Render H5P content using filters
@javascript
Scenario: Add an external H5P content URL in a link with the URL. Should be rendered.
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
Given I am on the PageName1 "page activity editing" page logged in as teacher1
# This content won't be displayed, so this scenario shouldn't be labeled as external.
And I set the field "Page content" to "<a href='https://moodle.h5p.com/content/1290772960722742119/embed'>https://moodle.h5p.com/content/1290772960722742119/embed</a>"
When I click on "Save and display" "button"
@@ -48,10 +42,7 @@ Feature: Render H5P content using filters
Then I should see "Lorum ipsum"
Scenario: Add an external H5P content URL in a link with text. Shouldn't be rendered.
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
Given I am on the PageName1 "page activity editing" page logged in as teacher1
# This content won't be displayed, so this scenario shouldn't be labeled as external.
And I set the field "Page content" to "<a href='https://moodle.h5p.com/content/1290772960722742119/embed'>Here you are the content</a>"
When I click on "Save and display" "button"
@@ -67,8 +58,7 @@ Feature: Render H5P content using filters
| Name | ipsumFile |
And I upload "h5p/tests/fixtures/ipsums.h5p" file to "Select files" filemanager
And I press "Save and return to course"
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
And I am on the PageName1 "page activity editing" page
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
And I click on "Browse repositories..." "button" in the "Insert H5P" "dialogue"
And I click on "Server files" "link" in the ".fp-repo-area" "css_element"
@@ -85,9 +75,7 @@ Feature: Render H5P content using filters
Then I should see "Lorum ipsum"
And I switch to the main frame
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I am on the PageName1 "page activity" page logged in as student1
# Switch to iframe created by filter
And I switch to "h5p-iframe" class iframe
# Switch to iframe created by embed.php page
@@ -104,8 +92,7 @@ Feature: Render H5P content using filters
| Name | ipsumFile |
And I upload "h5p/tests/fixtures/ipsums.h5p" file to "Select files" filemanager
And I press "Save and return to course"
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
And I am on the PageName1 "page activity editing" page
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
And I click on "Browse repositories..." "button" in the "Insert H5P" "dialogue"
And I click on "Server files" "link" in the ".fp-repo-area" "css_element"
@@ -129,8 +116,7 @@ Feature: Render H5P content using filters
| Name | ipsumFileTeacher |
And I upload "h5p/tests/fixtures/ipsums.h5p" file to "Select files" filemanager
And I press "Save and return to course"
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
And I am on the PageName1 "page activity editing" page
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
And I click on "Browse repositories..." "button" in the "Insert H5P" "dialogue"
And I click on "Server files" "link" in the ".fp-repo-area" "css_element"
@@ -153,8 +139,7 @@ Feature: Render H5P content using filters
| Name | ipsumFile |
And I upload "h5p/tests/fixtures/ipsums.h5p" file to "Select files" filemanager
And I press "Save and return to course"
And I follow "PageName2"
And I navigate to "Edit settings" in current page administration
And I am on the PageName2 "page activity editing" page
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
And I click on "Browse repositories..." "button" in the "Insert H5P" "dialogue"
And I click on "Server files" "link" in the ".fp-repo-area" "css_element"
@@ -172,9 +157,7 @@ Feature: Render H5P content using filters
And I should see "Lorum ipsum"
And I switch to the main frame
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I am on the PageName1 "page activity" page logged in as teacher1
# Switch to iframe created by filter
And I switch to "h5p-iframe" class iframe
# Switch to iframe created by embed.php page
@@ -50,7 +50,8 @@ Feature: Marking guides can be created and edited
@javascript
Scenario: Deleting criterion and comment
# Deleting criterion
When I go to "Test assignment 1 name" advanced grading definition page
When I am on "Course 1" course homepage
And I go to "Test assignment 1 name" advanced grading definition page
And I click on "Delete criterion" "button" in the "Guide criterion B" "table_row"
And I press "Yes"
And I press "Save"
@@ -59,7 +60,8 @@ Feature: Marking guides can be created and edited
And I should see "WARNING: Your marking guide has a maximum grade of 70 points"
But I should not see "Guide criterion B"
# Deleting a frequently used comment
When I go to "Test assignment 1 name" advanced grading definition page
When I am on "Course 1" course homepage
And I go to "Test assignment 1 name" advanced grading definition page
And I click on "Delete comment" "button" in the "Comment 3" "table_row"
And I press "Yes"
And I press "Save"
@@ -90,9 +92,7 @@ Feature: Marking guides can be created and edited
Then I should see "80" in the "Student 1" "table_row"
And I log out
# Viewing it as a student.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1 name"
And I am on the "Test assignment 1 name" "assign activity" page logged in as student1
And I should see "80" in the ".feedback" "css_element"
And I should see "Marking guide test description" in the ".feedback" "css_element"
And I should see "Very good"
@@ -70,9 +70,7 @@ Feature: Rubrics can be created and edited
And I should see "35" in the "Student 1" "table_row"
And I log out
# Viewing it as a student.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1 name"
And I am on the "Test assignment 1 name" "assign activity" page logged in as student1
And I should see "35" in the ".feedback" "css_element"
And I should see "Rubric test description" in the ".feedback" "css_element"
And I should see "In general... work harder..."
@@ -80,8 +78,7 @@ Feature: Rubrics can be created and edited
And the level with "20" points is selected for the rubric criterion "Criterion 1"
And the level with "5" points is selected for the rubric criterion "Criterion 3"
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
# Editing a rubric definition without regrading students.
And I go to "Test assignment 1 name" advanced grading definition page
And "Save as draft" "button" should not exist
@@ -93,9 +90,7 @@ Feature: Rubrics can be created and edited
And I press "Continue"
And I log out
# Check that the student still sees the grade.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1 name"
And I am on the "Test assignment 1 name" "assign activity" page logged in as student1
And I should see "35" in the ".feedback" "css_element"
And the level with "20" points is selected for the rubric criterion "Criterion 1"
And I log out
@@ -110,30 +105,23 @@ Feature: Rubrics can be created and edited
And I press "Continue"
And I log out
# Check that the student doesn't see the grade.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1 name"
And I am on the "Test assignment 1 name" "assign activity" page logged in as student1
And I should see "35" in the ".feedback" "css_element"
And the level with "20" points is not selected for the rubric criterion "Criterion 1"
And I log out
# Regrade student.
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1 name"
And I am on the "Test assignment 1 name" "assign activity" page logged in as teacher1
And I go to "Student 1" "Test assignment 1 name" activity advanced grading page
And I should see "The rubric definition was changed after this student had been graded. The student can not see this rubric until you check the rubric and update the grade."
And I save the advanced grading form
And I log out
# Check that the student sees the grade again.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1 name"
And I am on the "Test assignment 1 name" "assign activity" page logged in as student1
And I should see "31.82" in the ".feedback" "css_element"
And the level with "20" points is not selected for the rubric criterion "Criterion 1"
# Hide all rubric info for students
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
And I go to "Test assignment 1 name" advanced grading definition page
And I set the field "Allow users to preview rubric (otherwise it will only be displayed after grading)" to ""
And I set the field "Display rubric description during evaluation" to ""
@@ -145,9 +133,7 @@ Feature: Rubrics can be created and edited
And I press "Continue"
And I log out
# Students should not see anything.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1 name"
And I am on the "Test assignment 1 name" "assign activity" page logged in as student1
And I should not see "Criterion 1" in the ".submissionstatustable" "css_element"
And I should not see "Criterion 2" in the ".submissionstatustable" "css_element"
And I should not see "Criterion 3" in the ".submissionstatustable" "css_element"
@@ -14,12 +14,14 @@ Feature: Reuse my rubrics in other activities
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment 1 name |
| Description | Test assignment 1 description |
And the following "activities" exist:
| activity | name | intro | course | section | idnumber |
| assign | Test assignment 1 name | Test assignment 1 description | C1 | 1 | assign1 |
| assign | Test assignment 2 name | Test assignment 2 description | C1 | 1 | assign1 |
And I am on the "Test assignment 1 name" "assign activity editing" page logged in as teacher1
And I set the following fields to these values:
| Grading method | Rubric |
And I press "Save and return to course"
And I go to "Test assignment 1 name" advanced grading definition page
And I set the following fields to these values:
| Name | Assignment 1 rubric |
@@ -29,11 +31,10 @@ Feature: Reuse my rubrics in other activities
| Criterion 2 | Level 21 | 21 | Level 22 | 22 | Level 3 | 23 |
| Criterion 3 | Level 31 | 31 | Level 32 | 32 | | |
And I press "Save rubric and make it ready"
And I am on "Course 1" course homepage
When I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment 2 name |
| Description | Test assignment 2 description |
And I am on the "Test assignment 2 name" "assign activity editing" page
And I set the following fields to these values:
| Grading method | Rubric |
And I press "Save and return to course"
And I set "Test assignment 2 name" activity to use "Assignment 1 rubric" grading form
Then I should see "Ready for use"
And I should see "Criterion 1"
@@ -44,7 +45,6 @@ Feature: Reuse my rubrics in other activities
And I should see "Criterion 1"
And I should see "Criterion 2"
And I should see "Criterion 3"
And I press "Cancel"
@javascript
Scenario: A teacher can reuse one of his/her previously created rubrics, with Javascript enabled
@@ -28,16 +28,13 @@ Feature: We can change what we are viewing on the grader report
| Description | Submit your online text |
| assignsubmission_onlinetext_enabled | 1 |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name 1"
And I am on the "Test assignment name 1" "assign activity" page logged in as student1
When I press "Add submission"
And I set the following fields to these values:
| Online text | This is a submission for assignment 1 |
And I press "Save changes"
Then I should see "Submitted for grading"
And I am on "Course 1" course homepage
And I follow "Test assignment name 2"
And I am on the "Test assignment name 2" "assign activity" page
When I press "Add submission"
And I set the following fields to these values:
| Online text | This is a submission for assignment 2 |
@@ -55,7 +52,7 @@ Feature: We can change what we are viewing on the grader report
@javascript
Scenario: View and minimise the grader report containing hidden activities
And I am on "Course 1" course homepage with editing mode on
When I am on "Course 1" course homepage with editing mode on
And I open "Test assignment name 2" actions menu
And I click on "Hide" "link" in the "Test assignment name 2" activity
And I am on "Course 1" course homepage
@@ -83,7 +80,7 @@ Feature: We can change what we are viewing on the grader report
@javascript
Scenario: View and minimise the grader report containing hidden activities without the 'moodle/grade:viewhidden' capability
And I am on "Course 1" course homepage with editing mode on
When I am on "Course 1" course homepage with editing mode on
And I open "Test assignment name 2" actions menu
And I click on "Hide" "link" in the "Test assignment name 2" activity
And I log out
@@ -30,9 +30,7 @@ Feature: We can bulk insert grades for students in a course
| assign | C1 | a4 | Test assignment four | Submit nothing! |
Scenario: I can bulk insert grades and check their override flags for grade view.
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment one"
Given I am on the "Test assignment one" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the following fields to these values:
@@ -70,9 +68,7 @@ Feature: We can bulk insert grades for students in a course
And the field "Override for Student 4" matches value "1"
Scenario: I can bulk insert grades and check their override flags for user view.
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment two"
Given I am on the "Test assignment two" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the following fields to these values:
@@ -101,8 +97,7 @@ Feature: We can bulk insert grades for students in a course
And the field "Override for Test assignment four" matches value "1"
Scenario: I can not update grades if the value is out of bounds.
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 "View > Grader report" in the course gradebook
And I follow "Single view for Test assignment one"
And I set the field "Perform bulk insert" to "1"
+18 -26
View File
@@ -11,8 +11,8 @@ Feature: We can change the grading type and maximum grade point values
| fullname | shortname | category | format |
| Course 1 | C1 | 0 | topics |
Given the following "activities" exist:
| activity | course | idnumber | name | intro |
| assign | C1 | assign1| Test Assignment 1 | Test Assignment 1 |
| activity | course | idnumber | name | intro |
| assign | C1 | assign1 | Test Assignment 1 | Test Assignment 1 |
And I log in as "admin"
And I navigate to "Grades > General settings" in site administration
And I set the following fields to these values:
@@ -23,9 +23,8 @@ Feature: We can change the grading type and maximum grade point values
@javascript
Scenario: Validate that switching the type of grading used correctly disables input form elements
When I follow "Test Assignment 1"
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
Given I am on the "Test Assignment 1" "assign activity editing" page
When I expand all fieldsets
And I set the field "grade[modgrade_type]" to "Point"
Then the "Scale" "select" should be disabled
And the "Maximum grade" "field" should be enabled
@@ -39,46 +38,42 @@ Feature: We can change the grading type and maximum grade point values
@javascript
Scenario: Create an activity with a maximum grade point value less than the system maximum
When I follow "Test Assignment 1"
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
Given I am on the "Test Assignment 1" "assign activity editing" page
When I expand all fieldsets
And I set the field "grade[modgrade_type]" to "point"
And I set the field "grade[modgrade_point]" to "600"
And I press "Save and display"
And I navigate to "Edit settings" in current page administration
And I am on the "Test Assignment 1" "assign activity editing" page
Then the field "grade[modgrade_point]" matches value "600"
And the "Scale" "select" should be disabled
And I press "Save and return to course"
@javascript
Scenario: Create an activity with a scale as the grade type
When I follow "Test Assignment 1"
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
Given I am on the "Test Assignment 1" "assign activity editing" page
When I expand all fieldsets
And I set the field "grade[modgrade_type]" to "Scale"
And I set the field "grade[modgrade_scale]" to "Separate and Connected ways of knowing"
And I press "Save and display"
And I navigate to "Edit settings" in current page administration
And I am on the "Test Assignment 1" "assign activity editing" page
Then the field "grade[modgrade_scale]" matches value "Separate and Connected ways of knowing"
And the "Maximum grade" "field" should be disabled
And I press "Save and return to course"
@javascript
Scenario: Create an activity with no grade as the grade type
When I follow "Test Assignment 1"
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
Given I am on the "Test Assignment 1" "assign activity editing" page
When I expand all fieldsets
And I set the field "grade[modgrade_type]" to "None"
And I press "Save and display"
And I navigate to "Edit settings" in current page administration
And I am on the "Test Assignment 1" "assign activity editing" page
And the "Scale" "select" should be disabled
And the "Maximum grade" "field" should be disabled
And I press "Save and return to course"
Scenario: Create an activity with a maximum grade point value higher than the system maximum
When I follow "Test Assignment 1"
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
Given I am on the "Test Assignment 1" "assign activity editing" page
When I expand all fieldsets
And I set the field "grade[modgrade_type]" to "Point"
And I set the field "grade[modgrade_point]" to "20000"
And I press "Save and display"
@@ -86,9 +81,8 @@ Feature: We can change the grading type and maximum grade point values
And I press "Cancel"
Scenario: Create an activity with a valid maximum grade point and then change the system maximum to be lower
When I follow "Test Assignment 1"
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
Given I am on the "Test Assignment 1" "assign activity editing" page
When I expand all fieldsets
And I set the field "grade[modgrade_type]" to "point"
And I set the field "grade[modgrade_point]" to "600"
And I press "Save and display"
@@ -96,9 +90,7 @@ Feature: We can change the grading type and maximum grade point values
And I set the following fields to these values:
| Grade point maximum | 100 |
And I press "Save changes"
And I am on "Course 1" course homepage
And I follow "Test Assignment 1"
And I navigate to "Edit settings" in current page administration
And I am on the "Test Assignment 1" "assign activity editing" page
And I press "Save and display"
Then I should see "Invalid grade value. This must be an integer between 1 and 100"
And I press "Cancel"
@@ -23,8 +23,7 @@ Feature: Regrading grades does not unnecessarily mark some as overriden
And I navigate to "Grades > Grade category settings" in site administration
And I set the field "Available aggregation types" to "Weighted mean of grades"
And I press "Save changes"
And I am on "Course 1" course homepage
And I follow "Assignment 1"
And I am on the "Assignment 1" "assign activity" page
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade out of 100" to "80"
@@ -58,8 +57,7 @@ Feature: Regrading grades does not unnecessarily mark some as overriden
@javascript
Scenario: Confirm overridden course total does not get regraded when activity grade is changed
Given I am on "Course 1" course homepage
And I follow "Assignment 1"
Given I am on the "Assignment 1" "assign activity" page
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade out of 100" to "90"
+1 -4
View File
@@ -43,10 +43,7 @@ Feature: View gradebook when scales are used
And the following "activities" exist:
| activity | course | idnumber | name | intro | gradecategory |
| assign | C1 | a1 | Test assignment one | Submit something! | Sub category 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test assignment one" "assign activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the field "grade[modgrade_type]" to "Scale"
And I set the field "grade[modgrade_scale]" to "EN Letterscale"
@@ -39,10 +39,7 @@ Feature: View gradebook when single item scales are used
| assign | C1 | a1 | Test assignment one | Submit something! | <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> Sub category 1 |
And the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test assignment one" "assign activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the field "grade[modgrade_type]" to "Scale"
And I set the field "grade[modgrade_scale]" to "EN Singleitem"
@@ -531,4 +531,46 @@ abstract class behat_generator_base {
}
return $id;
}
/**
* Get a coursemodule from an activity name or idnumber.
*
* @param string $activity
* @param string $identifier
* @return cm_info
*/
protected function get_cm_by_activity_name(string $activity, string $identifier): cm_info {
global $DB;
$coursetable = new \core\dml\table('course', 'c', 'c');
$courseselect = $coursetable->get_field_select();
$coursefrom = $coursetable->get_from_sql();
$cmtable = new \core\dml\table('course_modules', 'cm', 'cm');
$cmfrom = $cmtable->get_from_sql();
$acttable = new \core\dml\table($activity, 'act', 'act');
$actselect = $acttable->get_field_select();
$actfrom = $acttable->get_from_sql();
$sql = <<<EOF
SELECT cm.id as cmid, {$courseselect}, {$actselect}
FROM {$cmfrom}
INNER JOIN {$coursefrom} ON c.id = cm.course
INNER JOIN {modules} m ON m.id = cm.module AND m.name = :modname
INNER JOIN {$actfrom} ON cm.instance = act.id
WHERE cm.idnumber = :idnumber OR act.name = :name
EOF;
$result = $DB->get_record_sql($sql, [
'modname' => $activity,
'idnumber' => $identifier,
'name' => $identifier,
], MUST_EXIST);
$course = $coursetable->extract_from_result($result);
$instancedata = $acttable->extract_from_result($result);
return get_fast_modinfo($course)->get_cm($result->cmid);
}
}
@@ -21,11 +21,8 @@ Feature: Add h5ps to Atto
@javascript @external
Scenario: Insert an embedded h5p
Given I log in as "admin"
And I change window size to "large"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
Given I change window size to "large"
And I am on the PageName1 "page activity editing" page logged in as admin
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
And I set the field with xpath "//input[@data-region='h5pfile']" to "https://moodle.h5p.com/content/1290772960722742119"
And I click on "Insert H5P" "button" in the "Insert H5P" "dialogue"
@@ -42,9 +39,7 @@ Feature: Add h5ps to Atto
And I follow "Manage private files..."
And I upload "h5p/tests/fixtures/guess-the-answer.h5p" file to "Files" filemanager
And I click on "Save changes" "button"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
And I am on the PageName1 "page activity editing" page
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
And I click on "Browse repositories..." "button" in the "Insert H5P" "dialogue"
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
@@ -57,11 +52,8 @@ Feature: Add h5ps to Atto
@javascript
Scenario: Test an invalid url
Given I log in as "admin"
And I change window size to "large"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
Given I change window size to "large"
And I am on the PageName1 "page activity editing" page logged in as admin
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
# This is not a real external URL, so this scenario shouldn't be labeled as external.
And I set the field with xpath "//input[@data-region='h5pfile']" to "ftp://moodle.h5p.com/content/1290772960722742119"
@@ -75,10 +67,7 @@ Feature: Add h5ps to Atto
| capability | permission | role | contextlevel | reference |
| atto/h5p:addembed | Prohibit | editingteacher | Course | C1 |
| moodle/h5p:deploy | Prohibit | editingteacher | Course | C1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "PageName1"
When I navigate to "Edit settings" in current page administration
When I am on the PageName1 "page activity editing" page logged in as teacher1
Then "Insert H5P" "button" should not exist
@javascript
@@ -86,10 +75,7 @@ Feature: Add h5ps to Atto
Given the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| atto/h5p:addembed | Prohibit | editingteacher | Course | C1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "PageName1"
When I navigate to "Edit settings" in current page administration
And I am on the PageName1 "page activity editing" page logged in as teacher1
And I click on "Insert H5P" "button"
Then I should not see "H5P URL" in the "Insert H5P" "dialogue"
And I should see "H5P file upload" in the "Insert H5P" "dialogue"
@@ -100,10 +86,7 @@ Feature: Add h5ps to Atto
Given the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/h5p:deploy | Prohibit | editingteacher | Course | C1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "PageName1"
When I navigate to "Edit settings" in current page administration
When I am on the PageName1 "page activity editing" page logged in as teacher1
And I click on "Insert H5P" "button"
Then I should not see "H5P file upload" in the "Insert H5P" "dialogue"
And I should see "H5P URL" in the "Insert H5P" "dialogue"
@@ -115,9 +98,7 @@ Feature: Add h5ps to Atto
And I follow "Manage private files..."
And I upload "lib/editor/atto/tests/fixtures/drag.h5p" file to "Files" filemanager
And I click on "Save changes" "button"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
And I am on the PageName1 "page activity editing" page
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
# H5P file content
And I click on "Browse repositories..." "button" in the "Insert H5P" "dialogue"
@@ -151,9 +132,7 @@ Feature: Add h5ps to Atto
And I follow "Manage private files..."
And I upload "h5p/tests/fixtures/guess-the-answer.h5p" file to "Files" filemanager
And I click on "Save changes" "button"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
And I am on the PageName1 "page activity editing" page
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
And I click on "Browse repositories..." "button" in the "Insert H5P" "dialogue"
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
@@ -205,11 +184,8 @@ Feature: Add h5ps to Atto
@javascript @external
Scenario: H5P options are ignored for H5P URLs
Given I log in as "admin"
And I change window size to "large"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
Given I change window size to "large"
And I am on the PageName1 "page activity editing" page logged in as admin
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
And I set the field with xpath "//input[@data-region='h5pfile']" to "https://moodle.h5p.com/content/1291366510035871129"
And I click on "H5P options" "link"
@@ -239,9 +215,7 @@ Feature: Add h5ps to Atto
And I follow "Manage private files..."
And I upload "h5p/tests/fixtures/guess-the-answer.h5p" file to "Files" filemanager
And I click on "Save changes" "button"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
And I am on the PageName1 "page activity editing" page
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
And I click on "Browse repositories..." "button" in the "Insert H5P" "dialogue"
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
@@ -251,9 +225,7 @@ Feature: Add h5ps to Atto
And I wait until the page is ready
And I click on "Save and display" "button"
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "PageName1"
When I am on the PageName1 "page activity" page logged in as student1
Then I switch to "h5pcontent" iframe
And I switch to "h5p-iframe" class iframe
And I should see "reveal"
@@ -22,16 +22,13 @@ Feature: Using the database activities which support point scale
@javascript
Scenario: Database rescale grade should not be possible when users are graded
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 add a "Text input" field to "Test database name" database and I fill the form with:
| Field name | Test field name |
| Field description | Test field description |
And I follow "Templates"
And I wait until the page is ready
And I am on "Course 1" course homepage
And I follow "Test database name"
And I navigate to "Edit settings" in current page administration
And I am on the "Test database name" "data activity editing" page
And I expand all fieldsets
And I set the field "Ratings > Aggregate type" to "Count of ratings"
And I set the field "Ratings > Type" to "Point"
@@ -44,13 +41,9 @@ Feature: Using the database activities which support point scale
| Test field name | Student original entry 2 |
And I press "Save and view"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test database name"
And I am on the "Test database name" "data activity" page logged in as teacher1
And I follow "View single"
And I set the field "rating" to "51"
And I am on "Course 1" course homepage
And I follow "Test database name"
When I navigate to "Edit settings" in current page administration
And I am on the "Test database name" "data activity editing" page
And I expand all fieldsets
Then the "Maximum grade" "field" should be disabled
@@ -25,25 +25,19 @@ Feature: Using the forum activities which support point scale
@javascript
Scenario: Forum rescale grade should not be possible when users are graded
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 I add a new discussion to "Test forum name" forum with:
| Subject | Discussion subject |
| Message | Test post in forum 1 |
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I navigate to "Edit settings" in current page administration
And I am on the "Test forum name" "forum activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the field "Ratings > Aggregate type" to "Count of ratings"
And I set the field "Ratings > Type" to "Point"
And I press "Save and return to course"
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page
And I follow "Discussion subject"
And I set the field "rating" to "30"
And I am on "Course 1" course homepage
And I follow "Test forum name"
When I navigate to "Edit settings" in current page administration
When I am on the "Test forum name" "forum activity editing" page
And I expand all fieldsets
Then the "Maximum grade" "field" should be disabled
@@ -25,27 +25,20 @@ Feature: Using the glossary activities which support point scale
@javascript
Scenario: Glossary rescale grade should not be possible when users are graded
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
Given I am on the "Test glossary name" "glossary activity" page logged in as student1
And I press "Add a new entry"
And I set the following fields to these values:
| Concept | Testing score |
| Definition | Scoring high on tests |
And I press "Save changes"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
And I navigate to "Edit settings" in current page administration
And I am on the "Test glossary name" "glossary activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the field "Ratings > Aggregate type" to "Count of ratings"
And I set the field "Ratings > Type" to "Point"
And I press "Save and return to course"
And I follow "Test glossary name"
And I am on the "Test glossary name" "glossary activity" page
And I set the field "rating" to "50"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
When I navigate to "Edit settings" in current page administration
When I am on the "Test glossary name" "glossary activity editing" page
And I expand all fieldsets
Then the "Maximum grade" "field" should be disabled
@@ -25,9 +25,7 @@ Feature: Using the lesson activities which support point scale
@javascript
Scenario: Lesson rescale grade should not be possible when users are graded
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
Given I am on the "Test lesson name" "lesson activity" page logged in as teacher1
And I follow "Add a question page"
And I set the field "Select a question type" to "Numerical"
And I press "Add a question page"
@@ -40,15 +38,10 @@ Feature: Using the lesson activities which support point scale
| id_jumpto_6 | Next page |
And I press "Save page"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page logged in as student1
And I set the field "Your answer" to "5"
And I press "Submit"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
When I navigate to "Edit settings" in current page administration
And I am on the "Test lesson name" "lesson activity editing" page logged in as teacher1
And I expand all fieldsets
Then the "Maximum grade" "field" should be disabled
@@ -31,18 +31,19 @@ Feature: Using the activity grade form element
| Scale | Disappointing, Good, Very good, Excellent |
And I press "Save changes"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| forum | Test forum name | Test forum description | C1 | forum1 |
And I am on the "Test forum name" "forum activity editing" page logged in as teacher1
And I set the following fields to these values:
| Forum type | Standard forum for general use |
| Description | Test forum description |
| Aggregate type | Average of ratings |
| scale[modgrade_type] | Point |
| scale[modgrade_point] | 100 |
| Group mode | No groups |
And I follow "Test forum name"
And I navigate to "Edit settings" in current page administration
And I press "Save and return to course"
And I am on the "Test forum name" "forum activity editing" page
When I expand all fieldsets
Then I should not see "Some grades have already been awarded, so the grade type"
And I set the field "scale[modgrade_type]" to "Scale"
@@ -89,21 +90,17 @@ Feature: Using the activity grade form element
| scale[modgrade_scale] | ABCDEF |
| Group mode | No groups |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student1
And I click on "Add a new discussion topic" "link"
And I set the following fields to these values:
| Subject | Discussion subject |
| Message | Discussion message |
And I press "Post to forum"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as teacher1
And I follow "Discussion subject"
And I set the field "rating" to "D"
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page
And I navigate to "Edit settings" in current page administration
When I expand all fieldsets
Then I should see "Some grades have already been awarded, so the grade type and scale cannot be changed"
@@ -138,8 +135,7 @@ Feature: Using the activity grade form element
| Description | Test assignment description |
| grade[modgrade_type] | Scale |
| grade[modgrade_scale] | ABCDEF |
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade" to "C"
@@ -156,32 +152,29 @@ Feature: Using the activity grade form element
@javascript
Scenario: Attempting to change the maximum grade when ratings exist
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
Given the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| forum | Test forum name | Test forum description | C1 | forum1 | 1 |
And I am on the "Test forum name" "forum activity editing" page logged in as teacher1
And I set the following fields to these values:
| Forum type | Standard forum for general use |
| Description | Test forum description |
| Aggregate type | Average of ratings |
| scale[modgrade_type] | Point |
| scale[modgrade_point] | 100 |
| Group mode | No groups |
And I press "Save and return to course"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student1
And I click on "Add a new discussion topic" "link"
And I set the following fields to these values:
| Subject | Discussion subject |
| Message | Discussion message |
And I press "Post to forum"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as teacher1
And I follow "Discussion subject"
And I set the field "rating" to "100"
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page
And I navigate to "Edit settings" in current page administration
When I expand all fieldsets
Then I should see "You cannot change the type, as grades already exist for this item."
@@ -189,13 +182,11 @@ Feature: Using the activity grade form element
@javascript
Scenario: Attempting to change the maximum grade when no rescaling option has been chosen
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment name |
| Description | Test assignment description |
And I am on "Course 1" course homepage
And I follow "Test assignment name"
Given the following "activity" exists:
| course | C1 |
| activity | assign |
| name | Test assign name |
And I am on the "Test assign name" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade out of 100" to "50"
+1 -2
View File
@@ -240,8 +240,7 @@ Feature: Initials bar
Given the following "activities" exist:
| activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | assignsubmission_file_enabled |
| assign | C1 | assign1 | TestAssignment | Test assignment description | 0 | 0 |
And I am on the "assign1" "Activity" page logged in as "admin"
And I navigate to "Edit settings" in current page administration
And I am on the "assign1" "assign Activity editing" page logged in as "admin"
And I expand all fieldsets
And I set the field "Completion tracking" to "1"
And I click on "Save and return to course" "button"
+1 -3
View File
@@ -12,9 +12,7 @@ Feature: Any day / month / year combination in date form elements works ok.
And the following "activity" exist:
| activity | name | intro | course | idnumber |
| assign | Assignment 01 | Assign activity to test some dates | C1 | assign01 |
Given I am on the "C1" "Course" page logged in as "admin"
And I follow "Assignment 01"
And I navigate to "Edit settings" in current page administration
And I am on the "Assignment 01" "assign activity editing" page logged in as admin
And I expand all fieldsets
And I set the field "Due date" to "<initial_date>"
And I set the field "Due date" to "<final_date>"
+5 -6
View File
@@ -31,12 +31,11 @@ Feature: Override permissions on a context
Then "Add announcementsmod/forum:addnews" row "Prohibited" column of "permissions" table should contain "Student"
Scenario: Module capabilities overrides
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Forum 1 |
And I follow "Forum 1"
And I navigate to "Permissions" in current page administration
Given the following "activity" exists:
| course | C1 |
| activity | forum |
| name | Forum 1 |
And I am on the "Forum 1" "forum activity permissions" page logged in as admin
When I click on "Allow" "icon" in the "mod/forum:addnews" "table_row"
And I press "Student"
Then "Add announcementsmod/forum:addnews" row "Roles with permission" column of "permissions" table should contain "Student"
@@ -24,23 +24,17 @@ Feature: Notification popover unread notifications
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment name |
| Description | Submit your online text |
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I press "Add submission"
And the following "activity" exists:
| activity | assign |
| course | C1 |
| name | Test assignment name |
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
| submissiondrafts | 0 |
# This should generate a notification.
And I set the following fields to these values:
| Online text | I'm the student first submission |
And I press "Save changes"
And I log out
And the following "mod_assign > submissions" exist:
| assign | user | onlinetext |
| Test assignment name | student1 | I'm the student1 submission |
Scenario: Notification popover shows correct unread count
When I log in as "student1"
+20 -59
View File
@@ -23,7 +23,6 @@ Feature: View the grading status of an assignment
Scenario: View the grading status for an assignment with marking workflow enabled
Given the following "activity" exists:
| activity | assign |
| idnumber | ass1 |
| course | C1 |
| name | Test assignment name |
| intro | Submit your online text |
@@ -32,20 +31,11 @@ Feature: View the grading status of an assignment
| assignfeedback_comments_enabled | 1 |
| assignsubmission_onlinetext_enabled | 1 |
# Add a submission.
And I log in as "student1"
And I am on "Course 1" course homepage
When I follow "Test assignment name"
Then I should not see "Feedback"
And I should see "Not marked" in the "Grading status" "table_row"
And I press "Add submission"
And I set the following fields to these values:
| Online text | I'm the student's first submission |
And I press "Save changes"
And I log out
And the following "mod_assign > submissions" exist:
| assign | user | onlinetext |
| Test assignment name | student1 | I'm the student first submission |
# Mark the submission.
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I should see "Not marked" in the "Student 1" "table_row"
And I click on "Grade" "link" in the "Student 1" "table_row"
@@ -58,22 +48,17 @@ Feature: View the grading status of an assignment
And I set the field "Feedback comments" to "Great job! Lol, not really."
And I set the field "Notify students" to "0"
And I press "Save changes"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page
And I navigate to "View all submissions" in current page administration
And I should see "In review" in the "Student 1" "table_row"
And I log out
# View the grading status as a student.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I should see "In review" in the "Grading status" "table_row"
And I should not see "Great job! Lol, not really."
And I log out
# Mark the submission again but set the marking workflow to 'Released'.
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I should see "In review" in the "Student 1" "table_row"
And I click on "Grade" "link" in the "Student 1" "table_row"
@@ -86,16 +71,12 @@ Feature: View the grading status of an assignment
And I should see "Released" in the "Student 1" "table_row"
And I log out
# View the grading status as a student.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I should see "Released" in the "Grading status" "table_row"
And I should see "Great job! Lol, not really."
And I log out
# Now, change the status from 'Released' to 'In marking' (this will remove the grade from the gradebook).
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I should see "Released" in the "Student 1" "table_row"
And I click on "Grade" "link" in the "Student 1" "table_row"
@@ -103,8 +84,7 @@ Feature: View the grading status of an assignment
And I set the field "Marking workflow state" to "In marking"
And I set the field "Notify students" to "0"
And I press "Save changes"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page
And I navigate to "View all submissions" in current page administration
And I should see "In marking" in the "Student 1" "table_row"
# The grade should also remain displayed as it's stored in the assign DB tables, but the final grade should be empty.
@@ -114,13 +94,11 @@ Feature: View the grading status of an assignment
And I click on "Change filters" "link"
And I set the field "Workflow filter" to "In review"
And I should see "0 of 0"
And I follow "Test assignment name"
@javascript
Scenario: View the grading status for an assignment with marking workflow disabled
Given the following "activity" exists:
| activity | assign |
| idnumber | ass1 |
| course | C1 |
| name | Test assignment name |
| intro | Submit your online text |
@@ -129,20 +107,11 @@ Feature: View the grading status of an assignment
| markingworkflow | 0 |
| assignsubmission_onlinetext_enabled | 1 |
# Add a submission.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I should not see "Feedback"
And I should see "Not graded" in the "Grading status" "table_row"
And I press "Add submission"
And I set the following fields to these values:
| Online text | I'm the student's first submission |
And I press "Save changes"
And I log out
And the following "mod_assign > submissions" exist:
| assign | user | onlinetext |
| Test assignment name | student1 | I'm the student first submission |
# Mark the submission.
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I should not see "Graded" in the "Student 1" "table_row"
And I click on "Grade" "link" in the "Student 1" "table_row"
@@ -154,30 +123,24 @@ Feature: View the grading status of an assignment
And I set the field "Feedback comments" to "Great job! Lol, not really."
And I press "Save changes"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page
And I navigate to "View all submissions" in current page administration
And I should see "Graded" in the "Student 1" "table_row"
And I log out
# View the grading status as a student.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I should see "Graded" in the "Grading status" "table_row"
And I should see "Great job! Lol, not really."
And I log out
# Student makes a subsequent submission.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I press "Edit submission"
And I set the following fields to these values:
| Online text | I'm the student's second submission |
And I press "Save changes"
And I log out
# Teacher marks the submission again after noticing the 'Graded - follow-up submission received'.
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I should see "Graded - follow-up submission received" in the "Student 1" "table_row"
And I wait "10" seconds
@@ -187,13 +150,11 @@ Feature: View the grading status of an assignment
And I set the field "Feedback comments" to "Even better job! Really."
And I press "Save changes"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page
And I navigate to "View all submissions" in current page administration
And I should see "Graded" in the "Student 1" "table_row"
And I log out
# View the grading status as a student again.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I should see "Graded" in the "Grading status" "table_row"
And I should see "Even better job! Really."
+19 -27
View File
@@ -44,29 +44,26 @@ Feature: Outcome grading
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment name |
| Description | Test assignment description |
| assignsubmission_onlinetext_enabled | 1 |
| Outcome Test | 1 |
| Assignment name | Test assignment name |
| ID number | Test assignment name |
| Description | Test assignment description |
| assignsubmission_onlinetext_enabled | 1 |
| Outcome Test | 1 |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I press "Add submission"
And I set the following fields to these values:
| Online text | My online text |
And I press "Save changes"
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
When I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student 0" "table_row"
And I set the following fields to these values:
| Outcome Test: | Excellent |
And I press "Save changes"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
When I am on the "Test assignment name" "assign activity" page
And I navigate to "View all submissions" in current page administration
Then I should see "Outcome Test: Excellent" in the "Student 0" "table_row"
And I should not see "Outcome Test: Excellent" in the "Student 1" "table_row"
@@ -88,32 +85,28 @@ Feature: Outcome grading
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment name |
| Description | Test assignment description |
| assignsubmission_onlinetext_enabled | 1 |
| Students submit in groups | Yes |
| Group mode | No groups |
| Outcome Test | 1 |
| Assignment name | Test assignment name |
| Description | Test assignment description |
| ID number | Test assignment name |
| assignsubmission_onlinetext_enabled | 1 |
| Students submit in groups | Yes |
| Group mode | No groups |
| Outcome Test | 1 |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I press "Add submission"
And I set the following fields to these values:
| Online text | My online text |
And I press "Save changes"
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
When I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student 0" "table_row"
And I set the following fields to these values:
| Outcome Test: | Excellent |
| Apply grades and feedback to entire group | Yes |
And I press "Save changes"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page
And I navigate to "View all submissions" in current page administration
Then I should see "Outcome Test: Excellent" in the "Student 0" "table_row"
And I should see "Outcome Test: Excellent" in the "Student 1" "table_row"
@@ -123,8 +116,7 @@ Feature: Outcome grading
| Outcome Test: | Disappointing |
| Apply grades and feedback to entire group | No |
And I press "Save changes"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page
And I navigate to "View all submissions" in current page administration
And I should see "Outcome Test: Excellent" in the "Student 0" "table_row"
And I should see "Outcome Test: Disappointing" in the "Student 1" "table_row"
@@ -11,11 +11,11 @@ Feature: Submit assignment without group
| Course 2 | C2 | 0 | 1 |
| Course 3 | C3 | 0 | 1 |
And the following "activities" exist:
| activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | preventsubmissionnotingroup | teamsubmission |
| assign | C1 | assign1 | Allow default group | Test assignment description | 1 | 0 | 1 |
| assign | C1 | assign2 | Require group membership | Test assignment description | 1 | 1 | 1 |
| assign | C2 | assign2 | Require group membership | Test assignment description | 1 | 1 | 1 |
| assign | C3 | assign2 | Require group membership | Test assignment description | 1 | 1 | 1 |
| activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | preventsubmissionnotingroup | teamsubmission |
| assign | C1 | c1assign1 | Allow default group | Test assignment description | 1 | 0 | 1 |
| assign | C1 | c1assign2 | Require group membership | Test assignment description | 1 | 1 | 1 |
| assign | C2 | c2assign1 | Require group membership | Test assignment description | 1 | 1 | 1 |
| assign | C3 | c3assign1 | Require group membership | Test assignment description | 1 | 1 | 1 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
@@ -44,9 +44,7 @@ Feature: Submit assignment without group
| student3 | GC31 |
| student3 | GC32 |
# Student 1 can only submit assignment in course 2.
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Allow default group"
When I am on the "c1assign1" "assign activity" page logged in as student1
Then I should not see "Not a member of any group"
And I should not see "This assignment requires submission in groups. You are not a member of any group"
And I should see "Nothing has been submitted for this assignment"
@@ -57,14 +55,12 @@ Feature: Submit assignment without group
And I press "Submit assignment"
And I press "Continue"
And I should see "Submitted for grading"
And I am on "Course 1" course homepage
And I follow "Require group membership"
And I am on the "c1assign2" "assign activity" page
And I should see "Not a member of any group"
And I should see "This assignment requires submission in groups. You are not a member of any group"
And I should see "Nothing has been submitted for this assignment"
And I should not see "Add submission"
And I am on "Course 2" course homepage
And I follow "Require group membership"
And I am on the "c2assign1" "assign activity" page
And I should not see "Not a member of any group"
And I should see "Nothing has been submitted for this assignment"
And I press "Add submission"
@@ -76,18 +72,13 @@ Feature: Submit assignment without group
And I should see "Submitted for grading"
And I log out
# Student 2 should see submitted for grading.
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Allow default group"
And I am on the "c1assign1" "assign activity" page logged in as student2
And I should see "Submitted for grading"
And I am on "Course 2" course homepage
And I follow "Require group membership"
And I am on the "c2assign1" "assign activity" page
And I should see "Submitted for grading"
And I log out
# Teacher should see student 1 and student 2 has submitted assignment.
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Allow default group"
And I am on the "c1assign1" "assign activity" page logged in as teacher1
And I should see "1" in the "Groups" "table_row"
And I should not see "The setting 'Require group to make submission\' is enabled and some users are either not a member of any group, or are a member of more than one group, so are unable to make submissions."
And I navigate to "View all submissions" in current page administration
@@ -95,8 +86,7 @@ Feature: Submit assignment without group
And I should see "Default group" in the "Student 2" "table_row"
And I should see "Submitted for grading" in the "Student 1" "table_row"
And I should see "Submitted for grading" in the "Student 2" "table_row"
And I am on "Course 1" course homepage
And I follow "Require group membership"
And I am on the "c1assign2" "assign activity" page
And I should see "0" in the "Groups" "table_row"
And I should see "The setting 'Require group to make submission' is enabled and some users are either not a member of any group, or are a member of more than one group, so are unable to make submissions."
And I navigate to "View all submissions" in current page administration
@@ -104,8 +94,7 @@ Feature: Submit assignment without group
And I should see "Not a member of any group, so unable to make submissions." in the "Student 2" "table_row"
And I should not see "Submitted for grading" in the "Student 1" "table_row"
And I should not see "Submitted for grading" in the "Student 2" "table_row"
And I am on "Course 2" course homepage
And I follow "Require group membership"
And I am on the "c2assign1" "assign activity" page
And I should see "1" in the "Groups" "table_row"
And I should not see "The setting 'Require group to make submission' is enabled and some users are either not a member of any group, or are a member of more than one group, so are unable to make submissions."
And I navigate to "View all submissions" in current page administration
@@ -115,17 +104,13 @@ Feature: Submit assignment without group
And I should see "Submitted for grading" in the "Student 2" "table_row"
And I log out
# Test student 3 (in multiple groups) should not be able to submit.
And I log in as "student3"
And I am on "Course 3" course homepage
And I follow "Require group membership"
And I am on the "c3assign1" "assign activity" page logged in as student3
And I should see "Member of more than one group"
And I should see "The assignment requires submission in groups. You are a member of more than one group."
And I should see "Nothing has been submitted for this assignment"
And I should not see "Add submission"
And I log out
And I log in as "teacher1"
And I am on "Course 3" course homepage
And I follow "Require group membership"
And I am on the "c3assign1" "assign activity" page logged in as teacher1
And I should see "The setting 'Require group to make submission' is enabled and some users are either not a member of any group, or are a member of more than one group, so are unable to make submissions."
And I navigate to "View all submissions" in current page administration
And I should see "Member of more than one group, so unable to make submissions." in the "Student 3" "table_row"
@@ -155,9 +140,7 @@ Feature: Submit assignment without group
| user | group |
| student1 | G1 |
| student2 | G2 |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Allow default group"
When I am on the "Allow default group" "assign activity" page logged in as teacher1
Then I should not see "The setting 'Require group to make submission\' is enabled and some users are either not a member of any group, or are a member of more than one group, so are unable to make submissions."
And I should not see "The setting 'Students submit in groups' is enabled and some users are either not a member of any group, or are a member of more than one group. Please be aware that these students will submit as members of the 'Default group'."
@@ -185,9 +168,7 @@ Feature: Submit assignment without group
And the following "group members" exist:
| user | group |
| student1 | G1 |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Allow default group"
When I am on the "Allow default group" "assign activity" page logged in as teacher1
Then I should not see "The setting 'Require group to make submission\' is enabled and some users are either not a member of any group, or are a member of more than one group, so are unable to make submissions."
And I should see "The setting 'Students submit in groups' is enabled and some users are either not a member of any group, or are a member of more than one group. Please be aware that these students will submit as members of the 'Default group'."
@@ -217,8 +198,6 @@ Feature: Submit assignment without group
| student1 | G1 |
| student2 | G1 |
| student2 | G2 |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Allow default group"
When I am on the "Allow default group" "assign activity" page logged in as teacher1
Then I should not see "The setting 'Require group to make submission\' is enabled and some users are either not a member of any group, or are a member of more than one group, so are unable to make submissions."
And I should see "The setting 'Students submit in groups' is enabled and some users are either not a member of any group, or are a member of more than one group. Please be aware that these students will submit as members of the 'Default group'."
+2 -6
View File
@@ -24,9 +24,7 @@ Feature: Edited book chapters handle tags correctly
| student1 | C1 | student |
Scenario: Book chapter edition of custom tags works as expected
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test book"
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 |
@@ -50,9 +48,7 @@ Feature: Edited book chapters handle tags correctly
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 log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test book"
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"
+6 -5
View File
@@ -9,12 +9,13 @@ Feature: In a book, verify log entries
Given the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
And I log in as "admin"
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 am on "Course 1" course homepage with editing mode on
When I add a "Book" to section "1" and I fill the form with:
| Name | Test book |
| Description | A book about dreams! |
And I follow "Test book"
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 |
@@ -16,16 +16,16 @@ Feature: Book activity chapter visibility management
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
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 |
| Description | A book about dreams! |
And I follow "Test book"
And the following "activity" exists:
| 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 turn editing mode on
And I click on "Add new chapter after \"First chapter\"" "link"
And I set the following fields to these values:
| Chapter title | Second chapter |
@@ -53,9 +53,8 @@ Feature: Book activity chapter visibility management
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 turn editing mode off
And I am on "Course 1" course homepage
And I follow "Test book"
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 turn editing mode on
@@ -70,13 +69,11 @@ Feature: Book activity chapter visibility management
And I should see "Fourth chapter" in the ".book_content" "css_element"
And I follow "Exit book"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test book"
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"
And I follow "Exit book"
And I follow "Test book"
And I am on the "Test book" "book activity" page
And I should see "First chapter" in the ".book_content" "css_element"
@@ -0,0 +1,58 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Behat data generator for mod_book.
*
* @package mod_book
* @category test
* @copyright 2021 Andrew Lyons <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Behat data generator for mod_book.
*
* @copyright 2019 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class behat_mod_book_generator extends behat_generator_base {
protected function get_creatable_entities(): array {
return [
'chapters' => [
'singular' => 'chapter',
'datagenerator' => 'chapter',
'required' => ['book', 'title', 'content'],
'switchids' => ['book' => 'bookid'],
],
];
}
/**
* Look up the id of a book from its name.
*
* @param string $bookname the book name, for example 'Test book'.
* @return int corresponding id.
*/
protected function get_book_id(string $bookname): int {
global $DB;
$cm = $this->get_cm_by_activity_name('book', $bookname);
return $cm->instance;
}
}
+2 -3
View File
@@ -46,8 +46,7 @@ class behat_mod_choice extends behat_base {
* @return array
*/
public function I_choose_option_from_activity($option, $choiceactivity) {
$this->execute("behat_general::click_link", $this->escape($choiceactivity));
$this->execute("behat_navigation::i_am_on_page_instance", [$this->escape($choiceactivity), 'choice activity']);
$this->execute('behat_forms::i_set_the_field_to', array( $this->escape($option), 1));
@@ -69,7 +68,7 @@ class behat_mod_choice extends behat_base {
$behatforms = behat_context_helper::get('behat_forms');
// Go to choice activity.
$behatgeneral->click_link($this->escape($choiceactivity));
$this->execute("behat_navigation::i_am_on_page_instance", [$this->escape($choiceactivity), 'choice activity']);
// Wait for page to be loaded.
$this->wait_for_pending_js();
+11 -37
View File
@@ -26,10 +26,7 @@ Feature: Teacher can modify choices of the students
@javascript
Scenario: Delete students choice response as a teacher
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Choice name"
And I navigate to "Edit settings" in current page administration
Given I am on the "Choice name" "choice activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the field "Show column for unanswered" to "Yes"
And I press "Save and return to course"
@@ -42,35 +39,27 @@ Feature: Teacher can modify choices of the students
And I log out
And I log in as "teacher1"
And I change window size to "large"
And I am on "Course 1" course homepage
And I follow "Choice name"
And I am on the "Choice name" "choice activity" page
And I navigate to "View 1 responses" in current page administration
And I click on "Student 1 Option 1" "checkbox"
And I select "Delete" from the "With selected" singleselect
And "Student 1 Option 1" "checkbox" should not exist
And "Student 1 Not answered yet" "checkbox" should exist
And I log out
@javascript
Scenario: Teacher set answers of students who did not respond or change existing answers
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Choice name"
And I navigate to "Edit settings" in current page administration
Given I am on the "Choice name" "choice activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the field "Show column for unanswered" to "Yes"
And I press "Save and return to course"
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 choose "Option 1" from "Choice name" choice activity
Then I should see "Your selection: Option 1"
And I should see "Your choice has been saved"
And I log out
And I log in as "teacher1"
And I change window size to "large"
And I am on "Course 1" course homepage
And I follow "Choice name"
And I am on the "Choice name" "choice activity" page logged in as teacher1
And I navigate to "View 1 responses" in current page administration
And I click on "Student 1 Option 1" "checkbox"
And I click on "Student 2 Not answered yet" "checkbox"
@@ -82,52 +71,38 @@ Feature: Teacher can modify choices of the students
And "Student 1 Option 2" "checkbox" should exist
And "Student 2 Option 2" "checkbox" should exist
And "Student 3 Option 2" "checkbox" should exist
And I log out
@javascript
Scenario: Teacher can delete answers in the multiple answer choice
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Choice name"
And I navigate to "Edit settings" in current page administration
Given I am on the "Choice name" "choice activity editing" page logged in as teacher1
And I set the field "Allow more than one choice to be selected" to "Yes"
And I press "Save and return to course"
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 choose options "Option 1","Option 2" from "Choice name" choice activity
And I should see "Your selection: Option 1; Option 2"
And I should see "Your choice has been saved"
And I log out
And I log in as "teacher1"
And I change window size to "large"
And I am on "Course 1" course homepage
And I follow "Choice name"
And I am on the "Choice name" "choice activity" page logged in as teacher1
And I navigate to "View 1 responses" in current page administration
And I click on "Student 1 Option 2" "checkbox"
And I select "Delete" from the "With selected" singleselect
And I click on "Student 1 Option 1" "checkbox"
And I select "Choose: Option 3" from the "With selected" singleselect
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Choice name"
And I am on the "Choice name" "choice activity" page logged in as student1
And I should see "Your selection: Option 1; Option 3"
And I log out
@javascript
Scenario: Teacher can manage answers on view page if the names are displayed
When 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 choose "Option 1" from "Choice name" choice activity
Then I should see "Your selection: Option 1"
And I should see "Your choice has been saved"
And I log out
And I log in as "teacher1"
And I change window size to "large"
And I am on "Course 1" course homepage
And I follow "Choice name"
And I navigate to "Edit settings" in current page administration
And I am on the "Choice name" "choice activity editing" page logged in as teacher1
And I set the following fields to these values:
| Publish results | Always show results to students |
| Privacy of results | Publish full results, showing names and their choices |
@@ -144,4 +119,3 @@ Feature: Teacher can modify choices of the students
And I select "Delete" from the "With selected" singleselect
And "Student 1 Option 3" "checkbox" should not exist
And "Student 1 Not answered yet" "checkbox" should exist
And I log out
+4 -9
View File
@@ -22,8 +22,7 @@ Feature: Users can add entries to database activities
@javascript
Scenario: Students can add entries to a database
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 add a "Text input" field to "Test database name" database and I fill the form with:
| Field name | Test field name |
| Field description | Test field description |
@@ -34,8 +33,7 @@ Feature: Users can add entries to database activities
And I follow "Templates"
And I wait until the page is ready
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as student1
And I add an entry to "Test database name" database with:
| Test field name | Student original entry |
| Test field 2 name | Student original entry 2 |
@@ -71,9 +69,7 @@ Feature: Users can add entries to database activities
And I should see "Student third entry"
# Now I will bulk delete the rest of the entries.
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test database name"
And I am on the "Test database name" "data activity" page logged in as teacher1
And I press "Select all"
And I press "Delete selected"
And I press "Delete"
@@ -81,8 +77,7 @@ Feature: Users can add entries to database activities
@javascript @editor @editor_atto @atto @atto_h5p
Scenario: If a new text area entry is added, the filepicker is displayed in the H5P Atto button
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 add a "Text area" field to "Test database name" database and I fill the form with:
| Field name | Textarea field name |
When I add an entry to "Test database name" database with:
+28 -7
View File
@@ -48,8 +48,7 @@ class behat_mod_data extends behat_base {
* @param TableNode $fielddata
*/
public function i_add_a_field_to_database_and_i_fill_the_form_with($fieldtype, $activityname, TableNode $fielddata) {
$this->execute("behat_general::click_link", $this->escape($activityname));
$this->execute('behat_navigation::i_am_on_page_instance', [$this->escape($activityname), 'data activity']);
// Open "Fields" tab if it is not already open.
$fieldsstr = get_string('fields', 'mod_data');
@@ -80,11 +79,33 @@ class behat_mod_data extends behat_base {
* @param TableNode $entrydata
*/
public function i_add_an_entry_to_database_with($activityname, TableNode $entrydata) {
$this->execute("behat_general::click_link", $this->escape($activityname));
$this->execute("behat_navigation::i_navigate_to_in_current_page_administration",
get_string('add', 'mod_data'));
$this->execute('behat_navigation::i_am_on_page_instance', [$this->escape($activityname), 'mod_data > add entry']);
$this->execute("behat_forms::i_set_the_following_fields_to_these_values", $entrydata);
}
/**
* Convert page names to URLs for steps like 'When I am on the "[identifier]" "[page type]" page'.
*
* Recognised page names are:
* | pagetype | name meaning | description |
* | Add entry | Database name | Add an entry page (view.php) |
*
* @param string $type identifies which type of page this is, e.g. 'Add entry'.
* @param string $identifier identifies the particular page, e.g. 'My database name'.
* @return moodle_url the corresponding URL.
* @throws Exception with a meaningful error message if the specified page cannot be found.
*/
protected function resolve_page_instance_url(string $type, string $identifier): moodle_url {
global $DB;
switch (strtolower($type)) {
case 'add entry':
return new moodle_url('/mod/data/edit.php', [
'd' => $this->get_cm_by_activity_name('data', $identifier)->instance,
]);
default:
throw new Exception("Unrecognised page type '{$type}'");
}
}
}
+25 -34
View File
@@ -16,18 +16,17 @@ Feature: Users can edit approved entries in database activities
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
@javascript
Scenario: Students can manage their approved entries to a database
# Create database activity and allow editing of
# approved entries.
And I add a "Database" to section "1" and I fill the form with:
| Name | Test database name |
| Description | Test |
| id_approval | Yes |
| id_manageapproved | Yes |
Given the following "activity" exists:
| activity | data |
| course | C1 |
| idnumber | Test database name |
| name | Test database name |
| approval | 1 |
| manageapproved | 1 |
And I am on the "Test database name" "data activity" page logged in as teacher1
And I add a "Text input" field to "Test database name" database and I fill the form with:
| Field name | Test field name |
| Field description | Test field description |
@@ -35,34 +34,31 @@ Feature: Users can edit approved entries in database activities
And I follow "Templates"
And I log out
# Add an entry as a student.
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Test database name" "data activity" page logged in as student1
And I add an entry to "Test database name" database with:
| Test field name | Student entry |
And I press "Save and view"
And I log out
# Approve the student's entry as a teacher.
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test database name"
And I am on the "Test database name" "data activity" page logged in as teacher1
And I follow "Approve"
And I log out
# Make sure the student can still edit their entry after it's approved.
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test database name"
When I am on the "Test database name" "data activity" page logged in as student1
Then I should see "Student entry"
And "Edit" "link" should exist
@javascript
Scenario: Students can not manage their approved entries to a database
# Create database activity and don't allow editing of
# approved entries.
And I add a "Database" to section "1" and I fill the form with:
| Name | Test database name |
| Description | Test |
| id_approval | Yes |
| id_manageapproved | No |
# Create database activity and don't allow editing of approved entries.
Given the following "activity" exists:
| activity | data |
| course | C1 |
| idnumber | Test database name |
| name | Test database name |
| approval | 1 |
| manageapproved | 0 |
And I am on the "Test database name" "data activity" page logged in as teacher1
And I add a "Text input" field to "Test database name" database and I fill the form with:
| Field name | Test field name |
| Field description | Test field description |
@@ -70,21 +66,16 @@ Feature: Users can edit approved entries in database activities
And I follow "Templates"
And I log out
# Add an entry as a student.
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Test database name" "data activity" page logged in as student1
And I add an entry to "Test database name" database with:
| Test field name | Student entry |
And I press "Save and view"
And I log out
# Approve the student's entry as a teacher.
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test database name"
And I am on the "Test database name" "data activity" page logged in as teacher1
And I follow "Approve"
And I log out
# Make sure the student isn't able to edit their entry after it's approved.
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test database name"
Then I should see "Student entry"
And "Edit" "link" should not exist
When I am on the "Test database name" "data activity" page logged in as student1
Then "Edit" "link" should not exist
And I should see "Student entry"
+10 -29
View File
@@ -175,9 +175,7 @@ Feature: Anonymous feedback
@javascript
Scenario: Anonymous feedback in a course
# Teacher can not
When I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Course feedback"
When I am on the "Course feedback" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Multiple choice" question to the feedback with:
| Question | Do you like this course? |
@@ -186,9 +184,8 @@ Feature: Anonymous feedback
| Hide the "Not selected" option | Yes |
| Multiple choice values | Yes\nNo\nI don't know |
And I log out
And I log in as "user1"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I am on the "Course feedback" "feedback activity" page logged in as user1
And I follow "Preview"
Then I should see "Do you like this course?"
And I press "Continue"
@@ -198,9 +195,7 @@ Feature: Anonymous feedback
| Yes | 1 |
And I press "Submit your answers"
And I log out
And I log in as "user2"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I am on the "Course feedback" "feedback activity" page logged in as user2
And I follow "Preview"
And I should see "Do you like this course?"
And I press "Continue"
@@ -218,9 +213,7 @@ Feature: Anonymous feedback
And I should see "1 (50.00 %)" in the "Yes" "table_row"
And I should see "1 (50.00 %)" in the "No" "table_row"
And I log out
And I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I am on the "Course feedback" "feedback activity" page logged in as teacher
And I follow "Preview"
And I should see "Do you like this course?"
And I press "Continue"
@@ -243,12 +236,9 @@ Feature: Anonymous feedback
And I should see "Anonymous entries (1)"
And I should not see "Response number: 1"
And I should see "Response number: 2"
And I log out
Scenario: Collecting new non-anonymous feedback from a previously anonymous feedback activity
When I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Course feedback"
When I am on the "Course feedback" "feedback activity" page logged in as teacher
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Allow multiple submissions | Yes |
@@ -259,36 +249,27 @@ Feature: Anonymous feedback
| Label | shorttext |
| Maximum characters accepted | 200 |
And I log out
When I log in as "user1"
And I am on "Course 1" course homepage
And I follow "Course feedback"
When I am on the "Course feedback" "feedback activity" page logged in as user1
And I follow "Answer the questions"
And I set the following fields to these values:
| this is a short text answer | anontext |
And I press "Submit your answers"
And I log out
# Switch to non-anon responses.
And I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I navigate to "Edit settings" in current page administration
And I am on the "Course feedback" "feedback activity editing" page logged in as teacher
And I set the following fields to these values:
| Record user names | User's name will be logged and shown with answers |
And I press "Save and display"
And I log out
# Now leave a non-anon feedback as user1
When I log in as "user1"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I am on the "Course feedback" "feedback activity" page logged in as user1
And I follow "Answer the questions"
And I set the following fields to these values:
| this is a short text answer | usertext |
And I press "Submit your answers"
And I log out
# Now check the responses are correct.
When I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I am on the "Course feedback" "feedback activity" page logged in as teacher
And I follow "Show responses"
And I should see "Anonymous entries (1)"
And I should see "Non anonymous entries (1)"
@@ -108,8 +108,7 @@ class behat_mod_feedback extends behat_base {
$this->execute('behat_auth::i_log_in_as', $username);
// Navigate to feedback complete form.
$this->execute('behat_navigation::i_am_on_course_homepage', $coursename);
$this->execute('behat_general::click_link', $feedbackname);
$this->execute('behat_navigation::i_am_on_page_instance', [$feedbackname, 'feedback activity']);
$this->execute('behat_general::click_link', $completeform);
// Fill form and submit.
+3 -11
View File
@@ -21,9 +21,7 @@ Feature: Exporting and importing feedbacks
| feedback | Learning experience | C1 | feedback0 |
Scenario: Export sample feedback and compare with the fixture
When I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Learning experience"
When I am on the "Learning experience" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Information" question to the feedback with:
| Question | this is an information question |
@@ -73,9 +71,7 @@ Feature: Exporting and importing feedbacks
@javascript @_file_upload
Scenario: Import feedback deleting old items
When I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Learning experience"
When I am on the "Learning experience" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Numeric answer" question to the feedback with:
| Question | Existing question |
@@ -96,13 +92,10 @@ Feature: Exporting and importing feedbacks
And I should see "this is a multiple choice rated"
And I should see "this is a numeric answer"
And I should see "this is a short text answer"
And I log out
@javascript @_file_upload
Scenario: Import feedback appending new items
When I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Learning experience"
When I am on the "Learning experience" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Numeric answer" question to the feedback with:
| Question | Existing question |
@@ -125,4 +118,3 @@ Feature: Exporting and importing feedbacks
And I should see "this is a multiple choice rated"
And I should see "this is a numeric answer"
And I should see "this is a short text answer"
And I log out
+14 -44
View File
@@ -50,9 +50,7 @@ Feature: Feedbacks in courses with groups
| feedback | Site feedback | Acceptance test site | feedback0 | 2 | 1 | 1 | 1 |
| feedback | Course feedback | C1 | feedback1 | 2 | 1 | 1 | 0 |
| feedback | Course anon feedback | C1 | feedback2 | 1 | 1 | 1 | 0 |
When I log in as "manager"
And I am on site homepage
And I follow "Site feedback"
And I am on the "Site feedback" "feedback activity" page logged in as manager
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Multiple choice" question to the feedback with:
| Question | Do you like our site? |
@@ -64,9 +62,7 @@ Feature: Feedbacks in courses with groups
@javascript
Scenario: Non anonymous feedback with groups in a course
When I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Course feedback"
Given I am on the "Course feedback" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Multiple choice" question to the feedback with:
| Question | Do you like this course? |
@@ -90,9 +86,7 @@ Feature: Feedbacks in courses with groups
And I log in as "user7" and complete feedback "Course feedback" in course "Course 1" with:
| I don't know | 1 |
# View analysis, user1 should only see one group - group 1
And I log in as "user1"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I am on the "Course feedback" "feedback activity" page logged in as user1
And I follow "Submitted answers"
And I should see "Separate groups: Group 1"
And I show chart data for the "multichoice1" feedback
@@ -100,9 +94,7 @@ Feature: Feedbacks in courses with groups
And I should see "1 (25.00 %)" in the "Not at all" "table_row"
And I log out
# View analysis, user3 should only see one group - group 2
And I log in as "user3"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I am on the "Course feedback" "feedback activity" page logged in as user3
And I follow "Submitted answers"
And I should see "Separate groups: Group 2"
And I show chart data for the "multichoice1" feedback
@@ -110,9 +102,7 @@ Feature: Feedbacks in courses with groups
And I should see "2 (66.67 %)" in the "Not at all" "table_row"
And I log out
# View analysis, user2 should see a group selector and be able to change the group but not view all.
And I log in as "user2"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I am on the "Course feedback" "feedback activity" page logged in as user2
And I follow "Submitted answers"
And the field "Separate groups" matches value "Group 1"
And I show chart data for the "multichoice1" feedback
@@ -125,9 +115,7 @@ Feature: Feedbacks in courses with groups
And the "Separate groups" select box should not contain "All participants"
And I log out
# User without group can see all participants only
And I log in as "user7"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I am on the "Course feedback" "feedback activity" page logged in as user7
And I follow "Submitted answers"
And I should see "Separate groups: All participants"
And I show chart data for the "multichoice1" feedback
@@ -136,9 +124,7 @@ Feature: Feedbacks in courses with groups
And I should see "2 (28.57 %)" in the "I don't know" "table_row"
And I log out
# Teacher can browse everybody
And I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I am on the "Course feedback" "feedback activity" page logged in as teacher
And I navigate to "Analysis" in current page administration
And the field "Separate groups" matches value "All participants"
And I show chart data for the "multichoice1" feedback
@@ -163,13 +149,10 @@ Feature: Feedbacks in courses with groups
And I select "All participants" from the "Separate groups" singleselect
And I should see "Username 1"
And I should see "Username 3"
And I log out
@javascript
Scenario: Anonymous feedback with groups in a course
When I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Course anon feedback"
Given I am on the "Course anon feedback" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Multiple choice" question to the feedback with:
| Question | Do you like this course? |
@@ -180,9 +163,7 @@ Feature: Feedbacks in courses with groups
And I log out
And I log in as "user1" and complete feedback "Course anon feedback" in course "Course 1" with:
| Not at all | 1 |
And I log in as "user1"
And I am on "Course 1" course homepage
And I follow "Course anon feedback"
And I am on the "Course anon feedback" "feedback activity" page logged in as user1
And I follow "Submitted answers"
And I should see "There are insufficient responses for this group"
And I should not see "Yes of course"
@@ -200,9 +181,7 @@ Feature: Feedbacks in courses with groups
And I log in as "user7" and complete feedback "Course anon feedback" in course "Course 1" with:
| I don't know | 1 |
# View analysis, user1 should only see one group - group 1
And I log in as "user1"
And I am on "Course 1" course homepage
And I follow "Course anon feedback"
And I am on the "Course anon feedback" "feedback activity" page logged in as user1
And I follow "Submitted answers"
And I should see "Separate groups: Group 1"
And I show chart data for the "multichoice1" feedback
@@ -210,9 +189,7 @@ Feature: Feedbacks in courses with groups
And I should see "1 (25.00 %)" in the "Not at all" "table_row"
And I log out
# View analysis, user3 should only see one group - group 2
And I log in as "user3"
And I am on "Course 1" course homepage
And I follow "Course anon feedback"
And I am on the "Course anon feedback" "feedback activity" page logged in as user3
And I follow "Submitted answers"
And I should see "Separate groups: Group 2"
And I show chart data for the "multichoice1" feedback
@@ -220,9 +197,7 @@ Feature: Feedbacks in courses with groups
And I should see "2 (66.67 %)" in the "Not at all" "table_row"
And I log out
# View analysis, user2 should see a group selector and be able to change the group but not view all.
And I log in as "user2"
And I am on "Course 1" course homepage
And I follow "Course anon feedback"
And I am on the "Course anon feedback" "feedback activity" page logged in as user2
And I follow "Submitted answers"
And the field "Separate groups" matches value "Group 1"
And I show chart data for the "multichoice1" feedback
@@ -235,9 +210,7 @@ Feature: Feedbacks in courses with groups
And the "Separate groups" select box should not contain "All participants"
And I log out
# User without group can see all participants only
And I log in as "user7"
And I am on "Course 1" course homepage
And I follow "Course anon feedback"
And I am on the "Course anon feedback" "feedback activity" page logged in as user7
And I follow "Submitted answers"
And I should see "Separate groups: All participants"
And I show chart data for the "multichoice1" feedback
@@ -246,9 +219,7 @@ Feature: Feedbacks in courses with groups
And I should see "2 (28.57 %)" in the "I don't know" "table_row"
And I log out
# Teacher can browse everybody
And I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Course anon feedback"
And I am on the "Course anon feedback" "feedback activity" page logged in as teacher
And I navigate to "Analysis" in current page administration
And the field "Separate groups" matches value "All participants"
And I show chart data for the "multichoice1" feedback
@@ -274,4 +245,3 @@ Feature: Feedbacks in courses with groups
And I select "All participants" from the "Separate groups" singleselect
And "//tr[contains(@id,'_r6') and contains(.,'Response number')]" "xpath_element" should exist
And "//tr[contains(@id,'_r7') and contains(@class,'emptyrow')]" "xpath_element" should exist
And I log out
+10 -31
View File
@@ -21,9 +21,7 @@ Feature: Testing multichoice questions in feedback
And the following "activities" exist:
| activity | name | course | idnumber |
| feedback | Learning experience | C1 | feedback0 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
@javascript
@@ -56,9 +54,7 @@ Feature: Testing multichoice questions in feedback
And I add a "Label" question to the feedback with:
| Contents | this is the third page of the feedback |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as student1
And I follow "Answer the questions"
# Examine the first page, select nothing, go to the next page
Then the following fields match these values:
@@ -123,9 +119,7 @@ Feature: Testing multichoice questions in feedback
And I log out
# Student 2 tries to trick - he answers the third question and then
# goes back and changes dependency question. Analysis should not show this answer!
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as student2
And I follow "Answer the questions"
And I set the field "option a" to "1"
And I press "Next page"
@@ -138,9 +132,7 @@ Feature: Testing multichoice questions in feedback
And I press "Submit your answers"
And I log out
# Login as teacher and check analysis
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I navigate to "Analysis" in current page administration
And I should see "Submitted answers: 2"
And I should see "Questions: 3"
@@ -200,9 +192,7 @@ Feature: Testing multichoice questions in feedback
| Contents | this is the third page of the feedback |
And I log out
# Login as the first student.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as student1
And I follow "Answer the questions"
# Examine the first page, select nothing, go to the next page
And I should not see "Not selected"
@@ -265,9 +255,7 @@ Feature: Testing multichoice questions in feedback
And I log out
# Student 2 tries to trick - he answers the third question and then
# goes back and changes dependency question. Analysis should not show this answer!
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as student2
And I follow "Answer the questions"
And I set the field "option a" to "1"
And I set the field "option b" to "1"
@@ -282,9 +270,7 @@ Feature: Testing multichoice questions in feedback
And I press "Submit your answers"
And I log out
# Login as teacher and check analysis
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I navigate to "Analysis" in current page administration
And I should see "Submitted answers: 2"
And I should see "Questions: 3"
@@ -342,9 +328,7 @@ Feature: Testing multichoice questions in feedback
And I add a "Label" question to the feedback with:
| Contents | this is the third page of the feedback |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as student1
And I follow "Answer the questions"
# Examine the first page, select nothing, go to the next page
Then the following fields match these values:
@@ -390,9 +374,7 @@ Feature: Testing multichoice questions in feedback
And I log out
# Student 2 tries to trick - he answers the third question and then
# goes back and changes dependency question. Analysis should not show this answer!
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as student2
And I follow "Answer the questions"
And I set the field "this is a multiple choice 1" to "option a"
And I press "Next page"
@@ -405,9 +387,7 @@ Feature: Testing multichoice questions in feedback
And I press "Submit your answers"
And I log out
# Login as teacher and check analysis
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I navigate to "Analysis" in current page administration
And I should see "Submitted answers: 2"
And I should see "Questions: 3"
@@ -434,4 +414,3 @@ Feature: Testing multichoice questions in feedback
And I should see "1 (100.00 %)" in the "option a" "table_row"
And I should not see "%" in the "option b" "table_row"
And I should not see "%" in the "option c" "table_row"
And I log out
+4 -13
View File
@@ -108,9 +108,7 @@ Feature: Non anonymous feedback
@javascript
Scenario: Non anonymous feedback in a course
When I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Course feedback"
When I am on the "Course feedback" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Multiple choice" question to the feedback with:
| Question | Do you like this course? |
@@ -119,18 +117,14 @@ Feature: Non anonymous feedback
| Hide the "Not selected" option | Yes |
| Multiple choice values | Yes of course\nNot at all\nI don't know |
And I log out
And I log in as "user1"
And I am on "Course 1" course homepage
And I follow "Course feedback"
When I am on the "Course feedback" "feedback activity" page logged in as user1
And I follow "Answer the questions"
And I should see "Do you like this course?"
And I set the following fields to these values:
| Yes of course | 1 |
And I press "Submit your answers"
And I log out
And I log in as "user2"
And I am on "Course 1" course homepage
And I follow "Course feedback"
When I am on the "Course feedback" "feedback activity" page logged in as user2
And I follow "Answer the questions"
And I should see "Do you like this course?"
And I set the following fields to these values:
@@ -145,9 +139,7 @@ Feature: Non anonymous feedback
And I should see "1 (50.00 %)" in the "Yes of course" "table_row"
And I should see "1 (50.00 %)" in the "Not at all" "table_row"
And I log out
And I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Course feedback"
When I am on the "Course feedback" "feedback activity" page logged in as teacher
And I follow "Preview"
And I should see "Do you like this course?"
And I press "Continue"
@@ -170,4 +162,3 @@ Feature: Non anonymous feedback
And I should see "Non anonymous entries (1)"
And I should not see "Username 1"
And I should see "Username 2"
And I log out
@@ -22,9 +22,7 @@ Feature: Test creating different types of feedback questions for anonymous feedb
And the following "activities" exist:
| activity | name | course | idnumber |
| feedback | Learning experience | C1 | feedback0 |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
When I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Information" question to the feedback with:
| Question | this is an information question |
@@ -65,9 +63,7 @@ Feature: Test creating different types of feedback questions for anonymous feedb
| Label | shorttext |
| Maximum characters accepted | 200 |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as student1
And I follow "Answer the questions"
And I set the following fields to these values:
| this is a longer text answer | my long answer |
@@ -80,9 +76,7 @@ Feature: Test creating different types of feedback questions for anonymous feedb
| this is a short text answer | hello |
And I press "Submit your answers"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as student2
And I follow "Answer the questions"
And I set the following fields to these values:
| this is a longer text answer | lots of feedbacks |
@@ -95,16 +89,11 @@ Feature: Test creating different types of feedback questions for anonymous feedb
| this is a short text answer | no way |
And I press "Submit your answers"
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
When I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I navigate to "Analysis" in current page administration
And I should see "Submitted answers: 2"
And I should see "Questions: 8"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page
And I navigate to "Analysis" in current page administration
And I should see "C1" in the "(info)" "table"
And I should see "my long answer" in the "(longertext)" "table"
@@ -22,9 +22,7 @@ Feature: Test creating different types of feedback questions for non-anonymous f
And the following "activities" exist:
| activity | name | course | idnumber | anonymous |
| feedback | Learning experience | C1 | feedback0 | 2 |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
When I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Information" question to the feedback with:
| Question | this is an information question |
@@ -69,9 +67,7 @@ Feature: Test creating different types of feedback questions for non-anonymous f
| Label | shorttext |
| Maximum characters accepted | 200 |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
When I am on the "Learning experience" "feedback activity" page logged in as student1
And I follow "Answer the questions"
And I set the following fields to these values:
| this is a longer text answer | my long answer |
@@ -84,9 +80,7 @@ Feature: Test creating different types of feedback questions for non-anonymous f
| this is a short text answer | hello |
And I press "Submit your answers"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Learning experience"
When I am on the "Learning experience" "feedback activity" page logged in as student2
And I follow "Answer the questions"
And I set the following fields to these values:
| this is a longer text answer | lots of feedbacks |
@@ -99,16 +93,12 @@ Feature: Test creating different types of feedback questions for non-anonymous f
| this is a short text answer | no way |
And I press "Submit your answers"
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
When I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I navigate to "Analysis" in current page administration
And I should see "Submitted answers: 2"
And I should see "Questions: 9"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I navigate to "Analysis" in current page administration
And I should see "C1" in the "(info)" "table"
And I should see "my long answer" in the "(longertext)" "table"
@@ -44,7 +44,7 @@ Feature: Show users who have not responded to the feedback survey
| Description | x |
| Record user names | User's name will be logged and shown with answers |
| Access restrictions | Grouping: GX1 |
And I follow "Frogs"
And I am on the Frogs "feedback activity" page
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I set the field "Add question" to "Short text answer"
And I set the following fields to these values:
@@ -53,18 +53,14 @@ Feature: Show users who have not responded to the feedback survey
And I log out
# Go in as student 1 and do the feedback.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Frogs"
And I am on the Frogs "feedback activity" page logged in as student1
And I follow "Answer the questions"
And I set the field "Y/N?" to "Y"
And I press "Submit your answers"
And I log out
# Go in as teacher and check the users who haven't completed it.
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Frogs"
And I am on the Frogs "feedback activity" page logged in as teacher1
And I navigate to "Show non-respondents" in current page administration
# Should only show student 2; not student 1 (they did it) or 3 (not in grouping).
+14 -38
View File
@@ -25,9 +25,7 @@ Feature: Saving, using and deleting feedback templates
| feedback | Learning experience course 1 | C1 | feedback1 |
| feedback | Another feedback in course 1 | C1 | feedback2 |
| feedback | Learning experience course 2 | C2 | feedback3 |
And I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Learning experience course 1"
And I am on the "Learning experience course 1" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Multiple choice" question to the feedback with:
| Question | this is a multiple choice 1 |
@@ -38,9 +36,7 @@ Feature: Saving, using and deleting feedback templates
Scenario: Teacher can save template and re-use it in the same course only
# Go to feedback templates and make sure none exist yet
When I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Learning experience course 1"
When I am on the "Learning experience course 1" "feedback activity" page logged in as teacher
And I follow "Templates"
Then I should see "No templates available yet"
And "Use a template" "field" should not exist
@@ -55,8 +51,7 @@ Feature: Saving, using and deleting feedback templates
And I should see "Template saved"
And the "Use a template" select box should contain "My first template"
# Create a feedback from this template in the same course
And I am on "Course 1" course homepage
And I follow "Another feedback in course 1"
And I am on the "Another feedback in course 1" "feedback activity" page
And I follow "Templates"
And I set the field "Use a template" to "My first template"
And I press "Use this template"
@@ -65,24 +60,19 @@ Feature: Saving, using and deleting feedback templates
And I follow "Edit questions"
And I should see "this is a multiple choice 1"
# Make sure this template is not available in another course
And I am on "Course 2" course homepage
And I follow "Learning experience course 2"
And I am on the "Learning experience course 2" "feedback activity" page
And I follow "Templates"
And I should see "No templates available yet"
And "Use a template" "field" should not exist
And I log out
And I should see "No templates available yet"
Scenario: Teacher can append template to existing questions or remove them
# Save feedback as a course template
When I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Learning experience course 1"
When I am on the "Learning experience course 1" "feedback activity" page logged in as teacher
And I follow "Templates"
And I set the field "Name" to "My first template"
And I press "Save as new template"
# Add questions to another feedback
And I am on "Course 1" course homepage
And I follow "Another feedback in course 1"
And I am on the "Another feedback in course 1" "feedback activity" page
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Multiple choice" question to the feedback with:
| Question | What is your favourite subject |
@@ -104,22 +94,17 @@ Feature: Saving, using and deleting feedback templates
And I set the field "Delete old items" to "1"
And I press "Save changes"
And I follow "Edit questions"
And I should see "this is a multiple choice 1"
And I should not see "What is your favourite subject"
And I log out
And I should see "this is a multiple choice 1"
Scenario: Manager can save template as public and it will be available in any course
When I log in as "manager"
And I am on "Course 1" course homepage
And I follow "Learning experience course 1"
When I am on the "Learning experience course 1" "feedback activity" page logged in as manager
And I follow "Templates"
And I set the field "Name" to "My first template"
And I set the field "Public" to "1"
And I press "Save as new template"
And I log out
And I log in as "teacher"
And I am on "Course 2" course homepage
And I follow "Learning experience course 2"
And I am on the "Learning experience course 2" "feedback activity" page logged in as teacher
And I follow "Templates"
And I set the field "Use a template" to "My first template"
And I press "Use this template"
@@ -127,13 +112,10 @@ Feature: Saving, using and deleting feedback templates
And I press "Save changes"
And I follow "Edit questions"
And I should see "this is a multiple choice 1"
And I log out
Scenario: Teacher can delete course templates but can not delete public templates
# Save feedback as both public and course template
When I log in as "manager"
And I am on "Course 1" course homepage
And I follow "Learning experience course 1"
When I am on the "Learning experience course 1" "feedback activity" page logged in as manager
And I follow "Templates"
And I set the field "Name" to "My public template"
And I set the field "Public" to "1"
@@ -142,9 +124,7 @@ Feature: Saving, using and deleting feedback templates
And I press "Save as new template"
And I log out
# Login as teacher and try to delete templates
And I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Another feedback in course 1"
And I am on the "Another feedback in course 1" "feedback activity" page logged in as teacher
And I follow "Templates"
And I follow "Delete template..."
Then I should not see "My public template"
@@ -157,14 +137,11 @@ Feature: Saving, using and deleting feedback templates
And I press "Back"
And the "Use a template" select box should not contain "My course template"
And the "Use a template" select box should contain "My public template"
And I log out
@javascript
Scenario: Manager can delete both course and public templates
# Save feedback as both public and course template
When I log in as "manager"
And I am on "Course 1" course homepage
And I follow "Learning experience course 1"
When I am on the "Learning experience course 1" "feedback activity" page logged in as manager
And I click on "Templates" "link" in the "[role=main]" "css_element"
And I set the field "Name" to "My public template"
And I set the field "Public" to "1"
@@ -190,6 +167,5 @@ Feature: Saving, using and deleting feedback templates
And "My public template" "text" should not exist in the ".publictemplates" "css_element"
And "No templates available yet" "text" should exist in the ".publictemplates" "css_element"
And I press "Back"
And I should see "No templates available yet"
And "Use a template" "field" should not exist
And I log out
And I should see "No templates available yet"
@@ -40,9 +40,7 @@ Feature: Message users in the summary report
And the following "course enrolments" exist:
| user | course | role |
| student3 | C1 | student |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "forum1"
When I am on the forum1 "forum activity" page logged in as teacher1
And I navigate to "Forum summary report" in current page administration
And I click on "Select 'Student 1'" "checkbox"
And I click on "Select 'Student 3'" "checkbox"
@@ -62,9 +60,7 @@ Feature: Message users in the summary report
@javascript
Scenario: Message all users
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "forum1"
When I am on the forum1 "forum activity" page logged in as teacher1
And I navigate to "Forum summary report" in current page administration
And I click on "Select all" "checkbox"
And I set the field "With selected users..." to "Send a message"
@@ -72,13 +68,9 @@ Feature: Message users in the summary report
@javascript
Scenario: Ensure no message options when messaging is disabled
Given I log in as "admin"
And I set the following administration settings values:
Given the following config values are set as admin:
| messaging | 0 |
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "forum1"
When I am on the forum1 "forum activity" page logged in as teacher1
And I navigate to "Forum summary report" in current page administration
Then I should not see "With selected users..."
And I should not see "Select all"
@@ -33,9 +33,7 @@ Feature: Report relevant content availability
@javascript
Scenario: Teachers can access report data about other users by default
Given I log in as "teacher1"
When I am on "Course 1" course homepage
And I follow "forum1"
Given I am on the "forum1" "forum activity" page logged in as teacher1
And I navigate to "Forum summary report" in current page administration
Then the following should exist in the "forumreport_summary_table" table:
| -2- | -3- | -4- | -5- | -6- | -7- | -8- |
@@ -57,9 +55,7 @@ Feature: Report relevant content availability
And "Export posts" "link" should not exist
Scenario: Students cannot access the summary report by default
Given I log in as "student1"
When I am on "Course 1" course homepage
And I follow "forum1"
Given I am on the "forum1" "forum activity" page logged in as student1
Then "Forum summary report" "link" should not exist in current page administration
@javascript
@@ -67,9 +63,7 @@ Feature: Report relevant content availability
Given the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| forumreport/summary:view | Allow | student | Course | C1 |
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "forum1"
When I am on the "forum1" "forum activity" page logged in as student1
And I navigate to "Forum summary report" in current page administration
Then the following should exist in the "forumreport_summary_table" table:
| -1- | -2- | -3- | -4- | -5- | -6- | -7- |
@@ -35,9 +35,9 @@ Feature: Groups report filter is available if groups exist
| student1 | G3 |
And the following "activities" exist:
| activity | name | description | course | idnumber | groupmode |
| forum | forum1 | C1 first forum | C1 | forum1 | 1 |
| forum | forum2 | C1 second forum | C1 | forum2 | 2 |
| forum | forum1 | C2 first forum | C2 | forum1 | 0 |
| forum | forum1 | C1 first forum | C1 | c1forum1 | 1 |
| forum | forum2 | C1 second forum | C1 | c1forum2 | 2 |
| forum | forum1 | C2 first forum | C2 | c2forum1 | 0 |
And the following forum discussions exist in course "Course 1":
| user | forum | name | message | group | created |
| teacher1 | forum1 | discussion1 | D1 message | G1 | ## 1 month ago ## |
@@ -62,9 +62,7 @@ Feature: Groups report filter is available if groups exist
@javascript
Scenario: All groups can be selected or cleared together in the groups filter, and are unchecked by default
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "forum1"
When I am on the "c1forum1" "forum activity" page logged in as teacher1
And I navigate to "Forum summary report" in current page administration
Then "Groups" "button" should exist
And the following should exist in the "forumreport_summary_table" table:
@@ -112,9 +110,7 @@ Feature: Groups report filter is available if groups exist
@javascript
Scenario: The summary report can be filtered by a subset of groups, and re-ordering the results retains the filter
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "forum1"
When I am on the "c1forum1" "forum activity" page logged in as teacher1
And I navigate to "Forum summary report" in current page administration
Then "Groups" "button" should exist
And the following should exist in the "forumreport_summary_table" table:
@@ -148,9 +144,7 @@ Feature: Groups report filter is available if groups exist
@javascript
Scenario: The summary report can be filtered as a mixture of groups and no groups
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "forum2"
When I am on the "c1forum2" "forum activity" page logged in as teacher1
And I navigate to "Forum summary report" in current page administration
Then "Groups" "button" should exist
And the following should exist in the "forumreport_summary_table" table:
@@ -174,9 +168,7 @@ Feature: Groups report filter is available if groups exist
@javascript
Scenario: The summary report can be filtered by no groups only
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "forum2"
When I am on the "c1forum2" "forum activity" page logged in as teacher1
And I navigate to "Forum summary report" in current page administration
Then the following should exist in the "forumreport_summary_table" table:
# | | Discussions | Replies |
@@ -199,9 +191,7 @@ Feature: Groups report filter is available if groups exist
@javascript
Scenario: Filtering by a group containing no users still allows the page to render
# Log in as admin so Teacher 1 not existing on page can be confirmed.
When I log in as "admin"
And I am on "Course 1" course homepage
And I follow "forum1"
When I am on the "c1forum1" "forum activity" page logged in as admin
And I navigate to "Forum summary report" in current page administration
Then "Groups" "button" should exist
And the following should exist in the "forumreport_summary_table" table:
@@ -224,9 +214,7 @@ Feature: Groups report filter is available if groups exist
@javascript
Scenario: Course forum summary report can be filtered by group
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "forum2"
When I am on the "c1forum2" "forum activity" page logged in as teacher1
And I navigate to "Forum summary report" in current page administration
And I select "All forums in course" from the "Forum selected" singleselect
And I click on "Groups" "button"
+1 -1
View File
@@ -39,7 +39,7 @@ Feature: Add forum activities and discussions
| Attachment | lib/tests/fixtures/upload_users.csv |
Then I should see "Reply with attachment"
And I should see "upload_users.csv"
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page
And I follow "Post with attachment"
And I should see "empty.txt"
And I follow "Edit"
+11 -31
View File
@@ -38,9 +38,7 @@ Feature: The forum search allows users to perform advanced searches for forum po
And I log out
Scenario: Perform an advanced search using any term
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Announcements"
Given I am on the "Announcements" "forum activity" page logged in as student1
And I press "Search forums"
And I should see "Advanced search"
And I set the field "words" to "subject"
@@ -49,9 +47,7 @@ Feature: The forum search allows users to perform advanced searches for forum po
And I should see "Your subjective"
Scenario: Perform an advanced search avoiding words
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Announcements"
Given I am on the "Announcements" "forum activity" page logged in as student1
And I press "Search forums"
And I should see "Advanced search"
And I set the field "words" to "My"
@@ -62,11 +58,9 @@ Feature: The forum search allows users to perform advanced searches for forum po
Scenario: Perform an advanced search using whole words
Given database family used is one of the following:
| mysql |
| mysql |
| postgres |
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Announcements"
And I am on the "Announcements" "forum activity" page logged in as student1
And I press "Search forums"
And I should see "Advanced search"
And I set the field "fullwords" to "subject"
@@ -75,9 +69,7 @@ Feature: The forum search allows users to perform advanced searches for forum po
And I should not see "Your subjective"
Scenario: Perform an advanced search matching the subject
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Announcements"
Given I am on the "Announcements" "forum activity" page logged in as student1
And I press "Search forums"
And I should see "Advanced search"
And I set the field "subject" to "subjective"
@@ -92,9 +84,7 @@ Feature: The forum search allows users to perform advanced searches for forum po
| Subject | My Subjects |
| Message | My message |
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Announcements"
When I am on the "Announcements" "forum activity" page logged in as student1
And I press "Search forums"
And I should see "Advanced search"
And I set the field "user" to "TWO"
@@ -103,9 +93,7 @@ Feature: The forum search allows users to perform advanced searches for forum po
And I should not see "Teacher ONE"
Scenario: Perform an advanced search with multiple words
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Announcements"
Given I am on the "Announcements" "forum activity" page logged in as student1
And I press "Search forums"
And I should see "Advanced search"
And I set the field "subject" to "your subjective"
@@ -115,18 +103,14 @@ Feature: The forum search allows users to perform advanced searches for forum po
@javascript
Scenario: Perform an advanced search using tags
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Announcements"
Given I am on the "Announcements" "forum activity" page logged in as teacher1
And I follow "My subject"
And I follow "Edit"
And I set the following fields to these values:
| Tags | SearchedTag |
And I press "Save changes"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Announcements"
And I am on the "Announcements" "forum activity" page logged in as student1
And I press "Search forums"
And I should see "Advanced search"
And I set the field "Is tagged with" to "SearchedTag"
@@ -136,9 +120,7 @@ Feature: The forum search allows users to perform advanced searches for forum po
@javascript
Scenario: Perform an advanced search on starred discussions without text
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Announcements"
Given I am on the "Announcements" "forum activity" page logged in as student1
And I click on "Your subjective" action menu
And I follow "Star this discussion"
And I press "Search forums"
@@ -150,9 +132,7 @@ Feature: The forum search allows users to perform advanced searches for forum po
@javascript
Scenario: Perform an advanced search on starred discussions with text
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Announcements"
Given I am on the "Announcements" "forum activity" page logged in as student1
And I click on "Your subjective" action menu
And I follow "Star this discussion"
And I press "Search forums"
+4 -8
View File
@@ -112,9 +112,8 @@ class behat_mod_forum extends behat_base {
* @param TableNode $table
*/
public function i_reply_post_from_forum_using_an_inpage_reply_with($postsubject, $forumname, TableNode $table) {
// Navigate to forum.
$this->execute('behat_general::click_link', $this->escape($forumname));
$this->execute('behat_navigation::i_am_on_page_instance', [$this->escape($forumname), 'forum activity']);
$this->execute('behat_general::click_link', $this->escape($postsubject));
$this->execute('behat_general::click_link', get_string('reply', 'forum'));
@@ -132,9 +131,8 @@ class behat_mod_forum extends behat_base {
* @param string $forumname The forum name
*/
public function i_navigate_to_post_in_forum($postsubject, $forumname) {
// Navigate to forum discussion.
$this->execute('behat_general::click_link', $this->escape($forumname));
$this->execute('behat_navigation::i_am_on_page_instance', [$this->escape($forumname), 'forum activity']);
$this->execute('behat_general::click_link', $this->escape($postsubject));
}
@@ -475,9 +473,8 @@ class behat_mod_forum extends behat_base {
* @param string $buttonstr
*/
protected function add_new_discussion($forumname, TableNode $table, $buttonstr) {
// Navigate to forum.
$this->execute('behat_general::click_link', $this->escape($forumname));
$this->execute('behat_navigation::i_am_on_page_instance', [$this->escape($forumname), 'forum activity']);
$this->execute('behat_general::click_link', $buttonstr);
$this->execute('behat_forms::press_button', get_string('showadvancededitor'));
@@ -495,9 +492,8 @@ class behat_mod_forum extends behat_base {
* @param string $buttonstr
*/
protected function add_new_discussion_inline($forumname, TableNode $table, $buttonstr) {
// Navigate to forum.
$this->execute('behat_general::click_link', $this->escape($forumname));
$this->execute('behat_navigation::i_am_on_page_instance', [$this->escape($forumname), 'forum activity']);
$this->execute('behat_general::click_link', $buttonstr);
$this->fill_new_discussion_form($table);
}
@@ -14,17 +14,18 @@ Feature: Students can choose from 4 discussion display options and their choice
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Description | Test forum description |
And the following "activity" exists:
| course | C1 |
| activity | forum |
| name | Test forum name |
And I am on the "Course 1" course page logged in as admin
And I add a new discussion to "Test forum name" forum with:
| Subject | Discussion 1 |
| Message | Discussion contents 1, first message |
And I reply "Discussion 1" post from "Test forum name" forum with:
| Subject | Reply 1 to discussion 1 |
| Message | Discussion contents 1, second message |
And I am on the "Course 1" course page
And I add a new discussion to "Test forum name" forum with:
| Subject | Discussion 2 |
| Message | Discussion contents 2, first message |
@@ -32,11 +33,10 @@ Feature: Students can choose from 4 discussion display options and their choice
| Subject | Reply 1 to discussion 2 |
| Message | Discussion contents 2, second message |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
Scenario: Display replies flat, with oldest first
Given I reply "Discussion 1" post from "Test forum name" forum with:
Given I am on the "Course 1" course page logged in as student1
And I reply "Discussion 1" post from "Test forum name" forum with:
| Subject | Reply 2 to discussion 1 |
| Message | Discussion contents 1, third message |
When I select "Display replies flat, with oldest first" from the "mode" singleselect
@@ -50,7 +50,8 @@ Feature: Students can choose from 4 discussion display options and their choice
And I should see "Discussion contents 2, second message" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ') and not(contains(@class, 'starter'))]" "xpath_element"
Scenario: Display replies flat, with newest first
Given I reply "Discussion 1" post from "Test forum name" forum with:
Given I am on the "Course 1" course page logged in as student1
And I reply "Discussion 1" post from "Test forum name" forum with:
| Subject | Reply 2 to discussion 1 |
| Message | Discussion contents 1, third message |
When I select "Display replies flat, with newest first" from the "mode" singleselect
@@ -64,24 +65,24 @@ Feature: Students can choose from 4 discussion display options and their choice
And I should see "Discussion contents 2, third message" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ') and not(contains(@class, 'starter'))]" "xpath_element"
Scenario: Display replies in threaded form
Given I follow "Test forum name"
Given I am on the "Test forum name" "forum activity" page logged in as student1
And I follow "Discussion 1"
When I select "Display replies in threaded form" from the "mode" singleselect
Then I should see "Discussion contents 1, first message"
And I should see "Reply 1 to discussion 1" in the "div.forumthread" "css_element"
And I follow "Test forum name"
And I click on "Test forum name" "link" in the "page-header" "region"
And I follow "Discussion 2"
And the field "Display mode" matches value "Display replies in threaded form"
And I should see "Discussion contents 2, first message"
And I should see "Reply 1 to discussion 2" in the "div.forumthread" "css_element"
Scenario: Display replies in nested form
Given I follow "Test forum name"
Given I am on the "Test forum name" "forum activity" page logged in as student1
And I follow "Discussion 1"
When I select "Display replies in nested form" from the "mode" singleselect
Then I should see "Discussion contents 1, first message" in the "div.firstpost.starter" "css_element"
And I should see "Discussion contents 1, second message" in the "div.indent div.forumpost" "css_element"
And I follow "Test forum name"
And I click on "Test forum name" "link" in the "page-header" "region"
And I follow "Discussion 2"
And the field "Display mode" matches value "Display replies in nested form"
And I should see "Discussion contents 2, first message" in the "div.firstpost.starter" "css_element"
+8 -13
View File
@@ -11,11 +11,11 @@ Feature: As a teacher, you can manually lock individual discussions when viewing
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Description | Test forum description |
And the following "activity" exists:
| course | C1 |
| activity | forum |
| name | Test forum name |
And I am on the "Course 1" course page logged in as admin
And I add a new discussion to "Test forum name" forum with:
| Subject | Discussion 1 |
| Message | Discussion contents 1, first message |
@@ -28,11 +28,9 @@ Feature: As a teacher, you can manually lock individual discussions when viewing
And I reply "Discussion 2" post from "Test forum name" forum with:
| Subject | Reply 1 to discussion 2 |
| Message | Discussion contents 2, second message |
And I log out
Scenario: Lock a discussion and view
Given I log in as "admin"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page
And I navigate to post "Discussion 1" in "Test forum name" forum
And I press "Settings"
Then "Lock this discussion" "link" should be visible
@@ -53,8 +51,7 @@ Feature: As a teacher, you can manually lock individual discussions when viewing
@accessibility
Scenario: A locked discussion must be accessible
Given I log in as "admin"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page
And I navigate to post "Discussion 1" in "Test forum name" forum
When I reply "Discussion 1" post from "Test forum name" forum with:
| Subject | Discussion 1: Hello world! |
@@ -66,9 +63,7 @@ Feature: As a teacher, you can manually lock individual discussions when viewing
# Check discussion view accessibility with info notification shown when discussion is locked.
And the page should meet accessibility standards with "wcag143" extra tests
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student1
# Check discussion list accessibility with danger pill shown when discussion is locked.
And the page should meet accessibility standards with "wcag143" extra tests
And I follow "Preferences" in the user menu
@@ -34,9 +34,7 @@ Feature: A user can control their own subscription preferences for a discussion
| Subject | Test post subject two |
| Message | Test post message two |
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
When I am on the "Test forum name" "forum activity" page logged in as student1
Then I can subscribe to this forum
And "Subscribe to this discussion" "checkbox" should exist in the "Test post subject one" "table_row"
And "Subscribe to this discussion" "checkbox" should exist in the "Test post subject two" "table_row"
@@ -81,9 +79,7 @@ Feature: A user can control their own subscription preferences for a discussion
| Subject | Test post subject two |
| Message | Test post message two |
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
When I am on the "Test forum name" "forum activity" page logged in as student1
Then I can unsubscribe from this forum
And "Unsubscribe from this discussion" "checkbox" should exist in the "Test post subject one" "table_row"
And "Unsubscribe from this discussion" "checkbox" should exist in the "Test post subject two" "table_row"
@@ -128,9 +124,7 @@ Feature: A user can control their own subscription preferences for a discussion
| Subject | Test post subject two |
| Message | Test post message two |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student1
And I can subscribe to this forum
And "Subscribe to this discussion" "checkbox" should exist in the "Test post subject one" "table_row"
And "Subscribe to this discussion" "checkbox" should exist in the "Test post subject two" "table_row"
@@ -139,17 +133,13 @@ Feature: A user can control their own subscription preferences for a discussion
And "Unsubscribe from this discussion" "checkbox" should exist in the "Test post subject one" "table_row"
And "Subscribe to this discussion" "checkbox" should exist in the "Test post subject two" "table_row"
And I log out
And I log in as "admin"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as admin
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Subscription mode | Auto subscription |
And I press "Save and return to course"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student1
And I can unsubscribe from this forum
And "Unsubscribe from this discussion" "checkbox" should exist in the "Test post subject one" "table_row"
And "Unsubscribe from this discussion" "checkbox" should exist in the "Test post subject two" "table_row"
@@ -177,9 +167,7 @@ Feature: A user can control their own subscription preferences for a discussion
| Subject | Test post subject two |
| Message | Test post message two |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student1
And I can subscribe to this forum
And "Subscribe to this discussion" "checkbox" should exist in the "Test post subject one" "table_row"
And "Subscribe to this discussion" "checkbox" should exist in the "Test post subject two" "table_row"
@@ -189,16 +177,13 @@ Feature: A user can control their own subscription preferences for a discussion
And "Subscribe to this discussion" "checkbox" should exist in the "Test post subject two" "table_row"
And I log out
And I log in as "admin"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Subscription mode | Auto subscription |
And I press "Save and return to course"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student1
And I can unsubscribe from this forum
And "Unsubscribe from this discussion" "checkbox" should exist in the "Test post subject one" "table_row"
And "Unsubscribe from this discussion" "checkbox" should exist in the "Test post subject two" "table_row"
@@ -225,9 +210,7 @@ Feature: A user can control their own subscription preferences for a discussion
| Subject | Test post subject two |
| Message | Test post message two |
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
When I am on the "Test forum name" "forum activity" page logged in as student1
And I should see "Subscribe to this forum"
And I reply "Test post subject one" post from "Test forum name" forum with:
| Subject | Reply 1 to discussion 1 |
@@ -237,7 +220,7 @@ Feature: A user can control their own subscription preferences for a discussion
| Subject | Reply 1 to discussion 1 |
| Message | Discussion contents 1, second message |
| Discussion subscription | 0 |
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page
Then "Unsubscribe from this discussion" "checkbox" should exist in the "Test post subject one" "table_row"
And "Subscribe to this discussion" "checkbox" should exist in the "Test post subject two" "table_row"
And I follow "Test post subject one"
@@ -265,9 +248,7 @@ Feature: A user can control their own subscription preferences for a discussion
| Subject | Test post subject two |
| Message | Test post message two |
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
When I am on the "Test forum name" "forum activity" page logged in as student1
And I should see "Unsubscribe from this forum"
And I reply "Test post subject one" post from "Test forum name" forum with:
| Subject | Reply 1 to discussion 1 |
@@ -277,13 +258,13 @@ Feature: A user can control their own subscription preferences for a discussion
| Subject | Reply 1 to discussion 1 |
| Message | Discussion contents 1, second message |
| Discussion subscription | 0 |
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page
Then "Unsubscribe from this discussion" "checkbox" should exist in the "Test post subject one" "table_row"
And "Subscribe to this discussion" "checkbox" should exist in the "Test post subject two" "table_row"
And I follow "Test post subject one"
And I follow "Reply"
And the field "Discussion subscription" matches value "Send me notifications of new posts in this discussion"
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page
And I follow "Test post subject two"
And I follow "Reply"
And the field "Discussion subscription" matches value "I don't want to be notified of new posts in this discussion"
@@ -339,9 +320,7 @@ Feature: A user can control their own subscription preferences for a discussion
| Subject | Test post subject one |
| Message | Test post message one |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
When I follow "Test forum name"
When I am on the "Test forum name" "forum activity" page logged in as student1
Then "Subscribe to this forum" "link" should exist in current page administration
And I follow "Test post subject one"
And "You are not subscribed to this discussion. Click to subscribe" "link" should exist
+7 -10
View File
@@ -16,11 +16,11 @@ Feature: Edited forum posts handle tags correctly
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Description | Test forum description |
And the following "activity" exists:
| course | C1 |
| activity | forum |
| name | Test forum name |
And I am on the "Course 1" Course page logged in as teacher1
And I add a new discussion to "Test forum name" forum with:
| Subject | Teacher post subject |
| Message | Teacher post message |
@@ -28,8 +28,7 @@ Feature: Edited forum posts handle tags correctly
@javascript
Scenario: Forum post edition of custom tags works as expected
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 I reply "Teacher post subject" post from "Test forum name" forum with:
| Subject | Student post subject |
| Message | Student post message |
@@ -47,9 +46,7 @@ Feature: Edited forum posts handle tags correctly
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 log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test forum"
And I am on the "Test forum name" "forum activity" page logged in as teacher1
And I click on "Add a new discussion topic" "link"
And I click on "Advanced" "button"
And I expand all fieldsets
@@ -9,13 +9,13 @@ Feature: A student can favourite a discussion via the forum settings menu
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Description | Test forum description |
| user | course | role |
| student1 | C1 | student |
And the following "activity" exists:
| course | C1 |
| activity | forum |
| name | Test forum name |
And I am on the "Course 1" Course page logged in as admin
And I add a new discussion to "Test forum name" forum with:
| Subject | Discussion 1 |
| Message | Discussion contents 1, first message |
@@ -23,25 +23,25 @@ Feature: A student can favourite a discussion via the forum settings menu
| Subject | Reply 1 to discussion 1 |
| Message | Discussion contents 1, second message |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
Scenario: Student can favourite a discussion from within an individual discussion
Given I reply "Discussion 1" post from "Test forum name" forum with:
Given I am on the "Course 1" Course page logged in as student1
And I reply "Discussion 1" post from "Test forum name" forum with:
| Subject | Reply 2 to discussion 1 |
| Message | Discussion contents 1, third message |
And I wait until the page is ready
And I open the action menu in "[data-container='discussion-tools']" "css_element"
When I open the action menu in "[data-container='discussion-tools']" "css_element"
And I click on "[title='Star this discussion']" "css_element"
And I wait "3" seconds
And I open the action menu in "[data-container='discussion-tools']" "css_element"
And I click on "[title='Unstar this discussion']" "css_element"
Scenario: Student can favourite a discussion from the discussion list
Given I reply "Discussion 1" post from "Test forum name" forum with:
Given I am on the "Course 1" Course page logged in as student1
And I reply "Discussion 1" post from "Test forum name" forum with:
| Subject | Reply 2 to discussion 1 |
| Message | Discussion contents 1, third message |
And I follow "Test forum name"
When I am on the "Test forum name" "forum activity" page
And I click on "Discussion 1" action menu
And I click on "[title='Star this discussion']" "css_element"
And I click on "Discussion 1" action menu
+3 -9
View File
@@ -22,9 +22,7 @@ Feature: Export forum
| forum | Test forum 1 | Test forum 1 description | general | C1 | 123 |
Scenario: Teacher can export forum
Given I log in as "teacher1"
And I am on "Course 1" course homepage
When I follow "Test forum 1"
Given I am on the "Test forum 1" "forum activity" page logged in as teacher1
And I navigate to "Export" in current page administration
And I open the autocomplete suggestions list
And I should see "Student 1" in the ".form-autocomplete-suggestions" "css_element"
@@ -35,9 +33,7 @@ Feature: Export forum
And I log out
Scenario: Students cannot export forum by default
Given I log in as "student1"
And I am on "Course 1" course homepage
When I follow "Test forum 1"
Given I am on the "Test forum 1" "forum activity" page logged in as student1
Then "Export" "link" should not exist in current page administration
And I log out
@@ -45,9 +41,7 @@ Feature: Export forum
Given the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| mod/forum:exportforum | Allow | student | Course | C1 |
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum 1"
When I am on the "Test forum 1" "forum activity" page logged in as student1
And I navigate to "Export" in current page administration
And I open the autocomplete suggestions list
And I should see "Student 1" in the ".form-autocomplete-suggestions" "css_element"
@@ -44,14 +44,13 @@ Feature: As a teacher I need to see an accurate list of subscribed users
| Forum type | Standard forum for general use |
| Description | Test forum description |
| Subscription mode | Forced subscription |
And I follow "Forced Forum 1"
And I am on the "Forced Forum 1" "forum activity" page
And I navigate to "Show/edit current subscribers" in current page administration
Then I should see "Student 1"
And I should see "Teacher Teacher"
And I should see "Student 2"
And I should see "Student 3"
And I follow "Forced Forum 1"
And I navigate to "Edit settings" in current page administration
And I am on the "Forced Forum 1" "forum activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Grouping" "button" in the "Add restriction..." "dialogue"
@@ -64,13 +63,21 @@ Feature: As a teacher I need to see an accurate list of subscribed users
And I should not see "Student 3"
Scenario: A forced forum does not allow to edit the subscribers
When I add a "Forum" to section "1" and I fill the form with:
| Forum name | Forced Forum 2 |
| Forum type | Standard forum for general use |
| Description | Test forum description |
Given the following "activity" exists:
| activity | forum |
| name | Forced Forum 2 |
| intro | Test forum description |
| type | general |
| course | C1 |
| idnumber | 0001 |
| section | 1 |
And I am on the "Forced Forum 2" "forum activity" page
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Subscription mode | Forced subscription |
| Availability | Show on course page |
And I follow "Forced Forum 2"
And I press "Save and return to course"
And I am on the "Forced Forum 2" "forum activity" page
And I navigate to "Show/edit current subscribers" in current page administration
Then I should see "Teacher Teacher"
And I should see "Student 1"
@@ -79,13 +86,21 @@ Feature: As a teacher I need to see an accurate list of subscribed users
And I should not see "Manage subscribers"
Scenario: A forced and hidden forum lists only teachers
When I add a "Forum" to section "1" and I fill the form with:
| Forum name | Forced Forum 2 |
| Forum type | Standard forum for general use |
| Description | Test forum description |
Given the following "activity" exists:
| activity | forum |
| name | Forced Forum 2 |
| intro | Test forum description |
| type | general |
| course | C1 |
| idnumber | 0001 |
| section | 1 |
And I am on "Course 1" course homepage
And I am on the "Forced Forum 2" "forum activity editing" page
And I set the following fields to these values:
| Subscription mode | Forced subscription |
| Availability | Hide from students |
And I follow "Forced Forum 2"
And I press "Save and return to course"
And I am on the "Forced Forum 2" "forum activity" page
And I navigate to "Show/edit current subscribers" in current page administration
Then I should see "Teacher Teacher"
And I should not see "Student 1"
@@ -99,14 +114,14 @@ Feature: As a teacher I need to see an accurate list of subscribed users
| Forum type | Standard forum for general use |
| Description | Test forum description |
| Subscription mode | Auto subscription |
And I follow "Forced Forum 1"
And I am on the "Forced Forum 1" "forum activity" page
And I navigate to "Show/edit current subscribers" in current page administration
Then I should see "Student 1"
And I should see "Teacher Teacher"
And I should see "Student 2"
And I should see "Student 3"
And I follow "Forced Forum 1"
And I navigate to "Edit settings" in current page administration
And I am on "Course 1" course homepage
And I am on the "Forced Forum 1" "forum activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Grouping" "button" in the "Add restriction..." "dialogue"
@@ -16,122 +16,95 @@ Feature: A user can control their default discussion subscription settings
| user | course | role |
| student1 | C1 | student |
| student2 | C1 | student |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And the following "activities" exist:
| activity | name | intro | course | type | section |
| forum | Test forum name | Test forum description | C1 | general | 1 |
And I am on the "Test forum name" "forum activity editing" page logged in as admin
And I set the following fields to these values:
| Subscription mode | Optional subscription |
And I press "Save and return to course"
And I log out
Scenario: Creating a new discussion in an optional forum follows user preferences
Given I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Forum type | Standard forum for general use |
| Description | Test forum description |
| Subscription mode | Optional subscription |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
Given I am on the "Test forum name" "forum activity" page logged in as student1
When I click on "Add a new discussion topic" "link"
And I click on "Advanced" "button"
Then "input[name=discussionsubscribe][checked=checked]" "css_element" should exist
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student2
And I click on "Add a new discussion topic" "link"
And I click on "Advanced" "button"
And "input[name=discussionsubscribe]:not([checked=checked])" "css_element" should exist
Scenario: Replying to an existing discussion in an optional forum follows user preferences
Given I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Forum type | Standard forum for general use |
| Description | Test forum description |
| Subscription mode | Optional subscription |
Given I am on the "Test forum name" "forum activity" page logged in as admin
And I add a new discussion to "Test forum name" forum with:
| Subject | Test post subject |
| Message | Test post message |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student1
And I follow "Test post subject"
When I follow "Reply"
Then "input[name=discussionsubscribe][checked=checked]" "css_element" should exist
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student2
And I follow "Test post subject"
And I follow "Reply"
And "input[name=discussionsubscribe]:not([checked=checked])" "css_element" should exist
Scenario: Creating a new discussion in an automatic forum follows forum subscription
Given I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Forum type | Standard forum for general use |
| Description | Test forum description |
Given I am on the "Test forum name" "forum activity editing" page logged in as admin
And I set the following fields to these values:
| Subscription mode | Auto subscription |
And I press "Save and return to course"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student1
When I click on "Add a new discussion topic" "link"
And I click on "Advanced" "button"
Then "input[name=discussionsubscribe][checked=checked]" "css_element" should exist
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student2
And I click on "Add a new discussion topic" "link"
And I click on "Advanced" "button"
And "input[name=discussionsubscribe][checked=checked]" "css_element" should exist
Scenario: Replying to an existing discussion in an automatic forum follows forum subscription
Given I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Forum type | Standard forum for general use |
| Description | Test forum description |
Given I am on the "Test forum name" "forum activity editing" page logged in as admin
And I set the following fields to these values:
| Subscription mode | Optional subscription |
And I press "Save and return to course"
And I add a new discussion to "Test forum name" forum with:
| Subject | Test post subject |
| Message | Test post message |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student1
And I follow "Test post subject"
When I follow "Reply"
Then "input[name=discussionsubscribe][checked=checked]" "css_element" should exist
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student2
And I follow "Test post subject"
And I follow "Reply"
And "input[name=discussionsubscribe]:not([checked=checked])" "css_element" should exist
@javascript
Scenario: Replying to an existing discussion in an automatic forum which has been unsubscribed from follows user preferences
Given I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Forum type | Standard forum for general use |
| Description | Test forum description |
Given I am on the "Test forum name" "forum activity editing" page logged in as admin
And I set the following fields to these values:
| Subscription mode | Auto subscription |
And I press "Save and return to course"
And I add a new discussion to "Test forum name" forum with:
| Subject | Test post subject |
| Message | Test post message |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student1
And I click on "input[id^=subscription-toggle]" "css_element" in the "Test post subject" "table_row"
And I follow "Test post subject"
When I follow "Reply"
And I click on "Advanced" "button"
And "input[name=discussionsubscribe][checked]" "css_element" should exist
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student2
And I click on "input[id^=subscription-toggle]" "css_element" in the "Test post subject" "table_row"
And I follow "Test post subject"
And I follow "Reply"
@@ -37,9 +37,7 @@ Feature: View discussion while grading in a forum
| Gradable forum | student2 | My topic | I disagree |
Scenario: Viewing a discussion
Given I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Gradable forum"
Given I am on the "Gradable forum" "forum activity" page logged in as teacher
And I press "Grade users"
When I press "View discussion"
Then I should see "I disagree" in the "My topic" "dialogue"
@@ -47,9 +45,7 @@ Feature: View discussion while grading in a forum
And I should not see "I disagree"
Scenario: Viewing a discussion while grading is fullscreen
Given I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Gradable forum"
Given I am on the "Gradable forum" "forum activity" page logged in as teacher
And I press "Grade users"
# Uses the aria-label for the menu in in the grading interface.
And I press "Actions for the grader interface"
@@ -16,13 +16,11 @@ Feature: Blog posts are always displayed in reverse chronological order
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Course blog forum |
| Description | Single discussion forum description |
| Forum type | Standard forum displayed in a blog-like format |
And I log out
And the following "activity" exists:
| course | C1 |
| activity | forum |
| name | Course blog forum |
| type | blog |
#
# We need javascript/wait to prevent creation of the posts in the same second. The threads
@@ -31,9 +29,7 @@ Feature: Blog posts are always displayed in reverse chronological order
#
@javascript
Scenario: Replying to a blog post or editing it does not affect its display order
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Course blog forum"
Given I am on the "Course blog forum" "forum activity" page logged in as student1
#
# Add three posts into the blog.
#
@@ -58,14 +54,11 @@ Feature: Blog posts are always displayed in reverse chronological order
#
# Reply to another blog post.
#
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Course blog forum"
And I am on the "Course blog forum" "forum activity" page logged in as teacher1
And I click on "Discuss this topic" "link" in the "//div[@aria-label='Blog post 1 by Student 1']" "xpath_element"
And I reply "Blog post 1" post from "Course blog forum" forum with:
| Message | Reply to the first post |
And I am on "Course 1" course homepage
And I follow "Course blog forum"
And I am on the "Course blog forum" "forum activity" page
#
# Make sure the order of the blog posts is still reverse chronological.
#
@@ -16,13 +16,10 @@ Feature: New discussions and discussions with recently added replies are display
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Course general forum |
| Description | Single discussion forum description |
| Forum type | Standard forum for general use |
And I log out
And the following "activity" exists:
| course | C1 |
| activity | forum |
| name | Course general forum |
#
# We need javascript/wait to prevent creation of the posts in the same second. The threads
@@ -31,9 +28,7 @@ Feature: New discussions and discussions with recently added replies are display
#
@javascript
Scenario: Replying to a forum post or editing it puts the discussion to the front
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Course general forum"
Given I am on the "Course general forum" "forum activity" page logged in as student1
#
# Add three posts into the forum.
#
@@ -59,14 +54,11 @@ Feature: New discussions and discussions with recently added replies are display
#
# Reply to another forum post.
#
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Course general forum"
And I am on the "Course general forum" "forum activity" page logged in as teacher1
And I follow "Forum post 1"
And I reply "Forum post 1" post from "Course general forum" forum with:
| Message | Reply to the first post |
And I am on "Course 1" course homepage
And I follow "Course general forum"
And I am on the "Course general forum" "forum activity" page
#
# Make sure the order of the forum posts is as expected, with most recent new participation first (ie excluding edits).
#
+4 -6
View File
@@ -25,13 +25,12 @@ Feature: Glossary entries can be organised in categories
| label | name | check autolinking of CategoryAutoLinks and CategoryNoLinks text | C1 | label1 |
And the "glossary" filter is "on"
# Log in as a teacher and make sure nothing is yet autolinked
And I log in as "teacher1"
When I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as teacher1
Then I should see "CategoryAutoLinks"
And I should see "CategoryNoLinks"
And "a.glossary.autolink" "css_element" should not exist
# Create, edit and delete categories
And I follow "MyGlossary"
And I am on the MyGlossary "glossary activity" page
And I follow "Browse by category"
And I press "Edit categories"
And I press "Add category"
@@ -97,8 +96,7 @@ Feature: Glossary entries can be organised in categories
And I should see "CategoryNoLinks"
And "//a[contains(.,'CategoryNoLinks')]" "xpath_element" should not exist
# Delete a category with entries
And I am on "Course 1" course homepage
And I follow "MyGlossary"
And I am on the MyGlossary "glossary activity" page
And I follow "Browse by category"
And I press "Edit categories"
And I should see "2 Entries" in the "CategoryNoLinks" "table_row"
@@ -106,7 +104,7 @@ Feature: Glossary entries can be organised in categories
And I click on "Delete" "link" in the "CategoryAutoLinks" "table_row"
And I press "Yes"
And I wait to be redirected
And I follow "MyGlossary"
And I am on the MyGlossary "glossary activity" page
And I follow "Browse by category"
And I should see "EntryCategoryNL"
And I should not see "EntryNoCategory"
+7 -12
View File
@@ -16,17 +16,14 @@ Feature: Edited glossary entries handle tags correctly
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Glossary" to section "1" and I fill the form with:
| Name | Test glossary |
| Description | A glossary about dreams! |
And I log out
And the following "activity" exists:
| course | C1 |
| activity | glossary |
| name | Test glossary |
| intro | A glossary about dreams! |
Scenario: Glossary entry edition of custom tags works as expected
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test glossary"
Given I am on the "Test glossary" "glossary activity" page logged in as teacher1
And I press "Add a new entry"
And I set the following fields to these values:
| Concept | Dummy first entry |
@@ -50,9 +47,7 @@ Feature: Edited glossary entries handle tags correctly
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 log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test glossary"
Given I am on the "Test glossary" "glossary activity" page logged in as teacher1
And I press "Add a new entry"
And I expand all fieldsets
And I open the autocomplete suggestions list
@@ -27,53 +27,39 @@ Feature: A teacher can choose whether glossary entries require approval
And I log out
Scenario: Approve and undo approve glossary entries
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
Given I am on the "Test glossary name" "glossary activity" page logged in as student1
When I add a glossary entry with the following data:
| Concept | Just a test concept |
| Definition | Concept definition |
| Keyword(s) | Black |
And I log out
# Test that students can not see the unapproved entry.
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
And I am on the "Test glossary name" "glossary activity" page logged in as student2
Then I should see "No entries found in this section"
And I log out
# Approve the entry.
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
And I am on the "Test glossary name" "glossary activity" page logged in as teacher1
And I follow "Waiting approval"
Then I should see "(this entry is currently hidden)"
And I follow "Approve"
And I follow "Test glossary name"
And I click on "Test glossary name" "link" in the "page-header" "region"
Then I should see "Concept definition"
And I log out
# Check that the entry can now be viewed by students.
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
And I am on the "Test glossary name" "glossary activity" page logged in as student2
Then I should see "Concept definition"
And I log out
# Undo the approval of the previous entry.
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
And I am on the "Test glossary name" "glossary activity" page logged in as teacher1
And I follow "Undo approval"
And I log out
# Check that the entry is no longer visible by students.
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
And I am on the "Test glossary name" "glossary activity" page logged in as student2
Then I should see "No entries found in this section"
@javascript
Scenario: View pending approval glossary items
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
Given I am on the "Test glossary name" "glossary activity" page logged in as student1
When I add a glossary entry with the following data:
| Concept | Just a test concept |
| Definition | Concept definition |
@@ -23,7 +23,7 @@ Feature: Importing glossary entries
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Recent activity" block
And I follow "Glossary 1"
And I am on the "Glossary 1" "glossary activity" page
And I navigate to "Import entries" in current page administration
And I upload "mod/glossary/tests/fixtures/texfilter_glossary_en.xml" file to "File to import" filemanager
When I press "Submit"
@@ -38,7 +38,7 @@ Feature: Importing glossary entries
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Tags" block
And I follow "Glossary 1"
And I am on the "Glossary 1" "glossary activity" page
And I navigate to "Import entries" in current page administration
And I upload "mod/glossary/tests/fixtures/musicians.xml" file to "File to import" filemanager
When I press "Submit"
@@ -15,13 +15,13 @@ Feature: A teacher can choose whether to allow duplicate entries in a glossary
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Glossary" to section "1" and I fill the form with:
| Name | Test glossary name |
| Description | Test glossary description |
| Duplicate entries allowed | No |
And I follow "Test glossary name"
And the following "activity" exists:
| course | C1 |
| activity | glossary |
| name | Test glossary name |
| intro | Test glossary description |
| allowduplicatedentries | 0 |
And I am on the "Test glossary name" "glossary activity" page logged in as teacher1
And I add a glossary entry with the following data:
| Concept | Unique concept |
| Definition | I'm the definition of an unique concept |
@@ -16,19 +16,16 @@ Feature: A teacher can choose whether to provide a printer-friendly glossary ent
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
@javascript
Scenario: Printer-friendly glossary view enabled
Given I add a "Glossary" to section "1" and I fill the form with:
| Name | Test glossary name |
| Description | Test glossary description |
| Allow print view | Yes |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
Given the following "activity" exists:
| course | C1 |
| activity | glossary |
| name | Test glossary name |
| intro | Test glossary description |
| allowprintview | 1 |
And I am on the "Test glossary name" "glossary activity" page logged in as student1
When I add a glossary entry with the following data:
| Concept | Just a test concept |
| Definition | Concept definition |
@@ -39,14 +36,13 @@ Feature: A teacher can choose whether to provide a printer-friendly glossary ent
@javascript
Scenario: Printer-friendly glossary view disabled
Given I add a "Glossary" to section "1" and I fill the form with:
| Name | Test glossary name |
| Description | Test glossary description |
| Allow print view | No |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
Given the following "activity" exists:
| course | C1 |
| activity | glossary |
| name | Test glossary name |
| intro | Test glossary description |
| allowprintview | 0 |
And I am on the "Test glossary name" "glossary activity" page logged in as student1
When I add a glossary entry with the following data:
| Concept | Just a test concept |
| Definition | Concept definition |
@@ -19,9 +19,7 @@ Feature: Glossary entries can be searched or browsed by alphabet, category, date
And the following "activities" exist:
| activity | name | intro | displayformat | course | idnumber |
| glossary | Test glossary name | Test glossary description | fullwithauthor | C1 | g1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
And I am on the "Test glossary name" "glossary activity" page logged in as teacher1
And I add a glossary entries category named "The ones I like"
And I add a glossary entries category named "All for you"
And I add a glossary entry with the following data:
@@ -29,17 +27,13 @@ Feature: Glossary entries can be searched or browsed by alphabet, category, date
| Definition | Sour eggplants |
| Categories | All for you |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
And I am on the "Test glossary name" "glossary activity" page logged in as student1
And I add a glossary entry with the following data:
| Concept | Cucumber |
| Definition | Sweet cucumber |
| Categories | The ones I like |
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
And I am on the "Test glossary name" "glossary activity" page logged in as teacher1
@javascript
Scenario: Search by keyword and browse by alphabet
@@ -36,9 +36,7 @@ Feature: Attempts review settings.
| duration | 4 |
| completion | 1 |
| success | 1 |
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "H5P package"
When I am on the "H5P package" "h5pactivity activity" page logged in as student1
Then I should see "View my attempts"
And I should not see "This content is displayed in preview mode"
@@ -61,9 +59,7 @@ Feature: Attempts review settings.
| duration | 4 |
| completion | 1 |
| success | 1 |
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "H5P package"
When I am on the "H5P package" "h5pactivity activity" page logged in as student1
Then I should not see "View my attempts"
And I should not see "This content is displayed in preview mode"
@@ -85,9 +81,7 @@ Feature: Attempts review settings.
| duration | 4 |
| completion | 1 |
| success | 1 |
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "H5P package"
When I am on the "H5P package" "h5pactivity activity" page logged in as student1
Then I should not see "View my attempts"
And I should see "This content is displayed in preview mode"
@@ -110,9 +104,7 @@ Feature: Attempts review settings.
| duration | 4 |
| completion | 1 |
| success | 1 |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "H5P package"
When I am on the "H5P package" "h5pactivity activity" page logged in as teacher1
Then I should see "View all attempts (1 submitted)"
And I should see "This content is displayed in preview mode"
@@ -135,8 +127,6 @@ Feature: Attempts review settings.
| duration | 4 |
| completion | 1 |
| success | 1 |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "H5P package"
When I am on the "H5P package" "h5pactivity activity" page logged in as teacher1
Then I should see "View all attempts (1 submitted)"
And I should see "This content is displayed in preview mode"
@@ -23,9 +23,7 @@ Feature: Report different types of interactions.
Given the following "mod_h5pactivity > attempts" exist:
| user | h5pactivity | attempt | interactiontype | rawscore | maxscore | duration | completion | success |
| student1 | H5P package | 1 | compound | 2 | 2 | 4 | 1 | 1 |
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "H5P package"
When I am on the "H5P package" "h5pactivity activity" page logged in as student1
And I follow "View my attempts"
And I follow "View report"
Then I should see "2 out of 2"
@@ -37,9 +35,7 @@ Feature: Report different types of interactions.
Given the following "mod_h5pactivity > attempts" exist:
| user | h5pactivity | attempt | interactiontype | rawscore | maxscore | duration | completion | success |
| student1 | H5P package | 1 | compound | 0 | 2 | 4 | 1 | 0 |
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "H5P package"
When I am on the "H5P package" "h5pactivity activity" page logged in as student1
And I follow "View my attempts"
And I follow "View report"
Then I should see "0 out of 2"
@@ -52,9 +48,7 @@ Feature: Report different types of interactions.
| user | h5pactivity | attempt | interactiontype | rawscore | maxscore | duration | completion | success |
| student1 | H5P package | 1 | choice | 2 | 2 | 1 | 1 | 1 |
| student1 | H5P package | 1 | compound | 2 | 2 | 4 | 1 | 1 |
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "H5P package"
When I am on the "H5P package" "h5pactivity activity" page logged in as student1
And I follow "View my attempts"
And I follow "View report"
Then I should see "Select the correct answers"
@@ -66,9 +60,7 @@ Feature: Report different types of interactions.
| user | h5pactivity | attempt | interactiontype | rawscore | maxscore | duration | completion | success |
| student1 | H5P package | 1 | choice | 0 | 2 | 1 | 1 | 0 |
| student1 | H5P package | 1 | compound | 0 | 2 | 4 | 1 | 0 |
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "H5P package"
When I am on the "H5P package" "h5pactivity activity" page logged in as student1
And I follow "View my attempts"
And I follow "View report"
Then I should see "Select the correct answers"
@@ -80,9 +72,7 @@ Feature: Report different types of interactions.
| user | h5pactivity | attempt | interactiontype | rawscore | maxscore | duration | completion | success |
| student1 | H5P package | 1 | matching | 2 | 2 | 1 | 1 | 1 |
| student1 | H5P package | 1 | compound | 2 | 2 | 4 | 1 | 1 |
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "H5P package"
When I am on the "H5P package" "h5pactivity activity" page logged in as student1
And I follow "View my attempts"
And I follow "View report"
Then I should see "Drag and Drop example 1"
@@ -94,9 +84,7 @@ Feature: Report different types of interactions.
| user | h5pactivity | attempt | interactiontype | rawscore | maxscore | duration | completion | success |
| student1 | H5P package | 1 | matching | 0 | 2 | 1 | 1 | 1 |
| student1 | H5P package | 1 | compound | 0 | 2 | 4 | 1 | 1 |
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "H5P package"
When I am on the "H5P package" "h5pactivity activity" page logged in as student1
And I follow "View my attempts"
And I follow "View report"
Then I should see "Drag and Drop example 1"
@@ -108,9 +96,7 @@ Feature: Report different types of interactions.
| user | h5pactivity | attempt | interactiontype | rawscore | maxscore | duration | completion | success |
| student1 | H5P package | 1 | true-false | 2 | 2 | 1 | 1 | 1 |
| student1 | H5P package | 1 | compound | 2 | 2 | 4 | 1 | 1 |
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "H5P package"
When I am on the "H5P package" "h5pactivity activity" page logged in as student1
And I follow "View my attempts"
And I follow "View report"
Then I should see "The correct answer is true"
@@ -122,9 +108,7 @@ Feature: Report different types of interactions.
| user | h5pactivity | attempt | interactiontype | rawscore | maxscore | duration | completion | success |
| student1 | H5P package | 1 | true-false | 0 | 2 | 1 | 1 | 0 |
| student1 | H5P package | 1 | compound | 0 | 2 | 4 | 1 | 0 |
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "H5P package"
When I am on the "H5P package" "h5pactivity activity" page logged in as student1
And I follow "View my attempts"
And I follow "View report"
Then I should see "The correct answer is true"
@@ -136,9 +120,7 @@ Feature: Report different types of interactions.
| user | h5pactivity | attempt | interactiontype | rawscore | maxscore | duration | completion | success |
| student1 | H5P package | 1 | fill-in | 2 | 2 | 1 | 1 | 1 |
| student1 | H5P package | 1 | compound | 2 | 2 | 4 | 1 | 1 |
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "H5P package"
When I am on the "H5P package" "h5pactivity activity" page logged in as student1
And I follow "View my attempts"
And I follow "View report"
Then I should see "This an example of missing word text"
@@ -153,9 +135,7 @@ Feature: Report different types of interactions.
| user | h5pactivity | attempt | interactiontype | rawscore | maxscore | duration | completion | success |
| student1 | H5P package | 1 | fill-in | 0 | 2 | 1 | 1 | 0 |
| student1 | H5P package | 1 | compound | 0 | 2 | 4 | 1 | 0 |
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "H5P package"
When I am on the "H5P package" "h5pactivity activity" page logged in as student1
And I follow "View my attempts"
And I follow "View report"
Then I should see "This an example of missing word text"
@@ -172,9 +152,7 @@ Feature: Report different types of interactions.
| user | h5pactivity | attempt | interactiontype | rawscore | maxscore | duration | completion | success |
| student1 | H5P package | 1 | long-fill-in | 2 | 2 | 1 | 1 | 1 |
| student1 | H5P package | 1 | compound | 2 | 2 | 4 | 1 | 1 |
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "H5P package"
When I am on the "H5P package" "h5pactivity activity" page logged in as student1
And I follow "View my attempts"
And I follow "View report"
Then I should see "Please describe the novel The Hobbit"
@@ -187,9 +165,7 @@ Feature: Report different types of interactions.
| user | h5pactivity | attempt | interactiontype | rawscore | maxscore | duration | completion | success |
| student1 | H5P package | 1 | long-fill-in | 0 | 2 | 1 | 1 | 0 |
| student1 | H5P package | 1 | compound | 0 | 2 | 4 | 1 | 0 |
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "H5P package"
When I am on the "H5P package" "h5pactivity activity" page logged in as student1
And I follow "View my attempts"
And I follow "View report"
Then I should see "Please describe the novel The Hobbit"
@@ -204,9 +180,7 @@ Feature: Report different types of interactions.
| user | h5pactivity | attempt | interactiontype | rawscore | maxscore | duration | completion | success |
| student1 | H5P package | 1 | sequencing | 2 | 2 | 1 | 1 | 1 |
| student1 | H5P package | 1 | compound | 2 | 2 | 4 | 1 | 1 |
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "H5P package"
When I am on the "H5P package" "h5pactivity activity" page logged in as student1
And I follow "View my attempts"
And I follow "View report"
Then I should see "This interaction (sequencing) does not provide tracking information"
@@ -220,9 +194,7 @@ Feature: Report different types of interactions.
| user | h5pactivity | attempt | interactiontype | rawscore | maxscore | duration | completion | success |
| student1 | H5P package | 1 | sequencing | 2 | 2 | 1 | 1 | 0 |
| student1 | H5P package | 1 | compound | 0 | 2 | 4 | 1 | 0 |
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "H5P package"
When I am on the "H5P package" "h5pactivity activity" page logged in as student1
And I follow "View my attempts"
And I follow "View report"
Then I should see "This interaction (sequencing) does not provide tracking information"
@@ -236,9 +208,7 @@ Feature: Report different types of interactions.
| user | h5pactivity | attempt | interactiontype | rawscore | maxscore | duration | completion | success |
| student1 | H5P package | 1 | other | 2 | 2 | 1 | 1 | 1 |
| student1 | H5P package | 1 | compound | 2 | 2 | 4 | 1 | 1 |
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "H5P package"
When I am on the "H5P package" "h5pactivity activity" page logged in as student1
And I follow "View my attempts"
And I follow "View report"
Then I should see "This interaction (other) does not provide tracking information"
@@ -252,9 +222,7 @@ Feature: Report different types of interactions.
| user | h5pactivity | attempt | interactiontype | rawscore | maxscore | duration | completion | success |
| student1 | H5P package | 1 | other | 2 | 2 | 1 | 1 | 0 |
| student1 | H5P package | 1 | compound | 0 | 2 | 4 | 1 | 0 |
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "H5P package"
When I am on the "H5P package" "h5pactivity activity" page logged in as student1
And I follow "View my attempts"
And I follow "View report"
Then I should see "This interaction (other) does not provide tracking information"
@@ -28,9 +28,7 @@ Feature: Change grading options in an H5P activity
And I upload "h5p/tests/fixtures/multiple-choice-2-6.h5p" file to "Package file" filemanager
And I click on "Save and display" "button"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Awesome H5P package"
And I am on the "Awesome H5P package" "h5pactivity activity" page logged in as student1
And I switch to "h5p-player" class iframe
And I switch to "h5p-iframe" class iframe
And I click on "Wrong one" "text" in the ".h5p-question-content" "css_element"
@@ -47,12 +45,10 @@ Feature: Change grading options in an H5P activity
And I click on "Check" "button" in the ".h5p-question-buttons" "css_element"
And I switch to the main frame
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Awesome H5P package"
@javascript
Scenario: Default grading is max attempt grade
Given I am on the "Awesome H5P package" "h5pactivity activity" page logged in as teacher1
When I navigate to "View > User report" in the course gradebook
And I set the field "Select all or one user" to "Student 1"
Then the following should exist in the "user-grade" table:
@@ -61,8 +57,8 @@ Feature: Change grading options in an H5P activity
@javascript
Scenario: Change setting to first attempt
When I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
Given I am on the "Awesome H5P package" "h5pactivity activity editing" page logged in as teacher1
When I set the following fields to these values:
| Grading method | First attempt |
And I click on "Save and return to course" "button"
And I navigate to "View > User report" in the course gradebook
@@ -73,8 +69,8 @@ Feature: Change grading options in an H5P activity
@javascript
Scenario: Change setting to first attempt
When I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
Given I am on the "Awesome H5P package" "h5pactivity activity editing" page logged in as teacher1
When I set the following fields to these values:
| Grading method | Last attempt |
And I click on "Save and return to course" "button"
And I navigate to "View > User report" in the course gradebook
@@ -85,8 +81,8 @@ Feature: Change grading options in an H5P activity
@javascript
Scenario: Change setting to average attempt
When I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
Given I am on the "Awesome H5P package" "h5pactivity activity editing" page logged in as teacher1
When I set the following fields to these values:
| Grading method | Average grade |
And I click on "Save and return to course" "button"
And I navigate to "View > User report" in the course gradebook
@@ -97,8 +93,8 @@ Feature: Change grading options in an H5P activity
@javascript
Scenario: Change setting to manual grading
When I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
Given I am on the "Awesome H5P package" "h5pactivity activity editing" page logged in as teacher1
When I set the following fields to these values:
| Grading method | Don't calculate a grade |
And I click on "Save and return to course" "button"
And I navigate to "View > User report" in the course gradebook
@@ -109,8 +105,8 @@ Feature: Change grading options in an H5P activity
@javascript
Scenario: Disable tracking
When I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
Given I am on the "Awesome H5P package" "h5pactivity activity editing" page logged in as teacher1
When I set the following fields to these values:
| Enable attempt tracking | No |
And I click on "Save and return to course" "button"
And I navigate to "View > User report" in the course gradebook
@@ -122,8 +118,8 @@ Feature: Change grading options in an H5P activity
@javascript
Scenario: Reescale existing grades changing the maximum grade
# First we set to average and recalculate grades.
When I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
Given I am on the "Awesome H5P package" "h5pactivity activity editing" page logged in as teacher1
When I set the following fields to these values:
| Grading method | Average grade |
And I click on "Save and return to course" "button"
And I navigate to "View > User report" in the course gradebook
@@ -133,9 +129,7 @@ Feature: Change grading options in an H5P activity
| Awesome H5P package | 33.33 | 0100 | 33.33 % |
# Now we modify the maximum grade with rescaling.
When I am on "Course 1" course homepage
And I follow "Awesome H5P package"
And I navigate to "Edit settings" in current page administration
And I am on the "Awesome H5P package" "h5pactivity activity editing" page
And I set the following fields to these values:
| Rescale existing grades | Yes |
| Maximum grade | 50 |
@@ -149,8 +143,8 @@ Feature: Change grading options in an H5P activity
@javascript
Scenario: Change maximum grade without rescaling grade
# First we set to average and recalculate grades.
When I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
Given I am on the "Awesome H5P package" "h5pactivity activity editing" page logged in as teacher1
When I set the following fields to these values:
| Grading method | Average grade |
And I click on "Save and return to course" "button"
And I navigate to "View > User report" in the course gradebook
@@ -160,9 +154,7 @@ Feature: Change grading options in an H5P activity
| Awesome H5P package | 33.33 | 0100 | 33.33 % |
# Now we modify the maximum grade with rescaling.
When I am on "Course 1" course homepage
And I follow "Awesome H5P package"
And I navigate to "Edit settings" in current page administration
When I am on the "Awesome H5P package" "h5pactivity activity editing" page
And I set the following fields to these values:
| Rescale existing grades | No |
| Maximum grade | 50 |
+6 -11
View File
@@ -40,8 +40,7 @@ Feature: Add H5P activity context locking
Scenario: Access participants report on a freeze context
Given the "h5ppackage" "Activity module" is context frozen
And I am on the "C1" "Course" page logged in as "admin"
And I follow "H5P package"
And I am on the "H5P package" "h5pactivity activity" page logged in as admin
When I follow "View all attempts (1 submitted)"
Then I should see "Student 1"
And I should see "View user attempts (1)" in the "Student 1" "table_row"
@@ -50,8 +49,7 @@ Feature: Add H5P activity context locking
Scenario: Access own attempts on a freeze context
Given the "h5ppackage" "Activity module" is context frozen
When I am on the "C1" "Course" page logged in as "student1"
And I follow "H5P package"
And I am on the "H5P package" "h5pactivity activity" page logged in as student1
When I follow "View my attempts"
And I follow "View report"
Then I should see "Attempt #1: Student 1"
@@ -61,8 +59,7 @@ Feature: Add H5P activity context locking
Given the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| mod/h5pactivity:submit | Prohibit | student | System | |
And I am on the "C1" "Course" page logged in as "admin"
And I follow "H5P package"
And I am on the "H5P package" "h5pactivity activity" page logged in as admin
When I follow "View all attempts (1 submitted)"
Then I should see "Student 1"
And I should see "View user attempts (1)" in the "Student 1" "table_row"
@@ -73,8 +70,7 @@ Feature: Add H5P activity context locking
Given the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| mod/h5pactivity:view | Prohibit | student | System | |
When I am on the "C1" "Course" page logged in as "admin"
And I follow "H5P package"
And I am on the "H5P package" "h5pactivity activity" page logged in as admin
When I follow "View all attempts (0 submitted)"
Then I should see "No participants to display"
@@ -83,8 +79,7 @@ Feature: Add H5P activity context locking
| capability | permission | role | contextlevel | reference |
| mod/h5pactivity:submit | Prohibit | student | System | |
| mod/h5pactivity:view | Prohibit | student | System | |
When I am on the "C1" "Course" page logged in as "admin"
And I follow "H5P package"
And I am on the "H5P package" "h5pactivity activity" page logged in as admin
When I follow "View all attempts (0 submitted)"
Then I should see "No participants to display"
@@ -92,7 +87,7 @@ Feature: Add H5P activity context locking
Given I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I click on "Hide" "link" in the "H5P package" activity
When I follow "H5P package"
When I am on the "H5P package" "h5pactivity activity" page
And I follow "View all attempts (1 submitted)"
Then I should see "Student 1"
And I should see "View user attempts (1)"
@@ -29,10 +29,8 @@ Feature: View fill the blanks attempt report
And I log out
Scenario: View attempt in a fill the blanks content
Given I am on the "Awesome H5P package" "h5pactivity activity" page logged in as student1
# Do an attempt.
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Awesome H5P package"
And I switch to "h5p-player" class iframe
And I switch to "h5p-iframe" class iframe
And I set the field with xpath "//input[contains(@aria-label,\"Blank input 1 of 4\")]" to "Brigadoon"
@@ -30,9 +30,7 @@ Feature: View essay attempt report
Scenario: View attempt essay content
# Do an attempt.
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Awesome H5P package"
Given I am on the "Awesome H5P package" "h5pactivity activity" page logged in as student1
And I change window size to "large"
And I switch to "h5p-player" class iframe
And I switch to "h5p-iframe" class iframe
@@ -37,9 +37,7 @@ Feature: Do a H5P attempt
Scenario: To an attempts and check on course log report
When I click on "Save and return to course" "button"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Awesome H5P package"
Given I am on the "Awesome H5P package" "h5pactivity activity" page logged in as student1
And I wait until the page is ready
And I should not see "This content is displayed in preview mode"
And I switch to "h5p-player" class iframe
@@ -48,8 +46,7 @@ Feature: Do a H5P attempt
And I click on "Check" "button" in the ".h5p-question-buttons" "css_element"
And I switch to the main frame
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
And I navigate to course participants
And I follow "Student 1"
Then I follow "Today's logs"
@@ -25,9 +25,7 @@ Feature: Display the IMS content package description in the IMSCP and optionally
| Description | Test IMS content package description |
And I upload "mod/imscp/tests/packages/singlescobasic.zip" file to "Package file" filemanager
And I click on "Save and display" "button"
And I am on "Course 1" course homepage
And I should see "Test IMS content package"
When I follow "Test IMS content package"
When I am on the "Test IMS content package" "imscp activity" page
Then I should see "Test IMS content package description"
@javascript @_file_upload
@@ -40,9 +38,7 @@ Feature: Display the IMS content package description in the IMSCP and optionally
| Description | Test IMS content package description |
And I upload "mod/imscp/tests/packages/singlescobasic.zip" file to "Package file" filemanager
And I click on "Save and display" "button"
And I am on "Course 1" course homepage
And I follow "Test IMS content package"
And I navigate to "Edit settings" in current page administration
When I am on the "Test IMS content package" "imscp activity editing" page
And the following fields match these values:
| Display description on course page | |
And I set the following fields to these values:
@@ -61,9 +57,7 @@ Feature: Display the IMS content package description in the IMSCP and optionally
| Description | Test IMS content package description |
And I upload "mod/imscp/tests/packages/singlescobasic.zip" file to "Package file" filemanager
And I click on "Save and display" "button"
And I am on "Course 1" course homepage
And I follow "Test IMS content package"
And I navigate to "Edit settings" in current page administration
When I am on the "Test IMS content package" "imscp activity editing" page
And the following fields match these values:
| Display description on course page | |
And I press "Save and return to course"
@@ -16,18 +16,18 @@ Feature: In a lesson activity, a teacher can duplicate a lesson page
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activity" exists:
| course | C1 |
| activity | lesson |
| name | Test lesson name |
And I log in as "teacher1"
And I follow "Manage private files"
And I upload "mod/lesson/tests/fixtures/moodle_logo.jpg" file to "Files" filemanager
And I click on "Save changes" "button"
When I am on "Course 1" course homepage with editing mode on
And I add a "Lesson" to section "1" and I fill the form with:
| Name | Test lesson name |
| Description | Test lesson description |
@javascript @_file_upload
Scenario: Duplicate content page with an image.
Given I follow "Test lesson name"
Given I am on the "Test lesson name" "lesson activity" page
And I follow "Add a content page"
And I set the following fields to these values:
| Page title | First page name |
@@ -57,7 +57,7 @@ Feature: In a lesson activity, a teacher can duplicate a lesson page
@javascript @_file_upload
Scenario: Duplicate question page with image in answer.
Given I follow "Test lesson name"
Given I am on the "Test lesson name" "lesson activity" page
And I follow "Add a question page"
And I set the field "Select a question type" to "True/false"
And I press "Add a question page"
@@ -94,7 +94,7 @@ Feature: In a lesson activity, a teacher can duplicate a lesson page
@javascript @_file_upload
Scenario: Duplicate question page with image in feedback.
Given I follow "Test lesson name"
Given I am on the "Test lesson name" "lesson activity" page
And I follow "Add a question page"
And I set the field "Select a question type" to "True/false"
And I press "Add a question page"
@@ -16,12 +16,11 @@ Feature: In a lesson activity, teacher can import blackboard fill in the blank q
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
When I am on "Course 1" course homepage with editing mode on
And I add a "Lesson" to section "1" and I fill the form with:
| Name | Test lesson name |
| Description | Test lesson description |
And I follow "Test lesson name"
And the following "activity" exists:
| course | C1 |
| activity | lesson |
| name | Test lesson name |
When I am on the "Test lesson name" "lesson activity" page logged in as teacher1
And I follow "Import questions"
And I set the field "File format" to "Blackboard"
And I upload "mod/lesson/tests/fixtures/sample_blackboard_fib_qti.dat" file to "Upload" filemanager
+5 -6
View File
@@ -16,12 +16,11 @@ Feature: In a lesson activity, teacher can import embedded images in questions a
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
When I am on "Course 1" course homepage with editing mode on
And I add a "Lesson" to section "1" and I fill the form with:
| Name | Test lesson name |
| Description | Test lesson description |
And I follow "Test lesson name"
And the following "activity" exists:
| course | C1 |
| activity | lesson |
| name | Test lesson name |
When I am on the "Test lesson name" "lesson activity" page logged in as teacher1
And I follow "Import questions"
And I set the field "File format" to "Moodle XML format"
And I upload "mod/lesson/tests/fixtures/multichoice.xml" file to "Upload" filemanager
@@ -25,9 +25,7 @@ Feature: Lesson reset
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| lesson | Test lesson name | Test lesson description | C1 | lesson1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page logged in as teacher1
And I follow "Add a question page"
And I set the field "Select a question type" to "True/false"
And I press "Add a question page"
@@ -44,9 +42,7 @@ Feature: Lesson reset
Scenario: Use course reset to clear all attempt data
When I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page logged in as student1
And I should see "Cat is an amphibian"
And I set the following fields to these values:
| False | 1 |
@@ -54,9 +50,7 @@ Feature: Lesson reset
And I press "Continue"
And I should see "Congratulations - end of lesson reached"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page logged in as teacher1
And I navigate to "Reports > Overview" in current page administration
And I should see "Sam1 Student1"
And I am on "Course 1" course homepage
@@ -65,14 +59,13 @@ Feature: Lesson reset
| Delete all lesson attempts | 1 |
And I press "Reset course"
And I press "Continue"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page
And I navigate to "Reports > Overview" in current page administration
Then I should see "No attempts have been made on this lesson"
@javascript
Scenario: Use course reset to remove user overrides.
When I follow "Test lesson name"
When I am on the "Test lesson name" "lesson activity" page
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
@@ -86,13 +79,12 @@ Feature: Lesson reset
| Delete all user overrides | 1 |
And I press "Reset course"
And I press "Continue"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page
And I navigate to "User overrides" in current page administration
Then I should not see "Sam1 Student1"
Scenario: Use course reset to remove group overrides.
When I follow "Test lesson name"
When I am on the "Test lesson name" "lesson activity" page
And I navigate to "Group overrides" in current page administration
And I press "Add group override"
And I set the following fields to these values:
@@ -106,7 +98,6 @@ Feature: Lesson reset
| Delete all group overrides | 1 |
And I press "Reset course"
And I press "Continue"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page
And I navigate to "Group overrides" in current page administration
Then I should not see "Group 1"
@@ -32,9 +32,7 @@ Feature: Lesson group override
And the following "activities" exist:
| activity | name | intro | groupmode | course | idnumber |
| lesson | Test lesson name | Test lesson description | 1 | C1 | lesson1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page logged in as teacher1
And I follow "Add a question page"
And I set the field "Select a question type" to "True/false"
And I press "Add a question page"
@@ -51,9 +49,7 @@ Feature: Lesson group override
And I log out
Scenario: Add, modify then delete a group override
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I follow "Test lesson name"
Given I am on the "Test lesson name" "lesson activity" page logged in as teacher1
And I navigate to "Group overrides" in current page administration
And I press "Add group override"
And I set the following fields to these values:
@@ -76,9 +72,7 @@ Feature: Lesson group override
And I should not see "Group 1"
Scenario: Duplicate a user override
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I follow "Test lesson name"
Given I am on the "Test lesson name" "lesson activity" page logged in as teacher1
And I navigate to "Group overrides" in current page administration
And I press "Add group override"
And I set the following fields to these values:
@@ -100,10 +94,7 @@ Feature: Lesson group override
And I should see "Group 2"
Scenario: Allow a single group to have re-take the lesson
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I follow "Test lesson name"
And I navigate to "Edit settings" in current page administration
Given I am on the "Test lesson name" "lesson activity editing" page logged in as teacher1
And I set the following fields to these values:
| Re-takes allowed | 0 |
And I press "Save and display"
@@ -115,36 +106,29 @@ Feature: Lesson group override
And I press "Save"
And I should see "Re-takes allowed"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
Given I am on the "Test lesson name" "lesson activity" page logged in as student1
And I should see "Cat is an amphibian"
And I set the following fields to these values:
| False | 1 |
And I press "Submit"
And I press "Continue"
And I should see "Congratulations - end of lesson reached"
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page
Then I should not see "You are not allowed to retake this lesson."
And I should see "Cat is an amphibian"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
Given I am on the "Test lesson name" "lesson activity" page logged in as student2
And I should see "Cat is an amphibian"
And I set the following fields to these values:
| False | 1 |
And I press "Submit"
And I press "Continue"
And I should see "Congratulations - end of lesson reached"
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page
And I should see "You are not allowed to retake this lesson."
Scenario: Allow a single group to have a different password
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I follow "Test lesson name"
And I navigate to "Edit settings" in current page administration
Given I am on the "Test lesson name" "lesson activity editing" page logged in as teacher1
And I set the following fields to these values:
| Password protected lesson | Yes |
| id_password | moodle_rules |
@@ -157,9 +141,7 @@ Feature: Lesson group override
And I press "Save"
And I should see "Password protected lesson"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page logged in as student1
Then I should see "Test lesson name is a password protected lesson"
And I should not see "Cat is an amphibian"
And I set the field "userpassword" to "moodle_rules"
@@ -175,9 +157,7 @@ Feature: Lesson group override
And I press "Continue"
And I should see "Congratulations - end of lesson reached"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page logged in as student2
And I should see "Test lesson name is a password protected lesson"
And I should not see "Cat is an amphibian"
And I set the field "userpassword" to "12345"
@@ -188,10 +168,7 @@ Feature: Lesson group override
And I press "Continue"
Scenario: Allow a group to have a different due date
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I follow "Test lesson name"
And I navigate to "Edit settings" in current page administration
Given I am on the "Test lesson name" "lesson activity editing" page logged in as teacher1
And I set the following fields to these values:
| id_deadline_enabled | 1 |
| deadline[day] | 1 |
@@ -213,22 +190,15 @@ Feature: Lesson group override
And I press "Save"
And I should see "Lesson closes"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test lesson"
And I am on the "Test lesson name" "lesson activity" page logged in as student2
Then I should see "This lesson closed on Saturday, 1 January 2000, 8:00"
And I should not see "Cat is an amphibian"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test lesson"
And I am on the "Test lesson name" "lesson activity" page logged in as student1
And I should see "Cat is an amphibian"
Scenario: Allow a group to have a different start date
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I follow "Test lesson name"
And I navigate to "Edit settings" in current page administration
Given I am on the "Test lesson name" "lesson activity editing" page logged in as teacher1
And I set the following fields to these values:
| id_available_enabled | 1 |
| available[day] | 1 |
@@ -250,22 +220,15 @@ Feature: Lesson group override
And I press "Save"
And I should see "Lesson opens"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test lesson"
And I am on the "Test lesson name" "lesson activity" page logged in as student2
Then I should see "This lesson will be open on Tuesday, 1 January 2030, 8:00"
And I should not see "Cat is an amphibian"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test lesson"
And I am on the "Test lesson name" "lesson activity" page logged in as student1
And I should see "Cat is an amphibian"
Scenario: Allow a single group to have multiple attempts at each question
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I follow "Test lesson name"
And I navigate to "Edit settings" in current page administration
Given I am on the "Test lesson name" "lesson activity editing" page logged in as teacher1
And I set the following fields to these values:
| Re-takes allowed | 1 |
And I press "Save and display"
@@ -277,9 +240,7 @@ Feature: Lesson group override
And I press "Save"
And I should see "Maximum number of attempts per question"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page logged in as student1
And I should see "Cat is an amphibian"
And I set the following fields to these values:
| True | 1 |
@@ -292,9 +253,7 @@ Feature: Lesson group override
And I press "Continue"
And I should see "Congratulations - end of lesson reached"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page logged in as student2
And I should see "Cat is an amphibian"
And I set the following fields to these values:
| True | 1 |
@@ -304,11 +263,8 @@ Feature: Lesson group override
@javascript
Scenario: Add both a user and group override and verify that both are applied correctly
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I follow "Test lesson name"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
Given I am on the "Test lesson name" "lesson activity editing" page logged in as teacher1
When I set the following fields to these values:
| id_available_enabled | 1 |
| available[day] | 1 |
| available[month] | January |
@@ -316,7 +272,7 @@ Feature: Lesson group override
| available[hour] | 08 |
| available[minute] | 00 |
And I press "Save and display"
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page
And I navigate to "Group overrides" in current page administration
And I press "Add group override"
And I set the following fields to these values:
@@ -329,7 +285,7 @@ Feature: Lesson group override
| available[minute] | 00 |
And I press "Save"
And I should see "Tuesday, 1 January 2030, 8:00"
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
@@ -343,19 +299,13 @@ Feature: Lesson group override
And I press "Save"
And I should see "Wednesday, 1 January 2031, 8:00"
And I log out
Then I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test lesson"
And I am on the "Test lesson name" "lesson activity" page logged in as student1
And I should see "This lesson will be open on Wednesday, 1 January 2031, 8:00"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test lesson"
And I am on the "Test lesson name" "lesson activity" page logged in as student2
And I should see "This lesson will be open on Sunday, 1 January 2040, 8:00"
And I log out
And I log in as "student3"
And I am on "Course 1" course homepage
And I follow "Test lesson"
And I am on the "Test lesson name" "lesson activity" page logged in as student3
And I should see "This lesson will be open on Tuesday, 1 January 2030, 8:00"
Scenario: Override a group when teacher is in no group, and does not have accessallgroups permission, and the activity's group mode is 'separate groups'
@@ -365,9 +315,7 @@ Feature: Lesson group override
And the following "activities" exist:
| activity | name | intro | course | idnumber | groupmode |
| lesson | Lesson 2 | Lesson 2 description | C1 | lesson2 | 1 |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Lesson 2"
When I am on the "Lesson 2" "lesson activity" page logged in as teacher1
And I navigate to "Group overrides" in current page administration
Then I should see "No groups you can access."
And the "Add group override" "button" should be disabled
@@ -382,9 +330,7 @@ Feature: Lesson group override
And the following "group members" exist:
| user | group |
| teacher1 | G1 |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Lesson 2"
And I am on the "Lesson 2" "lesson activity" page logged in as teacher1
And I navigate to "Group overrides" in current page administration
And I press "Add group override"
Then the "Override group" select box should contain "Group 1"
@@ -400,9 +346,7 @@ Feature: Lesson group override
And the following "group members" exist:
| user | group |
| teacher1 | G1 |
And I log in as "admin"
And I am on "Course 1" course homepage
And I follow "Lesson 2"
And I am on the "Lesson 2" "lesson activity" page logged in as admin
And I navigate to "Group overrides" in current page administration
And I press "Add group override"
And I set the following fields to these values:
@@ -424,9 +368,7 @@ Feature: Lesson group override
| available[minute] | 00 |
And I press "Save"
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Lesson 2"
And I am on the "Lesson 2" "lesson activity" page logged in as teacher1
And I navigate to "Group overrides" in current page administration
Then I should see "Group 1" in the ".generaltable" "css_element"
And I should not see "Group 2" in the ".generaltable" "css_element"
@@ -15,16 +15,16 @@ Feature: In a lesson activity, students can not re-attempt a question more than
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Lesson" to section "1"
And I set the following fields to these values:
| Name | Test lesson name |
| Description | Test lesson description |
| Re-takes allowed | Yes |
| Minimum number of questions | 3 |
And I press "Save and return to course"
And I follow "Test lesson name"
And the following "activity" exists:
| activity | lesson |
| course | C1 |
| idnumber | 0001 |
| name | Test lesson name |
| intro | Test lesson description |
| retake | 1 |
| minquestions | 3 |
| section | 1 |
And I am on the "Test lesson name" "lesson activity" page logged in as teacher1
And I follow "Add a content page"
And I set the following fields to these values:
| Page title | First page name |
@@ -92,9 +92,7 @@ Feature: In a lesson activity, students can not re-attempt a question more than
And I log out
Scenario: Check that we can leave a quiz and when we re-enter we can not re-attempt the question again
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
Given I am on the "Test lesson name" "lesson activity" page logged in as student1
And I should see "First page contents"
And I press "Next page"
And I should see "The earth is round"
@@ -102,8 +100,7 @@ Feature: In a lesson activity, students can not re-attempt a question more than
| False| 1 |
And I press "Submit"
And I should see "Wrong"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page
And I should see "Do you want to start at the last page you saw?"
And I click on "No" "link" in the "#page-content" "css_element"
And I should see "First page contents"
@@ -116,9 +113,7 @@ Feature: In a lesson activity, students can not re-attempt a question more than
@javascript @_bug_phantomjs
Scenario: Check that we can not click back on the browser at the last quiz result page and re-attempt the last question to get full marks
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
Given I am on the "Test lesson name" "lesson activity" page logged in as student1
And I should see "First page contents"
And I press "Next page"
And I should see "The earth is round"
@@ -160,9 +155,7 @@ Feature: In a lesson activity, students can not re-attempt a question more than
@javascript
Scenario: Check that we can not click back on the browser and re-attempt a question
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
Given I am on the "Test lesson name" "lesson activity" page logged in as student1
And I should see "First page contents"
And I press "Next page"
And I should see "The earth is round"
@@ -21,9 +21,7 @@ Feature: Lesson user override
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| lesson | Test lesson name | Test lesson description | C1 | lesson1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page logged in as teacher1
And I follow "Add a question page"
And I set the field "Select a question type" to "True/false"
And I press "Add a question page"
@@ -41,9 +39,7 @@ Feature: Lesson user override
@javascript
Scenario: Add, modify then delete a user override
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I follow "Test lesson name"
Given I am on the "Test lesson name" "lesson activity" page logged in as teacher1
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
@@ -67,9 +63,7 @@ Feature: Lesson user override
@javascript
Scenario: Duplicate a user override
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I follow "Test lesson name"
Given I am on the "Test lesson name" "lesson activity" page logged in as teacher1
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
@@ -92,10 +86,7 @@ Feature: Lesson user override
@javascript
Scenario: Allow a single user to have re-take the lesson
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I follow "Test lesson name"
And I navigate to "Edit settings" in current page administration
Given I am on the "Test lesson name" "lesson activity editing" page logged in as teacher1
And I set the following fields to these values:
| Re-takes allowed | 0 |
And I press "Save and display"
@@ -107,37 +98,30 @@ Feature: Lesson user override
And I press "Save"
And I should see "Re-takes allowed"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page logged in as student1
And I should see "Cat is an amphibian"
And I set the following fields to these values:
| False | 1 |
And I press "Submit"
And I press "Continue"
And I should see "Congratulations - end of lesson reached"
And I follow "Test lesson name"
When I am on the "Test lesson name" "lesson activity" page
Then I should not see "You are not allowed to retake this lesson."
And I should see "Cat is an amphibian"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page logged in as student2
And I should see "Cat is an amphibian"
And I set the following fields to these values:
| False | 1 |
And I press "Submit"
And I press "Continue"
And I should see "Congratulations - end of lesson reached"
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page
And I should see "You are not allowed to retake this lesson."
@javascript
Scenario: Allow a single user to have a different password
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I follow "Test lesson name"
And I navigate to "Edit settings" in current page administration
Given I am on the "Test lesson name" "lesson activity editing" page logged in as teacher1
And I set the following fields to these values:
| Password protected lesson | Yes |
| id_password | moodle_rules |
@@ -150,9 +134,7 @@ Feature: Lesson user override
And I press "Save"
And I should see "Password protected lesson"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page logged in as student1
Then I should see "Test lesson name is a password protected lesson"
And I should not see "Cat is an amphibian"
And I set the field "userpassword" to "moodle_rules"
@@ -168,9 +150,7 @@ Feature: Lesson user override
And I press "Continue"
And I should see "Congratulations - end of lesson reached"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page logged in as student2
And I should see "Test lesson name is a password protected lesson"
And I should not see "Cat is an amphibian"
And I set the field "userpassword" to "12345"
@@ -182,10 +162,7 @@ Feature: Lesson user override
@javascript
Scenario: Allow a user to have a different due date
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I follow "Test lesson name"
And I navigate to "Edit settings" in current page administration
Given I am on the "Test lesson name" "lesson activity editing" page logged in as teacher1
And I set the following fields to these values:
| id_deadline_enabled | 1 |
| deadline[day] | 1 |
@@ -207,24 +184,17 @@ Feature: Lesson user override
And I press "Save"
And I should see "Lesson closes"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test lesson"
And I am on the "Test lesson name" "lesson activity" page logged in as student2
And I wait until the page is ready
Then I should see "This lesson closed on Saturday, 1 January 2000, 8:00"
And I should not see "Cat is an amphibian"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test lesson"
And I am on the "Test lesson name" "lesson activity" page logged in as student1
And I should see "Cat is an amphibian"
@javascript
Scenario: Allow a user to have a different start date
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I follow "Test lesson name"
And I navigate to "Edit settings" in current page administration
Given I am on the "Test lesson name" "lesson activity editing" page logged in as teacher1
And I set the following fields to these values:
| id_available_enabled | 1 |
| available[day] | 1 |
@@ -246,24 +216,17 @@ Feature: Lesson user override
And I press "Save"
And I should see "Lesson opens"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test lesson"
And I am on the "Test lesson name" "lesson activity" page logged in as student2
And I wait until the page is ready
Then I should see "This lesson will be open on Tuesday, 1 January 2030, 8:00"
And I should not see "Cat is an amphibian"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test lesson"
And I am on the "Test lesson name" "lesson activity" page logged in as student1
And I should see "Cat is an amphibian"
@javascript
Scenario: Allow a single user to have multiple attempts at each question
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I follow "Test lesson name"
And I navigate to "Edit settings" in current page administration
Given I am on the "Test lesson name" "lesson activity editing" page logged in as teacher1
And I set the following fields to these values:
| Re-takes allowed | 1 |
And I press "Save and display"
@@ -275,9 +238,7 @@ Feature: Lesson user override
And I press "Save"
And I should see "Maximum number of attempts per question"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page logged in as student1
And I should see "Cat is an amphibian"
And I set the following fields to these values:
| True | 1 |
@@ -290,9 +251,7 @@ Feature: Lesson user override
And I press "Continue"
And I should see "Congratulations - end of lesson reached"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page logged in as student2
And I should see "Cat is an amphibian"
And I set the following fields to these values:
| True | 1 |
@@ -307,9 +266,7 @@ Feature: Lesson user override
And the following "activities" exist:
| activity | name | intro | course | idnumber | groupmode |
| lesson | Lesson 2 | Lesson 2 description | C1 | lesson2 | 1 |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Lesson 2"
And I am on the "Lesson 2" "lesson activity" page logged in as teacher1
And I navigate to "User overrides" in current page administration
Then I should see "No groups you can access."
And the "Add user override" "button" should be disabled
@@ -330,9 +287,7 @@ Feature: Lesson user override
| teacher1 | G1 |
| student1 | G1 |
| student2 | G2 |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Lesson 2"
When I am on the "Lesson 2" "lesson activity" page logged in as teacher1
And I navigate to "User overrides" in current page administration
And I press "Add user override"
Then the "Override user" select box should contain "Sam1 Student1, student1@example.com"
@@ -355,9 +310,7 @@ Feature: Lesson user override
| teacher1 | G1 |
| student1 | G1 |
| student2 | G2 |
And I log in as "admin"
And I am on "Course 1" course homepage
And I follow "Lesson 2"
And I am on the "Lesson 2" "lesson activity" page logged in as admin
And I navigate to "User overrides" in current page administration
And I press "Add user override"
And I set the following fields to these values:
@@ -379,19 +332,14 @@ Feature: Lesson user override
| deadline[minute] | 00 |
And I press "Save"
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Lesson 2"
When I am on the "Lesson 2" "lesson activity" page logged in as teacher1
And I navigate to "User overrides" in current page administration
Then I should see "Student1" in the ".generaltable" "css_element"
And I should not see "Student2" in the ".generaltable" "css_element"
@javascript
Scenario: Create a user override when the lesson is not available to the student
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test lesson name"
And I navigate to "Edit settings" in current page administration
Given I am on the "Test lesson name" "lesson activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the field "Availability" to "Hide from students"
And I click on "Save and display" "button"
@@ -16,15 +16,15 @@ Feature: In a lesson activity, teacher can add embedded images in questions answ
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activity" exists:
| course | C1 |
| activity | lesson |
| name | Test lesson name |
And I log in as "teacher1"
And I follow "Manage private files"
And I upload "mod/lesson/tests/fixtures/moodle_logo.jpg" file to "Files" filemanager
And I click on "Save changes" "button"
When I am on "Course 1" course homepage with editing mode on
And I add a "Lesson" to section "1" and I fill the form with:
| Name | Test lesson name |
| Description | Test lesson description |
And I follow "Test lesson name"
When I am on the "Test lesson name" "lesson activity" page
And I follow "Add a question page"
And I set the field "Select a question type" to "Multichoice"
And I press "Add a question page"
@@ -76,9 +76,7 @@ Feature: In a lesson activity, teacher can add embedded images in questions answ
And I click on "Save image" "button"
And I press "Save page"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
When I follow "Test lesson name"
When I am on the "Test lesson name" "lesson activity" page logged in as student1
Then I should see "What animal is an amphibian?"
And "//*[contains(@class, 'answeroption')]//img[contains(@src, 'pluginfile.php')]" "xpath_element" should exist
And "//*[contains(@class, 'answeroption')]//img[contains(@src, 'moodle_logo.jpg')]" "xpath_element" should exist

Some files were not shown because too many files have changed in this diff Show More