MDL-75446 behat: Workshop behat generators use UI

Replace steps that manually add Workshop instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
This commit is contained in:
Angelia Dela Cruz 2022-08-15 15:17:04 +08:00
parent 7f5f04dbc2
commit bc82295f6a
13 changed files with 93 additions and 185 deletions

View File

@ -26,8 +26,7 @@ Feature: We can set the grade to pass value
| name | Test Assignment 1 |
| intro | Submit your online text |
| assignsubmission_onlinetext_enabled | 1 |
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
Scenario: Validate that switching the type of grading used correctly disables grade to pass
Given I turn editing mode on
@ -108,11 +107,10 @@ Feature: We can set the grade to pass value
Scenario: Set a valid grade to pass for workshop activity
Given the following "activities" exist:
| activity | name | intro | course | section | idnumber |
| workshop | Test Workshop 1 | Test workshop | C1 | 1 | workshop1 |
| activity | name | course | idnumber |
| workshop | Test Workshop 1 | C1 | workshop1 |
And I am on "Course 1" course homepage with editing mode on
And I am on the "Test Workshop 1" "workshop activity" page
And I navigate to "Settings" in current page administration
And I am on the "Test Workshop 1" "workshop activity editing" page
And I set the following fields to these values:
| grade | 80 |
| Submission grade to pass | 40 |
@ -130,19 +128,16 @@ Feature: We can set the grade to pass value
And the field "Grade to pass" matches value "10"
And I set the field "Grade to pass" to "15"
And I press "Save changes"
And I am on "Course 1" course homepage
And I am on the "Test Workshop 1" "workshop activity" page
And I follow "Settings"
And I am on the "Test Workshop 1" "workshop activity editing" page
And the field "Submission grade to pass" matches value "45"
And the field "Assessment grade to pass" matches value "15"
Scenario: Set an invalid grade to pass for workshop activity
Given the following "activities" exist:
| activity | name | intro | course | section | idnumber |
| workshop | Test Workshop 1 | Test workshop | C1 | 1 | workshop1 |
| activity | name | course | idnumber |
| workshop | Test Workshop 1 | C1 | workshop1 |
And I am on "Course 1" course homepage with editing mode on
And I am on the "Test Workshop 1" "workshop activity" page
And I navigate to "Settings" in current page administration
And I am on the "Test Workshop 1" "workshop activity editing" page
And I set the following fields to these values:
| grade | 80 |
| Submission grade to pass | 90 |

View File

@ -21,45 +21,33 @@ Feature: Workshop submission removal
| student3 | c1 | student |
| teacher1 | c1 | editingteacher |
And the following "activities" exist:
| activity | name | intro | course | idnumber | submissiontypefile |
| workshop | TestWorkshop | Test workshop description | c1 | workshop1 | 1 |
| activity | name | course | idnumber | submissiontypefile |
| workshop | TestWorkshop | c1 | workshop1 | 1 |
# Teacher sets up assessment form and changes the phase to submission.
And I log in as "teacher1"
And I am on "Course1" course homepage
And I am on the "Course1" course page logged in as teacher1
And I edit assessment form in workshop "TestWorkshop" as:"
| id_description__idx_0_editor | Aspect1 |
| id_description__idx_1_editor | Aspect2 |
| id_description__idx_2_editor | |
And I change phase in workshop "TestWorkshop" to "Submission phase"
And I log out
# Student1 submits.
And I log in as "student1"
And I am on "Course1" course homepage
And I follow "TestWorkshop"
And I am on the "TestWorkshop" "workshop activity" page logged in as student1
And I add a submission in workshop "TestWorkshop" as:"
| Title | Submission1 |
| Submission content | Some content |
And I log out
# Student2 submits.
And I log in as "student2"
And I am on "Course1" course homepage
And I am on the "Course1" course page logged in as student2
And I add a submission in workshop "TestWorkshop" as:"
| Title | Submission2 |
| Submission content | Some content |
And I log out
# Teacher allocates student3 to be reviewer of student2's submission.
And I log in as "teacher1"
And I am on "Course1" course homepage
And I follow "TestWorkshop"
And I am on the "TestWorkshop" "workshop activity" page logged in as teacher1
And I allocate submissions in workshop "TestWorkshop" as:"
| Participant | Reviewer |
| Sam2 Student2 | Sam3 Student3 |
And I log out
Scenario: Students can delete their submissions as long as the submissions are editable and not allocated for assessments
Given I log in as "student1"
And I am on "Course1" course homepage
And I follow "TestWorkshop"
Given I am on the "TestWorkshop" "workshop activity" page logged in as student1
When I follow "Submission1"
Then I should see "Submission1"
And "Delete submission" "button" should exist
@ -70,30 +58,21 @@ Feature: Workshop submission removal
And I should see "You have not submitted your work yet"
Scenario: Students cannot delete their submissions if the submissions are not editable
Given I log in as "teacher1"
And I am on "Course1" course homepage
And I follow "TestWorkshop"
Given I am on the "TestWorkshop" "workshop activity" page logged in as teacher1
And I change phase in workshop "TestWorkshop" to "Closed"
And I log out
And I log in as "student1"
And I am on "Course1" course homepage
And I follow "TestWorkshop"
And I am on the "TestWorkshop" "workshop activity" page logged in as student1
When I follow "Submission1"
Then I should see "Submission1"
And "Delete submission" "button" should not exist
Scenario: Students cannot delete their submissions if the submissions are allocated for assessments
Given I log in as "student2"
And I am on "Course1" course homepage
And I follow "TestWorkshop"
Given I am on the "TestWorkshop" "workshop activity" page logged in as student2
When I follow "Submission2"
Then I should see "Submission2"
And "Delete submission" "button" should not exist
Scenario: Teachers can delete submissions even if the submissions are allocated for assessments.
Given I log in as "teacher1"
And I am on "Course1" course homepage
And I follow "TestWorkshop"
Given I am on the "TestWorkshop" "workshop activity" page logged in as teacher1
And "Submission1" "link" should exist
And "Submission2" "link" should exist
When I follow "Submission2"

