Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @mod @mod_assign @assignfeedback @assignfeedback_editpdf @_file_upload
- Feature: In an assignment, teacher can annotate PDF files during grading
- In order to provide visual report on a graded PDF
- As a teacher
- I need to use the PDF editor
- @javascript
- Scenario: Submit a PDF file as a student and annotate the PDF as a teacher # /home/rajesh/moodles/integration/moodle/mod/assign/feedback/editpdf/tests/behat/annotate_pdf.feature:8
- Given ghostscript is installed # behat_assignfeedback_editpdf::ghostscript_is_installed()
- And the following "courses" exist: # behat_data_generators::the_following_exist()
- | fullname | shortname | category | groupmode |
- | Course 1 | C1 | 0 | 1 |
- And the following "users" exist: # behat_data_generators::the_following_exist()
- | username | firstname | lastname | email |
- | teacher1 | Teacher | 1 | teacher1@example.com |
- | student1 | Student | 1 | student1@example.com |
- And the following "course enrolments" exist: # behat_data_generators::the_following_exist()
- | user | course | role |
- | teacher1 | C1 | editingteacher |
- | student1 | C1 | student |
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "admin" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "admin" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I navigate to "Annotate PDF" node in "Site administration > Plugins > Activity modules > Assignment > Feedback plugins" # behat_navigation::i_navigate_to_node_in()
- And I upload "pix/help.png" file to "" filemanager # behat_repository_upload::i_upload_file_to_filemanager()
- And I upload "pix/docs.png" file to "" filemanager # behat_repository_upload::i_upload_file_to_filemanager()
- When I press "Save changes" # behat_forms::press_button()
- Then I should see "Changes saved" # behat_general::assert_page_contains_text()
- And I follow "Test ghostscript path" # behat_general::click_link()
- And I should see "The ghostscript path appears to be OK" # behat_general::assert_page_contains_text()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I follow "Log out" # behat_general::click_link()
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- Given I press "Turn editing on" # behat_forms::press_button()
- Given I add a "Assignment" to section "1" # behat_course::i_add_to_section()
- Given I set the following fields to these values: # behat_forms::i_set_the_following_fields_to_these_values()
- | Assignment name | Test assignment name |
- | Description | Submit your PDF file |
- | assignsubmission_file_enabled | 1 |
- | Maximum number of uploaded files | 2 |
- Given I press "Save and return to course" # behat_forms::press_button()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I follow "Log out" # behat_general::click_link()
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "student1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "student1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- And I follow "Test assignment name" # behat_general::click_link()
- And I press "Add submission" # behat_forms::press_button()
- And I upload "mod/assign/feedback/editpdf/tests/fixtures/submission.pdf" file to "File submissions" filemanager # behat_repository_upload::i_upload_file_to_filemanager()
- And I upload "mod/assign/feedback/editpdf/tests/fixtures/testgs.pdf" file to "File submissions" filemanager # behat_repository_upload::i_upload_file_to_filemanager()
- And I press "Save changes" # behat_forms::press_button()
- And I should see "Submitted for grading" # behat_general::assert_page_contains_text()
- And I should see "submission.pdf" # behat_general::assert_page_contains_text()
- And I should see "Not graded" # behat_general::assert_page_contains_text()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I follow "Log out" # behat_general::click_link()
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- And I follow "Test assignment name" # behat_general::click_link()
- And I follow "View/grade all submissions" # behat_general::click_link()
- And I click on "Grade" "link" in the "Submitted for grading" "table_row" # behat_general::i_click_on_in_the()
- And I follow "Launch PDF editor..." # behat_general::click_link()
- And I change window size to "large" # behat_general::i_change_window_size_to()
- And I click on ".navigate-next-button" "css_element" # behat_general::i_click_on()
- And I click on ".stampbutton" "css_element" # behat_general::i_click_on()
- And I click on ".linebutton" "css_element" # behat_general::i_click_on()
- And I click on ".commentcolourbutton" "css_element" # behat_general::i_click_on()
- And I click on "//img[@alt=\"Blue\"]" "xpath_element" # behat_general::i_click_on()
- And I change window size to "medium" # behat_general::i_change_window_size_to()
- And I wait until the page is ready # behat_general::wait_until_the_page_is_ready()
- And I click on "Close" "button" # behat_general::i_click_on()
- And I press "Save changes" # behat_forms::press_button()
- And I should see "The grade changes were saved" # behat_general::assert_page_contains_text()
- @javascript
- Scenario: Submit a PDF file as a student in a team and annotate the PDF as a teacher # /home/rajesh/moodles/integration/moodle/mod/assign/feedback/editpdf/tests/behat/annotate_pdf.feature:69
- Given ghostscript is installed # behat_assignfeedback_editpdf::ghostscript_is_installed()
- And the following "courses" exist: # behat_data_generators::the_following_exist()
- | fullname | shortname | category | groupmode |
- | Course 1 | C1 | 0 | 1 |
- And the following "users" exist: # behat_data_generators::the_following_exist()
- | username | firstname | lastname | email |
- | teacher1 | Teacher | 1 | teacher1@example.com |
- | student1 | Student | 1 | student1@example.com |
- | student2 | Student | 2 | student2@example.com |
- | student3 | Student | 3 | student3@example.com |
- | student4 | Student | 4 | student4@example.com |
- And the following "course enrolments" exist: # behat_data_generators::the_following_exist()
- | user | course | role |
- | teacher1 | C1 | editingteacher |
- | student1 | C1 | student |
- | student2 | C1 | student |
- | student3 | C1 | student |
- | student4 | C1 | student |
- And the following "groups" exist: # behat_data_generators::the_following_exist()
- | name | course | idnumber |
- | G1 | C1 | G1 |
- | G2 | C1 | G2 |
- And the following "groupings" exist: # behat_data_generators::the_following_exist()
- | name | course | idnumber |
- | G1 | C1 | G1 |
- And the following "group members" exist: # behat_data_generators::the_following_exist()
- | user | group |
- | student1 | G1 |
- | student2 | G1 |
- | student3 | G2 |
- | student4 | G2 |
- And the following "grouping groups" exist: # behat_data_generators::the_following_exist()
- | grouping | group |
- | G1 | G1 |
- | G1 | G2 |
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- Given I press "Turn editing on" # behat_forms::press_button()
- Given I add a "Assignment" to section "1" # behat_course::i_add_to_section()
- Given I set the following fields to these values: # behat_forms::i_set_the_following_fields_to_these_values()
- | Assignment name | Test assignment name |
- | Description | Submit your PDF file |
- | assignsubmission_file_enabled | 1 |
- | Maximum number of uploaded files | 2 |
- | Students submit in groups | Yes |
- | Grouping for student groups | G1 |
- Given I press "Save and return to course" # behat_forms::press_button()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I follow "Log out" # behat_general::click_link()
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "student1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "student1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- And I follow "Test assignment name" # behat_general::click_link()
- And I press "Add submission" # behat_forms::press_button()
- And I upload "mod/assign/feedback/editpdf/tests/fixtures/submission.pdf" file to "File submissions" filemanager # behat_repository_upload::i_upload_file_to_filemanager()
- And I press "Save changes" # behat_forms::press_button()
- Then I should see "Submitted for grading" # behat_general::assert_page_contains_text()
- And I should see "submission.pdf" # behat_general::assert_page_contains_text()
- And I should see "Not graded" # behat_general::assert_page_contains_text()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I follow "Log out" # behat_general::click_link()
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- And I follow "Test assignment name" # behat_general::click_link()
- And I follow "View/grade all submissions" # behat_general::click_link()
- And I click on "Grade" "link" in the "Student 2" "table_row" # behat_general::i_click_on_in_the()
- And I follow "Launch PDF editor..." # behat_general::click_link()
- And I change window size to "large" # behat_general::i_change_window_size_to()
- And I click on ".stampbutton" "css_element" # behat_general::i_click_on()
- And I click on ".drawingcanvas" "css_element" # behat_general::i_click_on()
- And I change window size to "medium" # behat_general::i_change_window_size_to()
- And I wait until the page is ready # behat_general::wait_until_the_page_is_ready()
- And I click on "Close" "button" # behat_general::i_click_on()
- And I press "Save changes" # behat_forms::press_button()
- And I should see "The grade changes were saved" # behat_general::assert_page_contains_text()
- And I press "Continue" # behat_forms::press_button()
- And I should see "View annotated PDF..." in the "student1@example.com" "table_row" # behat_general::assert_element_contains_text()
- @mod @mod_assign @assignfeedback @assignfeedback_editpdf @_file_upload
- Feature: In a group assignment, teacher can annotate PDF files for all users
- In order to provide visual report on a graded PDF for all users
- As a teacher
- I need to use the PDF editor for a group assignment
- @javascript
- Scenario: Submit a PDF file as a student and annotate the PDF as a teacher # /home/rajesh/moodles/integration/moodle/mod/assign/feedback/editpdf/tests/behat/group_annotations.feature:8
- Given ghostscript is installed # behat_assignfeedback_editpdf::ghostscript_is_installed()
- And the following "courses" exist: # behat_data_generators::the_following_exist()
- | fullname | shortname | category | groupmode |
- | Course 1 | C1 | 0 | 1 |
- And the following "users" exist: # behat_data_generators::the_following_exist()
- | username | firstname | lastname | email |
- | teacher1 | Teacher | 1 | teacher1@example.com |
- | student1 | Student | 1 | student1@example.com |
- | student2 | Student | 2 | student2@example.com |
- And the following "course enrolments" exist: # behat_data_generators::the_following_exist()
- | user | course | role |
- | teacher1 | C1 | editingteacher |
- | student1 | C1 | student |
- | student2 | C1 | student |
- And the following "groups" exist: # behat_data_generators::the_following_exist()
- | name | course | idnumber |
- | G1 | C1 | G1 |
- And the following "group members" exist: # behat_data_generators::the_following_exist()
- | user | group |
- | student1 | G1 |
- | student2 | G1 |
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- Given I press "Turn editing on" # behat_forms::press_button()
- Given I add a "Assignment" to section "1" # behat_course::i_add_to_section()
- Given I set the following fields to these values: # behat_forms::i_set_the_following_fields_to_these_values()
- | Assignment name | Test assignment name |
- | Description | Submit your PDF file |
- | assignsubmission_file_enabled | 1 |
- | Maximum number of uploaded files | 1 |
- | Students submit in groups | Yes |
- Given I press "Save and return to course" # behat_forms::press_button()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I follow "Log out" # behat_general::click_link()
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "student1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "student1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- And I follow "Test assignment name" # behat_general::click_link()
- And I press "Add submission" # behat_forms::press_button()
- And I upload "mod/assign/feedback/editpdf/tests/fixtures/submission.pdf" file to "File submissions" filemanager # behat_repository_upload::i_upload_file_to_filemanager()
- And I press "Save changes" # behat_forms::press_button()
- And I should see "Submitted for grading" # behat_general::assert_page_contains_text()
- And I should see "submission.pdf" # behat_general::assert_page_contains_text()
- And I should see "Not graded" # behat_general::assert_page_contains_text()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I follow "Log out" # behat_general::click_link()
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- And I follow "Test assignment name" # behat_general::click_link()
- And I follow "View/grade all submissions" # behat_general::click_link()
- And I click on "Grade" "link" in the "Submitted for grading" "table_row" # behat_general::i_click_on_in_the()
- And I follow "Launch PDF editor..." # behat_general::click_link()
- And I change window size to "large" # behat_general::i_change_window_size_to()
- And I click on ".navigate-next-button" "css_element" # behat_general::i_click_on()
- And I click on ".stampbutton" "css_element" # behat_general::i_click_on()
- And I click on ".drawingcanvas" "css_element" # behat_general::i_click_on()
- And I change window size to "medium" # behat_general::i_change_window_size_to()
- And I wait until the page is ready # behat_general::wait_until_the_page_is_ready()
- And I click on "Close" "button" # behat_general::i_click_on()
- And I press "Save changes" # behat_forms::press_button()
- And I should see "The grade changes were saved" # behat_general::assert_page_contains_text()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I follow "Log out" # behat_general::click_link()
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "student1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "student1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- And I follow "Test assignment name" # behat_general::click_link()
- When I follow "View annotated PDF..." # behat_general::click_link()
- And I change window size to "large" # behat_general::i_change_window_size_to()
- Then I should see "Annotate PDF" # behat_general::assert_page_contains_text()
- And I change window size to "medium" # behat_general::i_change_window_size_to()
- And I wait until the page is ready # behat_general::wait_until_the_page_is_ready()
- And I click on "Close" "button" # behat_general::i_click_on()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I follow "Log out" # behat_general::click_link()
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "student2" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "student2" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- And I follow "Test assignment name" # behat_general::click_link()
- And I follow "View annotated PDF..." # behat_general::click_link()
- And I should see "Annotate PDF" # behat_general::assert_page_contains_text()
- @editor @editor_atto @atto @atto_image @_file_upload
- Feature: Add images to Atto
- To write rich text - I need to add images.
- @javascript
- Scenario: Insert an image # /home/rajesh/moodles/integration/moodle/lib/editor/atto/plugins/image/tests/behat/image.feature:6
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "admin" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "admin" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Manage private files..." # behat_general::click_link()
- And I upload "lib/editor/atto/tests/fixtures/moodle-logo.png" file to "Files" filemanager # behat_repository_upload::i_upload_file_to_filemanager()
- And I click on "Save changes" "button" # behat_general::i_click_on()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I click on "Profile" "link" in the ".usermenu [data-rel='menu-content']" "css_element" # behat_general::i_click_on_in_the()
- And I follow "Edit profile" # behat_general::click_link()
- When I set the field "Description" to "<p>Image test</p>" # behat_forms::i_set_the_field_to()
- And I select the text in the "Description" Atto editor # behat_editor_atto::select_the_text_in_the_atto_editor()
- And I click on "Image" "button" # behat_general::i_click_on()
- And I click on "Browse repositories..." "button" # behat_general::i_click_on()
- And I click on "Private files" "link" # behat_general::i_click_on()
- And I click on "moodle-logo.png" "link" # behat_general::i_click_on()
- And I click on "Select this file" "button" # behat_general::i_click_on()
- And I set the field "Describe this image" to "It's the Moodle" # behat_forms::i_set_the_field_to()
- And I wait until the page is ready # behat_general::wait_until_the_page_is_ready()
- And the field "Width" matches value "204" # behat_forms::the_field_matches_value()
- And the field "Height" matches value "61" # behat_forms::the_field_matches_value()
- And I set the field "Auto size" to "1" # behat_forms::i_set_the_field_to()
- And I set the field "Width" to "2040" # behat_forms::i_set_the_field_to()
- And I take focus off "Width" "field" # behat_general::i_take_focus_off_field()
- And the field "Height" matches value "610" # behat_forms::the_field_matches_value()
- And I set the field "Height" to "61" # behat_forms::i_set_the_field_to()
- And I take focus off "Height" "field" # behat_general::i_take_focus_off_field()
- And the field "Width" matches value "204" # behat_forms::the_field_matches_value()
- And I set the field "Auto size" to "0" # behat_forms::i_set_the_field_to()
- And I set the field "Width" to "123" # behat_forms::i_set_the_field_to()
- And I set the field "Height" to "456" # behat_forms::i_set_the_field_to()
- And I take focus off "Height" "field" # behat_general::i_take_focus_off_field()
- And the field "Width" matches value "123" # behat_forms::the_field_matches_value()
- And the field "Height" matches value "456" # behat_forms::the_field_matches_value()
- And I click on "Save image" "button" # behat_general::i_click_on()
- And I click on "Update profile" "button" # behat_general::i_click_on()
- And I follow "Edit profile" # behat_general::click_link()
- And I select the text in the "Description" Atto editor # behat_editor_atto::select_the_text_in_the_atto_editor()
- And I click on "Image" "button" # behat_general::i_click_on()
- Then the field "Describe this image" matches value "It's the Moodle" # behat_forms::the_field_matches_value()
- And the field "Width" matches value "123" # behat_forms::the_field_matches_value()
- And the field "Height" matches value "456" # behat_forms::the_field_matches_value()
- @javascript
- Scenario: Manually inserting an image # /home/rajesh/moodles/integration/moodle/lib/editor/atto/plugins/image/tests/behat/image.feature:51
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "admin" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "admin" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I click on "Profile" "link" in the ".usermenu [data-rel='menu-content']" "css_element" # behat_general::i_click_on_in_the()
- And I follow "Edit profile" # behat_general::click_link()
- And I set the field "Description" to "<p>Image: <img src='/nothing/here'>.</p>" # behat_forms::i_set_the_field_to()
- And I select the text in the "Description" Atto editor # behat_editor_atto::select_the_text_in_the_atto_editor()
- When I click on "Image" "button" # behat_general::i_click_on()
- Then the field "Enter URL" matches value "/nothing/here" # behat_forms::the_field_matches_value()
- The 'Enter URL' value is '', '/nothing/here' expected
- And I set the field "Describe this image" to "Something" # behat_forms::i_set_the_field_to()
- And I set the field "Enter URL" to "" # behat_forms::i_set_the_field_to()
- And I press "Save image" # behat_forms::press_button()
- And I set the field "Description" to "<p>Image: <img src='/nothing/again' width='123' height='456' alt='Awesome!'>.</p>" # behat_forms::i_set_the_field_to()
- And I press "Update profile" # behat_forms::press_button()
- And I follow "Edit profile" # behat_general::click_link()
- And I select the text in the "Description" Atto editor # behat_editor_atto::select_the_text_in_the_atto_editor()
- And I click on "Image" "button" # behat_general::i_click_on()
- And the field "Enter URL" matches value "/nothing/again" # behat_forms::the_field_matches_value()
- And the field "Width" matches value "123" # behat_forms::the_field_matches_value()
- And the field "Height" matches value "456" # behat_forms::the_field_matches_value()
- And the field "Describe this image" matches value "Awesome!" # behat_forms::the_field_matches_value()
- @editor @editor_atto @atto @atto_link @_file_upload
- Feature: Add links to Atto
- To write rich text - I need to add links.
- @javascript
- Scenario: Insert a links # /home/rajesh/moodles/integration/moodle/lib/editor/atto/plugins/link/tests/behat/link.feature:6
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "admin" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "admin" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Manage private files..." # behat_general::click_link()
- And I upload "lib/editor/atto/tests/fixtures/moodle-logo.png" file to "Files" filemanager # behat_repository_upload::i_upload_file_to_filemanager()
- And I click on "Save changes" "button" # behat_general::i_click_on()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I click on "Profile" "link" in the ".usermenu [data-rel='menu-content']" "css_element" # behat_general::i_click_on_in_the()
- And I follow "Edit profile" # behat_general::click_link()
- And I set the field "Description" to "Super cool" # behat_forms::i_set_the_field_to()
- And I select the text in the "Description" Atto editor # behat_editor_atto::select_the_text_in_the_atto_editor()
- And I click on "Link" "button" # behat_general::i_click_on()
- And I click on "Browse repositories..." "button" # behat_general::i_click_on()
- And I click on "Private files" "link" # behat_general::i_click_on()
- And I click on "moodle-logo.png" "link" # behat_general::i_click_on()
- And I click on "Select this file" "button" # behat_general::i_click_on()
- And I click on "Update profile" "button" # behat_general::i_click_on()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I click on "Preferences" "link" in the ".usermenu [data-rel='menu-content']" "css_element" # behat_general::i_click_on_in_the()
- And I follow "Editor preferences" # behat_general::click_link()
- And I set the field "Text editor" to "Plain text area" # behat_forms::i_set_the_field_to()
- And I press "Save changes" # behat_forms::press_button()
- And I follow "Edit profile" # behat_general::click_link()
- Then I should see "Super cool</a>" # behat_general::assert_page_contains_text()
- "Super cool</a>" text was not found in the page
- @editor @editor_atto @atto @atto_media @_file_upload
- Feature: Add media to Atto
- To write rich text - I need to add media.
- @javascript
- Scenario: Insert some media # /home/rajesh/moodles/integration/moodle/lib/editor/atto/plugins/media/tests/behat/media.feature:6
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "admin" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "admin" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Manage private files..." # behat_general::click_link()
- And I upload "lib/editor/atto/tests/fixtures/moodle-logo.webm" file to "Files" filemanager # behat_repository_upload::i_upload_file_to_filemanager()
- And I click on "Save changes" "button" # behat_general::i_click_on()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I click on "Profile" "link" in the ".usermenu [data-rel='menu-content']" "css_element" # behat_general::i_click_on_in_the()
- And I follow "Blog entries" # behat_general::click_link()
- And I follow "Add a new entry" # behat_general::click_link()
- And I set the field "Blog entry body" to "<p>Media test</p>" # behat_forms::i_set_the_field_to()
- And I select the text in the "Blog entry body" Atto editor # behat_editor_atto::select_the_text_in_the_atto_editor()
- And I set the field "Entry title" to "The best video in the entire world (not really)" # behat_forms::i_set_the_field_to()
- And I click on "Media" "button" # behat_general::i_click_on()
- And I click on "Browse repositories..." "button" # behat_general::i_click_on()
- And I click on "Private files" "link" # behat_general::i_click_on()
- And I click on "moodle-logo.webm" "link" # behat_general::i_click_on()
- And I click on "Select this file" "button" # behat_general::i_click_on()
- And I set the field "Enter name" to "It's the logo" # behat_forms::i_set_the_field_to()
- And I click on "Insert media" "button" # behat_general::i_click_on()
- And I click on "Save changes" "button" # behat_general::i_click_on()
- Then "video" "css_element" should be visible # behat_general::should_be_visible()
- Css matching locator "video" not found.
- @editor @editor_atto @atto @_file_upload
- Feature: Atto Autosave
- To reduce frustration, atto should save drafts of my work.
- Background: # /home/rajesh/moodles/integration/moodle/lib/editor/atto/tests/behat/autosave.feature:5
- Given the following "courses" exist: # behat_data_generators::the_following_exist()
- | fullname | shortname | category | groupmode |
- | Course 1 | C1 | 0 | 1 |
- And the following "users" exist: # behat_data_generators::the_following_exist()
- | username | firstname | lastname | email |
- | teacher1 | Teacher | 1 | teacher1@example.com |
- | teacher2 | Teacher | 2 | teacher2@example.com |
- And the following "course enrolments" exist: # behat_data_generators::the_following_exist()
- | user | course | role |
- | teacher1 | C1 | editingteacher |
- | teacher2 | C1 | editingteacher |
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "admin" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "admin" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I navigate to "Atto toolbar settings" node in "Site administration > Plugins > Text editors > Atto HTML editor" # behat_navigation::i_navigate_to_node_in()
- And I set the field "Autosave frequency" to "3" # behat_forms::i_set_the_field_to()
- And I set the field with xpath "//select[@name='s_editor_atto_autosavefrequency[u]']" to "seconds" # behat_forms::i_set_the_field_with_xpath_to()
- And I click on "Save changes" "button" # behat_general::i_click_on()
- And I am on site homepage # behat_general::i_am_on_site_homepage()
- And I follow "Course 1" # behat_general::click_link()
- And I navigate to "Edit settings" node in "Course administration" # behat_navigation::i_navigate_to_node_in()
- And I set the field with xpath "//select[@name='summary_editor[format]']" to "1" # behat_forms::i_set_the_field_with_xpath_to()
- And I click on "Save and display" "button" # behat_general::i_click_on()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I follow "Log out" # behat_general::click_link()
- @javascript
- Scenario: Restore a draft # /home/rajesh/moodles/integration/moodle/lib/editor/atto/tests/behat/autosave.feature:30
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- And I navigate to "Edit settings" node in "Course administration" # behat_navigation::i_navigate_to_node_in()
- And I set the field "Course summary" to "This is my draft" # behat_forms::i_set_the_field_to()
- And I wait "5" seconds # behat_general::i_wait_seconds()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I follow "Log out" # behat_general::click_link()
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- And I navigate to "Edit settings" node in "Course administration" # behat_navigation::i_navigate_to_node_in()
- And I wait "2" seconds # behat_general::i_wait_seconds()
- Then I should see "This is my draft" # behat_general::assert_page_contains_text()
- @javascript
- Scenario: Do not restore a draft if files have been modified # /home/rajesh/moodles/integration/moodle/lib/editor/atto/tests/behat/autosave.feature:46
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- And I navigate to "Edit settings" node in "Course administration" # behat_navigation::i_navigate_to_node_in()
- And I set the field "Course summary" to "This is my draft" # behat_forms::i_set_the_field_to()
- And I wait "5" seconds # behat_general::i_wait_seconds()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I follow "Log out" # behat_general::click_link()
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "teacher2" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "teacher2" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Manage private files..." # behat_general::click_link()
- And I upload "lib/editor/atto/tests/fixtures/moodle-logo.png" file to "Files" filemanager # behat_repository_upload::i_upload_file_to_filemanager()
- And I click on "Save changes" "button" # behat_general::i_click_on()
- And I click on "Dashboard" "link" in the "Navigation" "block" # behat_general::i_click_on_in_the()
- And I follow "Course 1" # behat_general::click_link()
- And I navigate to "Edit settings" node in "Course administration" # behat_navigation::i_navigate_to_node_in()
- And I set the field "Course summary" to "<p>Image test</p>" # behat_forms::i_set_the_field_to()
- And I select the text in the "Course summary" Atto editor # behat_editor_atto::select_the_text_in_the_atto_editor()
- And I click on "Image" "button" # behat_general::i_click_on()
- And I click on "Browse repositories..." "button" # behat_general::i_click_on()
- And I click on "Private files" "link" # behat_general::i_click_on()
- And I click on "moodle-logo.png" "link" # behat_general::i_click_on()
- And I click on "Select this file" "button" # behat_general::i_click_on()
- And I set the field "Describe this image" to "It's the Moodle" # behat_forms::i_set_the_field_to()
- And I wait until the page is ready # behat_general::wait_until_the_page_is_ready()
- And I click on "Save image" "button" # behat_general::i_click_on()
- And I click on "Save and display" "button" # behat_general::i_click_on()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I follow "Log out" # behat_general::click_link()
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- And I navigate to "Edit settings" node in "Course administration" # behat_navigation::i_navigate_to_node_in()
- Then I should not see "This is my draft" # behat_general::assert_page_not_contains_text()
- @javascript
- Scenario: Do not restore a draft if text has been modified # /home/rajesh/moodles/integration/moodle/lib/editor/atto/tests/behat/autosave.feature:80
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- And I navigate to "Edit settings" node in "Course administration" # behat_navigation::i_navigate_to_node_in()
- And I set the field "Course summary" to "This is my draft" # behat_forms::i_set_the_field_to()
- And I wait "5" seconds # behat_general::i_wait_seconds()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I follow "Log out" # behat_general::click_link()
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "teacher2" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "teacher2" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- And I navigate to "Edit settings" node in "Course administration" # behat_navigation::i_navigate_to_node_in()
- And I set the field "Course summary" to "Modified text" # behat_forms::i_set_the_field_to()
- And I click on "Save and display" "button" # behat_general::i_click_on()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I follow "Log out" # behat_general::click_link()
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- And I navigate to "Edit settings" node in "Course administration" # behat_navigation::i_navigate_to_node_in()
- Then I should not see "This is my draft" # behat_general::assert_page_not_contains_text()
- And I should see "Modified text" # behat_general::assert_page_contains_text()
- @mod @mod_assign
- Feature: In an assignment, teachers can edit a students submission inline
- In order to easily mark students assignments
- As a teacher
- I need to have a students submission text copied to the grading online form.
- @javascript @_file_upload
- Scenario: Submit a text online and edit the submission # /home/rajesh/moodles/integration/moodle/mod/assign/tests/behat/comment_inline.feature:8
- Given the following "courses" exist: # behat_data_generators::the_following_exist()
- | fullname | shortname | category | groupmode |
- | Course 1 | C1 | 0 | 1 |
- And the following "users" exist: # behat_data_generators::the_following_exist()
- | username | firstname | lastname | email |
- | teacher1 | Teacher | 1 | teacher1@example.com |
- | student1 | Student | 1 | student1@example.com |
- And the following "course enrolments" exist: # behat_data_generators::the_following_exist()
- | user | course | role |
- | teacher1 | C1 | editingteacher |
- | student1 | C1 | student |
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- Given I press "Turn editing on" # behat_forms::press_button()
- Given I add a "Assignment" to section "1" # behat_course::i_add_to_section()
- Given I set the following fields to these values: # behat_forms::i_set_the_following_fields_to_these_values()
- | Assignment name | Test assignment name |
- | Description | Submit your online text |
- | assignsubmission_onlinetext_enabled | 1 |
- | assignsubmission_file_enabled | 0 |
- | assignfeedback_comments_enabled | 1 |
- | assignfeedback_comments_commentinline | 1 |
- | assignfeedback_file_enabled | 1 |
- Given I press "Save and return to course" # behat_forms::press_button()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I follow "Log out" # behat_general::click_link()
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "student1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "student1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- And I follow "Test assignment name" # behat_general::click_link()
- And I press "Add submission" # behat_forms::press_button()
- And I set the following fields to these values: # behat_forms::i_set_the_following_fields_to_these_values()
- | Online text | I'm the student first submission |
- And I press "Save changes" # behat_forms::press_button()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I follow "Log out" # behat_general::click_link()
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- And I follow "Test assignment name" # behat_general::click_link()
- And I follow "View/grade all submissions" # behat_general::click_link()
- And I click on "Grade Student 1" "link" in the "Student 1" "table_row" # behat_general::i_click_on_in_the()
- And I set the following fields to these values: # behat_forms::i_set_the_following_fields_to_these_values()
- | Grade out of 100 | 50 |
- | Feedback comments | I'm the teacher feedback |
- And I upload "lib/tests/fixtures/empty.txt" file to "Feedback files" filemanager # behat_repository_upload::i_upload_file_to_filemanager()
- And I press "Save changes" # behat_forms::press_button()
- And I press "Continue" # behat_forms::press_button()
- Then I should see "50.00" in the "Student 1" "table_row" # behat_general::assert_element_contains_text()
- And I should see "Submitted for grading" in the "Student 1" "table_row" # behat_general::assert_element_contains_text()
- And I should see "Graded" in the "Student 1" "table_row" # behat_general::assert_element_contains_text()
- And I should see "I'm the student first submission" in the "Student 1" "table_row" # behat_general::assert_element_contains_text()
- And I should see "I'm the teacher feedback" in the "Student 1" "table_row" # behat_general::assert_element_contains_text()
- And I should see "empty.txt" in the "Student 1" "table_row" # behat_general::assert_element_contains_text()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I follow "Log out" # behat_general::click_link()
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "student1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "student1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- And I follow "Test assignment name" # behat_general::click_link()
- And I should see "Submitted for grading" in the "Submission status" "table_row" # behat_general::assert_element_contains_text()
- And I should see "Graded" in the "Grading status" "table_row" # behat_general::assert_element_contains_text()
- And I should see "I'm the student first submission" in the "Online text" "table_row" # behat_general::assert_element_contains_text()
- And I should see "I'm the teacher feedback" in the "Feedback comments" "table_row" # behat_general::assert_element_contains_text()
- And I should see "empty.txt" in the "Feedback files" "table_row" # behat_general::assert_element_contains_text()
- @mod @mod_assign @_file_upload
- Feature: In an assignment, students can upload files for assessment
- In order to complete my assignments providing files
- As a student
- I need to upload files from my file system to be assessed
- @javascript
- Scenario: Submit a file and update the submission with another file # /home/rajesh/moodles/integration/moodle/mod/assign/tests/behat/file_submission.feature:8
- Given the following "courses" exist: # behat_data_generators::the_following_exist()
- | fullname | shortname | category | groupmode |
- | Course 1 | C1 | 0 | 1 |
- And the following "users" exist: # behat_data_generators::the_following_exist()
- | username | firstname | lastname | email |
- | teacher1 | Teacher | 1 | teacher1@example.com |
- | student1 | Student | 1 | student1@example.com |
- And the following "course enrolments" exist: # behat_data_generators::the_following_exist()
- | user | course | role |
- | teacher1 | C1 | editingteacher |
- | student1 | C1 | student |
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- Given I press "Turn editing on" # behat_forms::press_button()
- Given I add a "Assignment" to section "1" # behat_course::i_add_to_section()
- Given I set the following fields to these values: # behat_forms::i_set_the_following_fields_to_these_values()
- | Assignment name | Test assignment name |
- | Description | Submit your online text |
- | assignsubmission_onlinetext_enabled | 0 |
- | assignsubmission_file_enabled | 1 |
- | Maximum number of uploaded files | 2 |
- Given I press "Save and return to course" # behat_forms::press_button()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I follow "Log out" # behat_general::click_link()
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "student1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "student1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- And I follow "Test assignment name" # behat_general::click_link()
- When I press "Add submission" # behat_forms::press_button()
- And I upload "lib/tests/fixtures/empty.txt" file to "File submissions" filemanager # behat_repository_upload::i_upload_file_to_filemanager()
- And I press "Save changes" # behat_forms::press_button()
- Then I should see "Submitted for grading" # behat_general::assert_page_contains_text()
- And I should see "Not graded" # behat_general::assert_page_contains_text()
- And "empty.txt" "link" should exist # behat_general::should_exist()
- And I press "Edit submission" # behat_forms::press_button()
- And I upload "lib/tests/fixtures/upload_users.csv" file to "File submissions" filemanager # behat_repository_upload::i_upload_file_to_filemanager()
- And ".ffilemanager .fm-maxfiles .fp-btn-add" "css_element" should not be visible # behat_general::should_not_be_visible()
- And I press "Save changes" # behat_forms::press_button()
- And I should see "Submitted for grading" # behat_general::assert_page_contains_text()
- And "empty.txt" "link" should exist # behat_general::should_exist()
- And "upload_users.csv" "link" should exist # behat_general::should_exist()
- And I press "Edit submission" # behat_forms::press_button()
- And ".ffilemanager .fm-maxfiles .fp-btn-add" "css_element" should not be visible # behat_general::should_not_be_visible()
- And I delete "empty.txt" from "File submissions" filemanager # behat_filepicker::i_delete_file_from_filemanager()
- And I press "Save changes" # behat_forms::press_button()
- And "empty.txt" "link" should not exist # behat_general::should_not_exist()
- And "upload_users.csv" "link" should exist # behat_general::should_exist()
- @mod @mod_forum @_file_upload
- Feature: Add forum activities and discussions
- In order to discuss topics with other users
- As a teacher
- I need to add forum activities to moodle courses
- @javascript
- Scenario: Add a forum and a discussion attaching files # /home/rajesh/moodles/integration/moodle/mod/forum/tests/behat/add_forum.feature:8
- Given the following "users" exist: # behat_data_generators::the_following_exist()
- | username | firstname | lastname | email |
- | teacher1 | Teacher | 1 | teacher1@example.com |
- | student1 | Student | 1 | student1@example.com |
- And the following "courses" exist: # behat_data_generators::the_following_exist()
- | fullname | shortname | category |
- | Course 1 | C1 | 0 |
- And the following "course enrolments" exist: # behat_data_generators::the_following_exist()
- | user | course | role |
- | teacher1 | C1 | editingteacher |
- | student1 | C1 | student |
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- Given I press "Turn editing on" # behat_forms::press_button()
- Given I add a "Forum" to section "1" # behat_course::i_add_to_section()
- Given I set the following fields to these values: # behat_forms::i_set_the_following_fields_to_these_values()
- | Forum name | Test forum name |
- | Forum type | Standard forum for general use |
- | Description | Test forum description |
- Given I press "Save and return to course" # behat_forms::press_button()
- Given I follow "Test forum name" # behat_general::click_link()
- Given I press "Add a new discussion topic" # behat_forms::press_button()
- Given I set the following fields to these values: # behat_forms::i_set_the_following_fields_to_these_values()
- | Subject | Forum post 1 |
- | Message | This is the body |
- Given I press "Post to forum" # behat_forms::press_button()
- Given I wait to be redirected # behat_general::i_wait_to_be_redirected()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I follow "Log out" # behat_general::click_link()
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "student1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "student1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- Given I follow "Test forum name" # behat_general::click_link()
- Given I press "Add a new discussion topic" # behat_forms::press_button()
- Given I set the following fields to these values: # behat_forms::i_set_the_following_fields_to_these_values()
- | Subject | Post with attachment |
- | Message | This is the body |
- | Attachment | lib/tests/fixtures/empty.txt |
- Given I press "Post to forum" # behat_forms::press_button()
- Given I wait to be redirected # behat_general::i_wait_to_be_redirected()
- Given I follow "Test forum name" # behat_general::click_link()
- Given I follow "Forum post 1" # behat_general::click_link()
- Given I follow "Reply" # behat_general::click_link()
- Given I set the following fields to these values: # behat_forms::i_set_the_following_fields_to_these_values()
- | Subject | Reply with attachment |
- | Message | This is the body |
- | Attachment | lib/tests/fixtures/upload_users.csv |
- Given I press "Post to forum" # behat_forms::press_button()
- Given I wait to be redirected # behat_general::i_wait_to_be_redirected()
- Then I should see "Reply with attachment" # behat_general::assert_page_contains_text()
- And I should see "upload_users.csv" # behat_general::assert_page_contains_text()
- And I follow "Test forum name" # behat_general::click_link()
- And I follow "Post with attachment" # behat_general::click_link()
- And I should see "empty.txt" # behat_general::assert_page_contains_text()
- And I follow "Edit" # behat_general::click_link()
- And the field "Attachment" matches value "empty.txt" # behat_forms::the_field_matches_value()
- @mod @mod_lesson
- Feature: In a lesson activity, teacher can import blackboard fill in the blank question
- As a teacher
- I need to import a fill in the blank question made in Blackboard in a lesson
- @javascript @_file_upload
- Scenario: Import fill in the blank question in a lesson # /home/rajesh/moodles/integration/moodle/mod/lesson/tests/behat/import_fillintheblank_question.feature:7
- Given the following "users" exist: # behat_data_generators::the_following_exist()
- | username | firstname | lastname | email |
- | teacher1 | Teacher | 1 | teacher1@example.com |
- | student1 | Student | 1 | student1@example.com |
- And the following "courses" exist: # behat_data_generators::the_following_exist()
- | fullname | shortname | category |
- | Course 1 | C1 | 0 |
- And the following "course enrolments" exist: # behat_data_generators::the_following_exist()
- | user | course | role |
- | teacher1 | C1 | editingteacher |
- | student1 | C1 | student |
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- When I am on homepage # behat_general::i_am_on_homepage()
- And I follow "Course 1" # behat_general::click_link()
- Given I press "Turn editing on" # behat_forms::press_button()
- Given I add a "Lesson" to section "1" # behat_course::i_add_to_section()
- Given I set the following fields to these values: # behat_forms::i_set_the_following_fields_to_these_values()
- | Name | Test lesson name |
- | Description | Test lesson description |
- Given I press "Save and return to course" # behat_forms::press_button()
- And I follow "Test lesson name" # behat_general::click_link()
- And I follow "Import questions" # behat_general::click_link()
- And I set the field "File format" to "Blackboard" # behat_forms::i_set_the_field_to()
- And I upload "mod/lesson/tests/fixtures/sample_blackboard_fib_qti.dat" file to "Upload" filemanager # behat_repository_upload::i_upload_file_to_filemanager()
- And I press "Import" # behat_forms::press_button()
- Then I should see "Importing 1 questions" # behat_general::assert_page_contains_text()
- And I should see "Name an amphibian: __________" # behat_general::assert_page_contains_text()
- And I press "Continue" # behat_forms::press_button()
- And I should not see "__________" # behat_general::assert_page_not_contains_text()
- And I should not see "Your answer" # behat_general::assert_page_not_contains_text()
- And I set the field "id_answer" to "frog" # behat_forms::i_set_the_field_to()
- And I press "Submit" # behat_forms::press_button()
- And I should see "Your answer : frog" # behat_general::assert_page_contains_text()
- And I should see "A frog is an amphibian" # behat_general::assert_page_contains_text()
- And I press "Continue" # behat_forms::press_button()
- And I should see "Congratulations - end of lesson reached" # behat_general::assert_page_contains_text()
- @mod @mod_lesson
- Feature: In a lesson activity, teacher can import embedded images in questions answers and responses
- As a teacher
- I need to import a question with images in answers and responses in a lesson
- @javascript @_file_upload
- Scenario: Import questions with images in answers and responses in a lesson # /home/rajesh/moodles/integration/moodle/mod/lesson/tests/behat/import_images.feature:7
- Given the following "users" exist: # behat_data_generators::the_following_exist()
- | username | firstname | lastname | email |
- | teacher1 | Teacher | 1 | teacher1@example.com |
- | student1 | Student | 1 | student1@example.com |
- And the following "courses" exist: # behat_data_generators::the_following_exist()
- | fullname | shortname | category |
- | Course 1 | C1 | 0 |
- And the following "course enrolments" exist: # behat_data_generators::the_following_exist()
- | user | course | role |
- | teacher1 | C1 | editingteacher |
- | student1 | C1 | student |
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- When I am on homepage # behat_general::i_am_on_homepage()
- And I follow "Course 1" # behat_general::click_link()
- Given I press "Turn editing on" # behat_forms::press_button()
- Given I add a "Lesson" to section "1" # behat_course::i_add_to_section()
- Given I set the following fields to these values: # behat_forms::i_set_the_following_fields_to_these_values()
- | Name | Test lesson name |
- | Description | Test lesson description |
- Given I press "Save and return to course" # behat_forms::press_button()
- And I follow "Test lesson name" # behat_general::click_link()
- And I follow "Import questions" # behat_general::click_link()
- And I set the field "File format" to "Moodle XML format" # behat_forms::i_set_the_field_to()
- And I upload "mod/lesson/tests/fixtures/multichoice.xml" file to "Upload" filemanager # behat_repository_upload::i_upload_file_to_filemanager()
- And I press "Import" # behat_forms::press_button()
- Then I should see "Importing 1 questions" # behat_general::assert_page_contains_text()
- And I should see "bonjour.mp3" # behat_general::assert_page_contains_text()
- And I should see "What language is being spoken?" # behat_general::assert_page_contains_text()
- And I press "Continue" # behat_forms::press_button()
- And I should see "What language is being spoken?" # behat_general::assert_page_contains_text()
- And "//*[contains(@class, 'answeroption')]//img[contains(@src, 'pluginfile.php')]" "xpath_element" should exist # behat_general::should_exist()
- And "//*[contains(@class, 'answeroption')]//img[contains(@src, 'flag-france.jpg')]" "xpath_element" should exist # behat_general::should_exist()
- @mod @mod_lesson @_file_upload
- Feature: In a lesson activity, teacher can add an essay question
- As a teacher
- I need to add an essay question in a lesson and grade student attempts
- @javascript
- Scenario: questions with essay question # /home/rajesh/moodles/integration/moodle/mod/lesson/tests/behat/lesson_essay_question.feature:7
- Given the following "users" exist: # behat_data_generators::the_following_exist()
- | username | firstname | lastname | email |
- | teacher1 | Teacher | 1 | teacher1@example.com |
- | student1 | Student | 1 | student1@example.com |
- And the following "courses" exist: # behat_data_generators::the_following_exist()
- | fullname | shortname | category |
- | Course 1 | C1 | 0 |
- And the following "course enrolments" exist: # behat_data_generators::the_following_exist()
- | user | course | role |
- | teacher1 | C1 | editingteacher |
- | student1 | C1 | student |
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- Given I press "Turn editing on" # behat_forms::press_button()
- Given I add a "Lesson" to section "1" # behat_course::i_add_to_section()
- Given I set the following fields to these values: # behat_forms::i_set_the_following_fields_to_these_values()
- | Name | Test lesson name |
- | Description | Test lesson description |
- | Use default feedback | Yes |
- Given I press "Save and return to course" # behat_forms::press_button()
- And I follow "Test lesson name" # behat_general::click_link()
- And I follow "Add a question page" # behat_general::click_link()
- And I set the field "Select a question type" to "Essay" # behat_forms::i_set_the_field_to()
- And I press "Add a question page" # behat_forms::press_button()
- And I set the following fields to these values: # behat_forms::i_set_the_following_fields_to_these_values()
- | Page title | Essay question |
- | Page contents | <p>Please write a story about a <b>frog</b>.</p> |
- And I press "Save page" # behat_forms::press_button()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I follow "Log out" # behat_general::click_link()
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "student1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "student1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- When I follow "Test lesson name" # behat_general::click_link()
- Then I should see "Please write a story about a frog." # behat_general::assert_page_contains_text()
- And I set the field "Your answer" to "<p>Once upon a time there was a little <b>green</b> frog." # behat_forms::i_set_the_field_to()
- And I press "Submit" # behat_forms::press_button()
- And I should see "Your answer" # behat_general::assert_page_contains_text()
- And I should see "Once upon a time there was a little green frog." # behat_general::assert_page_contains_text()
- And I should not see "<b>" # behat_general::assert_page_not_contains_text()
- And I press "Continue" # behat_forms::press_button()
- And I should see "Congratulations - end of lesson reached" # behat_general::assert_page_contains_text()
- And I should see "You earned 0 out of 0 for the automatically graded questions." # behat_general::assert_page_contains_text()
- And I should see "Your 1 essay question(s) will be graded and added into your final score at a later date." # behat_general::assert_page_contains_text()
- And I should see "Your current grade without the essay question(s) is 0 out of 1." # behat_general::assert_page_contains_text()
- When I click on "//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]" "xpath_element" # behat_general::i_click_on()
- When I follow "Log out" # behat_general::click_link()
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Course 1" # behat_general::click_link()
- And I follow "Test lesson name" # behat_general::click_link()
- And I follow "Grade essays" # behat_general::click_link()
- And I should see "Student 1" # behat_general::assert_page_contains_text()
- And I should see "Essay question" # behat_general::assert_page_contains_text()
- And I follow "Essay question" # behat_general::click_link()
- And I should see "Student 1's response" # behat_general::assert_page_contains_text()
- And I should see "Once upon a time there was a little green frog." # behat_general::assert_page_contains_text()
- And I set the following fields to these values: # behat_forms::i_set_the_following_fields_to_these_values()
- | Your comments | <p>Well <b>done</b>.</p> |
- | Essay score | 1 |
- And I press "Save changes" # behat_forms::press_button()
- And I should see "Changes saved" # behat_general::assert_page_contains_text()
- And I follow "Reports" # behat_general::click_link()
- And I should see "Student 1" # behat_general::assert_page_contains_text()
- And I click on ".lesson-attempt-link" "css_element" in the "Student 1" "table_row" # behat_general::i_click_on_in_the()
- And I should see "Essay: Essay question" # behat_general::assert_page_contains_text()
- And I should see "Please write a story about a frog." # behat_general::assert_page_contains_text()
- And I should see "Once upon a time there was a little green frog." # behat_general::assert_page_contains_text()
- And I should see "Well done." # behat_general::assert_page_contains_text()
- And I should not see "<b>" # behat_general::assert_page_not_contains_text()
- @mod @mod_lesson
- Feature: In a lesson activity, teacher can add embedded images in questions answers and responses
- As a teacher
- I need to add questions with images in answers and responses
- @javascript @_file_upload
- Scenario: questions with images in answers and responses # /home/rajesh/moodles/integration/moodle/mod/lesson/tests/behat/questions_images.feature:7
- Given the following "users" exist: # behat_data_generators::the_following_exist()
- | username | firstname | lastname | email |
- | teacher1 | Teacher | 1 | teacher1@example.com |
- | student1 | Student | 1 | student1@example.com |
- And the following "courses" exist: # behat_data_generators::the_following_exist()
- | fullname | shortname | category |
- | Course 1 | C1 | 0 |
- And the following "course enrolments" exist: # behat_data_generators::the_following_exist()
- | user | course | role |
- | teacher1 | C1 | editingteacher |
- | student1 | C1 | student |
- Given I click on "Log in" "link" in the ".logininfo" "css_element" # behat_general::i_click_on_in_the()
- Given I set the field "Username" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I set the field "Password" to "teacher1" # behat_forms::i_set_the_field_to()
- Given I press "Log in" # behat_forms::press_button()
- And I follow "Manage private files" # behat_general::click_link()
- And I upload "mod/lesson/tests/fixtures/moodle_logo.jpg" file to "Files" filemanager # behat_repository_upload::i_upload_file_to_filemanager()
- And I click on "Save changes" "button" # behat_general::i_click_on()
- When I am on homepage # behat_general::i_am_on_homepage()
- And I follow "Course 1" # behat_general::click_link()
- Given I press "Turn editing on" # behat_forms::press_button()
- Given I add a "Lesson" to section "1" # behat_course::i_add_to_section()
- Given I set the following fields to these values: # behat_forms::i_set_the_following_fields_to_these_values()
- | Name | Test lesson name |
- | Description | Test lesson description |
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement