From bc82295f6a43b1bc7c46c7399ae3a93824f54199 Mon Sep 17 00:00:00 2001 From: Angelia Dela Cruz Date: Mon, 15 Aug 2022 15:17:04 +0800 Subject: [PATCH] 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. --- grade/tests/behat/grade_to_pass.feature | 21 ++++----- .../tests/behat/delete_submission.feature | 43 +++++-------------- .../tests/behat/embedded_images.feature | 17 +++++--- .../tests/behat/example_submission.feature | 7 ++- .../tests/behat/export_submission.feature | 37 ++++------------ .../tests/behat/file_type_restriction.feature | 14 ++---- .../tests/behat/grade_to_pass.feature | 32 ++++++-------- .../tests/behat/submission_types.feature | 24 +++++------ .../workshop_activity_completion.feature | 20 +++------ .../tests/behat/workshop_assessment.feature | 21 +++------ .../workshop_completion_pass_grade.feature | 28 +++--------- .../behat/workshop_late_submission.feature | 9 +--- .../behat/workshop_section_remembered.feature | 5 +-- 13 files changed, 93 insertions(+), 185 deletions(-) diff --git a/grade/tests/behat/grade_to_pass.feature b/grade/tests/behat/grade_to_pass.feature index 4c601a0c305..18effa6a508 100644 --- a/grade/tests/behat/grade_to_pass.feature +++ b/grade/tests/behat/grade_to_pass.feature @@ -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 | diff --git a/mod/workshop/tests/behat/delete_submission.feature b/mod/workshop/tests/behat/delete_submission.feature index 92be14c477a..5cde3a66ad9 100644 --- a/mod/workshop/tests/behat/delete_submission.feature +++ b/mod/workshop/tests/behat/delete_submission.feature @@ -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" diff --git a/mod/workshop/tests/behat/embedded_images.feature b/mod/workshop/tests/behat/embedded_images.feature index 0506e26d1d6..f505ef1f3c8 100644 --- a/mod/workshop/tests/behat/embedded_images.feature +++ b/mod/workshop/tests/behat/embedded_images.feature @@ -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 "

Image test

" And I select the text in the "Instructions for submission" Atto editor diff --git a/mod/workshop/tests/behat/example_submission.feature b/mod/workshop/tests/behat/example_submission.feature index 54f6fa379cf..fe5661a3e80 100644 --- a/mod/workshop/tests/behat/example_submission.feature +++ b/mod/workshop/tests/behat/example_submission.feature @@ -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 | diff --git a/mod/workshop/tests/behat/export_submission.feature b/mod/workshop/tests/behat/export_submission.feature index 861ef2d99d2..649e04660bc 100644 --- a/mod/workshop/tests/behat/export_submission.feature +++ b/mod/workshop/tests/behat/export_submission.feature @@ -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 diff --git a/mod/workshop/tests/behat/file_type_restriction.feature b/mod/workshop/tests/behat/file_type_restriction.feature index 3867525efee..7e96961604d 100644 --- a/mod/workshop/tests/behat/file_type_restriction.feature +++ b/mod/workshop/tests/behat/file_type_restriction.feature @@ -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" diff --git a/mod/workshop/tests/behat/grade_to_pass.feature b/mod/workshop/tests/behat/grade_to_pass.feature index 91fb3ecbd56..4050c6515a4 100644 --- a/mod/workshop/tests/behat/grade_to_pass.feature +++ b/mod/workshop/tests/behat/grade_to_pass.feature @@ -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" diff --git a/mod/workshop/tests/behat/submission_types.feature b/mod/workshop/tests/behat/submission_types.feature index 6bb2dfb328b..299063d015d 100644 --- a/mod/workshop/tests/behat/submission_types.feature +++ b/mod/workshop/tests/behat/submission_types.feature @@ -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" diff --git a/mod/workshop/tests/behat/workshop_activity_completion.feature b/mod/workshop/tests/behat/workshop_activity_completion.feature index 566a5d29909..08900028604 100644 --- a/mod/workshop/tests/behat/workshop_activity_completion.feature +++ b/mod/workshop/tests/behat/workshop_activity_completion.feature @@ -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" diff --git a/mod/workshop/tests/behat/workshop_assessment.feature b/mod/workshop/tests/behat/workshop_assessment.feature index c8951c4e054..f2e4e6b6052 100644 --- a/mod/workshop/tests/behat/workshop_assessment.feature +++ b/mod/workshop/tests/behat/workshop_assessment.feature @@ -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 diff --git a/mod/workshop/tests/behat/workshop_completion_pass_grade.feature b/mod/workshop/tests/behat/workshop_completion_pass_grade.feature index 214244c0ef9..e4053014d8f 100644 --- a/mod/workshop/tests/behat/workshop_completion_pass_grade.feature +++ b/mod/workshop/tests/behat/workshop_completion_pass_grade.feature @@ -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 diff --git a/mod/workshop/tests/behat/workshop_late_submission.feature b/mod/workshop/tests/behat/workshop_late_submission.feature index e555611e925..f54fc731317 100644 --- a/mod/workshop/tests/behat/workshop_late_submission.feature +++ b/mod/workshop/tests/behat/workshop_late_submission.feature @@ -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 diff --git a/mod/workshop/tests/behat/workshop_section_remembered.feature b/mod/workshop/tests/behat/workshop_section_remembered.feature index b44b76dc02f..ac67d476a70 100644 --- a/mod/workshop/tests/behat/workshop_section_remembered.feature +++ b/mod/workshop/tests/behat/workshop_section_remembered.feature @@ -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"