View File

@ -19,16 +19,23 @@ Feature: Teachers can embed images into instructions and conclusion fields
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| private_files | System | 1 | my-index | side-post |
And the following "activities" exist:
| activity | course | name |
| workshop | C1 | Workshop with embedded images |
And I am on the "Workshop with embedded images" "workshop activity editing" page logged in as admin
And I set the following fields to these values:
| instructauthorseditor[format] | 1 |
| instructreviewerseditor[format] | 1 |
| conclusioneditor[format] | 1 |
And I press "Save and display"
And I log out
And I log in as "teacher1"
# Upload an image into the private files.
And I follow "Manage private files"
And I upload "mod/workshop/tests/fixtures/moodlelogo.png" file to "Files" filemanager
And I click on "Save changes" "button"
And I am on "Course 1" course homepage with editing mode on
# Create and edit the workshop.
When I add a "Workshop" to section "1" and I fill the form with:
| Workshop name | Workshop with embedded images |
And I am on the "Workshop with embedded images" "workshop activity editing" page
# Edit the workshop.
When I am on the "Workshop with embedded images" "workshop activity editing" page
And I expand all fieldsets
And I set the field "Instructions for submission" to "<p>Image test</p>"
And I select the text in the "Instructions for submission" Atto editor

View File

@ -17,11 +17,10 @@ Feature: Provide example submission
| user | course | role |
| teacher1 | c1 | editingteacher |
And the following "activities" exist:
| activity | name | intro | course | idnumber | useexamples |
| workshop | TestWorkshop | Test workshop description | c1 | workshop1 | 1 |
| activity | name | course | idnumber | useexamples |
| workshop | TestWorkshop | c1 | workshop1 | 1 |
# As a teacher, define the assessment form to be used in the workshop.
When I log in as "teacher1"
And I am on "Course1" course homepage
When I am on the "Course1" course page logged in as teacher1
And I edit assessment form in workshop "TestWorkshop" as:"
| id_description__idx_0_editor | Aspect1 |
| id_description__idx_1_editor | Aspect2 |

View File

@ -19,8 +19,8 @@ Feature: Exporting workshop submissions and assessments to a portfolio
| student2 | c1 | student |
| teacher1 | c1 | editingteacher |
And the following "activities" exist:
| activity | name | intro | course | idnumber | submissiontypefile |
| workshop | TestWorkshop | Test workshop description | c1 | workshop1 | 1 |
| activity | name | course | idnumber | submissiontypefile |
| workshop | TestWorkshop | c1 | workshop1 | 1 |
# Admin needs to enable portfolio API and set a portfolio instance first.
And I log in as "admin"
And the following config values are set as admin:
@ -28,34 +28,24 @@ Feature: Exporting workshop submissions and assessments to a portfolio
And I navigate to "Plugins > Portfolios > Manage portfolios" in site administration
And I set portfolio instance "File download" to "Enabled and visible"
And I click on "Save" "button"
And I log out
# Teacher sets up assessment form and changes the phase to submission.
And I log in as "teacher1"
And I am on "Course1" course homepage
And I am on the "Course1" course page logged in as teacher1
And I edit assessment form in workshop "TestWorkshop" as:"
| id_description__idx_0_editor | Aspect1 |
| id_description__idx_1_editor | Aspect2 |
And I change phase in workshop "TestWorkshop" to "Submission phase"
And I log out
# Student1 submits.
And I log in as "student1"
And I am on "Course1" course homepage
And I follow "TestWorkshop"
And I am on the "TestWorkshop" "workshop activity" page logged in as student1
And I add a submission in workshop "TestWorkshop" as:"
| Title | Submission1 |
| Submission content | Some content |
And I log out
# Student2 submits.
And I log in as "student2"
And I am on "Course1" course homepage
And I am on the "Course1" course page logged in as student2
And I add a submission in workshop "TestWorkshop" as:"
| Title | Submission2 |
| Submission content | Some content |
And I log out
# Teacher allocates reviewers and changes the phase to assessment.
And I log in as "teacher1"
And I am on "Course1" course homepage
And I follow "TestWorkshop"
And I am on the "TestWorkshop" "workshop activity" page logged in as teacher1
And I should see "to allocate: 2"
And I should see "Workshop submissions report"
And I should see "Submitted (2) / not submitted (0)"
@ -68,12 +58,9 @@ Feature: Exporting workshop submissions and assessments to a portfolio
And I follow "TestWorkshop"
And I should see "to allocate: 0"
And I change phase in workshop "TestWorkshop" to "Assessment phase"
And I log out
Scenario: Students can export their own submission to a portfolio.
Given I log in as "student1"
And I am on "Course1" course homepage
And I follow "TestWorkshop"
Given I am on the "TestWorkshop" "workshop activity" page logged in as student1
When I follow "Submission1"
Then I should see "Submission1"
And "Export this page" "button" should exist
@ -83,12 +70,9 @@ Feature: Exporting workshop submissions and assessments to a portfolio
And I should see "Summary of your export"
And I click on "Continue" "button"
And I should see "Return to where you were"
And I log out
Scenario: Students can export submission they have peer-assessed.
Given I log in as "student1"
And I am on "Course1" course homepage
And I follow "TestWorkshop"
Given I am on the "TestWorkshop" "workshop activity" page logged in as student1
And I should see "Submission2"
And I follow "Submission2"
And "Export this page" "button" should exist
@ -98,14 +82,11 @@ Feature: Exporting workshop submissions and assessments to a portfolio
And I should see "Summary of your export"
And I click on "Continue" "button"
And I should see "Return to where you were"
And I log out
Scenario: If the portfolio API is disabled, the portfolio export button is not displayed.
Given the following config values are set as admin:
| enableportfolios | 0 |
When I log in as "student1"
And I am on "Course1" course homepage
And I follow "TestWorkshop"
When I am on the "TestWorkshop" "workshop activity" page logged in as student1
And I follow "Submission1"
Then I should see "Submission1"
And "Export this page" "button" should not exist

View File

@ -19,19 +19,17 @@ Feature: File types of the submission and feedback attachments can be limitted
| student1 | c1 | student |
| student2 | c1 | student |
And the following "activities" exist:
| activity | name | intro | course | idnumber | submissiontypetext | submissiontypefile |
| workshop | TestWorkshop | Test workshop description | c1 | workshop1 | 2 | 1 |
| activity | name | course | idnumber | submissiontypetext | submissiontypefile |
| workshop | TestWorkshop | c1 | workshop1 | 2 | 1 |
@_file_upload @javascript
Scenario: Student submission attachments obey the list of allowed file types
# Define workshop to accept only images as submission attachments.
Given I am on the TestWorkshop "workshop activity" page logged in as teacher1
And I navigate to "Settings" in current page administration
Given I am on the "TestWorkshop" "workshop activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the field "Submission attachment allowed file types" to "image"
And I press "Save and display"
And I change phase in workshop "TestWorkshop" to "Submission phase"
And I log out
# As a student, attempt to attach a non-image file.
And I am on the TestWorkshop "workshop activity" page logged in as student1
And I press "Add submission"
@ -58,8 +56,7 @@ Feature: File types of the submission and feedback attachments can be limitted
@_file_upload @javascript
Scenario: Overall feedback attachments obey the list of allowed file types
# Define workshop to accept only .php files as overall feedback attachments.
Given I log in as "teacher1"
And I am on "Course1" course homepage
Given I am on the "Course1" course page logged in as teacher1
And I edit assessment form in workshop "TestWorkshop" as:"
| id_description__idx_0_editor | Aspect1 |
| id_description__idx_1_editor | Aspect2 |
@ -70,20 +67,17 @@ Feature: File types of the submission and feedback attachments can be limitted
And I set the field "Feedback attachment allowed file types" to "PHP"
And I press "Save and display"
And I change phase in workshop "TestWorkshop" to "Submission phase"
And I log out
# As a student, attempt to attach an invalid file.
And I am on the TestWorkshop "workshop activity" page logged in as student1
And I add a submission in workshop "TestWorkshop" as:"
| Title | Submission1 |
| Submission content | Some content |
And I log out
# As a teacher, allocate that submission to be assessed by another student.
And I am on the TestWorkshop "workshop activity" page logged in as teacher1
And I allocate submissions in workshop "TestWorkshop" as:"
| Participant | Reviewer |
| Sam1 Student1 | Sam2 Student2 |
And I change phase in workshop "TestWorkshop" to "Assessment phase"
And I log out
# As the other student, assess the assigned submission.
And I am on the TestWorkshop "workshop activity" page logged in as student2
And I follow "Submission1"

View File

@ -17,8 +17,8 @@ Feature: Setting grades to pass via workshop editing form
Scenario: Adding a new workshop with grade to pass field set
Given the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| workshop | Awesome workshop | Grades to pass are set here | c1 | workshop1 | 1 |
| activity | name | course | idnumber |
| workshop | Awesome workshop | c1 | workshop1 |
When I am on the "Awesome workshop" "workshop activity editing" page logged in as teacher1
And I set the field "Submission grade to pass" to "45"
And I set the field "Assessment grade to pass" to "10.5"
@ -29,14 +29,10 @@ Feature: Setting grades to pass via workshop editing form
@javascript
Scenario: Grade to pass kept even with submission types without online text (MDL-64862)
Given I log in as "teacher1"
And I am on "Course1" course homepage with editing mode on
When I add a "Workshop" to section "1" and I fill the form with:
| Workshop name | Another workshop |
| Description | Grades to pass are set here |
| Submission grade to pass | 42 |
| Assessment grade to pass | 10.1 |
| submissiontypetextavailable | 0 |
Given the following "activities" exist:
| activity | course | name | submissiongradepass | gradinggradepass | submissiontypetextavailable |
| workshop | c1 | Another workshop | 42 | 10.1 | 0 |
When I am on the "Course1" course page logged in as teacher1
Then I should not see "Adding a new Workshop"
And I am on the "Another workshop" "workshop activity editing" page
And the field "Submission grade to pass" matches value "42.00"
@ -44,16 +40,16 @@ Feature: Setting grades to pass via workshop editing form
Scenario: Adding a new workshop with grade to pass fields left empty
Given the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| workshop | Another awesome workshop | No grades to pass are set here | c1 | workshop1 | 1 |
| activity | name | course | idnumber |
| workshop | Another awesome workshop | c1 | workshop1 |
When I am on the "Another awesome workshop" "workshop activity editing" page logged in as teacher1
Then the field "Submission grade to pass" matches value "0.00"
And the field "Assessment grade to pass" matches value "0.00"
Scenario: Adding a new workshop with non-numeric value of a grade to pass
Given the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| workshop | Another awesome workshop | Invalid grade to pass is set here | c1 | workshop1 | 1 |
| activity | name | course | idnumber | section |
| workshop | Another awesome workshop | c1 | workshop1 | 1 |
When I am on the "Another awesome workshop" "workshop activity editing" page logged in as teacher1
And I set the field "Assessment grade to pass" to "You shall not pass!"
And I press "Save and return to course"
@ -62,8 +58,8 @@ Feature: Setting grades to pass via workshop editing form
Scenario: Adding a new workshop with invalid value of a grade to pass
Given the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| workshop | Almost awesome workshop | Invalid grade to pass is set here | c1 | workshop1 | 1 |
| activity | name | course | idnumber | section |
| workshop | Almost awesome workshop | c1 | workshop1 | 1 |
When I am on the "Almost awesome workshop" "workshop activity editing" page logged in as teacher1
And I set the field "Assessment grade to pass" to "10000000"
And I press "Save and return to course"
@ -72,8 +68,8 @@ Feature: Setting grades to pass via workshop editing form
Scenario: Emptying grades to pass fields sets them to zero
Given the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| workshop | Super awesome workshop | Grade to pass are set and then unset here | c1 | workshop1 | 1 |
| activity | name | course | idnumber | section |
| workshop | Super awesome workshop | c1 | workshop1 | 1 |
When I am on the "Super awesome workshop" "workshop activity editing" page logged in as teacher1
And I set the field "Submission grade to pass" to "59.99"
And I set the field "Assessment grade to pass" to "0.000"

View File

@ -67,8 +67,8 @@ Feature: Submission types
@javascript @_file_upload
Scenario: All submission fields required
Given the following "activities" exist:
| activity | name | intro | course | idnumber | submissiontypetext | submissiontypefile |
| workshop | All required | Test workshop description | TEST | workshop1 | 2 | 2 |
| activity | name | course | idnumber | submissiontypetext | submissiontypefile |
| workshop | All required | TEST | workshop1 | 2 | 2 |
And I am on the "All required" "workshop activity" page
And I follow "Switch to the submission phase"
And I press "Continue"
@ -88,8 +88,8 @@ Feature: Submission types
Scenario: Online text required, file attachment optional
Given the following "activities" exist:
| activity | name | intro | course | idnumber | submissiontypetext | submissiontypefile |
| workshop | Optional file | Test workshop description | TEST | workshop1 | 2 | 1 |
| activity | name | course | idnumber | submissiontypetext | submissiontypefile |
| workshop | Optional file | TEST | workshop1 | 2 | 1 |
And I am on the "Optional file" "workshop activity" page
And I follow "Switch to the submission phase"
And I press "Continue"
@ -107,8 +107,8 @@ Feature: Submission types
@javascript @_file_upload
Scenario: Online text optional, file attachment required
Given the following "activities" exist:
| activity | name | intro | course | idnumber | submissiontypetext | submissiontypefile |
| workshop | Optional text | Test workshop description | TEST | workshop1 | 1 | 2 |
| activity | name | course | idnumber | submissiontypetext | submissiontypefile |
| workshop | Optional text | TEST | workshop1 | 1 | 2 |
And I am on the "Optional text" "workshop activity" page
And I follow "Switch to the submission phase"
And I press "Continue"
@ -125,8 +125,8 @@ Feature: Submission types
Scenario: Online text only
Given the following "activities" exist:
| activity | name | intro | course | idnumber | submissiontypetext | submissiontypefile |
| workshop | Only text | Test workshop description | TEST | workshop1 | 2 | 0 |
| activity | name | course | idnumber | submissiontypetext | submissiontypefile |
| workshop | Only text | TEST | workshop1 | 2 | 0 |
And I am on the "Only text" "workshop activity" page
And I follow "Switch to the submission phase"
And I press "Continue"
@ -145,8 +145,8 @@ Feature: Submission types
@javascript @_file_upload
Scenario: File attachment only
Given the following "activities" exist:
| activity | name | intro | course | idnumber | submissiontypetext | submissiontypefile |
| workshop | Only file | Test workshop description | TEST | workshop1 | 0 | 2 |
| activity | name | course | idnumber | submissiontypetext | submissiontypefile |
| workshop | Only file | TEST | workshop1 | 0 | 2 |
And I am on the "Only file" "workshop activity" page
And I follow "Switch to the submission phase"
And I press "Continue"
@ -166,8 +166,8 @@ Feature: Submission types
@javascript @_file_upload
Scenario: Neither submission type explicitly required
Given the following "activities" exist:
| activity | name | intro | course | idnumber |
| workshop | Neither required | Test workshop description | TEST | workshop1 |
| activity | name | course | idnumber |
| workshop | Neither required | TEST | workshop1 |
And I am on the "Neither required" "workshop activity" page
And I follow "Switch to the submission phase"
And I press "Continue"

View File

@ -19,8 +19,8 @@ Feature: View activity completion information in the Workshop activity
| student2 | C1 | student |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | intro | course | submissiontypefile | completion | completionview |
| workshop | Music history | Test workshop description | C1 | 1 | 2 | 1 |
| activity | name | course | submissiontypefile | completion | completionview |
| workshop | Music history | C1 | 1 | 2 | 1 |
And I am on the "Music history" "workshop activity editing" page logged in as teacher1
And I set the following fields to these values:
| Require grade | Submission |
@ -28,10 +28,9 @@ Feature: View activity completion information in the Workshop activity
And I edit assessment form in workshop "Music history" as:"
| id_description__idx_0_editor | Aspect1 |
And I change phase in workshop "Music history" to "Submission phase"
And I log out
Scenario: View automatic completion items as a teacher
Given I am on the "Music history" "workshop activity" page logged in as teacher1
Given I am on the "Music history" "workshop activity" page
Then "Music history" should have the "Receive a grade" completion condition
And "Music history" should have the "View" completion condition
@ -44,28 +43,22 @@ Feature: View activity completion information in the Workshop activity
And I set the field "Title" to "Pinch harmonics"
And I set the field "Submission content" to "Satisfying to play"
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 am on the "Course 1" course page logged in as teacher1
And I change phase in workshop "Music history" to "Assessment phase"
And I allocate submissions in workshop "Music history" as:"
| Participant | Reviewer |
| Vinnie Student1 | Rex Student2 |
And I log out
# Assess the submission.
And I am on the "Music history" "workshop activity" page logged in as student2
And I assess submission "Pinch harmonics" in workshop "Music history" as:"
| grade__idx_0 | 9 / 10 |
| peercomment__idx_0 | Well done |
And I log out
# Evaluate and close the workshop so a grade is recorded for the student.
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 change phase in workshop "Music history" to "Grading evaluation phase"
And I am on the "Music history" "workshop activity" page
And I click on "Re-calculate grades" "button"
And I change phase in workshop "Music history" to "Closed"
And I log out
# Confirm completion condition is updated.
When I am on the "Music history" "workshop activity" page logged in as student1
Then the "View" completion condition of "Music history" is displayed as "done"
@ -73,14 +66,13 @@ Feature: View activity completion information in the Workshop activity
@javascript
Scenario: Use manual completion
Given I am on the "Music history" "workshop activity" page logged in as teacher1
Given I am on the "Music history" "workshop activity" page
And I am on the "Music history" "workshop activity editing" page
And I expand all fieldsets
And I set the field "Completion tracking" to "Students can manually mark the activity as completed"
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" "workshop activity" page logged in as student1
Then the manual completion button of "Music history" is displayed as "Mark as done"

