Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CONTRIB-6467 mod_surveypro: new test for numbers using different formats
In the frame of this patch I found an undiscovered issue. To submits a surveypro, students are redirected to the view_form page. The view_form page verifies the submission, saves it and much more. IF a submissions was really performed (no pause, no cancel, no previous page button was pressed) the thanks page is displayed, buttons to continue are displayed AND THE EXECUTION IS STOPPED. This is very bad because if in that page the student switches the lang using the corresponding menu, he/she is redirected to the view_form page that is the one to submit one more response and not to the thanks page were he/she actually is.
- Loading branch information
Kordan
committed
Jul 28, 2016
1 parent
b743c8e
commit 3adac11
Showing
5 changed files
with
167 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
@mod @mod_surveypro @surveyprofield @surveyprofield_numeric @current | ||
Feature: verify the input with different number format | ||
In order to verify numbers are correctly handled in different languages // Why this feature is useful | ||
As student1 // It can be 'an admin', 'a teacher', 'a student', 'a guest', 'a user', 'a tests writer' and 'a developer' | ||
I submit a numeric field // The feature we want | ||
|
||
Background: | ||
Given remote langimport tests are enabled | ||
And the following "courses" exist: | ||
| fullname | shortname | category | groupmode | | ||
| Multiformat numeric input | MF Number | 0 | 0 | | ||
And the following "users" exist: | ||
| username | firstname | lastname | email | | ||
| student1 | Student1 | user1 | student1@nowhere.net | | ||
And the following "course enrolments" exist: | ||
| user | course | role | | ||
| student1 | MF Number | student | | ||
And the following "activities" exist: | ||
| activity | name | intro | course | idnumber | | ||
| surveypro | Test multiformat numeric input | Test multiformat numeric input | MF Number | surveypro1 | | ||
And surveypro "Test multiformat numeric input" contains the following items: | ||
| type | plugin | | ||
| field | numeric | | ||
|
||
@javascript | ||
Scenario: submit the numeric field using two different formats | ||
And I log in as "admin" | ||
And I navigate to "Language packs" node in "Site administration > Language" | ||
And I set the field "menupack" to "Italiano" | ||
And I press "Install selected language pack(s)" | ||
Then I should see "Language pack 'it' was successfully installed" | ||
And I log out | ||
|
||
# Force English for UI. | ||
And I follow "English" in the language menu | ||
And I log in as "student1" | ||
And I am on site homepage | ||
And I follow "Multiformat numeric input" | ||
And I follow "Test multiformat numeric input" | ||
And I press "New response" | ||
And I set the field "Write the best approximation of π you can remember" to "3,14" | ||
And I press "Submit" | ||
Then I should see "Provided value is not a number" | ||
|
||
And I set the field "Write the best approximation of π you can remember" to "3.14" | ||
And I press "Submit" | ||
|
||
And I follow "Italiano" in the language menu | ||
And I press "Nuova risposta" | ||
And I set the field "Write the best approximation of π you can remember" to "3.14" | ||
And I press "Invia" | ||
Then I should see "Provided value is not a number" | ||
|
||
And I set the field "Write the best approximation of π you can remember" to "3,14" | ||
And I press "Invia" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters