Skip to content

Commit

Permalink
CONTRIB-6282 mod_surveypro: added one more test
Browse files Browse the repository at this point in the history
  • Loading branch information
Kordan committed May 5, 2016
1 parent 61418dc commit aed37bc
Show file tree
Hide file tree
Showing 37 changed files with 325 additions and 104 deletions.
6 changes: 4 additions & 2 deletions classes/itemlist.class.php
Expand Up @@ -348,7 +348,7 @@ public function display_items_table() {

$icons = $OUTPUT->action_icon(new moodle_url('/mod/surveypro/layout_manage.php#sortindex_'.$sortindex, $paramurl),
new pix_icon('all', $message, 'surveypro', array('title' => $message)),
null, array('id' => 'limitaccess_item_'.$item->get_sortindex(), 'title' => $message));
null, array('id' => 'makereserved_item_'.$item->get_sortindex(), 'title' => $message));
} else {
$icons = $OUTPUT->pix_icon('all', $message, 'surveypro', array('title' => $message, 'class' => 'smallicon'));
}
Expand All @@ -361,7 +361,7 @@ public function display_items_table() {

$icons = $OUTPUT->action_icon(new moodle_url('/mod/surveypro/layout_manage.php#sortindex_'.$sortindex, $paramurl),
new pix_icon('limited', $message, 'surveypro', array('title' => $message)),
null, array('id' => 'increaseaccess_item_'.$item->get_sortindex(), 'title' => $message));
null, array('id' => 'makefree_item_'.$item->get_sortindex(), 'title' => $message));
}