View File

@ -23,17 +23,15 @@ Feature: Workshop submission and assessment
| student4 | c1 | student |
| teacher1 | c1 | editingteacher |
And the following "activities" exist:
| activity | name | intro | course | idnumber | submissiontypetext | submissiontypefile |
| workshop | TestWorkshop | Test workshop description | c1 | workshop1 | 2 | 1 |
| activity | name | course | idnumber | submissiontypetext | submissiontypefile |
| workshop | TestWorkshop | c1 | workshop1 | 2 | 1 |
# teacher1 sets up assessment form and changes the phase to submission
When I log in as "teacher1"
And I am on "Course1" course homepage
When I am on the "Course1" course page logged in as teacher1
And I edit assessment form in workshop "TestWorkshop" as:"
| id_description__idx_0_editor | Aspect1 |
| id_description__idx_1_editor | Aspect2 |
| id_description__idx_2_editor | |
And I change phase in workshop "TestWorkshop" to "Submission phase"
And I log out
# student1 submits
And I am on the TestWorkshop "workshop activity" page logged in as student1
Then I should see "Submit your work"
@ -41,21 +39,16 @@ Feature: Workshop submission and assessment
| Title | Submission1 |
| Submission content | Some content |
And "//div[@class='submission-full' and contains(.,'Submission1') and contains(.,'submitted on')]" "xpath_element" should exist
And I log out
# student2 submits
And I log in as "student2"
And I am on "Course1" course homepage
And I am on the "Course1" course page logged in as student2
And I add a submission in workshop "TestWorkshop" as:"
| Title | Submission2 |
| Submission content | Some content |
And I log out
# student3 submits
And I log in as "student3"
And I am on "Course1" course homepage
And I am on the "Course1" course page logged in as student3
And I add a submission in workshop "TestWorkshop" as:"
| Title | Submission3 |
| Submission content | Some content |
And I log out
# teacher1 allocates reviewers and changes the phase to assessment
And I am on the TestWorkshop "workshop activity" page logged in as teacher1
And I should see "to allocate: 3"
@ -75,7 +68,6 @@ Feature: Workshop submission and assessment
And I am on the TestWorkshop "workshop activity" page
And I should see "to allocate: 0"
And I change phase in workshop "TestWorkshop" to "Assessment phase"
And I log out
# student1 assesses work of student2 and student3
And I am on the TestWorkshop "workshop activity" page logged in as student1
And "//ul[@class='tasks']/li[div[@class='title' and contains(.,'Assess peers')]]/div[@class='details' and contains(.,'pending: 2') and contains(.,'total: 2')]" "xpath_element" should exist
@ -94,7 +86,6 @@ Feature: Workshop submission and assessment
| peercomment__idx_1 | Very good |
| Feedback for the author | No comments |
And "//ul[@class='tasks']/li[div[@class='title' and contains(.,'Assess peers')]]/div[@class='details' and contains(.,'pending: 0') and contains(.,'total: 2')]" "xpath_element" should exist
And I log out
# student2 assesses work of student1
And I am on the TestWorkshop "workshop activity" page logged in as student2
And "//ul[@class='tasks']/li[div[@class='title' and contains(.,'Assess peers')]]/div[@class='details' and contains(.,'pending: 1') and contains(.,'total: 1')]" "xpath_element" should exist
@ -105,7 +96,6 @@ Feature: Workshop submission and assessment
| peercomment__idx_1 | |
| Feedback for the author | Keep it up |
And "//ul[@class='tasks']/li[div[@class='title' and contains(.,'Assess peers')]]/div[@class='details' and contains(.,'pending: 0') and contains(.,'total: 1')]" "xpath_element" should exist
And I log out
# teacher1 makes sure he can see all peer grades
And I am on the TestWorkshop "workshop activity" page logged in as teacher1
And I should see grade "52" for workshop participant "Sam1" set by peer "Sam2"
@ -139,7 +129,6 @@ Feature: Workshop submission and assessment
And I should see "32" in the "//table/tbody/tr[td[contains(concat(' ', normalize-space(@class), ' '), ' participant ') and contains(.,'Sam1')]]/td[contains(concat(' ', normalize-space(@class), ' '), ' submissiongrade ')]" "xpath_element"
And I should see "16" in the "//table/tbody/tr[td[contains(concat(' ', normalize-space(@class), ' '), ' participant ') and contains(.,'Sam1')]]/td[contains(concat(' ', normalize-space(@class), ' '), ' gradinggrade ')]" "xpath_element"
And I change phase in workshop "TestWorkshop" to "Closed"
And I log out
# student1 looks at the activity
And I am on the TestWorkshop "workshop activity" page logged in as student1

