Skip to content

Commit a97d5b7

Browse files
authored
Fix behat tests (#5880)
* CI: Fix users name displayed in test to create session * CI: Fix behat test for matching question * CI: Fix behat test for oral expression question * CI: Fix behat test for Combination true/false/don't-know question * CI: Fix users name displayed in test to create session * Survey: Fix duplication
1 parent f9af441 commit a97d5b7

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

main/survey/survey.lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static function generate_unique_code($code)
5858
*/
5959
public static function checkUniqueCode($surveyCode)
6060
{
61-
if (empty($courseCode)) {
61+
if (empty($surveyCode)) {
6262
return false;
6363
}
6464
$courseId = api_get_course_int_id();

tests/behat/features/sessionAccess.feature

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Feature: Session access
1818
Then I should see "Subscribe users to this session"
1919
Then I follow "Multiple registration"
2020
Then wait for the page to be loaded
21-
Then I select "Warnier Yannick (ywarnier)" from "nosessionUsersList[]"
21+
Then I select "Yannick Warnier (ywarnier)" from "nosessionUsersList[]"
2222
And I press "add_user"
2323
And I press "next"
2424
Then I should see "Session1"
@@ -40,7 +40,8 @@ Feature: Session access
4040
Then I should see "Update successful"
4141
Then I should see "Subscribe users to this session"
4242
Then I follow "Multiple registration"
43-
Then I select "Mosquera Guardamino Michela (mmosquera)" from "nosessionUsersList[]"
43+
Then wait for the page to be loaded
44+
Then I select "Michela Mosquera Guardamino (mmosquera)" from "nosessionUsersList[]"
4445
And I press "add_user"
4546
And I press "next"
4647
Then I should see "Session2"

tests/behat/features/toolExercise.feature

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ Feature: Exercise tool
106106
And I fill in ckeditor field "option[2]" with "Option B"
107107
And I fill in select bootstrap static input "#matches_2" select "2"
108108
And I press "submitQuestion"
109+
And wait for the page to be loaded
109110
Then I should see "Item added"
110111

111112
Scenario: Add question "Open" to exercise created "Exercise 1"
@@ -128,6 +129,7 @@ Feature: Exercise tool
128129
| questionName | Oral expression question |
129130
| weighting | 10 |
130131
And I press "submitQuestion"
132+
And wait for the page to be loaded
131133
Then I should see "Item added"
132134

133135
Scenario: Add question "Exact answers combination" to exercise created "Exercise 1"
@@ -206,6 +208,7 @@ Feature: Exercise tool
206208
Then I fill in ckeditor field "comment[1]" with "Comment true"
207209
Then I fill in ckeditor field "comment[2]" with "Comment false"
208210
And I press "submitQuestion"
211+
And wait for the page to be loaded
209212
Then I should see "Item added"
210213

211214
Scenario: Add question "Global multiple answer" to exercise created "Exercise 1"
@@ -353,7 +356,8 @@ Feature: Exercise tool
353356
And I press "next"
354357
Then I should see "Update successful"
355358
Then I follow "Multiple registration"
356-
Then I select "Costea Andrea (acostea)" from "nosessionUsersList[]"
359+
Then wait for the page to be loaded
360+
Then I select "Andrea Costea (acostea)" from "nosessionUsersList[]"
357361
And I press "add_user"
358362
And I press "next"
359363
Then I should see "Update successful"

tests/behat/features/toolSurvey.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Feature: Survey tool
5151
Scenario: Duplicate survey
5252
Given I am on "/main/survey/survey_list.php?cidReq=TEMP"
5353
And I follow "Duplicate survey"
54+
And I press "Copy survey"
5455
Then I should see "Survey copied"
5556
And I should see "Survey 1 Copy"
5657

0 commit comments

Comments
 (0)