Skip to content

Commit

Permalink
MDL-83551 behat: make duplicated scenario names unique
Browse files Browse the repository at this point in the history
  • Loading branch information
lameze committed Nov 5, 2024
1 parent d015c4c commit ffcd34e
Show file tree
Hide file tree
Showing 20 changed files with 43 additions and 110 deletions.
4 changes: 2 additions & 2 deletions mod/data/tests/behat/data_activity_completion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Feature: View activity completion in the database activity
And I press "Save and display"
And I log out

Scenario: View automatic completion items as a teacher
Scenario: Database activity displays completion conditions to teachers
# We add an entry to let the user change to a different view.
Given the following "mod_data > entries" exist:
| database | user | Instrument types |
Expand All @@ -61,7 +61,7 @@ Feature: View activity completion in the database activity
And "Music history" should have the "Make entries: 2" completion condition
And "Music history" should have the "Receive a grade" completion condition

Scenario: View automatic completion items as a student
Scenario: A student can complete an database activity by achieving a passing grade
Given I am on the "Music history" "data activity" page logged in as student1
And the "View" completion condition of "Music history" is displayed as "done"
And the "Make entries: 2" completion condition of "Music history" is displayed as "todo"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Feature: Completion pass grade
And I log out

@javascript
Scenario: View automatic completion items as a teacher
Scenario: Database module completion conditions are displayed regardless of the view
# We add an entry to let the user change to a different view.
Given the following "mod_data > entries" exist:
| database | user | Instrument types |
Expand All @@ -63,7 +63,7 @@ Feature: Completion pass grade
And "Music history" should have the "Receive a passing grade" completion condition

@javascript
Scenario: View automatic completion items as a failing student
Scenario: Student cannot complete a database activity if one of the conditions are not met
Given I am on the "Music history" "data activity" page logged in as student1
And the "View" completion condition of "Music history" is displayed as "done"
And the "Make entries: 2" completion condition of "Music history" is displayed as "todo"
Expand Down Expand Up @@ -102,7 +102,7 @@ Feature: Completion pass grade
And "Vinnie Student1" user has completed "Music history" activity

@javascript
Scenario: View automatic completion items as a passing student
Scenario: Student can complete a database activity when all conditions are met
Given I am on the "Music history" "data activity" page logged in as student1
And the "View" completion condition of "Music history" is displayed as "done"
And the "Make entries: 2" completion condition of "Music history" is displayed as "todo"
Expand Down
4 changes: 2 additions & 2 deletions mod/feedback/tests/behat/feedback_activity_completion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ Feature: View activity completion in the feedback activity
| Multiple choice values | drums\guitar\hurdygurdy |
And I log out

Scenario: View automatic completion items as a teacher
Scenario: Feedback module displays completion conditions to teachers
When I am on the "Music history" "feedback activity" page logged in as teacher1
Then "Music history" should have the "View" completion condition
And "Music history" should have the "Submit feedback" completion condition

Scenario: View automatic completion items as a student
Scenario: Student can complete a feedback activity when all conditions are met
Given I am on the "Music history" "feedback activity" page logged in as student1
And the "View" completion condition of "Music history" is displayed as "todo"
And the "Submit feedback" completion condition of "Music history" is displayed as "todo"
Expand Down
2 changes: 1 addition & 1 deletion mod/folder/tests/behat/folder_activity_completion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Feature: View activity completion information in the folder activity
| teacher1 | C1 | editingteacher |
| student1 | C2 | student |

Scenario: View automatic completion items
Scenario: A folder is automatically completed when a student views it
Given the following "activity" exists:
| activity | folder |
| course | C1 |
Expand Down
5 changes: 2 additions & 3 deletions mod/forum/tests/behat/forum_activity_completion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ Feature: View activity completion in the forum activity
| completionreplies | 1 |
And I press "Save and display"