// Second icon: insearchform vs not insearchform.
Expand Down Expand Up @@ -1176,6 +1176,8 @@ public function item_hide_feedback() {
* @return void
*/
public function item_show_execute() {
global $DB;

// Build toshowlist.
list($toshowlist, $sortindextoshowlist) = $this->add_parent_node(array('hidden' => 1));

Expand Down
2 changes: 1 addition & 1 deletion field/age/tests/behat/submit_age.feature
Expand Up @@ -56,4 +56,4 @@ Feature: make a submission test for "age" item
And I press "Submit"

And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
2 changes: 1 addition & 1 deletion field/autofill/tests/behat/submit_autofill.feature
Expand Up @@ -48,4 +48,4 @@ Feature: make a submission test for "autofill" item
And I press "Submit"

And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
2 changes: 1 addition & 1 deletion field/boolean/tests/behat/submit_boolean.feature
Expand Up @@ -80,4 +80,4 @@ Feature: make a submission test for "boolean" item
And I press "Submit"

And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
8 changes: 4 additions & 4 deletions field/character/tests/behat/settings_configuration_01.feature
Expand Up @@ -47,15 +47,15 @@ Feature: Validate creation and submit for "character" elements using the princip
And I press "New response"
And I press "Submit"
And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
# End of test number 1

# Test number 2: Student submits a standard answer
And I press "New response"
And I set the field "This is a free text" to "Nice to know!"
And I press "Submit"
And I press "Continue to responses list"
Then I should see "2" submissions displayed
Then I should see "2" submissions
# End of test number 2

@javascript
Expand All @@ -80,7 +80,7 @@ Feature: Validate creation and submit for "character" elements using the princip
Then I should see "Text is supposed to be longer-equal than 20 characters"
And I press "Submit"
And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
# End of test number 3

# Test number 4: Student submits a standard answer
Expand All @@ -92,5 +92,5 @@ Feature: Validate creation and submit for "character" elements using the princip
And I set the field "This is a free text" to "Ok! Now I enter a correct text."
And I press "Submit"
And I press "Continue to responses list"
Then I should see "2" submissions displayed
Then I should see "2" submissions
# End of test number 4
8 changes: 4 additions & 4 deletions field/character/tests/behat/settings_configuration_02.feature
Expand Up @@ -47,7 +47,7 @@ Feature: Validate creation and submit for "character" elements using the princip
And I press "New response"
And I press "Submit"
And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
# End of test number 1

# Test number 2: Student submits a standard answer
Expand All @@ -58,7 +58,7 @@ Feature: Validate creation and submit for "character" elements using the princip
And I set the field "Write down your email" to "me@myserver.net"
And I press "Submit"
And I press "Continue to responses list"
Then I should see "2" submissions displayed
Then I should see "2" submissions
# End of test number 2

@javascript
Expand All @@ -83,7 +83,7 @@ Feature: Validate creation and submit for "character" elements using the princip
Then I should see "Text is supposed to be longer-equal than 20 characters"
And I press "Submit"
And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
# End of test number 3

# Test number 4: Student submits a standard answer
Expand All @@ -95,5 +95,5 @@ Feature: Validate creation and submit for "character" elements using the princip
And I set the field "Write down your email" to "myname.myfamilyname@myserver.net"
And I press "Submit"
And I press "Continue to responses list"
Then I should see "2" submissions displayed
Then I should see "2" submissions
# End of test number 4
8 changes: 4 additions & 4 deletions field/character/tests/behat/settings_configuration_03.feature
Expand Up @@ -48,7 +48,7 @@ Feature: Validate creation and submit for "character" elements using the princip
Then I should see "URL is expected here"
And I press "Submit"
And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
# End of test number 1

# Test number 2: Student submits a standard answer
Expand All @@ -60,7 +60,7 @@ Feature: Validate creation and submit for "character" elements using the princip
And I set the field "Type a web address" to "www.moodle.org"
And I press "Submit"
And I press "Continue to responses list"
Then I should see "2" submissions displayed
Then I should see "2" submissions
# End of test number 2

@javascript
Expand All @@ -86,7 +86,7 @@ Feature: Validate creation and submit for "character" elements using the princip
Then I should see "Text is supposed to be longer-equal than 20 characters"
And I press "Submit"
And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
# End of test number 3

# Test number 4: Student submits a standard answer
Expand All @@ -98,5 +98,5 @@ Feature: Validate creation and submit for "character" elements using the princip
And I set the field "Type a web address" to "http://www.moodle.org"
And I press "Submit"
And I press "Continue to responses list"
Then I should see "2" submissions displayed
Then I should see "2" submissions
# End of test number 4
6 changes: 3 additions & 3 deletions field/character/tests/behat/settings_configuration_04.feature
Expand Up @@ -49,7 +49,7 @@ Feature: Validate creation and submit for "character" elements using the princip
Then I should see "Text is supposed to be exactly 5 characters long; Text is supposed to match the following pattern: \"00000\""
And I press "Submit"
And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
# End of test number 1

# Test number 2: Student submits a standard answer
Expand All @@ -61,7 +61,7 @@ Feature: Validate creation and submit for "character" elements using the princip
And I set the field "Enter a zip code" to "00123"
And I press "Submit"
And I press "Continue to responses list"
Then I should see "2" submissions displayed
Then I should see "2" submissions
# End of test number 2

@javascript
Expand Down Expand Up @@ -92,5 +92,5 @@ Feature: Validate creation and submit for "character" elements using the princip
And I set the field "Enter a zip code" to "00123"
And I press "Submit"
And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
# End of test number 3
4 changes: 2 additions & 2 deletions field/character/tests/behat/settings_configuration_05.feature
Expand Up @@ -50,7 +50,7 @@ Feature: Validate creation and submit for "character" elements using the princip
And I set the field "This is a free text" to "Nice to know!"
And I press "Submit"
And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
# End of test number 1

@javascript
Expand Down Expand Up @@ -81,5 +81,5 @@ Feature: Validate creation and submit for "character" elements using the princip
And I set the field "This is a free text" to "Ok! Now I enter a correct text."
And I press "Submit"
And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
# End of test number 2
4 changes: 2 additions & 2 deletions field/character/tests/behat/settings_configuration_06.feature
Expand Up @@ -53,7 +53,7 @@ Feature: Validate creation and submit for "character" elements using the princip
And I set the field "Write down your email" to "me@myserver.net"
And I press "Submit"
And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
# End of test number 1

@javascript
Expand Down Expand Up @@ -86,5 +86,5 @@ Feature: Validate creation and submit for "character" elements using the princip
And I set the field "Write down your email" to "myname.myfamilyname@myserver.net"
And I press "Submit"
And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
# End of test number 2
4 changes: 2 additions & 2 deletions field/character/tests/behat/settings_configuration_07.feature
Expand Up @@ -53,7 +53,7 @@ Feature: Validate creation and submit for "character" elements using the princip
And I set the field "Type a web address" to "www.moodle.org"
And I press "Submit"
And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
# End of test number 1

@javascript
Expand Down Expand Up @@ -86,5 +86,5 @@ Feature: Validate creation and submit for "character" elements using the princip
And I set the field "Type a web address" to "http://www.moodle.org"
And I press "Submit"
And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
# End of test number 2
12 changes: 6 additions & 6 deletions field/checkbox/tests/behat/settings_configuration_01.feature
Expand Up @@ -52,7 +52,7 @@ Feature: Validate creation and submit for "checkbox" elements using the principa
And I press "New response"
And I press "Submit"
And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
# End of test number 1

# Test number 2: Student submits a standard answer
Expand All @@ -62,7 +62,7 @@ Feature: Validate creation and submit for "checkbox" elements using the principa
| id_surveypro_field_checkbox_1_3 | 1 |
And I press "Submit"
And I press "Continue to responses list"
Then I should see "2" submissions displayed
Then I should see "2" submissions
# End of test number 2

# Test number 3: Student chooses "No answer"
Expand All @@ -72,7 +72,7 @@ Feature: Validate creation and submit for "checkbox" elements using the principa
| id_surveypro_field_checkbox_1_noanswer | 1 |
And I press "Submit"
And I press "Continue to responses list"
Then I should see "3" submissions displayed
Then I should see "3" submissions
# End of test number 3

@javascript
Expand Down Expand Up @@ -108,7 +108,7 @@ Feature: Validate creation and submit for "checkbox" elements using the principa
| id_surveypro_field_checkbox_1_3 | 1 |
And I press "Submit"
And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
# End of test number 4

# Test number 5: Student submits a standard answer
Expand All @@ -119,7 +119,7 @@ Feature: Validate creation and submit for "checkbox" elements using the principa
| id_surveypro_field_checkbox_1_3 | 1 |
And I press "Submit"
And I press "Continue to responses list"
Then I should see "2" submissions displayed
Then I should see "2" submissions
# End of test number 5

# Test number 6: Student chooses "No answer"
Expand All @@ -130,5 +130,5 @@ Feature: Validate creation and submit for "checkbox" elements using the principa
| id_surveypro_field_checkbox_1_noanswer | 1 |
And I press "Submit"
And I press "Continue to responses list"
Then I should see "3" submissions displayed
Then I should see "3" submissions
# End of test number 6
12 changes: 6 additions & 6 deletions field/checkbox/tests/behat/settings_configuration_02.feature
Expand Up @@ -52,7 +52,7 @@ Feature: Validate creation and submit for "checkbox" elements using the principa
And I press "New response"
And I press "Submit"
And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
# End of test number 1

# Test number 2: Student submits a standard answer
Expand All @@ -62,7 +62,7 @@ Feature: Validate creation and submit for "checkbox" elements using the principa
| id_surveypro_field_checkbox_1_3 | 1 |
And I press "Submit"
And I press "Continue to responses list"
Then I should see "2" submissions displayed
Then I should see "2" submissions
# End of test number 2

# Test number 3: Student chooses "No answer"
Expand All @@ -72,7 +72,7 @@ Feature: Validate creation and submit for "checkbox" elements using the principa
| id_surveypro_field_checkbox_1_noanswer | 1 |
And I press "Submit"
And I press "Continue to responses list"
Then I should see "3" submissions displayed
Then I should see "3" submissions
# End of test number 3

@javascript
Expand Down Expand Up @@ -104,7 +104,7 @@ Feature: Validate creation and submit for "checkbox" elements using the principa
| id_surveypro_field_checkbox_1_3 | 1 |
And I press "Submit"
And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
# End of test number 4

# Test number 5: Student submits a standard answer
Expand All @@ -115,7 +115,7 @@ Feature: Validate creation and submit for "checkbox" elements using the principa
| id_surveypro_field_checkbox_1_3 | 1 |
And I press "Submit"
And I press "Continue to responses list"
Then I should see "2" submissions displayed
Then I should see "2" submissions
# End of test number 5

# Test number 6: Student chooses "No answer"
Expand All @@ -125,5 +125,5 @@ Feature: Validate creation and submit for "checkbox" elements using the principa
| id_surveypro_field_checkbox_1_noanswer | 1 |
And I press "Submit"
And I press "Continue to responses list"
Then I should see "3" submissions displayed
Then I should see "3" submissions
# End of test number 6
8 changes: 4 additions & 4 deletions field/checkbox/tests/behat/settings_configuration_03.feature
Expand Up @@ -53,7 +53,7 @@ Feature: Validate creation and submit for "checkbox" elements using the principa
Then I should not see "No answer"
And I press "Submit"
And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
# End of test number 1

# Test number 2: Student submits a standard answer
Expand All @@ -63,7 +63,7 @@ Feature: Validate creation and submit for "checkbox" elements using the principa
| id_surveypro_field_checkbox_1_3 | 1 |
And I press "Submit"
And I press "Continue to responses list"
Then I should see "2" submissions displayed
Then I should see "2" submissions
# End of test number 2

@javascript
Expand Down Expand Up @@ -100,7 +100,7 @@ Feature: Validate creation and submit for "checkbox" elements using the principa
| id_surveypro_field_checkbox_1_2 | 1 |
And I press "Submit"
And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
# End of test number 3

# Test number 4: Student submits a standard answer
Expand All @@ -111,5 +111,5 @@ Feature: Validate creation and submit for "checkbox" elements using the principa
| id_surveypro_field_checkbox_1_3 | 1 |
And I press "Submit"
And I press "Continue to responses list"
Then I should see "2" submissions displayed
Then I should see "2" submissions
# End of test number 4
8 changes: 4 additions & 4 deletions field/checkbox/tests/behat/settings_configuration_04.feature
Expand Up @@ -53,7 +53,7 @@ Feature: Validate creation and submit for "checkbox" elements using the principa
Then I should not see "No answer"
And I press "Submit"
And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
# End of test number 1

# Test number 2: Student submits a standard answer
Expand All @@ -63,7 +63,7 @@ Feature: Validate creation and submit for "checkbox" elements using the principa
| id_surveypro_field_checkbox_1_3 | 1 |
And I press "Submit"
And I press "Continue to responses list"
Then I should see "2" submissions displayed
Then I should see "2" submissions
# End of test number 2

@javascript
Expand Down Expand Up @@ -96,7 +96,7 @@ Feature: Validate creation and submit for "checkbox" elements using the principa
| id_surveypro_field_checkbox_1_0 | 1 |
And I press "Submit"
And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions
# End of test number 3

# Test number 4: Student submits a standard answer
Expand All @@ -106,6 +106,6 @@ Feature: Validate creation and submit for "checkbox" elements using the principa
| id_surveypro_field_checkbox_1_0 | 1 |
And I press "Submit"
And I press "Continue to responses list"
Then I should see "2" submissions displayed
Then I should see "2" submissions
# End of test number 4

2 changes: 1 addition & 1 deletion field/date/tests/behat/submit_date.feature
Expand Up @@ -54,4 +54,4 @@ Feature: make a submission test for "date" item
And I press "Submit"

And I press "Continue to responses list"
Then I should see "1" submissions displayed
Then I should see "1" submissions

0 comments on commit aed37bc

Please sign in to comment.