63e4df60f6
This is a squash of many small fixes. The list of changes are: Initial set of behat selectors overrides required for new theme. set core behat selectors if not overridden by theme Remove pause Fix for checkboxes not saving properly Custom override for click in the user menu Fix for behat guessing the field type. Behat fix for guessing the correct field type. Fix for missing closeElementBefore mforms mess. Fix for textareas not displaying their contents. Fix availability form element Fix action menu selectors for activities in a course page Fix textareas not retaining their values Fix selector for blocks I had to change the single select template to use an input instead of a button because of a behat bug we have not tracked down yet. Fix for frozen attribute in form elements Use input instead of button while behat is still broken Fix for navigation selector override Behat selector fixes and multi-select fixes for templated select Fix for configure blocks selector + booleans for autocomplete Fixes for course_summary behat tests Allow optgroups in single_select Behat fixes for block_navigation Fixes for url form element and activity chooser selectors blocks_social - fix specific selector for behat Fix export_for_template for selectgroups element. Dont set empty id on the form Fix direct call to behat_navigation in backup context Checkbox empty value fix Fix for assign grading panel popouts file picker overrides to find a file manager in the page Fix chat tests to use element name Make selectors in mod_data behat less specific MDL-55839: recent activity behat test relies on time() SQUASH Honour mform element "class" attribute on the container SQUASH Fixes for behat in mod_forum SQUASH search form template showing value as text next to the button SQUASH undo double selectgroup fix SQUASH - The slightly different structure to action menus breaks course drag and drop SQUASH Wrap loading icon in a span so the selector still works. SQUASH Fix fragile javascript in report_loglive SQUASH Fix tabtree, and selectgroups for mod_feedback Also - do-not enhance the action menu - we are dropping support for this. SQUASH Fix filemanager selector and pix_icon template for mod_forum tests. SQUASH Fixes to breadcrumb and add formid to single select (fixes mod_glossary tests) SQUASH lesson behat fixes. 95% of lesson styles were rubbish so they were disgarded. SQUASH Fix lti behat tests - they were cheating and using a context step from quiz SQUASH Behat fixes for quiz with new theme SQUASH behat fixes for mod_wiki SQUASH Workshop behat fixes SQUASH Frozen form elements cannot use a readonly form element because it screws with the form JS "disabledIf" stuff. SQUASH Fixes for grades behat tests SQUASH behat fixes for groups SQUASH blacklist action menu tests SQUASH Fix for tag form element missing "manage standard tags" link SQUASH Incomplete fixes for course behat tests SQUASH behat fixes for badges SQUASH Tags fixes for behat SQUASH filepicker fixes for behat SQUASH Abort guessing field type when we hit 'html' SQUASH Fix for admin/tool/behat tests SQUASH fix for admin tool behat tests SQUASH fix for availabilty conditions hiding "aria-hidden" elements SQUASH give the blocks more room. We get behat files because nav tree nodes are not in view SQUASH Blocks fixed Fix behaviour of unchecked checkboxes SQUASH Remove incorrect step in user test SQUASH behat fixes for course tests Part of MDL-55071
247 lines
11 KiB
Gherkin
247 lines
11 KiB
Gherkin
@mod @mod_feedback
|
|
Feature: Mapping courses in a feedback
|
|
In order to collect the same feedback about multiple courses
|
|
As a manager
|
|
I need to be able to map site feedback to courses
|
|
|
|
Background:
|
|
Given the following "users" exist:
|
|
| username | firstname | lastname |
|
|
| user1 | Username | 1 |
|
|
| user2 | Username | 2 |
|
|
| user3 | Username | 3 |
|
|
| teacher | Teacher | 4 |
|
|
| manager | Manager | 5 |
|
|
And the following "courses" exist:
|
|
| fullname | shortname |
|
|
| Course 1 | C1 |
|
|
| Course 2 | C2 |
|
|
| Course 3 | C3 |
|
|
And the following "course enrolments" exist:
|
|
| user | course | role |
|
|
| user1 | C1 | student |
|
|
| user1 | C2 | student |
|
|
| user2 | C1 | student |
|
|
| user2 | C2 | student |
|
|
| user3 | C3 | student |
|
|
| teacher | C1 | editingteacher |
|
|
| teacher | C2 | editingteacher |
|
|
| teacher | C3 | editingteacher |
|
|
And the following "system role assigns" exist:
|
|
| user | course | role |
|
|
| manager | Acceptance test site | manager |
|
|
And the following "activities" exist:
|
|
| activity | name | course | idnumber | anonymous | publish_stats |
|
|
| feedback | Course feedback | Acceptance test site | feedback0 | 1 | 1 |
|
|
| feedback | Another feedback | C1 | feedback1 | 1 | 1 |
|
|
When I log in as "manager"
|
|
And I am on site homepage
|
|
And I follow "Course feedback"
|
|
And I follow "Edit questions"
|
|
And I add a "Information" question to the feedback with:
|
|
| Question | this is an information question |
|
|
| Label | info |
|
|
| Information type | Course |
|
|
And I add a "Multiple choice (rated)" question to the feedback with:
|
|
| Question | this is a multiple choice rated |
|
|
| Label | multichoicerated |
|
|
| Multiple choice type | Multiple choice - single answer |
|
|
| Multiple choice values | 0/option a\n1/option b\n5/option c |
|
|
And I add a "Multiple choice" question to the feedback with:
|
|
| Question | this is a simple multiple choice |
|
|
| Label | multichoicesimple |
|
|
| Multiple choice type | Multiple choice - single answer allowed (dropdownlist) |
|
|
| Multiple choice values | option d\noption e\noption f |
|
|
And I log out
|
|
And I log in as "teacher"
|
|
And I follow "Course 1"
|
|
And I turn editing mode on
|
|
And I add the "Feedback" block
|
|
And I am on site homepage
|
|
And I follow "Course 2"
|
|
And I add the "Feedback" block
|
|
And I am on site homepage
|
|
And I follow "Course 3"
|
|
And I add the "Feedback" block
|
|
And I log out
|
|
|
|
Scenario: Course feedback can not be mapped
|
|
And I log in as "manager"
|
|
And I am on site homepage
|
|
And I follow "Course 1"
|
|
And I follow "Another feedback"
|
|
And I should not see "Mapped courses"
|
|
And I should not see "Map feedback to courses"
|
|
|
|
@javascript
|
|
Scenario: Site feedback is not mapped to any course
|
|
And I log in as "user1"
|
|
And I am on site homepage
|
|
And I follow "Course feedback"
|
|
And I follow "Answer the questions..."
|
|
And I should see "Acceptance test site" in the ".feedback_form" "css_element"
|
|
And I set the following fields to these values:
|
|
| option a | 1 |
|
|
| this is a simple multiple choice | option d |
|
|
And I press "Submit your answers"
|
|
And I press "Continue"
|
|
And I follow "Course 1"
|
|
And I click on "Course feedback" "link" in the "Feedback" "block"
|
|
And I follow "Answer the questions..."
|
|
And I should not see "Acceptance test site" in the ".feedback_form" "css_element"
|
|
And I should see "C1" in the ".feedback_form" "css_element"
|
|
And I set the following fields to these values:
|
|
| option b | 1 |
|
|
| this is a simple multiple choice | option e |
|
|
And I press "Submit your answers"
|
|
And I press "Continue"
|
|
And I click on "Course feedback" "link" in the "Feedback" "block"
|
|
And I should not see "Answer the questions..."
|
|
And I log out
|
|
And I log in as "user2"
|
|
And I follow "Course 1"
|
|
And I click on "Course feedback" "link" in the "Feedback" "block"
|
|
And I follow "Answer the questions..."
|
|
And I should not see "Acceptance test site" in the ".feedback_form" "css_element"
|
|
And I should see "C1" in the ".feedback_form" "css_element"
|
|
And I set the following fields to these values:
|
|
| option c | 1 |
|
|
| this is a simple multiple choice | option e |
|
|
And I press "Submit your answers"
|
|
And I press "Continue"
|
|
And I log out
|
|
And I log in as "manager"
|
|
And I am on site homepage
|
|
And I follow "Course feedback"
|
|
|
|
And I follow "Analysis"
|
|
And I should see "All courses" in the "#feedback_course_filter [data-fieldtype=autocomplete] .form-autocomplete-selection [role=listitem]" "css_element"
|
|
And I show chart data for the "multichoicerated" feedback
|
|
And I should see "1 (33.33 %)" in the "option a" "table_row"
|
|
And I should see "1 (33.33 %)" in the "option b" "table_row"
|
|
And I should see "1 (33.33 %)" in the "option c" "table_row"
|
|
And I should see "Average: 2.00"
|
|
And I follow "Sort by course"
|
|
And I should see "2.50" in the "C1" "table_row"
|
|
And I should see "1.00" in the "Acceptance test site" "table_row"
|
|
And I follow "Back"
|
|
And I set the field "Filter by course" to "Course 1"
|
|
And I press "Filter"
|
|
And I should see "Course 1" in the "#feedback_course_filter [data-fieldtype=autocomplete] .form-autocomplete-selection [role=listitem]" "css_element"
|
|
And I show chart data for the "multichoicerated" feedback
|
|
And I should see "0" in the "option a" "table_row"
|
|
And I should see "1 (50.00 %)" in the "option b" "table_row"
|
|
And I should see "1 (50.00 %)" in the "option c" "table_row"
|
|
And I log out
|
|
|
|
@javascript
|
|
Scenario: Site feedback is mapped to courses
|
|
And I log in as "manager"
|
|
And I am on site homepage
|
|
And I follow "Course feedback"
|
|
And I follow "Map feedback to courses"
|
|
And I set the field "Courses" to "Course 2"
|
|
And I set the field "Courses" to "Course 3"
|
|
And I press "Save changes"
|
|
And I log out
|
|
|
|
And I log in as "user1"
|
|
And I am on site homepage
|
|
And I follow "Course feedback"
|
|
And I should see "You can only access this feedback from a course"
|
|
And I should not see "Answer the questions..."
|
|
|
|
And I am on site homepage
|
|
And I follow "Course 1"
|
|
And "Feedback" "block" should not exist
|
|
And I should not see "Course feedback"
|
|
|
|
And I am on site homepage
|
|
And I follow "Course 2"
|
|
And I click on "Course feedback" "link" in the "Feedback" "block"
|
|
And I follow "Answer the questions..."
|
|
And I should not see "Acceptance test site" in the ".feedback_form" "css_element"
|
|
And I should see "C2" in the ".feedback_form" "css_element"
|
|
And I set the following fields to these values:
|
|
| option b | 1 |
|
|
| this is a simple multiple choice | option e |
|
|
And I press "Submit your answers"
|
|
And I press "Continue"
|
|
And I click on "Course feedback" "link" in the "Feedback" "block"
|
|
And I should not see "Answer the questions..."
|
|
And I log out
|
|
And I log in as "user2"
|
|
And I follow "Course 2"
|
|
And I click on "Course feedback" "link" in the "Feedback" "block"
|
|
And I follow "Answer the questions..."
|
|
And I should not see "Acceptance test site" in the ".feedback_form" "css_element"
|
|
And I should see "C2" in the ".feedback_form" "css_element"
|
|
And I set the following fields to these values:
|
|
| option c | 1 |
|
|
| this is a simple multiple choice | option e |
|
|
And I press "Submit your answers"
|
|
And I press "Continue"
|
|
And I log out
|
|
And I log in as "user3"
|
|
And I follow "Course 3"
|
|
And I click on "Course feedback" "link" in the "Feedback" "block"
|
|
And I follow "Answer the questions..."
|
|
And I should not see "Acceptance test site" in the ".feedback_form" "css_element"
|
|
And I should see "C3" in the ".feedback_form" "css_element"
|
|
And I set the following fields to these values:
|
|
| option c | 1 |
|
|
| this is a simple multiple choice | option d |
|
|
And I press "Submit your answers"
|
|
And I press "Continue"
|
|
And I log out
|
|
And I log in as "manager"
|
|
And I am on site homepage
|
|
And I follow "Course feedback"
|
|
And I follow "Analysis"
|
|
And I should see "All courses" in the "#feedback_course_filter [data-fieldtype=autocomplete] .form-autocomplete-selection [role=listitem]" "css_element"
|
|
And I show chart data for the "multichoicerated" feedback
|
|
And I should see "0" in the "option a" "table_row"
|
|
And I should see "1 (33.33 %)" in the "option b" "table_row"
|
|
And I should see "2 (66.67 %)" in the "option c" "table_row"
|
|
And I should see "Average: 3.67"
|
|
And I click on "Sort by course" "link"
|
|
And I should see "3.00" in the "C3" "table_row"
|
|
And I should see "2.50" in the "C2" "table_row"
|
|
And I follow "Back"
|
|
And I set the field "Filter by course" to "Course 2"
|
|
And I press "Filter"
|
|
And I show chart data for the "multichoicerated" feedback
|
|
And I should see "0" in the "option a" "table_row"
|
|
And I should see "1 (50.00 %)" in the "option b" "table_row"
|
|
And I should see "1 (50.00 %)" in the "option c" "table_row"
|
|
And I show chart data for the "multichoicesimple" feedback
|
|
And I should see "2 (100.00 %)" in the "option e" "table_row"
|
|
And I set the field "Filter by course" to "Course 3"
|
|
And I press "Filter"
|
|
And I show chart data for the "multichoicerated" feedback
|
|
And I should see "0" in the "option a" "table_row"
|
|
And I should see "0" in the "option b" "table_row"
|
|
And I should see "1 (100.00 %)" in the "option c" "table_row"
|
|
And I show chart data for the "multichoicesimple" feedback
|
|
And I should see "1 (100.00 %)" in the "option d" "table_row"
|
|
And I follow "Show all"
|
|
And I show chart data for the "multichoicesimple" feedback
|
|
And I should see "1 (33.33 %)" in the "option d" "table_row"
|
|
And I should see "2 (66.67 %)" in the "option e" "table_row"
|
|
And I should see "0" in the "option f" "table_row"
|
|
And I log out
|
|
|
|
Scenario: Site feedback deletion hides feedback block completely
|
|
When I log in as "manager"
|
|
And I am on site homepage
|
|
And I follow "Turn editing on"
|
|
And I add the "Feedback" block
|
|
And I click on "Delete" "link" in the "//*[contains(@class,'block_site_main_menu')]//li[contains(.,'Course feedback')]" "xpath_element"
|
|
And I press "Yes"
|
|
And I follow "Turn editing off"
|
|
And I am on site homepage
|
|
Then "Feedback" "block" should not exist
|
|
And I follow "Course 1"
|
|
And "Feedback" "block" should not exist
|
|
And I log out
|