@javascript
Scenario: View automatic completion items as a teacher
Scenario: Forum module displays automatic completion conditions to teachers
When I am on the "Music history" "forum activity" page logged in as teacher1
Then "Music history" should have the "View" completion condition
And "Music history" should have the "Start discussions: 1" completion condition
Expand All @@ -48,7 +47,7 @@ Feature: View activity completion in the forum activity
And "Music history" should have the "Receive a grade" completion condition

@javascript
Scenario: View automatic completion items as a student
Scenario: A student can complete a forum activity by meeting the completion conditions
Given I am on the "Music history" "forum activity" page logged in as student1
And the "View" completion condition of "Music history" is displayed as "done"
And the "Start discussions: 1" completion condition of "Music history" is displayed as "todo"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Feature: Completion pass grade view activity completion in the forum activity
| completionreplies | 1 |
And I press "Save and display"

Scenario: View automatic completion items as a teacher
Scenario: Forum module displays completion conditions to teachers
Given I am on the "Music history" "forum activity" page logged in as teacher1
Then "Music history" should have the "View" completion condition
And "Music history" should have the "Start discussions: 1" completion condition
Expand All @@ -49,7 +49,7 @@ Feature: Completion pass grade view activity completion in the forum activity
And "Music history" should have the "Receive a passing grade" completion condition

@javascript
Scenario: View automatic completion items as a failing student
Scenario: Student cannot complete a forum activity if one of the conditions are not met
Given I am on the "Music history" "forum activity" page logged in as student1
And the "View" completion condition of "Music history" is displayed as "done"
And the "Start discussions: 1" completion condition of "Music history" is displayed as "todo"
Expand Down Expand Up @@ -93,7 +93,7 @@ Feature: Completion pass grade view activity completion in the forum activity
And the "Receive a passing grade" completion condition of "Music history" is displayed as "failed"

@javascript
Scenario: View automatic completion items as a passing student
Scenario: Student can complete a forum activity when all conditions are met
Given I am on the "Music history" "forum activity" page logged in as student1
And the "View" completion condition of "Music history" is displayed as "done"
And the "Start discussions: 1" completion condition of "Music history" is displayed as "todo"
Expand Down
23 changes: 1 addition & 22 deletions mod/glossary/tests/behat/glossary_activity_completion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,7 @@ Feature: View activity completion in the glossary activity
And I press "Save and display"
And I log out

Scenario: View automatic completion items as a teacher
Given I am on the "Music history" "glossary activity" page logged in as teacher1
Then "Music history" should have the "View" completion condition
And "Music history" should have the "Make entries: 1" completion condition
And "Music history" should have the "Receive a grade" completion condition

Scenario: View automatic completion items as a student
Scenario: A student completes a glossary
Given I am on the "Music history" "glossary activity" page logged in as student1
And the "View" completion condition of "Music history" is displayed as "done"
And the "Make entries: 1" completion condition of "Music history" is displayed as "todo"
Expand All @@ -65,18 +59,3 @@ Feature: View activity completion in the glossary activity
Then the "View" completion condition of "Music history" is displayed as "done"
And the "Make entries: 1" completion condition of "Music history" is displayed as "done"
And the "Receive a grade" completion condition of "Music history" is displayed as "done"

@javascript
Scenario: Use manual completion
Given I am on the "Music history" "glossary activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the field "Students must manually mark the activity as done" to "1"
And I press "Save and display"
# Teacher view.
And the manual completion button for "Music history" should be disabled
And I log out
# Student view.
When I am on the "Music history" "glossary activity" page logged in as student1
Then the manual completion button of "Music history" is displayed as "Mark as done"
And I toggle the manual completion state of "Music history"
And the manual completion button of "Music history" is displayed as "Done"
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Feature: Pass grade completion in the glossary activity
And I press "Save and display"
And I log out

Scenario: View automatic completion items as a teacher
Scenario: A teacher can view a glossary activity completion conditions
Given I log in as "teacher1"
And I am on "Course 1" course homepage
When I follow "Music history"
Expand All @@ -47,7 +47,7 @@ Feature: Pass grade completion in the glossary activity
And "Music history" should have the "Receive a grade" completion condition
And "Music history" should have the "Receive a passing grade" completion condition