View File

@ -22,7 +22,6 @@ Feature: Workshop submission and assessment with pass grade activity completion
And the following "activity" exists:
| activity | workshop |
| name | TestWorkshop |
| intro | Test workshop description |
| course | c1 |
| idnumber | workshop1 |
| submissiontypetext | 2 |
@ -39,25 +38,21 @@ Feature: Workshop submission and assessment with pass grade activity completion
| id_description__idx_1_editor | Aspect2 |
| id_description__idx_2_editor | |
And I change phase in workshop "TestWorkshop" to "Submission phase"
And I log out
# student1 submits
And I am on the "TestWorkshop" "workshop activity" page logged in as student1
And I add a submission in workshop "TestWorkshop" as:"
| Title | Submission1 |
| Submission content | Some content |
And I log out
# student2 submits
And I am on the "TestWorkshop" "workshop activity" page logged in as student2
And I add a submission in workshop "TestWorkshop" as:"
| Title | Submission2 |
| Submission content | Some content |
And I log out
# student3 submits
And I am on the "TestWorkshop" "workshop activity" page logged in as student3
And I add a submission in workshop "TestWorkshop" as:"
| Title | Submission3 |
| Submission content | Some content |
And I log out
# teacher1 allocates reviewers and changes the phase to assessment
And I am on the "TestWorkshop" "workshop activity" page logged in as teacher1
And I allocate submissions in workshop "TestWorkshop" as:"
@ -68,7 +63,6 @@ Feature: Workshop submission and assessment with pass grade activity completion
| Sam2 Student2 | Sam4 Student4 |
And I am on the "TestWorkshop" "workshop activity" page
And I change phase in workshop "TestWorkshop" to "Assessment phase"
And I log out
# student1 assesses work of student2 and student3
And I am on the "TestWorkshop" "workshop activity" page logged in as student1
And I assess submission "Sam2" in workshop "TestWorkshop" as:"
@ -84,7 +78,6 @@ Feature: Workshop submission and assessment with pass grade activity completion
| grade__idx_1 | 8 / 10 |
| peercomment__idx_1 | Very good |
| Feedback for the author | No comments |
And I log out
# student2 assesses work of student1
And I am on the "TestWorkshop" "workshop activity" page logged in as student2
And I assess submission "Sam1" in workshop "TestWorkshop" as:"
@ -93,7 +86,6 @@ Feature: Workshop submission and assessment with pass grade activity completion
| grade__idx_1 | 7 / 10 |
| peercomment__idx_1 | |
| Feedback for the author | Keep it up |
And I log out
# teacher1 makes sure he can see all peer grades
And I am on the "TestWorkshop" "workshop activity" page logged in as teacher1
And I click on "//table/tbody/tr[td[contains(concat(' ', normalize-space(@class), ' '), ' participant ') and contains(.,'Sam2')]]/td[contains(concat(' ', normalize-space(@class), ' '), ' receivedgrade ') and contains(.,'Sam1')]/descendant::a[@class='grade']" "xpath_element"
@ -114,31 +106,21 @@ Feature: Workshop submission and assessment with pass grade activity completion
And I press "Save and close"
And I press "Re-calculate grades"
And I change phase in workshop "TestWorkshop" to "Closed"
And I log out
Scenario: Add and assess submissions in workshop with javascript enabled
And I log in as "student1"
And I am on "Course1" course homepage
And I am on the "Course1" course page logged in as student1
And the "Receive a grade" completion condition of "TestWorkshop" is displayed as "done"
And the "Receive a passing grade" completion condition of "TestWorkshop" is displayed as "failed"
And I log out
And I log in as "student2"
And I am on "Course1" course homepage
And I am on the "Course1" course page logged in as student2
And the "Receive a grade" completion condition of "TestWorkshop" is displayed as "done"
And the "Receive a passing grade" completion condition of "TestWorkshop" is displayed as "done"
And I log out
And I log in as "student3"
And I am on "Course1" course homepage
And I am on the "Course1" course page logged in as student3
And the "Receive a grade" completion condition of "TestWorkshop" is displayed as "done"
And the "Receive a passing grade" completion condition of "TestWorkshop" is displayed as "done"
And I log out
And I log in as "student4"
And I am on "Course1" course homepage
And I am on the "Course1" course page logged in as student4
And the "Receive a grade" completion condition of "TestWorkshop" is displayed as "todo"
And the "Receive a passing grade" completion condition of "TestWorkshop" is displayed as "todo"
And I log out
And I log in as "teacher1"
And I am on "Course1" course homepage
And I am on the "Course1" course page logged in as teacher1
And "Sam1 Student1" user has completed "TestWorkshop" activity
And "Sam2 Student2" user has completed "TestWorkshop" activity
And "Sam3 Student3" user has completed "TestWorkshop" activity

