Skip to content

Commit e8607f8

Browse files
authored
Questionnaire different ≤ 4.2 and ≥ 4.3 activity completion behat tes fix #522ts. (#523)
1 parent 57ba67f commit e8607f8

File tree

2 files changed

+35
-9
lines changed

2 files changed

+35
-9
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
matrix:
3232
include:
3333
- php: '8.1'
34-
moodle-branch: 'master'
34+
moodle-branch: 'MOODLE_403_STABLE'
3535
database: 'pgsql'
3636
- php: '8.0'
3737
moodle-branch: 'MOODLE_402_STABLE'

tests/behat/questionnaire_activity_completion.feature

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,32 +19,32 @@ Feature: View activity completion information in the questionnaire activity
1919
And the following "activities" exist:
2020
| activity | name | introduction | course | idnumber | completion | completionview | completionpostsenabled | completionposts |
2121
| questionnaire | Test questionnaire completion | Test questionnaire description | C1 | questionnaire2 | 2 | 1 | 1 | 1 |
22-
23-
@javascript
24-
Scenario: Check questionnaire completion feature in web.
25-
Given I log in as "teacher1"
22+
And I log in as "teacher1"
2623
And I am on "Course 1" course homepage
2724
And I follow "Test questionnaire completion"
28-
Then I click on "Add questions" "link"
25+
And I click on "Add questions" "link"
2926
And I add a "Yes/No" question and I fill the form with:
3027
| Question Name | Q1 |
3128
| Yes | y |
3229
| Question Text | Are you still in School? |
33-
Then I should see "[Yes/No] (Q1)"
3430
And I add a "Radio Buttons" question and I fill the form with:
3531
| Question Name | Q2 |
3632
| Yes | y |
3733
| Horizontal | Checked |
3834
| Question Text | Select one choice |
3935
| Possible answers | 1=One,2=Two,3=Three,4=Four |
40-
Then I should see "[Radio Buttons] (Q2)"
4136
And I add a "Text Box" question and I fill the form with:
4237
| Question Name | Q8 |
4338
| No | n |
4439
| Input box length | 10 |
4540
| Max. text length | 15 |
4641
| Question Text | Enter some text |
47-
Then I should see "[Text Box] (Q8)"
42+
43+
@javascript
44+
Scenario: Check questionnaire completion feature in web for Moodle ≤ 4.2.
45+
Given the site is running Moodle version 4.2 or lower
46+
And I log in as "teacher1"
47+
And I am on "Course 1" course homepage
4848
And I am on the "Test questionnaire completion" "questionnaire activity editing" page
4949
And I set the following fields to these values:
5050
| Completion tracking | Show activity as complete when conditions are met |
@@ -65,3 +65,29 @@ Feature: View activity completion information in the questionnaire activity
6565
Then I should see "Thank you for completing this Questionnaire."
6666
And I press "Continue"
6767
Then I should see "View your response(s)"
68+
69+
Scenario: Check questionnaire completion feature in web for Moodle ≥ 4.3.
70+
Given the site is running Moodle version 4.3 or higher
71+
And I log in as "teacher1"
72+
And I am on "Course 1" course homepage
73+
And I am on the "Test questionnaire completion" "questionnaire activity editing" page
74+
And I click on "Expand all" "link" in the "region-main" "region"
75+
And I set the following fields to these values:
76+
| Add requirements | 1 |
77+
| Student must submit this questionnaire to complete it | 1 |
78+
And I press "Save and display"
79+
80+
And I am on the "Test questionnaire completion" "questionnaire activity" page
81+
Then I should see "You are not eligible to take this questionnaire."
82+
83+
And I am on the "Test questionnaire completion" "questionnaire activity" page logged in as "student1"
84+
And I click on "Answer the questions..." "link"
85+
Then I should see "Are you still in School?"
86+
And I should see "Select one choice"
87+
And I should see "Enter some text"
88+
And I set the field "Yes" to "1"
89+
And I set the field "Three" to "1"
90+
And I press "Submit questionnaire"
91+
Then I should see "Thank you for completing this Questionnaire."
92+
And I press "Continue"
93+
Then I should see "View your response(s)"

0 commit comments

Comments
 (0)