Scenario: View automatic completion items as a failing student
Scenario: A student will not complete a glossary activity if the conditions are not met
Given I am on the "Music history" "glossary activity" page logged in as student1
And the "View" completion condition of "Music history" is displayed as "done"
And the "Make entries: 1" completion condition of "Music history" is displayed as "todo"
Expand Down Expand Up @@ -75,7 +75,7 @@ Feature: Pass grade completion in the glossary activity
And the "Receive a grade" completion condition of "Music history" is displayed as "done"
And the "Receive a passing grade" completion condition of "Music history" is displayed as "failed"

Scenario: View automatic completion items as a passing student
Scenario: A student can complete a glossary activity by meeting the completion conditions
Given I am on the "Music history" "glossary activity" page logged in as student1
And the "View" completion condition of "Music history" is displayed as "done"
And the "Make entries: 1" completion condition of "Music history" is displayed as "todo"
Expand Down
3 changes: 1 addition & 2 deletions mod/imscp/tests/behat/imscp_activity_completion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ Feature: View activity completion information in the IMS content package activit
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |

Scenario: View automatic completion items
Scenario: A student can complete a IMSCP activity by viewing it
Given the following "activities" exist:
| activity | course | name | completion | completionview | packagefilepath |
| imscp | C1 | Music history | 2 | 1 | mod/imscp/tests/pacakges/singescobbasic.zip |
# Student view.
When I am on the "Music history" "imscp activity" page logged in as student1
Then the "View" completion condition of "Music history" is displayed as "done"

Expand Down
4 changes: 2 additions & 2 deletions mod/lesson/tests/behat/lesson_activity_completion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ Feature: View activity completion in the lesson activity
| Music history part 1 | The history of music part 1 | Next page | 0 |
| Music essay | | Next page | 1 |

Scenario: View automatic completion items as a teacher
Scenario: A teacher can view a lesson activity automatic completion conditions
When I am on the "Music history" "lesson activity" page logged in as teacher1
Then "Music history" should have the "View" completion condition
And "Music history" should have the "Spend at least 3 secs on this activity" completion condition
And "Music history" should have the "Go through the activity to the end" completion condition
And "Music history" should have the "Receive a grade" completion condition

Scenario: View automatic completion items as a student
Scenario: A student can complete a lesson activity by meeting the completion conditions
Given I am on the "Music history" "lesson activity" page logged in as student1
And the "View" completion condition of "Music history" is displayed as "done"
And the "Spend at least 3 secs on this activity" completion condition of "Music history" is displayed as "todo"
Expand Down
4 changes: 2 additions & 2 deletions mod/lesson/tests/behat/lesson_completion_pass_grade.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ Feature: Pass grade activity completion in the lesson activity
| Numerical question | 3 | End of lesson | 1 |
| Numerical question | @#wronganswer#@ | Next page | 0 |

Scenario: View automatic completion items as a teacher
Scenario: Lesson activity displays completion conditions to teachers
When I am on the "Music history" "lesson activity" page logged in as teacher1
And "Music history" should have the "Receive a grade" completion condition
And "Music history" should have the "Receive a passing grade" completion condition

Scenario: View automatic completion items as a student
Scenario: A student can complete an lesson activity by achieving a passing grade
Given I am on the "Music history" "lesson activity" page logged in as student1
And the "Receive a grade" completion condition of "Music history" is displayed as "todo"
And the "Receive a passing grade" completion condition of "Music history" is displayed as "todo"
Expand Down
4 changes: 2 additions & 2 deletions mod/lti/tests/behat/lti_completion_pass_grade.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ Feature: Pass grade activity completion information in the LTI activity
| activity | name | course | gradepass | completion | completionview | completionusegrade | completionpassgrade |
| lti | Music history | C1 | 50 | 2 | 1 | 1 | 1 |

Scenario: View automatic completion items as a teacher
Scenario: Verify that the LTI completion conditions are displayed to teachers
Given I am on the "Music history" "lti activity" page logged in as teacher1
Then "Music history" should have the "View" completion condition
And "Music history" should have the "Receive a grade" completion condition
And "Music history" should have the "Receive a passing grade" completion condition

@javascript
Scenario: View automatic completion items as a student
Scenario: Verify that students can complete an LTI activity by achieving a passing grade
Given I am on the "Music history" "lti activity" page logged in as student1
And the "View" completion condition of "Music history" is displayed as "done"
And the "Receive a grade" completion condition of "Music history" is displayed as "todo"
Expand Down
4 changes: 2 additions & 2 deletions mod/page/tests/behat/page_activity_completion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Feature: View activity completion information in the Page resource
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |

Scenario: View automatic completion items as teacher
Scenario: A teacher can view a page resource automatic completion items
Given the following "activity" exists:
| activity | page |
| course | C1 |
Expand All @@ -30,7 +30,7 @@ Feature: View activity completion information in the Page resource
When I am on the "Music history" "page activity" page logged in as teacher1
Then "Music history" should have the "View" completion condition

Scenario: View automatic completion items as student
Scenario: A student can complete a page resource by viewing it
Given the following "activity" exists:
| activity | page |
| course | C1 |
Expand Down
2 changes: 1 addition & 1 deletion mod/quiz/tests/behat/quiz_activity_completion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Feature: View activity completion in the quiz activity
| question | page |
| First question | 1 |

Scenario Outline: View automatic completion items as a student
Scenario Outline: A student can complete a quiz activity by achieving a passing grade
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test quiz name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Feature: View activity completion information for file resources
And the manual completion button of "Myfile" is displayed as "Done"

@javascript
Scenario: View automatic completion items
Scenario: A student can complete a resource activity by viewing it
Given the following "activities" exist:
| activity | course | name | display | defaultfilename | uploaded |
| resource | C1 | Myfile | 1 | mod/resource/tests/fixtures/samplefile.txt | 1 |
Expand Down
4 changes: 2 additions & 2 deletions mod/scorm/tests/behat/scorm_activity_completion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Feature: View activity completion in the SCORM activity
| completionusegrade | 1 |

@javascript
Scenario: View automatic completion items as a teacher
Scenario: A teacher can view a SCORM activity automatic completion conditions
Given I am on the "Music history" "scorm activity" page logged in as teacher1
Then "Music history" should have the "View" completion condition
And "Music history" should have the "Receive a score of 3 or more" completion condition
Expand All @@ -51,7 +51,7 @@ Feature: View activity completion in the SCORM activity
And I should not see "Passing grade"

@javascript
Scenario: View automatic completion items as a student
Scenario: A student can complete a SCORM activity by achieving a passing grade
Given I am on the "Music history" "scorm activity" page logged in as student1
# We need a little taller window because Firefox is, apparently, unable to auto-scroll within
# an iframe, so we need to ensure that the "Save changes" button is visible in the viewport.
Expand Down
13 changes: 1 addition & 12 deletions mod/survey/tests/behat/survey_completion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,4 @@ Feature: A teacher can use activity completion to track a student progress
And I follow "Test survey name"
And the "Submit answers" completion condition of "Test survey name" is displayed as "done"

Scenario: Use manual completion
Given the following "activities" exist:
| activity | name | course | idnumber | completion |
| survey | Test survey name | C1 | survey1 | 1 |
And I am on "Course 1" course homepage
# Teacher view.
And "Test survey name" should have the "Mark as done" completion condition
# Student view.
When I am on the "survey1" Activity page logged in as student1
Then the manual completion button of "Test survey name" is displayed as "Mark as done"
And I toggle the manual completion state of "Test survey name"
And the manual completion button of "Test survey name" is displayed as "Done"

Loading

0 comments on commit ffcd34e

Please sign in to comment.