View File

@ -19,8 +19,8 @@ Feature: Workshop 'Late submissions are allowed' task
| student2 | c1 | student |
| teacher1 | c1 | editingteacher |
And the following "activities" exist:
| activity | name | intro | course | idnumber | latesubmissions | submisstionstart | submissionend |
| workshop | TestWorkshop1 | TW3 with Submission deadline in future (1 Jan 2030)| c1 | workshop1 | 1 | 1514904308 | 1893369600 |
| activity | name | course | idnumber | latesubmissions | submisstionstart | submissionend |
| workshop | TestWorkshop1 | c1 | workshop1 | 1 | 1514904308 | 1893369600 |
# Teacher sets up assessment form and changes the phase to submission.
And I am on the "TestWorkshop1" "workshop activity" page logged in as teacher1
And I edit assessment form in workshop "TestWorkshop1" as:"
@ -28,7 +28,6 @@ Feature: Workshop 'Late submissions are allowed' task
| id_description__idx_1_editor | Aspect2 |
| id_description__idx_2_editor | Aspect3 |
And I change phase in workshop "TestWorkshop1" to "Submission phase"
And I log out
@javascript
Scenario: Student1 add his submission to TestWorkshop1 before submission deadline, but student2 does not submitt
@ -39,7 +38,6 @@ Feature: Workshop 'Late submissions are allowed' task
And I add a submission in workshop "TestWorkshop1" as:"
| Title | Submission from s1 |
| Submission content | Some content from student1 |
And I log out
# Teacher modifies submission deadline.
When I am on the "TestWorkshop1" "workshop activity" page logged in as teacher1
@ -51,20 +49,17 @@ Feature: Workshop 'Late submissions are allowed' task
And I set the field "id_submissionend_year" to "2018"
And I click on "Save and display" "button"
And I follow "Switch to the assessment phase"
And I log out
# Student1 has already submitted and cannot see 'Late submissions are allowed'.
When I am on the "TestWorkshop1" "workshop activity" page logged in as student1
Then I should see "Submissions deadline:"
And I should not see "Late submissions are allowed"
And I log out
# Student2 has not submitted yet who can see 'Late submissions are allowed' text after the submission deadline.
When I am on the "TestWorkshop1" "workshop activity" page logged in as student2
Then I should see "Submissions deadline:"
And I should see "Monday, 1 January 2018"
And I should see "Late submissions are allowed"
And I log out
# Teacher can see 'Late submissions are allowed' text after submission deadline.
When I am on the "TestWorkshop1" "workshop activity" page logged in as teacher1

View File

@ -17,15 +17,14 @@ Feature: Workshop should remember collapsed/expanded sections in view page.
| teacher1 | c1 | editingteacher |
| student1 | c1 | student |
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| workshop | Workshop 1 | Workshop 1 description | c1 | workshop1 |
| activity | name | course | idnumber |
| workshop | Workshop 1 | c1 | workshop1 |
@javascript
Scenario: Check section in view page can be remembered.
Given I am on the "Workshop 1" "workshop activity" page logged in as teacher1
When I change phase in workshop "Workshop 1" to "Submission phase"
And I wait until the page is ready
And I log out
And I am on the "Workshop 1" "workshop activity" page logged in as student1
Then I should see "You have not submitted your work yet"