Skip to content

Commit

Permalink
MDL-67513 forum: Test that discussions can be viewed while grading
Browse files Browse the repository at this point in the history
  • Loading branch information
NeillM committed Nov 9, 2020
1 parent d330035 commit 76df82c
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions mod/forum/tests/behat/grade_view_discussion.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
@mod @mod_forum @javascript
Feature: View discussion while grading in a forum
In order to grade efficiently
As a teacher
I want to be able to see the full discussion the student was taking part in.

Background:
# Student 1 needs to be created first or they will not be the first user on the grading screen.
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student.1@example.com |
| student2 | Student | 2 | student.2@example.com |
| teacher | Teacher | Tom | teacher@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student2 | C1 | student |
| teacher | C1 | editingteacher |
And the following "activity" exists:
| activity | forum |
| name | Gradable forum |
| intro | Standard forum description |
| course | C1 |
| idnumber | forum1 |
| grade_forum | 100 |
| scale | 100 |
# If there is more than one pots for Student 1 the test will not be able to select the
# correct View discussion link, as there is no selector for thier container.
And the following forum discussions exist in course "Course 1":
| forum | user | name | message |
| Gradable forum | student1 | My topic | This is the thing I posted about |
And the following forum replies exist in course "Course 1":
| forum | user | discussion | message |
| 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"
And I press "Grade users"
When I press "View discussion"
Then I should see "I disagree" in the "My topic" "dialogue"
And I click on "Cancel" "button" in the "My topic" "dialogue"
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"
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"
And I press "Toggle full screen"
When I press "View discussion"
Then I should see "I disagree" in the "My topic" "dialogue"
And I click on "Cancel" "button" in the "My topic" "dialogue"
And I should not see "I disagree"

0 comments on commit 76df82c

Please sign in to comment.