Skip to content

Commit

Permalink
Final try.
Browse files Browse the repository at this point in the history
  • Loading branch information
mchurchward committed Nov 2, 2023
1 parent 203b67a commit 5d9d8d1
Showing 1 changed file with 11 additions and 36 deletions.
47 changes: 11 additions & 36 deletions tests/behat/questionnaire_activity_completion.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@mod @mod_questionnaire @core_completion
@mod @mod_questionnaire @core_completion @javascript
Feature: View activity completion information in the questionnaire activity
In order to have visibility of questionnaire completion requirements
As a student
Expand All @@ -19,33 +19,31 @@ Feature: View activity completion information in the questionnaire activity
And the following "activities" exist:
| activity | name | introduction | course | idnumber | completion | completionview | completionpostsenabled | completionposts |
| questionnaire | Test questionnaire completion | Test questionnaire description | C1 | questionnaire2 | 2 | 1 | 1 | 1 |

@javascript
Scenario: Check questionnaire completion feature in web for Moodle ≤ 4.2.
Given the site is running Moodle version 4.2 or lower
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test questionnaire completion"
Then I click on "Add questions" "link"
And I click on "Add questions" "link"
And I add a "Yes/No" question and I fill the form with:
| Question Name | Q1 |
| Yes | y |
| Question Text | Are you still in School? |
Then I should see "[Yes/No] (Q1)"
And I add a "Radio Buttons" question and I fill the form with:
| Question Name | Q2 |
| Yes | y |
| Horizontal | Checked |
| Question Text | Select one choice |
| Possible answers | 1=One,2=Two,3=Three,4=Four |
Then I should see "[Radio Buttons] (Q2)"
And I add a "Text Box" question and I fill the form with:
| Question Name | Q8 |
| No | n |
| Input box length | 10 |
| Max. text length | 15 |
| Question Text | Enter some text |
Then I should see "[Text Box] (Q8)"

Scenario: Check questionnaire completion feature in web for Moodle ≤ 4.2.
Given the site is running Moodle version 4.2 or lower
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I am on the "Test questionnaire completion" "questionnaire activity editing" page
And I set the following fields to these values:
| Completion tracking | Show activity as complete when conditions are met |
Expand All @@ -60,42 +58,19 @@ Feature: View activity completion information in the questionnaire activity
Then I should see "Are you still in School?"
And I should see "Select one choice"
And I should see "Enter some text"
And I click on "Yes" "radio"
And I click on "Three" "radio"
And I set the field "Yes" to "1"
And I set the field "Three" to "1"
And I press "Submit questionnaire"
Then I should see "Thank you for completing this Questionnaire."
And I press "Continue"
Then I should see "View your response(s)"

@javascript
Scenario: Check questionnaire completion feature in web for Moodle ≥ 4.3.
Given the site is running Moodle version 4.3 or higher
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test questionnaire completion"
Then I click on "Add questions" "link"
And I add a "Yes/No" question and I fill the form with:
| Question Name | Q1 |
| Yes | y |
| Question Text | Are you still in School? |
Then I should see "[Yes/No] (Q1)"
And I add a "Radio Buttons" question and I fill the form with:
| Question Name | Q2 |
| Yes | y |
| Horizontal | Checked |
| Question Text | Select one choice |
| Possible answers | 1=One,2=Two,3=Three,4=Four |
Then I should see "[Radio Buttons] (Q2)"
And I add a "Text Box" question and I fill the form with:
| Question Name | Q8 |
| No | n |
| Input box length | 10 |
| Max. text length | 15 |
| Question Text | Enter some text |
Then I should see "[Text Box] (Q8)"
And I am on the "Test questionnaire completion" "questionnaire activity editing" page
And I click on "Expand all" "link" in the "region-main" "region"
And I set the field "Add requirements" to "1"
And I set the following fields to these values:
| Add requirements | 1 |
| Student must submit this questionnaire to complete it | 1 |
Expand All @@ -109,8 +84,8 @@ Feature: View activity completion information in the questionnaire activity
Then I should see "Are you still in School?"
And I should see "Select one choice"
And I should see "Enter some text"
And I click on "Yes" "radio"
And I click on "Three" "radio"
And I set the field "Yes" to "1"
And I set the field "Three" to "1"
And I press "Submit questionnaire"
Then I should see "Thank you for completing this Questionnaire."
And I press "Continue"
Expand Down

0 comments on commit 5d9d8d1

Please sign in to comment.