Feature: Add a comment to the comments block

In order to comment on a conversation or a topic
As a user
In need to add comments to courses

Background: /private/srv/www/loganberry.local/data/40975/moodle/blocks/comments/tests/behat/add_comment.feature:7

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  2. And the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher Frist teacher1@asd.com
    student1 Student First student1@asd.com
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add the "Comments" block behat_blocks::i_add_the_block()
  8. And I log out behat_auth::i_log_out()
  9. And I log in as "student1" behat_auth::i_log_in_as()
  10. And I follow "Course 1" behat_general::click_link()
  • @javascript

Scenario: Add a comment with Javascript enabled /private/srv/www/loganberry.local/data/40975/moodle/blocks/comments/tests/behat/add_comment.feature:28

  1. When I add "I'm a comment from student1" comment to comments block behat_block_comments::i_add_comment_to_comments_block()
  2. Then I should see "I'm a comment from student1" behat_general::assert_page_contains_text()

Scenario: Add a comment with Javascript disabled /private/srv/www/loganberry.local/data/40975/moodle/blocks/comments/tests/behat/add_comment.feature:32

  1. When I follow "Show comments" behat_general::click_link()
  2. And I add "I'm a comment from student1" comment to comments block behat_block_comments::i_add_comment_to_comments_block()
  3. Then I should see "I'm a comment from student1" behat_general::assert_page_contains_text()

Feature: Delete comment block messages

In order to refine comment block's contents
As a teacher
In need to delete comments from courses

  • @javascript

Scenario: Delete comments with Javascript enabled /private/srv/www/loganberry.local/data/40975/moodle/blocks/comments/tests/behat/delete_comment.feature:8

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  2. And the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher First teacher1@asd.com
    student1 Student First student1@asd.com
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add the "Comments" block behat_blocks::i_add_the_block()
  8. And I log out behat_auth::i_log_out()
  9. And I log in as "student1" behat_auth::i_log_in_as()
  10. And I follow "Course 1" behat_general::click_link()
  11. And I add "Comment from student1" comment to comments block behat_block_comments::i_add_comment_to_comments_block()
  12. And I log out behat_auth::i_log_out()
  13. And I log in as "teacher1" behat_auth::i_log_in_as()
  14. And I follow "Course 1" behat_general::click_link()
  15. And I add "Comment from teacher1" comment to comments block behat_block_comments::i_add_comment_to_comments_block()
  16. When I delete "Comment from student1" comment from comments block behat_block_comments::i_delete_comment_from_comments_block()
  17. Then I should not see "Comment from student1" behat_general::assert_page_not_contains_text()
  18. And I delete "Comment from teacher1" comment from comments block behat_block_comments::i_delete_comment_from_comments_block()
  19. And I should not see "Comment from teacher1" behat_general::assert_page_not_contains_text()

Feature: View my courses in navigation block

In order to navigate to my courses
As a student
I need my courses displayed in the navigation block

Background: /private/srv/www/loganberry.local/data/40975/moodle/blocks/navigation/tests/behat/view_my_courses.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    student1 Student 1 student1@asd.com
  2. And the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    cat1 0 cat1
    cat2 0 cat2
    cat3 0 cat3
    cat31 cat3 cat31
    cat32 cat3 cat32
    cat33 cat3 cat33
  3. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course1 c1 cat1
    Course2 c2 cat2
    Course31 c31 cat31
    Course32 c32 cat32
    Course331 c331 cat33
    Course332 c332 cat33
  4. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    student1 c1 student
    student1 c31 student
    student1 c331 student
  5. And I log in as "admin" behat_auth::i_log_in_as()
  • @javascript

Scenario: The plain list of enrolled courses is shown /private/srv/www/loganberry.local/data/40975/moodle/blocks/navigation/tests/behat/view_my_courses.feature:35

  1. Given I set the following administration settings values: behat_admin::i_set_the_following_administration_settings_values()
    Show my course categories 0
  2. And I log out behat_auth::i_log_out()
  3. And I log in as "student1" behat_auth::i_log_in_as()
  4. When I follow "My home" behat_general::click_link()
  5. Then I should not see "cat1" in the "Navigation" "block" behat_general::assert_element_not_contains_text()
  6. And I should not see "cat2" in the "Navigation" "block" behat_general::assert_element_not_contains_text()
  7. And I should see "c1" in the "Navigation" "block" behat_general::assert_element_contains_text()
  8. And I should see "c31" in the "Navigation" "block" behat_general::assert_element_contains_text()
  9. And I should see "c331" in the "Navigation" "block" behat_general::assert_element_contains_text()
  10. And I should not see "c2" in the "Navigation" "block" behat_general::assert_element_not_contains_text()
  11. And I should not see "c32" in the "Navigation" "block" behat_general::assert_element_not_contains_text()
  12. And I should not see "c332" in the "Navigation" "block" behat_general::assert_element_not_contains_text()
  • @javascript

Scenario: The nested list of enrolled courses is shown /private/srv/www/loganberry.local/data/40975/moodle/blocks/navigation/tests/behat/view_my_courses.feature:51

  1. Given I set the following administration settings values: behat_admin::i_set_the_following_administration_settings_values()
    Show my course categories 1
  2. And I log out behat_auth::i_log_out()
  3. And I log in as "student1" behat_auth::i_log_in_as()
  4. When I follow "My home" behat_general::click_link()
  5. Then I should see "cat1" in the "Navigation" "block" behat_general::assert_element_contains_text()
  6. And I should see "cat3" in the "Navigation" "block" behat_general::assert_element_contains_text()
  7. And I should not see "cat2" in the "Navigation" "block" behat_general::assert_element_not_contains_text()
  8. And I expand "cat3" node behat_navigation::i_expand_node()
  9. And I wait "2" seconds behat_general::i_wait_seconds()
  10. And I should see "cat31" in the "Navigation" "block" behat_general::assert_element_contains_text()
  11. And I should see "cat33" in the "Navigation" "block" behat_general::assert_element_contains_text()
  12. And I should not see "cat32" in the "Navigation" "block" behat_general::assert_element_not_contains_text()
  13. And I expand "cat31" node behat_navigation::i_expand_node()
  14. And I wait "2" seconds behat_general::i_wait_seconds()
  15. And I should see "c31" in the "Navigation" "block" behat_general::assert_element_contains_text()
  16. And I expand "cat33" node behat_navigation::i_expand_node()
  17. And I wait "2" seconds behat_general::i_wait_seconds()
  18. And I should see "c331" in the "Navigation" "block" behat_general::assert_element_contains_text()
  19. And I should not see "c332" in the "Navigation" "block" behat_general::assert_element_not_contains_text()

Feature: Add or remove items from the TinyMCE editor toolbar

In order to customize the TinyMCE editor appearance
As an admin
I need to add and remove items from the toolbar

Background: /private/srv/www/loganberry.local/data/40975/moodle/lib/editor/tinymce/tests/behat/edit_available_icons.feature:7

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  2. And I log in as "admin" behat_auth::i_log_in_as()
  • @javascript

Scenario: Remove icons /private/srv/www/loganberry.local/data/40975/moodle/lib/editor/tinymce/tests/behat/edit_available_icons.feature:14

  1. When I set the following administration settings values: behat_admin::i_set_the_following_administration_settings_values()
    Editor toolbar fontselect,fontsizeselect,formatselect,|,undo,redo,|,search,replace,|,fullscreen
  2. And I am on homepage behat_general::i_am_on_homepage()
  3. And I follow "Course 1" behat_general::click_link()
  4. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  5. And I add a "Database" to section "1" behat_course::i_add_to_section()
  6. Then "#id_introeditor_tbl .mce_bold" "css_element" should not exists behat_general::should_not_exists()
  7. And "#id_introeditor_tbl .mce_fullscreen" "css_element" should exists behat_general::should_exists()
  8. And I press "Cancel" behat_forms::press_button()
  • @javascript

Scenario: Add icons /private/srv/www/loganberry.local/data/40975/moodle/lib/editor/tinymce/tests/behat/edit_available_icons.feature:26

  1. When I set the following administration settings values: behat_admin::i_set_the_following_administration_settings_values()
    Editor toolbar fontselect,fontsizeselect,formatselect,|,undo,redo,|,search,replace,|,fullscreen,anchor
  2. And I am on homepage behat_general::i_am_on_homepage()
  3. And I follow "Course 1" behat_general::click_link()
  4. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  5. And I add a "Database" to section "1" behat_course::i_add_to_section()
  6. Then "#id_introeditor_tbl .mce_bold" "css_element" should not exists behat_general::should_not_exists()
  7. And "#id_introeditor_tbl .mce_anchor" "css_element" should exists behat_general::should_exists()
  8. And I set the following administration settings values: behat_admin::i_set_the_following_administration_settings_values()
    Editor toolbar fontselect,fontsizeselect,formatselect,|,undo,redo,|,search,replace,|,fullscreen
  9. And I am on homepage behat_general::i_am_on_homepage()
  10. And I follow "Course 1" behat_general::click_link()
  11. And I add a "Database" to section "1" behat_course::i_add_to_section()
  12. And "#id_introeditor_tbl .mce_anchor" "css_element" should not exists behat_general::should_not_exists()
  13. And I press "Cancel" behat_forms::press_button()
  • @javascript

Scenario: Default icons /private/srv/www/loganberry.local/data/40975/moodle/lib/editor/tinymce/tests/behat/edit_available_icons.feature:44

  1. Given I follow "Course 1" behat_general::click_link()
  2. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  3. When I add a "Database" to section "1" behat_course::i_add_to_section()
  4. Then "#id_introeditor_tbl .mce_bold" "css_element" should exists behat_general::should_exists()
  5. And "#id_introeditor_tbl .mce_anchor" "css_element" should not exists behat_general::should_not_exists()
  6. And I press "Cancel" behat_forms::press_button()

Feature: Guest users can auto-enrol themself in courses where guest access is allowed

In order to access courses contents
As a guest
I need to access courses as a guest

Background: /private/srv/www/loganberry.local/data/40975/moodle/enrol/guest/tests/behat/guest_access.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname format
    Course 1 C1 topics
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name
    Description Test forum description
  8. And I click on "Edit settings" "link" in the "Administration" "block" behat_general::i_click_on_in_the()
  • @javascript

Scenario: Allow guest access without password /private/srv/www/loganberry.local/data/40975/moodle/enrol/guest/tests/behat/guest_access.feature:27

  1. Given I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Allow guest access Yes
  2. And I press "Save changes" behat_forms::press_button()
  3. And I log out behat_auth::i_log_out()
  4. And I log in as "student1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. When I follow "Test forum name" behat_general::click_link()
  7. Then I should not see "Subscribe to this forum" behat_general::assert_page_not_contains_text()
  • @javascript

Scenario: Allow guest access with password /private/srv/www/loganberry.local/data/40975/moodle/enrol/guest/tests/behat/guest_access.feature:38

  1. Given I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Allow guest access Yes
    Password moodle_rules
  2. And I press "Save changes" behat_forms::press_button()
  3. And I log out behat_auth::i_log_out()
  4. And I log in as "student1" behat_auth::i_log_in_as()
  5. When I follow "Course 1" behat_general::click_link()
  6. Then I should see "Guest access" behat_general::assert_page_contains_text()
  7. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Password moodle_rules
  8. And I press "Submit" behat_forms::press_button()
  9. And I should see "Test forum name" behat_general::assert_page_contains_text()

Feature: Users can auto-enrol themself in courses where self enrolment is allowed

In order to participate in courses
As a user
I need to auto enrol me in courses

Background: /private/srv/www/loganberry.local/data/40975/moodle/enrol/self/tests/behat/self_enrolment.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname format
    Course 1 C1 topics
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  • @javascript

Scenario: Self-enrolment enabled /private/srv/www/loganberry.local/data/40975/moodle/enrol/self/tests/behat/self_enrolment.feature:20

  1. Given I log in as "teacher1" behat_auth::i_log_in_as()
  2. And I follow "Course 1" behat_general::click_link()
  3. When I add "Self enrolment" enrolment method with: behat_enrol::i_add_enrolment_method_with()
    Custom instance name Test student enrolment
  4. And I log out behat_auth::i_log_out()
  5. And I log in as "student1" behat_auth::i_log_in_as()
  6. And I follow "Course 1" behat_general::click_link()
  7. And I press "Enrol me" behat_forms::press_button()
  8. Then I should see "Topic 1" behat_general::assert_page_contains_text()
  9. And I should not see "Enrolment options" behat_general::assert_page_not_contains_text()
  • @javascript

Scenario: Self-enrolment enabled requiring an enrolment key /private/srv/www/loganberry.local/data/40975/moodle/enrol/self/tests/behat/self_enrolment.feature:33

  1. Given I log in as "teacher1" behat_auth::i_log_in_as()
  2. And I follow "Course 1" behat_general::click_link()
  3. When I add "Self enrolment" enrolment method with: behat_enrol::i_add_enrolment_method_with()
    Custom instance name Test student enrolment
    Enrolment key moodle_rules
  4. And I log out behat_auth::i_log_out()
  5. And I log in as "student1" behat_auth::i_log_in_as()
  6. And I follow "Course 1" behat_general::click_link()
  7. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Enrolment key moodle_rules
  8. And I press "Enrol me" behat_forms::press_button()
  9. Then I should see "Topic 1" behat_general::assert_page_contains_text()
  10. And I should not see "Enrolment options" behat_general::assert_page_not_contains_text()
  11. And I should not see "Enrol me in this course" behat_general::assert_page_not_contains_text()
  • @javascript

Scenario: Self-enrolment disabled /private/srv/www/loganberry.local/data/40975/moodle/enrol/self/tests/behat/self_enrolment.feature:50

  1. Given I log in as "student1" behat_auth::i_log_in_as()
  2. When I follow "Course 1" behat_general::click_link()
  3. Then I should see "You can not enrol yourself in this course" behat_general::assert_page_contains_text()
  • @javascript

Scenario: Self-enrolment enabled requiring a group enrolment key /private/srv/www/loganberry.local/data/40975/moodle/enrol/self/tests/behat/self_enrolment.feature:56

  1. Given I log in as "teacher1" behat_auth::i_log_in_as()
  2. And I follow "Course 1" behat_general::click_link()
  3. When I add "Self enrolment" enrolment method with: behat_enrol::i_add_enrolment_method_with()
    Custom instance name Test student enrolment
    Enrolment key moodle_rules
    Use group enrolment keys Yes
  4. And I follow "Groups" behat_general::click_link()
  5. And I press "Create group" behat_forms::press_button()
  6. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Group name Group 1
    Enrolment key testgroupenrolkey
  7. And I press "Save changes" behat_forms::press_button()
  8. And I log out behat_auth::i_log_out()
  9. And I log in as "student1" behat_auth::i_log_in_as()
  10. And I follow "Course 1" behat_general::click_link()
  11. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Enrolment key testgroupenrolkey
  12. And I press "Enrol me" behat_forms::press_button()
  13. Then I should see "Topic 1" behat_general::assert_page_contains_text()
  14. And I should not see "Enrolment options" behat_general::assert_page_not_contains_text()
  15. And I should not see "Enrol me in this course" behat_general::assert_page_not_contains_text()

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 /private/srv/www/loganberry.local/data/40975/moodle/mod/assign/tests/behat/file_submission.feature:8

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category groupmode
    Course 1 C1 0 1
  2. And the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Assignment" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Assignment name Test assignment name
    Description Submit your online text
    assignsubmission_onlinetext_enabled 0
    assignsubmission_file_enabled 1
    Maximum number of uploaded files 2
  8. And I log out behat_auth::i_log_out()
  9. And I log in as "student1" behat_auth::i_log_in_as()
  10. And I follow "Course 1" behat_general::click_link()
  11. And I follow "Test assignment name" behat_general::click_link()
  12. When I press "Add submission" behat_forms::press_button()
  13. And I upload "lib/tests/fixtures/empty.txt" file to "File submissions" filepicker behat_repository_upload::i_upload_file_to_filepicker()
  14. And I press "Save changes" behat_forms::press_button()
  15. Then I should see "Submitted for grading" behat_general::assert_page_contains_text()
  16. And I should see "empty.txt" behat_general::assert_page_contains_text()
  17. And I should see "Not graded" behat_general::assert_page_contains_text()
  18. And I press "Edit submission" behat_forms::press_button()
  19. And I upload "lib/tests/fixtures/upload_users.csv" file to "File submissions" filepicker behat_repository_upload::i_upload_file_to_filepicker()
  20. And ".ffilemanager .fm-maxfiles .fp-btn-add" "css_element" should exists behat_general::should_exists()
  21. And I press "Save changes" behat_forms::press_button()
  22. And I should see "Submitted for grading" behat_general::assert_page_contains_text()
  23. And I should see "empty.txt" behat_general::assert_page_contains_text()
  24. And I should see "upload_users.csv" behat_general::assert_page_contains_text()
  25. And I press "Edit submission" behat_forms::press_button()
  26. And ".ffilemanager .fm-maxfiles .fp-btn-add" "css_element" should exists behat_general::should_exists()

Feature: Group assignment submissions

In order to allow students to work collaboratively on an assignment
As a teacher
I need to group submissions in groups

  • @javascript

Scenario: Switch between group modes /private/srv/www/loganberry.local/data/40975/moodle/mod/assign/tests/behat/group_submission.feature:8

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category groupmode
    Course 1 C1 0 1
  2. And the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student0 Student 0 student0@asd.com
    student1 Student 1 student1@asd.com
    student2 Student 2 student2@asd.com
    student3 Student 3 student3@asd.com
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student0 C1 student
    student1 C1 student
    student2 C1 student
    student3 C1 student
  4. And the following "groups" exists: behat_data_generators::the_following_exists()
    name course idnumber
    Group 1 C1 G1
  5. And I log in as "teacher1" behat_auth::i_log_in_as()
  6. And I follow "Course 1" behat_general::click_link()
  7. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  8. And I add a "Assignment" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Assignment name Test assignment name
    Description Test assignment description
    Students submit in groups Yes
    Group mode No groups
  9. And I follow "Test assignment name" behat_general::click_link()
  10. When I follow "View/grade all submissions" behat_general::click_link()
  11. Then "//tr[contains(., 'Student 0')][contains(., 'Default group')]" "xpath_element" should exists behat_general::should_exists()
  12. And "//tr[contains(., 'Student 1')][contains(., 'Default group')]" "xpath_element" should exists behat_general::should_exists()
  13. And "//tr[contains(., 'Student 2')][contains(., 'Default group')]" "xpath_element" should exists behat_general::should_exists()
  14. And "//tr[contains(., 'Student 3')][contains(., 'Default group')]" "xpath_element" should exists behat_general::should_exists()
  15. And I follow "Edit settings" behat_general::click_link()
  16. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Group mode Separate groups
  17. And I press "Save and return to course" behat_forms::press_button()
  18. And I click on "Edit settings" "link" in the "Administration" "block" behat_general::i_click_on_in_the()
  19. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Group mode Separate groups
  20. And I press "Save changes" behat_forms::press_button()
  21. And I expand "Users" node behat_navigation::i_expand_node()
  22. And I follow "Groups" behat_general::click_link()
  23. And I add "student0" user to "Group 1" group behat_groups::i_add_user_to_group()
  24. And I add "student1" user to "Group 1" group behat_groups::i_add_user_to_group()
  25. And I follow "Course 1" behat_general::click_link()
  26. And I follow "Test assignment name" behat_general::click_link()
  27. And I follow "View/grade all submissions" behat_general::click_link()
  28. And "//tr[contains(., 'Student 0')][contains(., 'Group 1')]" "xpath_element" should exists behat_general::should_exists()
  29. And "//tr[contains(., 'Student 1')][contains(., 'Group 1')]" "xpath_element" should exists behat_general::should_exists()
  30. And I should not see "Student 2" behat_general::assert_page_not_contains_text()
  31. And I select "All participants" from "Separate groups" behat_forms::select_option()
  32. And "//tr[contains(., 'Student 0')][contains(., 'Group 1')]" "xpath_element" should exists behat_general::should_exists()
  33. And "//tr[contains(., 'Student 1')][contains(., 'Group 1')]" "xpath_element" should exists behat_general::should_exists()
  34. And "//tr[contains(., 'Student 2')][contains(., 'Default group')]" "xpath_element" should exists behat_general::should_exists()
  35. And "//tr[contains(., 'Student 3')][contains(., 'Default group')]" "xpath_element" should exists behat_general::should_exists()

Feature: In an assignment, students can add and edit text online

In order to complete my submissions online
As a student
I need to submit my assignment editing an online form

  • @javascript

Scenario: Submit a text online and edit the submission /private/srv/www/loganberry.local/data/40975/moodle/mod/assign/tests/behat/online_submissions.feature:8

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category groupmode
    Course 1 C1 0 1
  2. And the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Assignment" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Assignment name Test assignment name
    Description Submit your online text
    assignsubmission_onlinetext_enabled 1
    assignsubmission_file_enabled 0
  8. And I log out behat_auth::i_log_out()
  9. And I log in as "student1" behat_auth::i_log_in_as()
  10. And I follow "Course 1" behat_general::click_link()
  11. And I follow "Test assignment name" behat_general::click_link()
  12. When I press "Add submission" behat_forms::press_button()
  13. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Online text I'm the student first submission
  14. And I press "Save changes" behat_forms::press_button()
  15. Then I should see "Submitted for grading" behat_general::assert_page_contains_text()
  16. And I should see "I'm the student first submission" behat_general::assert_page_contains_text()
  17. And I should see "Not graded" behat_general::assert_page_contains_text()
  18. And I press "Edit submission" behat_forms::press_button()
  19. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Online text I'm the student second submission
  20. And I press "Save changes" behat_forms::press_button()
  21. Then I should see "Submitted for grading" behat_general::assert_page_contains_text()
  22. And I should see "I'm the student second submission" behat_general::assert_page_contains_text()
  23. And I should not see "I'm the student first submission" behat_general::assert_page_not_contains_text()

Feature: Prevent or allow assignment submission changes

In order to control when a student can change his/her submission
As a teacher
I need to prevent or allow student submission at any time

  • @javascript

Scenario: Preventing changes and allowing them again /private/srv/www/loganberry.local/data/40975/moodle/mod/assign/tests/behat/prevent_submission_changes.feature:8

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category groupmode
    Course 1 C1 0 1
  2. And the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Assignment" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Assignment name Test assignment name
    Description Submit your online text
    assignsubmission_onlinetext_enabled 1
    assignsubmission_file_enabled 0
  8. And I log out behat_auth::i_log_out()
  9. And I log in as "student1" behat_auth::i_log_in_as()
  10. And I follow "Course 1" behat_general::click_link()
  11. And I follow "Test assignment name" behat_general::click_link()
  12. And I press "Add submission" behat_forms::press_button()
  13. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Online text I'm the student submission
  14. And I press "Save changes" behat_forms::press_button()
  15. And I press "Edit submission" behat_forms::press_button()
  16. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Online text I'm the student submission and he/she edited me
  17. And I press "Save changes" behat_forms::press_button()
  18. And I log out behat_auth::i_log_out()
  19. And I log in as "teacher1" behat_auth::i_log_in_as()
  20. And I follow "Course 1" behat_general::click_link()
  21. And I follow "Test assignment name" behat_general::click_link()
  22. When I follow "View/grade all submissions" behat_general::click_link()
  23. And I click on "//tr[contains(., 'Student 1')]/descendant::td/descendant::img[@alt='Actions']/parent::a" "xpath_element" behat_general::i_click_on()
  24. And I follow "Prevent submission changes" behat_general::click_link()
  25. Then I should see "Submission changes not allowed" behat_general::assert_page_contains_text()
  26. And I log out behat_auth::i_log_out()
  27. And I log in as "student1" behat_auth::i_log_in_as()
  28. And I follow "Course 1" behat_general::click_link()
  29. And I follow "Test assignment name" behat_general::click_link()
  30. And "Edit submission" "button" should not exists behat_general::should_not_exists()
  31. And I should see "This assignment is not accepting submissions" behat_general::assert_page_contains_text()
  32. And I log out behat_auth::i_log_out()
  33. And I log in as "teacher1" behat_auth::i_log_in_as()
  34. And I follow "Course 1" behat_general::click_link()
  35. And I follow "Test assignment name" behat_general::click_link()
  36. And I follow "View/grade all submissions" behat_general::click_link()
  37. And I click on "//tr[contains(., 'Student 1')]/descendant::td/descendant::img[@alt='Actions']/parent::a" "xpath_element" behat_general::i_click_on()
  38. And I follow "Allow submission changes" behat_general::click_link()
  39. And I log out behat_auth::i_log_out()
  40. And I log in as "student1" behat_auth::i_log_in_as()
  41. And I follow "Course 1" behat_general::click_link()
  42. And I follow "Test assignment name" behat_general::click_link()
  43. And I should not see "This assignment is not accepting submissions" behat_general::assert_page_not_contains_text()
  44. And I press "Edit submission" behat_forms::press_button()
  45. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Online text I'm the student submission edited again
  46. And I press "Save changes" behat_forms::press_button()
  47. And I should see "I'm the student submission edited again" behat_general::assert_page_contains_text()

Feature: Add choice activity

In order to ask questions as a choice of multiple responses
As a teacher
I need to add choice activities to courses

  • @javascript

Scenario: Add a choice activity and complete the activity as a student /private/srv/www/loganberry.local/data/40975/moodle/mod/choice/tests/behat/add_choice.feature:8

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Choice" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Choice name Choice name
    Choice Description
    Option 1
    Option 2
  8. And I log out behat_auth::i_log_out()
  9. When I log in as "student1" behat_auth::i_log_in_as()
  10. And I follow "Course 1" behat_general::click_link()
  11. And I choose "Option 1" from "Choice name" choice activity behat_mod_choice::I_choose_option_from_activity()
  12. Then I should see "Your selection: Option 1" behat_general::assert_page_contains_text()
  13. And I should see "Your choice has been saved" behat_general::assert_page_contains_text()

Feature: Teacher can choose whether to allow students to change their choice response

In order to allow students to change their choice
As a teacher
I need to enable the option to change the choice

  • @javascript

Scenario: Add a choice activity and complete the activity as a student /private/srv/www/loganberry.local/data/40975/moodle/mod/choice/tests/behat/change_response.feature:8

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Choice" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Choice name Choice name
    Choice Description
    No
    Option 1
    Option 2
  8. And I log out behat_auth::i_log_out()
  9. When I log in as "student1" behat_auth::i_log_in_as()
  10. And I follow "Course 1" behat_general::click_link()
  11. And I choose "Option 1" from "Choice name" choice activity behat_mod_choice::I_choose_option_from_activity()
  12. Then I should see "Your selection: Option 1" behat_general::assert_page_contains_text()
  13. And I should see "Your choice has been saved" behat_general::assert_page_contains_text()
  14. And "Save my choice" "button" should not exists behat_general::should_not_exists()
  15. And I log out behat_auth::i_log_out()
  16. And I log in as "teacher1" behat_auth::i_log_in_as()
  17. And I follow "Course 1" behat_general::click_link()
  18. And I follow "Choice name" behat_general::click_link()
  19. And I follow "Edit settings" behat_general::click_link()
  20. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Allow choice to be updated Yes
  21. And I press "Save and display" behat_forms::press_button()
  22. And I log out behat_auth::i_log_out()
  23. And I log in as "student1" behat_auth::i_log_in_as()
  24. And I follow "Course 1" behat_general::click_link()
  25. And I follow "Choice name" behat_general::click_link()
  26. And I should see "Your selection: Option 1" behat_general::assert_page_contains_text()
  27. And "Save my choice" "button" should exists behat_general::should_exists()
  28. And "Remove my choice" "link" should exists behat_general::should_exists()
  29. And I select "Option 2" radio button behat_forms::select_radio()
  30. And I press "Save my choice" behat_forms::press_button()
  31. And I should see "Your choice has been saved" behat_general::assert_page_contains_text()
  32. And I should see "Your selection: Option 2" behat_general::assert_page_contains_text()

Feature: Limit choice responses

In order to restrict students from selecting a response more than a specified number of times
As a teacher
I need to limit the choice responses

  • @javascript

Scenario: Limit the number of responses allowed for a choice activity and verify the result as students /private/srv/www/loganberry.local/data/40975/moodle/mod/choice/tests/behat/limit_responses.feature:8

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
    student2 Student 2 student2@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
    student2 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Choice" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Choice name Choice name
    Choice Description
    1
    Option 1
    1
    Option 2
  8. And I log out behat_auth::i_log_out()
  9. When I log in as "student1" behat_auth::i_log_in_as()
  10. And I follow "Course 1" behat_general::click_link()
  11. And I choose "Option 1" from "Choice name" choice activity behat_mod_choice::I_choose_option_from_activity()
  12. Then I should see "Your selection: Option 1" behat_general::assert_page_contains_text()
  13. And I should see "Your choice has been saved" behat_general::assert_page_contains_text()
  14. And I log out behat_auth::i_log_out()
  15. And I log in as "student2" behat_auth::i_log_in_as()
  16. And I follow "Course 1" behat_general::click_link()
  17. And I follow "Choice name" behat_general::click_link()
  18. And I should see "Option 1 (Full)" behat_general::assert_page_contains_text()
  19. And the "choice_1" "radio" should be disabled behat_general::the_element_should_be_disabled()

Feature: A teacher can choose one of 4 options for publishing choice results

In order to display choice activities outcomes
As a teacher
I need to publish the choice activity results in different ways

Background: /private/srv/www/loganberry.local/data/40975/moodle/mod/choice/tests/behat/publish_results.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  • @javascript

Scenario: Do not publish results to students /private/srv/www/loganberry.local/data/40975/moodle/mod/choice/tests/behat/publish_results.feature:24

  1. Given I add a "Choice" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Choice name Choice 1
    Description Choice Description
    Publish results Do not publish results to students
    option[0] Option 1
    option[1] Option 2
  2. And I log out behat_auth::i_log_out()
  3. And I log in as "student1" behat_auth::i_log_in_as()
  4. And I follow "Course 1" behat_general::click_link()
  5. When I choose "Option 1" from "Choice 1" choice activity behat_mod_choice::I_choose_option_from_activity()
  6. Then I should see "Your selection: Option 1" behat_general::assert_page_contains_text()
  7. And I should not see "Responses" behat_general::assert_page_not_contains_text()
  8. And I should not see "Graph display" behat_general::assert_page_not_contains_text()
  • @javascript

Scenario: Show results to students after they answer /private/srv/www/loganberry.local/data/40975/moodle/mod/choice/tests/behat/publish_results.feature:40

  1. Given I add a "Choice" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Choice name Choice 1
    Description Choice Description
    option[0] Option 1
    option[1] Option 2
    Publish results Show results to students after they answer
  2. And I log out behat_auth::i_log_out()
  3. And I log in as "student1" behat_auth::i_log_in_as()
  4. And I follow "Course 1" behat_general::click_link()
  5. When I follow "Choice 1" behat_general::click_link()
  6. Then I should not see "Responses" behat_general::assert_page_not_contains_text()
  7. And I should not see "Graph display" behat_general::assert_page_not_contains_text()
  8. And I follow "Course 1" behat_general::click_link()
  9. And I choose "Option 1" from "Choice 1" choice activity behat_mod_choice::I_choose_option_from_activity()
  10. And I should see "Your selection: Option 1" behat_general::assert_page_contains_text()
  11. And I should see "Responses" behat_general::assert_page_contains_text()
  12. And I should see "Graph display" behat_general::assert_page_contains_text()
  • @javascript

Scenario: Show results to students only after the choice is closed /private/srv/www/loganberry.local/data/40975/moodle/mod/choice/tests/behat/publish_results.feature:60

  1. Given I add a "Choice" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Choice name Choice 1
    Description Choice Description
    Publish results Show results to students only after the choice is closed
    option[0] Option 1
    option[1] Option 2
  2. And I log out behat_auth::i_log_out()
  3. And I log in as "student1" behat_auth::i_log_in_as()
  4. And I follow "Course 1" behat_general::click_link()
  5. When I follow "Choice 1" behat_general::click_link()
  6. Then I should not see "Responses" behat_general::assert_page_not_contains_text()
  7. And I should not see "Graph display" behat_general::assert_page_not_contains_text()
  8. And I choose "Option 1" from "Choice 1" choice activity behat_mod_choice::I_choose_option_from_activity()
  9. And I log out behat_auth::i_log_out()
  10. And I log in as "teacher1" behat_auth::i_log_in_as()
  11. And I follow "Course 1" behat_general::click_link()
  12. And I follow "Choice 1" behat_general::click_link()
  13. And I follow "Edit settings" behat_general::click_link()
  14. And I expand all fieldsets behat_forms::i_expand_all_fieldsets()
  15. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Restrict answering to this time period 1
    timeclose[year] 2010
  16. And I press "Save and return to course" behat_forms::press_button()
  17. And I log out behat_auth::i_log_out()
  18. And I log in as "student1" behat_auth::i_log_in_as()
  19. And I follow "Course 1" behat_general::click_link()
  20. And I follow "Choice 1" behat_general::click_link()
  21. And I should see "Responses" behat_general::assert_page_contains_text()
  22. And I should see "Graph display" behat_general::assert_page_contains_text()
  • @javascript

Scenario: Always show results to students /private/srv/www/loganberry.local/data/40975/moodle/mod/choice/tests/behat/publish_results.feature:92

  1. Given I add a "Choice" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Choice name Choice 1
    Description Choice Description
    option[0] Option 1
    option[1] Option 2
    Publish results Always show results to students
  2. And I log out behat_auth::i_log_out()
  3. And I log in as "student1" behat_auth::i_log_in_as()
  4. And I follow "Course 1" behat_general::click_link()
  5. When I follow "Choice 1" behat_general::click_link()
  6. And I should see "Responses" behat_general::assert_page_contains_text()
  7. And I should see "Graph display" behat_general::assert_page_contains_text()

Feature: A teacher can choose whether to publish choice activity results anonymously or showing names

In order to keep students privacy or to give more info to students
As a teacher
I need to select whether I want other students to know who selected what option

Background: /private/srv/www/loganberry.local/data/40975/moodle/mod/choice/tests/behat/publish_results_anonymously.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
    student2 Student 2 student2@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
    student2 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  • @javascript

Scenario: Publish anonymous results /private/srv/www/loganberry.local/data/40975/moodle/mod/choice/tests/behat/publish_results_anonymously.feature:26

  1. Given I add a "Choice" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Choice name Choice 1
    Description Choice Description
    option[0] Option 1
    option[1] Option 2
    Publish results Always show results to students
    Privacy of results Publish anonymous results, do not show student names
  2. And I log out behat_auth::i_log_out()
  3. And I log in as "student1" behat_auth::i_log_in_as()
  4. And I follow "Course 1" behat_general::click_link()
  5. And I choose "Option 1" from "Choice 1" choice activity behat_mod_choice::I_choose_option_from_activity()
  6. And I log out behat_auth::i_log_out()
  7. When I log in as "student2" behat_auth::i_log_in_as()
  8. And I follow "Course 1" behat_general::click_link()
  9. And I follow "Choice 1" behat_general::click_link()
  10. Then I should not see "Student 1" behat_general::assert_page_not_contains_text()
  11. And I should not see "User choose this option" behat_general::assert_page_not_contains_text()
  12. And I hover ".results .graph img" "css_element" behat_general::i_hover()
  • @javascript

Scenario: Publish full results /private/srv/www/loganberry.local/data/40975/moodle/mod/choice/tests/behat/publish_results_anonymously.feature:47

  1. Given I add a "Choice" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Choice name Choice 1
    Description Choice Description
    option[0] Option 1
    option[1] Option 2
    Publish results Always show results to students
    Privacy of results Publish full results, showing names and their choices
  2. And I log out behat_auth::i_log_out()
  3. And I log in as "student1" behat_auth::i_log_in_as()
  4. And I follow "Course 1" behat_general::click_link()
  5. And I choose "Option 1" from "Choice 1" choice activity behat_mod_choice::I_choose_option_from_activity()
  6. And I log out behat_auth::i_log_out()
  7. When I log in as "student2" behat_auth::i_log_in_as()
  8. And I follow "Course 1" behat_general::click_link()
  9. And I follow "Choice 1" behat_general::click_link()
  10. Then I should see "Student 1" behat_general::assert_page_contains_text()
  11. And I should see "User choose this option" behat_general::assert_page_contains_text()

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 /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/add_forum.feature:8

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name
    Forum type Standard forum for general use
    Description Test forum description
  8. When I add a new discussion to "Test forum name" forum with: behat_mod_forum::i_add_a_forum_discussion_to_forum_with()
    Subject Forum post 1
    Message This is the body
  9. And I wait "6" seconds behat_general::i_wait_seconds()
  10. Then I should see "Test forum name" behat_general::assert_page_contains_text()

Feature: Set a certain number of discussions as a completion condition for a forum

In order to ensure students are participating on forums
As a teacher
I need to set a minimum number of discussions to mark the forum activity as completed

  • @javascript

Scenario: Set X number of discussions as a condition /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/completion_condition_number_discussions.feature:8

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    student1 Student 1 student1@asd.com
    teacher1 Teacher 1 teacher1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "admin" behat_auth::i_log_in_as()
  5. And I set the following administration settings values: behat_admin::i_set_the_following_administration_settings_values()
    Enable completion tracking 1
    Enable conditional access 1
  6. And I log out behat_auth::i_log_out()
  7. And I log in as "teacher1" behat_auth::i_log_in_as()
  8. And I follow "Course 1" behat_general::click_link()
  9. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  10. And I click on "Edit settings" "link" in the "Administration" "block" behat_general::i_click_on_in_the()
  11. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Enable completion tracking Yes
  12. And I press "Save changes" behat_forms::press_button()
  13. When I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name
    Description Test forum description
    Completion tracking Show activity as complete when conditions are met
    completiondiscussionsenabled 1
    completiondiscussions 2
  14. And I log out behat_auth::i_log_out()
  15. And I log in as "student1" behat_auth::i_log_in_as()
  16. And I follow "Course 1" behat_general::click_link()
  17. Then I hover "//li[contains(concat(' ', normalize-space(@class), ' '), ' modtype_forum ')]/descendant::img[@alt='Not completed: Test forum name']" "xpath_element" behat_general::i_hover()
  18. And I add a new discussion to "Test forum name" forum with: behat_mod_forum::i_add_a_forum_discussion_to_forum_with()
    Subject Post 1 subject
    Message Body 1 content
  19. And I add a new discussion to "Test forum name" forum with: behat_mod_forum::i_add_a_forum_discussion_to_forum_with()
    Subject Post 2 subject
    Message Body 2 content
  20. And I follow "Course 1" behat_general::click_link()
  21. And I hover "//li[contains(concat(' ', normalize-space(@class), ' '), ' modtype_forum ')]/descendant::img[contains(@alt, 'Completed: Test forum name')]" "xpath_element" behat_general::i_hover()
  22. And I log out behat_auth::i_log_out()
  23. And I log in as "teacher1" behat_auth::i_log_in_as()
  24. And I follow "Course 1" behat_general::click_link()
  25. And "Student 1" user has completed "Test forum name" activity behat_completion::user_has_completed_activity()

Feature: Students can choose from 4 discussion display options and their choice is remembered

In order to read forum posts in a suitable view
As a user
I need to select which display method I want to use

Background: /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/discussion_display.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    student1 Student 1 student1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    student1 C1 student
  4. And I log in as "admin" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name
    Description Test forum description
  8. And I add a new discussion to "Test forum name" forum with: behat_mod_forum::i_add_a_forum_discussion_to_forum_with()
    Subject Discussion 1
    Message Discussion contents 1, first message
  9. And I reply "Discussion 1" post from "Test forum name" forum with: behat_mod_forum::i_reply_post_from_forum_with()
    Subject Reply 1 to discussion 1
    Message Discussion contents 1, second message
  10. And I add a new discussion to "Test forum name" forum with: behat_mod_forum::i_add_a_forum_discussion_to_forum_with()
    Subject Discussion 2
    Message Discussion contents 2, first message
  11. And I reply "Discussion 2" post from "Test forum name" forum with: behat_mod_forum::i_reply_post_from_forum_with()
    Subject Reply 1 to discussion 2
    Message Discussion contents 2, second message
  12. And I log out behat_auth::i_log_out()
  13. And I log in as "student1" behat_auth::i_log_in_as()
  14. And I follow "Course 1" behat_general::click_link()
  • @javascript

Scenario: Display replies flat, with oldest first /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/discussion_display.feature:40

  1. Given I reply "Discussion 1" post from "Test forum name" forum with: behat_mod_forum::i_reply_post_from_forum_with()
    Subject Reply 2 to discussion 1
    Message Discussion contents 1, third message
  2. When I select "Display replies flat, with oldest first" from "mode" behat_forms::select_option()
  3. Then I should see "Discussion contents 1, first message" in the "div.firstpost.starter" "css_element" behat_general::assert_element_contains_text()
  4. And I should see "Discussion contents 1, second message" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ') and not(contains(@class, 'starter'))]" "xpath_element" behat_general::assert_element_contains_text()
  5. And I reply "Discussion 2" post from "Test forum name" forum with: behat_mod_forum::i_reply_post_from_forum_with()
    Subject Reply 2 to discussion 2
    Message Discussion contents 2, third message
  6. And the "Display mode" field should match "Display replies flat, with oldest first" value behat_forms::the_field_should_match_value()
  7. And I should see "Discussion contents 2, first message" in the "div.firstpost.starter" "css_element" behat_general::assert_element_contains_text()
  8. And I should see "Discussion contents 2, second message" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ') and not(contains(@class, 'starter'))]" "xpath_element" behat_general::assert_element_contains_text()
  • @javascript

Scenario: Display replies flat, with newest first /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/discussion_display.feature:55

  1. Given I reply "Discussion 1" post from "Test forum name" forum with: behat_mod_forum::i_reply_post_from_forum_with()
    Subject Reply 2 to discussion 1
    Message Discussion contents 1, third message
  2. When I select "Display replies flat, with newest first" from "mode" behat_forms::select_option()
  3. Then I should see "Discussion contents 1, first message" in the "div.firstpost.starter" "css_element" behat_general::assert_element_contains_text()
  4. And I should see "Discussion contents 1, third message" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ') and not(contains(@class, 'starter'))]" "xpath_element" behat_general::assert_element_contains_text()
  5. And I reply "Discussion 2" post from "Test forum name" forum with: behat_mod_forum::i_reply_post_from_forum_with()
    Subject Reply 2 to discussion 2
    Message Discussion contents 2, third message
  6. And the "Display mode" field should match "Display replies flat, with newest first" value behat_forms::the_field_should_match_value()
  7. And I should see "Discussion contents 2, first message" in the "div.firstpost.starter" "css_element" behat_general::assert_element_contains_text()
  8. And I should see "Discussion contents 2, third message" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ') and not(contains(@class, 'starter'))]" "xpath_element" behat_general::assert_element_contains_text()
  • @javascript

Scenario: Display replies in threaded form /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/discussion_display.feature:70

  1. Given I follow "Test forum name" behat_general::click_link()
  2. And I follow "Discussion 1" behat_general::click_link()
  3. When I select "Display replies in threaded form" from "mode" behat_forms::select_option()
  4. Then I should see "Discussion contents 1, first message" behat_general::assert_page_contains_text()
  5. And I should see "Reply 1 to discussion 1" in the "span.forumthread" "css_element" behat_general::assert_element_contains_text()
  6. And I follow "Test forum name" behat_general::click_link()
  7. And I follow "Discussion 2" behat_general::click_link()
  8. And the "Display mode" field should match "Display replies in threaded form" value behat_forms::the_field_should_match_value()
  9. And I should see "Discussion contents 2, first message" behat_general::assert_page_contains_text()
  10. And I should see "Reply 1 to discussion 2" in the "span.forumthread" "css_element" behat_general::assert_element_contains_text()
  • @javascript

Scenario: Display replies in nested form /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/discussion_display.feature:83

  1. Given I follow "Test forum name" behat_general::click_link()
  2. And I follow "Discussion 1" behat_general::click_link()
  3. When I select "Display replies in nested form" from "mode" behat_forms::select_option()
  4. Then I should see "Discussion contents 1, first message" in the "div.firstpost.starter" "css_element" behat_general::assert_element_contains_text()
  5. And I should see "Discussion contents 1, second message" in the "div.indent div.forumpost" "css_element" behat_general::assert_element_contains_text()
  6. And I follow "Test forum name" behat_general::click_link()
  7. And I follow "Discussion 2" behat_general::click_link()
  8. And the "Display mode" field should match "Display replies in nested form" value behat_forms::the_field_should_match_value()
  9. And I should see "Discussion contents 2, first message" in the "div.firstpost.starter" "css_element" behat_general::assert_element_contains_text()
  10. And I should see "Discussion contents 2, second message" in the "div.indent div.forumpost" "css_element" behat_general::assert_element_contains_text()

Feature: Students can edit or delete their forum posts within a set time limit

In order to refine forum posts
As a user
I need to edit or delete my forum posts within a certain period of time after posting

Background: /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/edit_post_student.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    student1 Student 1 student1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    student1 C1 student
  4. And I log in as "admin" behat_auth::i_log_in_as()
  5. And I go to notifications page behat_admin::i_go_to_notifications_page()
  6. And I expand "Security" node behat_navigation::i_expand_node()
  7. And I follow "Site policies" behat_general::click_link()
  8. And I select "1 minutes" from "Maximum time to edit posts" behat_forms::select_option()
  9. And I press "Save changes" behat_forms::press_button()
  10. And I am on homepage behat_general::i_am_on_homepage()
  11. And I follow "Course 1" behat_general::click_link()
  12. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  13. And I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name
    Forum type Standard forum for general use
    Description Test forum description
  14. And I log out behat_auth::i_log_out()
  15. And I follow "Course 1" behat_general::click_link()
  16. And I log in as "student1" behat_auth::i_log_in_as()
  17. And I add a new discussion to "Test forum name" forum with: behat_mod_forum::i_add_a_forum_discussion_to_forum_with()
    Subject Forum post subject
    Message This is the body

Scenario: Edit forum post /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/edit_post_student.feature:37

  1. When I follow "Forum post subject" behat_general::click_link()
  2. And I follow "Edit" behat_general::click_link()
  3. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Subject Edited post subject
    Message Edited post body
  4. And I press "Save changes" behat_forms::press_button()
  5. And I wait to be redirected behat_general::i_wait_to_be_redirected()
  6. Then I should see "Edited post subject" behat_general::assert_page_contains_text()
  7. And I should see "Edited post body" behat_general::assert_page_contains_text()
  • @javascript

Scenario: Delete forum post /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/edit_post_student.feature:49

  1. When I follow "Forum post subject" behat_general::click_link()
  2. And I follow "Delete" behat_general::click_link()
  3. And I press "Continue" behat_forms::press_button()
  4. Then I should not see "Forum post subject" behat_general::assert_page_not_contains_text()
  • @javascript

Scenario: Time limit expires /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/edit_post_student.feature:56

  1. When I wait "70" seconds behat_general::i_wait_seconds()
  2. And I follow "Forum post subject" behat_general::click_link()
  3. Then I should not see "Edit" in the "region-main" "region" behat_general::assert_element_not_contains_text()
  4. And I should not see "Delete" in the "region-main" "region" behat_general::assert_element_not_contains_text()

Feature: Teachers can edit or delete any forum post

In order to refine the forum contents
As a teacher
I need to edit or delete any user's forum posts

Background: /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/edit_post_teacher.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name
    Description Test forum description
  8. And I add a new discussion to "Test forum name" forum with: behat_mod_forum::i_add_a_forum_discussion_to_forum_with()
    Subject Teacher post subject
    Message Teacher post message
  9. And I log out behat_auth::i_log_out()
  10. And I log in as "student1" behat_auth::i_log_in_as()
  11. And I follow "Course 1" behat_general::click_link()
  12. And I reply "Teacher post subject" post from "Test forum name" forum with: behat_mod_forum::i_reply_post_from_forum_with()
    Subject Student post subject
    Message Student post message
  • @javascript

Scenario: A teacher can delete another user's posts /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/edit_post_teacher.feature:36

  1. Given I log out behat_auth::i_log_out()
  2. And I log in as "teacher1" behat_auth::i_log_in_as()
  3. When I follow "Course 1" behat_general::click_link()
  4. And I follow "Test forum name" behat_general::click_link()
  5. And I follow "Teacher post subject" behat_general::click_link()
  6. And I click on "Delete" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ')][contains(., 'Student post subject')]" "xpath_element" behat_general::i_click_on_in_the()
  7. And I press "Continue" behat_forms::press_button()
  8. And I wait "4" seconds behat_general::i_wait_seconds()
  9. Then I should not see "Student post subject" behat_general::assert_page_not_contains_text()
  10. And I should not see "Student post message" behat_general::assert_page_not_contains_text()
  • @javascript

Scenario: A teacher can edit another user's posts /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/edit_post_teacher.feature:49

  1. Given I log out behat_auth::i_log_out()
  2. And I log in as "teacher1" behat_auth::i_log_in_as()
  3. When I follow "Course 1" behat_general::click_link()
  4. And I follow "Test forum name" behat_general::click_link()
  5. And I follow "Teacher post subject" behat_general::click_link()
  6. And I click on "Edit" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ')][contains(., 'Student post subject')]" "xpath_element" behat_general::i_click_on_in_the()
  7. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Subject Edited student subject
  8. And I press "Save changes" behat_forms::press_button()
  9. And I wait "4" seconds behat_general::i_wait_seconds()
  10. Then I should see "Edited student subject" behat_general::assert_page_contains_text()
  11. And I should see "Edited by Teacher 1 - original submission" behat_general::assert_page_contains_text()
  • @javascript

Scenario: A student can't edit or delete another user's posts /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/edit_post_teacher.feature:64

  1. When I follow "Teacher post subject" behat_general::click_link()
  2. Then I should not see "Edit" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ')][contains(., 'Teacher post subject')]" "xpath_element" behat_general::assert_element_not_contains_text()
  3. And I should not see "Delete" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ')][contains(., 'Teacher post subject')]" "xpath_element" behat_general::assert_element_not_contains_text()

Feature: Single simple forum discussion type

In order to restrict the discussion topic to one
As a teacher
I need to create a forum with a single simple discussion

Background: /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/single_forum_discussion.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Single discussion forum name
    Forum type A single simple discussion
    Description Single discussion forum description
  • @javascript

Scenario: Teacher can start the single simple discussion /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/single_forum_discussion.feature:28

  1. When I follow "Single discussion forum name" behat_general::click_link()
  2. Then I should see "Single discussion forum description" in the "div.firstpost.starter" "css_element" behat_general::assert_element_contains_text()
  3. And I should not see "Add a new discussion topic" behat_general::assert_page_not_contains_text()
  • @javascript

Scenario: Student can not add more discussions /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/single_forum_discussion.feature:34

  1. Given I log out behat_auth::i_log_out()
  2. And I log in as "student1" behat_auth::i_log_in_as()
  3. And I follow "Course 1" behat_general::click_link()
  4. When I reply "Single discussion forum name" post from "Single discussion forum name" forum with: behat_mod_forum::i_reply_post_from_forum_with()
    Subject Reply to single discussion subject
    Message Reply to single discussion message
  5. Then I should not see "Add a new discussion topic" behat_general::assert_page_not_contains_text()
  6. And I should see "Reply" in the "div.firstpost.starter" "css_element" behat_general::assert_element_contains_text()
  7. And I should see "Reply to single discussion message" behat_general::assert_page_contains_text()

Feature: A teacher can set one of 3 possible options for tracking read forum posts

In order to ease the forum posts follow up
As a user
I need to distinct the unread posts from the read ones

Background: /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/track_read_posts.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email trackforums
    student1 Student 1 student1@asd.com 1
    student2 Student 2 student2@asd.com 0
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    student1 C1 student
    student2 C1 student
  4. And I log in as "admin" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  • @javascript

Scenario: Tracking forum posts off /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/track_read_posts.feature:24

  1. Given I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name
    Forum type Standard forum for general use
    Description Test forum description
    Read tracking Off
  2. And I add a new discussion to "Test forum name" forum with: behat_mod_forum::i_add_a_forum_discussion_to_forum_with()
    Subject Test post subject
    Message Test post message
  3. And I wait "6" seconds behat_general::i_wait_seconds()
  4. And I log out behat_auth::i_log_out()
  5. When I log in as "student1" behat_auth::i_log_in_as()
  6. And I follow "Course 1" behat_general::click_link()
  7. Then I should not see "1 unread post" behat_general::assert_page_not_contains_text()
  8. And I follow "Test forum name" behat_general::click_link()
  9. And I should not see "Track unread posts" behat_general::assert_page_not_contains_text()
  • @javascript

Scenario: Tracking forum posts optional with user tracking on /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/track_read_posts.feature:42

  1. Given I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name
    Forum type Standard forum for general use
    Description Test forum description
    Read tracking Optional
  2. And I add a new discussion to "Test forum name" forum with: behat_mod_forum::i_add_a_forum_discussion_to_forum_with()
    Subject Test post subject
    Message Test post message
  3. And I wait "6" seconds behat_general::i_wait_seconds()
  4. And I log out behat_auth::i_log_out()
  5. When I log in as "student1" behat_auth::i_log_in_as()
  6. And I follow "Course 1" behat_general::click_link()
  7. Then I should see "1 unread post" behat_general::assert_page_contains_text()
  8. And I follow "Test forum name" behat_general::click_link()
  9. And I follow "Don't track unread posts" behat_general::click_link()
  10. And I wait "4" seconds behat_general::i_wait_seconds()
  11. And I follow "Course 1" behat_general::click_link()
  12. And I should not see "1 unread post" behat_general::assert_page_not_contains_text()
  13. And I follow "Test forum name" behat_general::click_link()
  14. And I follow "Track unread posts" behat_general::click_link()
  15. And I wait "4" seconds behat_general::i_wait_seconds()
  16. And I follow "1" behat_general::click_link()
  17. And I follow "Course 1" behat_general::click_link()
  18. And I should not see "1 unread post" behat_general::assert_page_not_contains_text()
  • @javascript

Scenario: Tracking forum posts optional with user tracking off /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/track_read_posts.feature:69

  1. Given I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name
    Forum type Standard forum for general use
    Description Test forum description
    Read tracking Optional
  2. And I add a new discussion to "Test forum name" forum with: behat_mod_forum::i_add_a_forum_discussion_to_forum_with()
    Subject Test post subject
    Message Test post message
  3. And I wait "6" seconds behat_general::i_wait_seconds()
  4. And I log out behat_auth::i_log_out()
  5. When I log in as "student2" behat_auth::i_log_in_as()
  6. And I follow "Course 1" behat_general::click_link()
  7. Then I should not see "1 unread post" behat_general::assert_page_not_contains_text()
  8. And I follow "Test forum name" behat_general::click_link()
  9. And I should not see "Track unread posts" behat_general::assert_page_not_contains_text()
  • @javascript

Scenario: Tracking forum posts forced with user tracking on /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/track_read_posts.feature:87

  1. And I set the following administration settings values: behat_admin::i_set_the_following_administration_settings_values()
    Allow forced read tracking 1
  2. And I follow "Home" behat_general::click_link()
  3. And I follow "Course 1" behat_general::click_link()
  4. Given I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name
    Forum type Standard forum for general use
    Description Test forum description
    Read tracking Force
  5. And I add a new discussion to "Test forum name" forum with: behat_mod_forum::i_add_a_forum_discussion_to_forum_with()
    Subject Test post subject
    Message Test post message
  6. And I wait "6" seconds behat_general::i_wait_seconds()
  7. And I log out behat_auth::i_log_out()
  8. When I log in as "student1" behat_auth::i_log_in_as()
  9. And I follow "Course 1" behat_general::click_link()
  10. Then I should see "1 unread post" behat_general::assert_page_contains_text()
  11. And I follow "1 unread post" behat_general::click_link()
  12. And I should not see "Don't track unread posts" behat_general::assert_page_not_contains_text()
  13. And I follow "Test post subject" behat_general::click_link()
  14. And I follow "Course 1" behat_general::click_link()
  15. And I should not see "1 unread post" behat_general::assert_page_not_contains_text()
  • @javascript

Scenario: Tracking forum posts forced with user tracking off /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/track_read_posts.feature:112

  1. And I set the following administration settings values: behat_admin::i_set_the_following_administration_settings_values()
    Allow forced read tracking 1
  2. And I follow "Home" behat_general::click_link()
  3. And I follow "Course 1" behat_general::click_link()
  4. Given I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name
    Forum type Standard forum for general use
    Description Test forum description
    Read tracking Force
  5. And I add a new discussion to "Test forum name" forum with: behat_mod_forum::i_add_a_forum_discussion_to_forum_with()
    Subject Test post subject
    Message Test post message
  6. And I wait "6" seconds behat_general::i_wait_seconds()
  7. And I log out behat_auth::i_log_out()
  8. When I log in as "student2" behat_auth::i_log_in_as()
  9. And I follow "Course 1" behat_general::click_link()
  10. Then I should see "1 unread post" behat_general::assert_page_contains_text()
  11. And I follow "1 unread post" behat_general::click_link()
  12. And I should not see "Don't track unread posts" behat_general::assert_page_not_contains_text()
  13. And I follow "Test post subject" behat_general::click_link()
  14. And I follow "Course 1" behat_general::click_link()
  15. And I should not see "1 unread post" behat_general::assert_page_not_contains_text()
  • @javascript

Scenario: Tracking forum posts forced (with force disabled) with user tracking on /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/track_read_posts.feature:137

  1. And I set the following administration settings values: behat_admin::i_set_the_following_administration_settings_values()
    Allow forced read tracking 1
  2. And I follow "Home" behat_general::click_link()
  3. And I follow "Course 1" behat_general::click_link()
  4. Given I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name
    Forum type Standard forum for general use
    Description Test forum description
    Read tracking Force
  5. And I add a new discussion to "Test forum name" forum with: behat_mod_forum::i_add_a_forum_discussion_to_forum_with()
    Subject Test post subject
    Message Test post message
  6. And I wait "6" seconds behat_general::i_wait_seconds()
  7. And I set the following administration settings values: behat_admin::i_set_the_following_administration_settings_values()
    Allow forced read tracking 0
  8. And I log out behat_auth::i_log_out()
  9. When I log in as "student1" behat_auth::i_log_in_as()
  10. And I follow "Course 1" behat_general::click_link()
  11. Then I should see "1 unread post" behat_general::assert_page_contains_text()
  12. And I follow "Test forum name" behat_general::click_link()
  13. And I follow "Don't track unread posts" behat_general::click_link()
  14. And I wait "4" seconds behat_general::i_wait_seconds()
  15. And I follow "Course 1" behat_general::click_link()
  16. And I should not see "1 unread post" behat_general::assert_page_not_contains_text()
  17. And I follow "Test forum name" behat_general::click_link()
  18. And I follow "Track unread posts" behat_general::click_link()
  19. And I wait "4" seconds behat_general::i_wait_seconds()
  20. And I follow "1" behat_general::click_link()
  21. And I follow "Course 1" behat_general::click_link()
  22. And I should not see "1 unread post" behat_general::assert_page_not_contains_text()
  • @javascript

Scenario: Tracking forum posts forced (with force disabled) with user tracking off /private/srv/www/loganberry.local/data/40975/moodle/mod/forum/tests/behat/track_read_posts.feature:170

  1. And I set the following administration settings values: behat_admin::i_set_the_following_administration_settings_values()
    Allow forced read tracking 1
  2. And I follow "Home" behat_general::click_link()
  3. And I follow "Course 1" behat_general::click_link()
  4. Given I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name
    Forum type Standard forum for general use
    Description Test forum description
    Read tracking Force
  5. And I add a new discussion to "Test forum name" forum with: behat_mod_forum::i_add_a_forum_discussion_to_forum_with()
    Subject Test post subject
    Message Test post message
  6. And I wait "6" seconds behat_general::i_wait_seconds()
  7. And I set the following administration settings values: behat_admin::i_set_the_following_administration_settings_values()
    Allow forced read tracking 0
  8. And I log out behat_auth::i_log_out()
  9. When I log in as "student2" behat_auth::i_log_in_as()
  10. And I follow "Course 1" behat_general::click_link()
  11. Then I should not see "1 unread post" behat_general::assert_page_not_contains_text()
  12. And I follow "Test forum name" behat_general::click_link()
  13. And I should not see "Track unread posts" behat_general::assert_page_not_contains_text()

Feature: A teacher can set whether glossary entries are always editable or not

In order to ensure students think before adding new entries
As a teacher
I need to prevent entries to be always editable

  • @javascript

Scenario: Glossary entries are not always editable /private/srv/www/loganberry.local/data/40975/moodle/mod/glossary/tests/behat/entries_always_editable.feature:8

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "admin" behat_auth::i_log_in_as()
  5. And I set the following administration settings values: behat_admin::i_set_the_following_administration_settings_values()
    Maximum time to edit posts 1 minutes
  6. And I log out behat_auth::i_log_out()
  7. And I log in as "teacher1" behat_auth::i_log_in_as()
  8. And I follow "Course 1" behat_general::click_link()
  9. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  10. And I add a "Glossary" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name Test glossary name
    Description Test glossary description
    Always allow editing No
  11. And I log out behat_auth::i_log_out()
  12. And I log in as "student1" behat_auth::i_log_in_as()
  13. And I follow "Course 1" behat_general::click_link()
  14. And I follow "Test glossary name" behat_general::click_link()
  15. When I add a glossary entry with the following data: behat_mod_glossary::i_add_a_glossary_entry_with_the_following_data()
    Concept Test concept name
    Definition Test concept description
  16. Then "Delete: Test concept name" "link" should exists behat_general::should_exists()
  17. And "Edit: Test concept name" "link" should exists behat_general::should_exists()
  18. And I wait "65" seconds behat_general::i_wait_seconds()
  19. And I reload the page behat_general::reload()
  20. Then "Delete: Test concept name" "link" should not exists behat_general::should_not_exists()
  21. And "Edit: Test concept name" "link" should not exists behat_general::should_not_exists()

Feature: A teacher can choose whether glossary entries require approval

In order to check entries before they are displayed
As a user
I need to enable entries requiring approval

Scenario: Approve and disapprove glossary entries /private/srv/www/loganberry.local/data/40975/moodle/mod/glossary/tests/behat/entries_require_approval.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
    student2 Student 2 student2@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
    student2 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. Given I add a "Glossary" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name Test glossary name
    Description Test glossary entries require approval
    Approved by default No
  8. And I log out behat_auth::i_log_out()
  9. And I log in as "student1" behat_auth::i_log_in_as()
  10. And I follow "Course 1" behat_general::click_link()
  11. And I follow "Test glossary name" behat_general::click_link()
  12. When I add a glossary entry with the following data: behat_mod_glossary::i_add_a_glossary_entry_with_the_following_data()
    Concept Just a test concept
    Definition Concept definition
    Keyword(s) Black
  13. And I log out behat_auth::i_log_out()
  14. And I log in as "student2" behat_auth::i_log_in_as()
  15. And I follow "Course 1" behat_general::click_link()
  16. And I follow "Test glossary name" behat_general::click_link()
  17. Then I should see "No entries found in this section" behat_general::assert_page_contains_text()
  18. And I log out behat_auth::i_log_out()
  19. And I log in as "teacher1" behat_auth::i_log_in_as()
  20. And I follow "Course 1" behat_general::click_link()
  21. And I follow "Test glossary name" behat_general::click_link()
  22. And I follow "Waiting approval" behat_general::click_link()
  23. Then I should see "(this entry is currently hidden)" behat_general::assert_page_contains_text()
  24. And I follow "Approve" behat_general::click_link()
  25. And I follow "Test glossary name" behat_general::click_link()
  26. Then I should see "Concept definition" behat_general::assert_page_contains_text()
  27. And I log out behat_auth::i_log_out()
  28. And I log in as "student2" behat_auth::i_log_in_as()
  29. And I follow "Course 1" behat_general::click_link()
  30. And I follow "Test glossary name" behat_general::click_link()
  31. Then I should see "Concept definition" behat_general::assert_page_contains_text()
  32. And I log out behat_auth::i_log_out()
  33. And I log in as "teacher1" behat_auth::i_log_in_as()
  34. And I follow "Course 1" behat_general::click_link()
  35. And I follow "Test glossary name" behat_general::click_link()
  36. And I follow "Disapprove" behat_general::click_link()
  37. And I log out behat_auth::i_log_out()
  38. And I log in as "student2" behat_auth::i_log_in_as()
  39. And I follow "Course 1" behat_general::click_link()
  40. And I follow "Test glossary name" behat_general::click_link()
  41. Then I should see "No entries found in this section" behat_general::assert_page_contains_text()

Feature: A teacher can choose whether to allow duplicate entries in a glossary

In order to avoid confusion
As a teacher
I need to avoid having duplicate concept definitions

  • @javascript

Scenario: Prevent duplicate entries /private/srv/www/loganberry.local/data/40975/moodle/mod/glossary/tests/behat/prevent_duplicate_entries.feature:8

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Glossary" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name Test glossary name
    Description Test glossary description
    Duplicate entries allowed No
  8. And I follow "Test glossary name" behat_general::click_link()
  9. And I add a glossary entry with the following data: behat_mod_glossary::i_add_a_glossary_entry_with_the_following_data()
    Concept Unique concept
    Definition I'm the definition of an unique concept
  10. When I press "Add a new entry" behat_forms::press_button()
  11. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Concept Unique concept
    Definition There is no definition restriction
  12. And I press "Save changes" behat_forms::press_button()
  13. Then I should see "This concept already exists. No duplicates allowed in this glossary." behat_general::assert_page_contains_text()
  14. And I press "Cancel" behat_forms::press_button()

Feature: A teacher can choose whether to provide a printer-friendly glossary entries list

In order to print glossaries easily
As a user
I need to provide users a different view to print the glossary contents

Background: /private/srv/www/loganberry.local/data/40975/moodle/mod/glossary/tests/behat/print_friendly_version.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  • @javascript

Scenario: Printer-friendly glossary view enabled /private/srv/www/loganberry.local/data/40975/moodle/mod/glossary/tests/behat/print_friendly_version.feature:24

  1. Given I add a "Glossary" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name Test glossary name
    Description Test glossary description
    Allow print view Yes
  2. And I log out behat_auth::i_log_out()
  3. And I log in as "student1" behat_auth::i_log_in_as()
  4. And I follow "Course 1" behat_general::click_link()
  5. And I follow "Test glossary name" behat_general::click_link()
  6. When I add a glossary entry with the following data: behat_mod_glossary::i_add_a_glossary_entry_with_the_following_data()
    Concept Just a test concept
    Definition Concept definition
  7. Then "Printer-friendly version" "link" should exists behat_general::should_exists()
  8. And "//*[contains(concat(' ', normalize-space(@class), ' '), ' printicon ')][contains(@href, 'print.php')]" "xpath_element" should exists behat_general::should_exists()
  9. And I follow "Printer-friendly version" behat_general::click_link()
  10. And I should see "Just a test concept" behat_general::assert_page_contains_text()

Scenario: Printer-friendly glossary view disabled /private/srv/www/loganberry.local/data/40975/moodle/mod/glossary/tests/behat/print_friendly_version.feature:41

  1. Given I add a "Glossary" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name Test glossary name
    Description Test glossary description
    Allow print view No
  2. And I log out behat_auth::i_log_out()
  3. And I log in as "student1" behat_auth::i_log_in_as()
  4. And I follow "Course 1" behat_general::click_link()
  5. And I follow "Test glossary name" behat_general::click_link()
  6. When I add a glossary entry with the following data: behat_mod_glossary::i_add_a_glossary_entry_with_the_following_data()
    Concept Just a test concept
    Definition Concept definition
  7. Then "Printer-friendly version" "link" should not exists behat_general::should_not_exists()
  8. And "//*[contains(concat(' ', normalize-space(@class), ' '), ' printicon ')][contains(@href, 'print.php')]" "xpath_element" should not exists behat_general::should_not_exists()

Feature: Glossary entries can be searched or browsed by alphabet, category, date or author

In order to find entries in a glossary
As a user
I need to search the entries list by keyword, alphabet, category, date and author

Background: /private/srv/www/loganberry.local/data/40975/moodle/mod/glossary/tests/behat/search_entries.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Glossary" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name Test glossary name
    Description Test glossary description
  8. And I follow "Test glossary name" behat_general::click_link()
  9. And I add a glossary entries category named "The ones I like" behat_mod_glossary::i_add_a_glossary_entries_category_named()
  10. And I add a glossary entries category named "All for you" behat_mod_glossary::i_add_a_glossary_entries_category_named()
  11. And I add a glossary entry with the following data: behat_mod_glossary::i_add_a_glossary_entry_with_the_following_data()
    Concept Eggplant
    Definition Sour eggplants
    Categories All for you
  12. And I log out behat_auth::i_log_out()
  13. And I log in as "student1" behat_auth::i_log_in_as()
  14. And I follow "Course 1" behat_general::click_link()
  15. And I follow "Test glossary name" behat_general::click_link()
  16. And I add a glossary entry with the following data: behat_mod_glossary::i_add_a_glossary_entry_with_the_following_data()
    Concept Cucumber
    Definition Sweet cucumber
    Categories The ones I like
  17. And I log out behat_auth::i_log_out()
  18. And I log in as "teacher1" behat_auth::i_log_in_as()
  19. And I follow "Course 1" behat_general::click_link()
  20. And I follow "Test glossary name" behat_general::click_link()
  • @javascript

Scenario: Search by keyword and browse by alphabet /private/srv/www/loganberry.local/data/40975/moodle/mod/glossary/tests/behat/search_entries.feature:46

  1. When I fill in "hook" with "cucumber" behat_forms::fill_field()
  2. And I press "Search" behat_forms::press_button()
  3. Then I should see "Sweet cucumber" behat_general::assert_page_contains_text()
  4. And I should see "Search: cucumber" behat_general::assert_page_contains_text()
  5. And I follow "Browse by alphabet" behat_general::click_link()
  6. And I click on "E" "link" in the ".entrybox" "css_element" behat_general::i_click_on_in_the()
  7. And I should see "Sour eggplants" behat_general::assert_page_contains_text()
  8. And I should not see "Sweet cucumber" behat_general::assert_page_not_contains_text()
  9. And I click on "X" "link" in the ".entrybox" "css_element" behat_general::i_click_on_in_the()
  10. And I should not see "Sweet cucumber" behat_general::assert_page_not_contains_text()
  11. And I should see "No entries found in this section" behat_general::assert_page_contains_text()
  • @javascript

Scenario: Browse by category /private/srv/www/loganberry.local/data/40975/moodle/mod/glossary/tests/behat/search_entries.feature:60

  1. When I follow "Browse by category" behat_general::click_link()
  2. And I select "The ones I like" from "Categories" behat_forms::select_option()
  3. Then I should see "Sweet cucumber" behat_general::assert_page_contains_text()
  4. And I should not see "Sour eggplants" behat_general::assert_page_not_contains_text()
  5. And I select "All for you" from "Categories" behat_forms::select_option()
  6. And I should see "Sour eggplants" behat_general::assert_page_contains_text()
  7. And I should not see "Sweet cucumber" behat_general::assert_page_not_contains_text()
  • @javascript

Scenario: Browse by date /private/srv/www/loganberry.local/data/40975/moodle/mod/glossary/tests/behat/search_entries.feature:70

  1. When I follow "Browse by date" behat_general::click_link()
  2. And I follow "By creation date" behat_general::click_link()
  3. Then "Delete: Eggplant" "link" should appear before "Delete: Cucumber" "link" behat_general::should_appear_before()
  4. And I follow "By last update" behat_general::click_link()
  5. And I follow "By last update change to descending" behat_general::click_link()
  6. And "Delete: Cucumber" "link" should appear before "Delete: Eggplant" "link" behat_general::should_appear_before()
  • @javascript

Scenario: Browse by author /private/srv/www/loganberry.local/data/40975/moodle/mod/glossary/tests/behat/search_entries.feature:79

  1. When I follow "Browse by Author" behat_general::click_link()
  2. And I click on "T" "link" in the ".entrybox" "css_element" behat_general::i_click_on_in_the()
  3. Then I should see "Teacher 1" behat_general::assert_page_contains_text()
  4. And I should see "Sour eggplants" behat_general::assert_page_contains_text()
  5. And I should not see "Sweet cucumber" behat_general::assert_page_not_contains_text()
  6. And I click on "S" "link" in the ".entrybox" "css_element" behat_general::i_click_on_in_the()
  7. And I should see "Student 1" behat_general::assert_page_contains_text()
  8. And I should see "Sweet cucumber" behat_general::assert_page_contains_text()
  9. And I should not see "Sour eggplants" behat_general::assert_page_not_contains_text()

Feature: A teacher can set available from and deadline dates to access a lesson

In order to schedule lesson activities
As a teacher
I need to set available from and deadline dates

Background: /private/srv/www/loganberry.local/data/40975/moodle/mod/lesson/tests/behat/date_availability.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  • @javascript

Scenario: Forbidding lesson accesses until a specified date /private/srv/www/loganberry.local/data/40975/moodle/mod/lesson/tests/behat/date_availability.feature:24

  1. Given I add a "Lesson" to section "1" behat_course::i_add_to_section()
  2. And I expand all fieldsets behat_forms::i_expand_all_fieldsets()
  3. And I click on "id_available_enabled" "checkbox" behat_general::i_click_on()
  4. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Name Test lesson
    available[day] 1
    available[month] January
    available[year] 2020
    available[hour] 08
    available[minute] 00
  5. And I press "Save and display" behat_forms::press_button()
  6. And I follow "Test lesson" behat_general::click_link()
  7. And I follow "Add a content page" behat_general::click_link()
  8. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Page title First page name
    Page contents First page contents
    Description The first one
  9. And I press "Save page" behat_forms::press_button()
  10. And I log out behat_auth::i_log_out()
  11. And I log in as "student1" behat_auth::i_log_in_as()
  12. And I follow "Course 1" behat_general::click_link()
  13. When I follow "Test lesson" behat_general::click_link()
  14. Then I should see "This lesson will be open on Wednesday, 1 January 2020, 8:00" behat_general::assert_page_contains_text()
  15. And I should not see "First page contents" behat_general::assert_page_not_contains_text()
  • @javascript

Scenario: Forbidding lesson accesses until a specified date /private/srv/www/loganberry.local/data/40975/moodle/mod/lesson/tests/behat/date_availability.feature:51

  1. Given I add a "Lesson" to section "1" behat_course::i_add_to_section()
  2. And I expand all fieldsets behat_forms::i_expand_all_fieldsets()
  3. And I click on "id_deadline_enabled" "checkbox" behat_general::i_click_on()
  4. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Name Test lesson
    deadline[day] 1
    deadline[month] January
    deadline[year] 2000
    deadline[hour] 08
    deadline[minute] 00
  5. And I press "Save and display" behat_forms::press_button()
  6. And I follow "Test lesson" behat_general::click_link()
  7. And I follow "Add a content page" behat_general::click_link()
  8. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Page title First page name
    Page contents First page contents
    Description The first one
  9. And I press "Save page" behat_forms::press_button()
  10. And I log out behat_auth::i_log_out()
  11. And I log in as "student1" behat_auth::i_log_in_as()
  12. And I follow "Course 1" behat_general::click_link()
  13. When I follow "Test lesson" behat_general::click_link()
  14. Then I should see "This lesson closed on Saturday, 1 January 2000, 8:00" behat_general::assert_page_contains_text()
  15. And I should not see "First page contents" behat_general::assert_page_not_contains_text()

Feature: In a lesson activity, students can navigate through a series of pages in various ways depending upon their answers to questions

In order to create a lesson with conditional paths
As a teacher
I need to add pages and questions with links between them

  • @javascript

Scenario: Student navigation with pages and questions /private/srv/www/loganberry.local/data/40975/moodle/mod/lesson/tests/behat/lesson_navigation.feature:8

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Lesson" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name Test lesson name
  8. And I follow "Test lesson name" behat_general::click_link()
  9. And I follow "Add a content page" behat_general::click_link()
  10. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Page title First page name
    Page contents First page contents
    id_answer_editor_0 Next page
    id_jumpto_0 Next page
  11. And I press "Save page" behat_forms::press_button()
  12. And I select "Add a content page" from "qtype" behat_forms::select_option()
  13. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Page title Second page name
    Page contents Second page contents
    id_answer_editor_0 Previous page
    id_jumpto_0 Previous page
    id_answer_editor_1 Next page
    id_jumpto_1 Next page
  14. And I press "Save page" behat_forms::press_button()
  15. And I follow "Expanded" behat_general::click_link()
  16. And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][3]" "xpath_element" behat_general::i_click_on_in_the()
  17. And I select "Numerical" from "Select a question type" behat_forms::select_option()
  18. And I press "Add a question page" behat_forms::press_button()
  19. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Page title Hardest question ever
    Page contents 1 + 1?
    id_answer_editor_0 2
    id_response_editor_0 Correct answer
    id_jumpto_0 End of lesson
    id_score_0 1
    id_answer_editor_1 1
    id_response_editor_1 Incorrect answer
    id_jumpto_1 Second page name
    id_score_1 0
  20. And I press "Save page" behat_forms::press_button()
  21. And I log out behat_auth::i_log_out()
  22. And I log in as "student1" behat_auth::i_log_in_as()
  23. And I follow "Course 1" behat_general::click_link()
  24. When I follow "Test lesson name" behat_general::click_link()
  25. Then I should see "First page contents" behat_general::assert_page_contains_text()
  26. And I press "Next page" behat_forms::press_button()
  27. And I should see "Second page contents" behat_general::assert_page_contains_text()
  28. And I should not see "First page contents" behat_general::assert_page_not_contains_text()
  29. And I press "Previous page" behat_forms::press_button()
  30. And I should see "First page contents" behat_general::assert_page_contains_text()
  31. And I should not see "Second page contents" behat_general::assert_page_not_contains_text()
  32. And I press "Next page" behat_forms::press_button()
  33. And I should see "Second page contents" behat_general::assert_page_contains_text()
  34. And I press "Next page" behat_forms::press_button()
  35. And I should see "1 + 1?" behat_general::assert_page_contains_text()
  36. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Your answer 1
  37. And I press "Submit" behat_forms::press_button()
  38. And I should see "Incorrect answer" behat_general::assert_page_contains_text()
  39. And I press "Continue" behat_forms::press_button()
  40. And I should see "Second page name" behat_general::assert_page_contains_text()
  41. And I press "Next page" behat_forms::press_button()
  42. And I should see "1 + 1?" behat_general::assert_page_contains_text()
  43. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Your answer 2
  44. And I press "Submit" behat_forms::press_button()
  45. And I should see "Correct answer" behat_general::assert_page_contains_text()
  46. And I should not see "Incorrect answer" behat_general::assert_page_not_contains_text()
  47. And I press "Continue" behat_forms::press_button()
  48. And I should see "Congratulations - end of lesson reached" behat_general::assert_page_contains_text()
  49. And I should see "Your score is 0 (out of 1)." behat_general::assert_page_contains_text()

Feature: A teacher can password protect a lesson

In order to avoid undesired accesses to lesson activities
As a teacher
I need to set a password to access the lesson

  • @javascript

Scenario: Accessing as student to a protected lesson /private/srv/www/loganberry.local/data/40975/moodle/mod/lesson/tests/behat/password_protection.feature:8

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Lesson" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name Test lesson
    Password protected lesson Yes
    id_password moodle_rules
  8. And I follow "Test lesson" behat_general::click_link()
  9. And I follow "Add a content page" behat_general::click_link()
  10. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Page title First page name
    Page contents First page contents
    Description The first one
  11. And I press "Save page" behat_forms::press_button()
  12. And I log out behat_auth::i_log_out()
  13. And I log in as "student1" behat_auth::i_log_in_as()
  14. And I follow "Course 1" behat_general::click_link()
  15. When I follow "Test lesson" behat_general::click_link()
  16. Then I should see "Test lesson is a password protected lesson" behat_general::assert_page_contains_text()
  17. And I should not see "First page contents" behat_general::assert_page_not_contains_text()
  18. And I fill in "userpassword" with "moodle" behat_forms::fill_field()
  19. And I press "Continue" behat_forms::press_button()
  20. And I should see "Login failed, please try again..." behat_general::assert_page_contains_text()
  21. And I should see "Test lesson is a password protected lesson" behat_general::assert_page_contains_text()
  22. And I fill in "userpassword" with "moodle_rules" behat_forms::fill_field()
  23. And I press "Continue" behat_forms::press_button()
  24. And I should see "First page contents" behat_general::assert_page_contains_text()

Feature: A teacher can set a time limit for a lesson

In order to restrict the time students have to complete a lesson
As a teacher
I need to set a time limit

  • @javascript

Scenario: Accessing as student to a lesson with time limit /private/srv/www/loganberry.local/data/40975/moodle/mod/lesson/tests/behat/time_limit.feature:8

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Lesson" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name Test lesson
    timed 1
    maxtime 1
  8. And I follow "Test lesson" behat_general::click_link()
  9. And I follow "Add a content page" behat_general::click_link()
  10. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Page title Lesson page name
    Page contents Single lesson page contents
    Description Single button
  11. And I press "Save page" behat_forms::press_button()
  12. And I log out behat_auth::i_log_out()
  13. And I log in as "student1" behat_auth::i_log_in_as()
  14. And I follow "Course 1" behat_general::click_link()
  15. When I follow "Test lesson" behat_general::click_link()
  16. Then I should see "You have 1 minute(s) to finish the lesson." behat_general::assert_page_contains_text()
  17. And I wait "3" seconds behat_general::i_wait_seconds()
  18. And I should see "Time remaining" behat_general::assert_page_contains_text()
  19. And I press "Single button" behat_forms::press_button()
  20. And I should see "0:00:" behat_general::assert_page_contains_text()
  21. And I should see "Warning: You have 1 minute or less to finish the lesson." behat_general::assert_page_contains_text()
  22. And I wait "60" seconds behat_general::i_wait_seconds()
  23. And I press "Single button" behat_forms::press_button()
  24. And I should see "You ran out of time for this lesson." behat_general::assert_page_contains_text()
  25. And I should see "Your last answer may not have counted if it was answered after the time was up." behat_general::assert_page_contains_text()
  26. And I should see "Congratulations - end of lesson reached" behat_general::assert_page_contains_text()
  27. And I should not see "Single lesson page contents" behat_general::assert_page_not_contains_text()

Feature: Add scorm activity

In order to let students access a scorm package
As a teacher
I need to add scorm activity to a course

  • @javascript

Scenario: Add a scorm activity to a course /private/srv/www/loganberry.local/data/40975/moodle/mod/scorm/tests/behat/add_scorm.feature:8

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. When I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "SCORM package" to section "1" behat_course::i_add_to_section()
  8. And I upload "mod/scorm/tests/packages/singlescobasic.zip" file to "Package file" filepicker behat_repository_upload::i_upload_file_to_filepicker()
  9. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Name Awesome SCORM package
    Description Description
  10. And I click on "Save and display" "button" behat_general::i_click_on()
  11. Then I should see "Awesome SCORM package" behat_general::assert_page_contains_text()
  12. And I should see "Normal" behat_general::assert_page_contains_text()
  13. And I should see "Preview" behat_general::assert_page_contains_text()
  14. And I log out behat_auth::i_log_out()
  15. And I log in as "student1" behat_auth::i_log_in_as()
  16. And I follow "Course 1" behat_general::click_link()
  17. And I follow "Awesome SCORM package" behat_general::click_link()
  18. And I should see "Normal" behat_general::assert_page_contains_text()
  19. And I press "Enter" behat_forms::press_button()
  20. And I switch to "scorm_object" iframe behat_general::switch_to_iframe()
  21. And I switch to "contentFrame" iframe behat_general::switch_to_iframe()
  22. And I should see "Play of the game" behat_general::assert_page_contains_text()

Feature: A teacher can set three types of survey activity

In order to use verified survey instruments
As a teacher
I need to set survey activities and select which survey type suits my needs

Scenario: Switching between the three survey types /private/srv/www/loganberry.local/data/40975/moodle/mod/survey/tests/behat/survey_types.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname format
    Course 1 C1 topics
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. When I add a "Survey" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name Test survey name
    Survey type ATTLS (20 item version)
    Description Test survey description
  8. And I follow "Test survey name" behat_general::click_link()
  9. Then I should see "Attitudes Towards Thinking and Learning" behat_general::assert_page_contains_text()
  10. And I follow "Edit settings" behat_general::click_link()
  11. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Survey type Critical incidents
  12. And I press "Save and display" behat_forms::press_button()
  13. And I should see "At what moment in class were you most engaged as a learner?" behat_general::assert_page_contains_text()
  14. And I follow "Edit settings" behat_general::click_link()
  15. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Survey type COLLES (Preferred and Actual)
  16. And I press "Save and display" behat_forms::press_button()
  17. And I should see "In this online unit..." behat_general::assert_page_contains_text()
  18. And I should see "my learning focuses on issues that interest me." behat_general::assert_page_contains_text()

Feature: A teacher can set a wiki to be collaborative or individual

In order to allow both collaborative wikis and individual journals with history register
As a teacher
I need to select whether the wiki is collaborative or individual

  • @javascript

Scenario: Collaborative and individual wikis /private/srv/www/loganberry.local/data/40975/moodle/mod/wiki/tests/behat/collaborative_individual.feature:8

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
    student2 Student 2 student2@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
    student2 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Wiki" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Wiki name Collaborative wiki name
    Description Collaborative wiki description
    First page name Collaborative index
    Wiki mode Collaborative wiki
  8. And I follow "Collaborative wiki name" behat_general::click_link()
  9. And I press "Create page" behat_forms::press_button()
  10. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    HTML format Collaborative teacher1 edition
  11. And I press "Save" behat_forms::press_button()
  12. And I follow "Course 1" behat_general::click_link()
  13. And I add a "Wiki" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Wiki name Individual wiki name
    Description Individual wiki description
    First page name Individual index
    Wiki mode Individual wiki
  14. And I follow "Individual wiki name" behat_general::click_link()
  15. And I press "Create page" behat_forms::press_button()
  16. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    HTML format Individual teacher1 edition
  17. And I press "Save" behat_forms::press_button()
  18. And I log out behat_auth::i_log_out()
  19. And I log in as "student1" behat_auth::i_log_in_as()
  20. And I follow "Course 1" behat_general::click_link()
  21. When I follow "Collaborative wiki name" behat_general::click_link()
  22. Then I should see "Collaborative teacher1 edition" behat_general::assert_page_contains_text()
  23. And I follow "Edit" behat_general::click_link()
  24. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    HTML format Collaborative student1 edition
  25. And I press "Save" behat_forms::press_button()
  26. And I should not see "Collaborative teacher1 edition" behat_general::assert_page_not_contains_text()
  27. And I should see "Collaborative student1 edition" behat_general::assert_page_contains_text()
  28. And I follow "Course 1" behat_general::click_link()
  29. And I follow "Individual wiki name" behat_general::click_link()
  30. And I should not see "Individual teacher1 edition" behat_general::assert_page_not_contains_text()
  31. And I press "Create page" behat_forms::press_button()
  32. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    HTML format Individual student1 edition
  33. And I press "Save" behat_forms::press_button()
  34. And I log out behat_auth::i_log_out()
  35. And I log in as "student2" behat_auth::i_log_in_as()
  36. And I follow "Course 1" behat_general::click_link()
  37. And I follow "Individual wiki name" behat_general::click_link()
  38. And I should not see "Individual teacher1 edition" behat_general::assert_page_not_contains_text()
  39. And I should not see "Individual student1 edition" behat_general::assert_page_not_contains_text()
  40. And I press "Create page" behat_forms::press_button()
  41. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    HTML format Individual student2 edition
  42. And I press "Save" behat_forms::press_button()
  43. And I log out behat_auth::i_log_out()
  44. And I log in as "teacher1" behat_auth::i_log_in_as()
  45. And I follow "Course 1" behat_general::click_link()
  46. And I follow "Collaborative wiki name" behat_general::click_link()
  47. And I should see "Collaborative student1 edition" behat_general::assert_page_contains_text()
  48. And I follow "Course 1" behat_general::click_link()
  49. And I follow "Individual wiki name" behat_general::click_link()
  50. And I should see "Individual teacher1 edition" behat_general::assert_page_contains_text()
  51. And I should not see "Individual student1 edition" behat_general::assert_page_not_contains_text()
  52. And I select "Student 1" from "uid" behat_forms::select_option()
  53. And I should see "Individual student1 edition" behat_general::assert_page_contains_text()
  54. And I should not see "Individual teacher1 edition" behat_general::assert_page_not_contains_text()
  55. And I select "Student 2" from "uid" behat_forms::select_option()
  56. And I should see "Individual student2 edition" behat_general::assert_page_contains_text()
  57. And I should not see "Individual teacher1 edition" behat_general::assert_page_not_contains_text()

Feature: A history of each wiki page is available

In order to know how a wiki page evolved over the time and how changed what
As a user
I need to check the history of a wiki page

  • @javascript

Scenario: Wiki page edition history changes list /private/srv/www/loganberry.local/data/40975/moodle/mod/wiki/tests/behat/page_history.feature:8

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
    student2 Student 2 student2@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
    student2 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Wiki" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Wiki name Test wiki name
    Description Test wiki description
    First page name First page
    Wiki mode Collaborative wiki
  8. And I follow "Test wiki name" behat_general::click_link()
  9. And I press "Create page" behat_forms::press_button()
  10. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    HTML format First edition
  11. And I press "Save" behat_forms::press_button()
  12. And I log out behat_auth::i_log_out()
  13. When I log in as "student1" behat_auth::i_log_in_as()
  14. And I follow "Course 1" behat_general::click_link()
  15. And I follow "Test wiki name" behat_general::click_link()
  16. And I follow "Edit" behat_general::click_link()
  17. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    HTML format Second edition
  18. And I press "Save" behat_forms::press_button()
  19. And I log out behat_auth::i_log_out()
  20. And I log in as "student2" behat_auth::i_log_in_as()
  21. And I follow "Course 1" behat_general::click_link()
  22. And I follow "Test wiki name" behat_general::click_link()
  23. And I follow "Edit" behat_general::click_link()
  24. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    HTML format Third edition
  25. And I press "Save" behat_forms::press_button()
  26. And I follow "History" behat_general::click_link()
  27. And "//div[@class='region-content']/descendant::table/descendant::tr[4]" "xpath_element" should exists behat_general::should_exists()
  28. And I click on "1" "link" in the "Teacher 1" table row behat_general::i_click_on_in_the_table_row()
  29. And I should see "First edition" behat_general::assert_page_contains_text()
  30. And I should see "Teacher 1" behat_general::assert_page_contains_text()
  31. And I follow "History" behat_general::click_link()
  32. And I click on "2" "link" in the "Student 1" table row behat_general::i_click_on_in_the_table_row()
  33. And I should see "Second edition" behat_general::assert_page_contains_text()
  34. And I should see "Student 1" behat_general::assert_page_contains_text()
  35. And I follow "History" behat_general::click_link()
  36. And I click on "3" "link" in the "Student 2" table row behat_general::i_click_on_in_the_table_row()
  37. And I should see "Third edition" behat_general::assert_page_contains_text()
  38. And I should see "Student 2" in the ".region-content" "css_element" behat_general::assert_element_contains_text()
  39. And I follow "History" behat_general::click_link()
  40. And I click on "comparewith" "radio" in the "Student 1" table row behat_general::i_click_on_in_the_table_row()
  41. And I click on "compare" "radio" in the "Teacher 1" table row behat_general::i_click_on_in_the_table_row()
  42. And I press "Compare selected" behat_forms::press_button()
  43. And I should see "Comparing version 1 with version 3" behat_general::assert_page_contains_text()
  44. And I follow "Next" behat_general::click_link()
  45. And I should see "Comparing version 2 with version 3" behat_general::assert_page_contains_text()

Feature: Edited wiki pages may be previewed before saving

In order to avoid silly mistakes
As a user
I need to preview pages before saving changes

Background: /private/srv/www/loganberry.local/data/40975/moodle/mod/wiki/tests/behat/preview_page.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Wiki" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Wiki name Test wiki name
    Description Test wiki description
    First page name First page
    Wiki mode Collaborative wiki
  8. And I log out behat_auth::i_log_out()
  9. And I log in as "student1" behat_auth::i_log_in_as()
  10. And I follow "Course 1" behat_general::click_link()
  11. And I follow "Test wiki name" behat_general::click_link()
  12. When I press "Create page" behat_forms::press_button()
  13. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    HTML format Student page contents to be previewed
  14. And I press "Preview" behat_forms::press_button()
  15. Then I should see "This is a preview. Changes have not been saved yet" behat_general::assert_page_contains_text()
  16. And I should see "Student page contents to be previewed" behat_general::assert_page_contains_text()
  17. And I press "Save" behat_forms::press_button()
  18. And I should see "Student page contents to be previewed" behat_general::assert_page_contains_text()
  19. And I follow "Edit" behat_general::click_link()
  • @javascript

Scenario: Page contents preview before saving with Javascript enabled /private/srv/www/loganberry.local/data/40975/moodle/mod/wiki/tests/behat/preview_page.feature:42

  1. Then the "HTML format" field should match "<p>Student page contents to be previewed</p>" value behat_forms::the_field_should_match_value()
  2. And I press "Cancel" behat_forms::press_button()

Scenario: Page contents preview before saving with Javascript disabled /private/srv/www/loganberry.local/data/40975/moodle/mod/wiki/tests/behat/preview_page.feature:46

  1. Then the "HTML format" field should match "Student page contents to be previewed" value behat_forms::the_field_should_match_value()
  2. And I press "Cancel" behat_forms::press_button()

Feature: There is a choice of formats for editing a wiki page

In order to allow users to use their favorite wiki format
As a user
I need to choose which wiki format do I want to use

Background: /private/srv/www/loganberry.local/data/40975/moodle/mod/wiki/tests/behat/wiki_formats.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Wiki" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Wiki name Test wiki name
    Description Test wiki description
    First page name First page
  8. And I follow "Test wiki name" behat_general::click_link()
  • @javascript

Scenario: Creole format /private/srv/www/loganberry.local/data/40975/moodle/mod/wiki/tests/behat/wiki_formats.feature:27

  1. When I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Creole format 1
  2. And I press "Create page" behat_forms::press_button()
  3. Then "div.wikieditor-toolbar" "css_element" should exists behat_general::should_exists()
  4. And I click on "//div[@class='wikieditor-toolbar']/descendant::a[1]" "xpath_element" behat_general::i_click_on()
  5. And I click on "//div[@class='wikieditor-toolbar']/descendant::a[2]" "xpath_element" behat_general::i_click_on()
  6. And I click on "//div[@class='wikieditor-toolbar']/descendant::a[4]" "xpath_element" behat_general::i_click_on()
  7. And the "newcontent" field should match "**Bold text**//Italic text//[[Internal link]]" value behat_forms::the_field_should_match_value()
  8. And I click on "//div[@class='wikieditor-toolbar']/descendant::a[8]" "xpath_element" behat_general::i_click_on()
  9. And I press "Save" behat_forms::press_button()
  10. And I should see "Bold textItalic textInternal link" behat_general::assert_page_contains_text()
  11. And I should see "Level 1 Header" behat_general::assert_page_contains_text()
  12. And I should see "Table of contents" behat_general::assert_page_contains_text()
  13. And I click on "Level 1 Header" "link" in the ".wiki-toc" "css_element" behat_general::i_click_on_in_the()
  14. And I follow "Internal link" behat_general::click_link()
  15. And I should see "New page title" behat_general::assert_page_contains_text()
  • @javascript

Scenario: NWiki format /private/srv/www/loganberry.local/data/40975/moodle/mod/wiki/tests/behat/wiki_formats.feature:47

  1. When I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    NWiki format 1
  2. And I press "Create page" behat_forms::press_button()
  3. Then "div.wikieditor-toolbar" "css_element" should exists behat_general::should_exists()
  4. And I click on "//div[@class='wikieditor-toolbar']/descendant::a[2]" "xpath_element" behat_general::i_click_on()
  5. And I click on "//div[@class='wikieditor-toolbar']/descendant::a[4]" "xpath_element" behat_general::i_click_on()
  6. And the "newcontent" field should match "'''Italic text'''[[Internal link]]" value behat_forms::the_field_should_match_value()
  7. And I click on "//div[@class='wikieditor-toolbar']/descendant::a[8]" "xpath_element" behat_general::i_click_on()
  8. And I press "Save" behat_forms::press_button()
  9. And I should see "Italic textInternal link" behat_general::assert_page_contains_text()
  10. And I should see "Level 1 Header" behat_general::assert_page_contains_text()
  11. And I should see "Table of contents" behat_general::assert_page_contains_text()
  12. And I click on "Level 1 Header" "link" in the ".wiki-toc" "css_element" behat_general::i_click_on_in_the()
  13. And I follow "Internal link" behat_general::click_link()
  14. And I should see "New page title" behat_general::assert_page_contains_text()
  • @javascript

Scenario: HTML format /private/srv/www/loganberry.local/data/40975/moodle/mod/wiki/tests/behat/wiki_formats.feature:66

  1. When I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    HTML format 1
  2. And I press "Create page" behat_forms::press_button()
  3. Then "#id_newcontent_editor_tbl" "css_element" should exists behat_general::should_exists()
  4. And ".mce_bold" "css_element" should exists behat_general::should_exists()
  5. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    HTML format I'm a text
  6. And I press "Save" behat_forms::press_button()
  7. And I should see "I'm a text" behat_general::assert_page_contains_text()

Feature: Recent files repository lists the recently used files

In order to save time when selecting files
As a user
I need to use again the files I've just used

  • @javascript

Scenario: Add files recently uploaded /private/srv/www/loganberry.local/data/40975/moodle/repository/recent/tests/behat/add_recent.feature:8

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I expand "My profile" node behat_navigation::i_expand_node()
  4. And I follow "My private files" behat_general::click_link()
  5. And I upload "lib/tests/fixtures/empty.txt" file to "Files" filepicker behat_repository_upload::i_upload_file_to_filepicker()
  6. And I upload "lib/tests/fixtures/upload_users.csv" file to "Files" filepicker behat_repository_upload::i_upload_file_to_filepicker()
  7. And I press "Save changes" behat_forms::press_button()
  8. And I am on homepage behat_general::i_am_on_homepage()
  9. And I follow "Course 1" behat_general::click_link()
  10. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  11. When I add a "Folder" to section "1" behat_course::i_add_to_section()
  12. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Name Folder name
    Description Folder description
  13. And I add "empty.txt" file from recent files to "Files" filepicker behat_repository_recent::i_add_file_from_recent_files_to_filepicker()
  14. And I press "Save and display" behat_forms::press_button()
  15. Then I should see "empty.txt" behat_general::assert_page_contains_text()
  16. And I should see "Folder description" behat_general::assert_page_contains_text()

Feature: Upload files

In order to add contents
As a user
I need to upload files

  • @javascript

Scenario: Upload a file in a multiple file filepicker /private/srv/www/loganberry.local/data/40975/moodle/repository/upload/tests/behat/upload_file.feature:8

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I follow "Admin User" behat_general::click_link()
  4. And I follow "My private files" behat_general::click_link()
  5. And I upload "lib/tests/fixtures/empty.txt" file to "Files" filepicker behat_repository_upload::i_upload_file_to_filepicker()
  6. Then I should see "empty.txt" in the "div.fp-content" "css_element" behat_general::assert_element_contains_text()
  7. And I press "Cancel" behat_forms::press_button()

Feature: Page contents assertions

In order to write good tests
As a tests writer
I need to check the page contents

  • @javascript

Scenario: Basic contents assertions /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/basic_actions.feature:8

  1. Given I log in as "admin" behat_auth::i_log_in_as()
  2. And I am on homepage behat_general::i_am_on_homepage()
  3. And I expand "Users" node behat_navigation::i_expand_node()
  4. And I follow "Groups" behat_general::click_link()
  5. And I press "Create group" behat_forms::press_button()
  6. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Group name I'm the name
    Group description I'm the description
  7. And I press "Save changes" behat_forms::press_button()
  8. When I follow "Overview" behat_general::click_link()
  9. And I wait until the page is ready behat_general::wait_until_the_page_is_ready()
  10. And I wait "2" seconds behat_general::i_wait_seconds()
  11. And I hover ".region-content .generaltable td span" "css_element" behat_general::i_hover()
  12. Then I should see "I'm the description" behat_general::assert_page_contains_text()
  13. And "Grouping" "select" in the "region-main" "region" should be visible behat_general::in_the_should_be_visible()
  14. And "Group" "select" should be visible behat_general::should_be_visible()
  15. And "Messaging" "link" in the "Administration" "block" should not be visible behat_general::in_the_should_not_be_visible()
  16. And "Change password" "link" should not be visible behat_general::should_not_be_visible()
  17. And I should see "Filter groups by" behat_general::assert_page_contains_text()
  18. And I should not see "Filter groupssss by" behat_general::assert_page_not_contains_text()
  19. And I should see "Group members" in the ".region-content table th.c1" "css_element" behat_general::assert_element_contains_text()
  20. And I should not see "Group membersssss" in the ".region-content table th.c1" "css_element" behat_general::assert_element_not_contains_text()
  21. And I follow "Groups" behat_general::click_link()
  22. And the "#groupeditform #showcreateorphangroupform" "css_element" should be enabled behat_general::the_element_should_be_enabled()
  23. And the "#groupeditform #showeditgroupsettingsform" "css_element" should be disabled behat_general::the_element_should_be_disabled()
  • @javascript

Scenario: Locators inside specific DOM nodes using CSS selectors /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/basic_actions.feature:36

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I follow "Course 1" behat_general::click_link()
  4. When I click on "Move this to the dock" "button" in the "Administration" "block" behat_general::i_click_on_in_the()
  5. Then I should not see "Question bank" in the "region-pre" "region" behat_general::assert_element_not_contains_text()
  6. And I click on "//div[@id='dock']/descendant::h2[normalize-space(.)='Administration']" "xpath_element" behat_general::i_click_on()
  • @javascript

Scenario: Locators inside specific DOM nodes using XPath /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/basic_actions.feature:47

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. When I click on "Move this to the dock" "button" in the "Administration" "block" behat_general::i_click_on_in_the()
  4. Then I should not see "Turn editing on" in the "region-pre" "region" behat_general::assert_element_not_contains_text()

Feature: Set up contextual data for tests

In order to write tests quickly
As a developer
I need to fill the database with fixtures

Scenario: Add a bunch of users /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/data_generators.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username password firstname lastname
    testuser testuser
    testuser2 testuser2 TestFirstname TestLastname
  2. And I log in as "testuser" behat_auth::i_log_in_as()
  3. And I log out behat_auth::i_log_out()
  4. When I log in as "testuser2" behat_auth::i_log_in_as()
  5. Then I should see "TestFirstname" behat_general::assert_page_contains_text()
  • @javascript

Scenario: Add a bunch of courses and categories /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/data_generators.feature:18

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
    Cat 2 CAT1 CAT2
    Cat 3 CAT1 CAT3
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 COURSE1 CAT3
    Course 2 COURSE2 CAT3
    Course 3 COURSE3 0
  3. When I log in as "admin" behat_auth::i_log_in_as()
  4. Then I should see "Course 1" behat_general::assert_page_contains_text()
  5. And I should see "Course 2" behat_general::assert_page_contains_text()
  6. And I should see "Course 3" behat_general::assert_page_contains_text()
  7. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  8. And I follow "Cat 1" behat_general::click_link()
  9. And I should see "Cat 2" behat_general::assert_page_contains_text()
  10. And I should see "Cat 3" behat_general::assert_page_contains_text()
  11. And I follow "Cat 3" behat_general::click_link()
  12. And I should see "Course 1" behat_general::assert_page_contains_text()
  13. And I should see "Course 2" behat_general::assert_page_contains_text()
  14. And I follow "Cat 2" behat_general::click_link()
  15. And I should see "No courses in this category" behat_general::assert_page_contains_text()
  16. And I follow "Miscellaneous" behat_general::click_link()
  17. And I should see "Course 3" behat_general::assert_page_contains_text()
  • @javascript

Scenario: Add a bunch of groups and groupings /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/data_generators.feature:46

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname
    Course 1 C1
  2. And the following "groups" exists: behat_data_generators::the_following_exists()
    name course idnumber
    Group 1 C1 G1
    Group 2 C1 G2
  3. And the following "groupings" exists: behat_data_generators::the_following_exists()
    name course idnumber
    Grouping 1 C1 GG1
    Grouping 2 C1 GG2
  4. When I log in as "admin" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I expand "Users" node behat_navigation::i_expand_node()
  7. And I follow "Groups" behat_general::click_link()
  8. Then I should see "Group 1" behat_general::assert_page_contains_text()
  9. And I should see "Group 2" behat_general::assert_page_contains_text()
  10. And I follow "Groupings" behat_general::click_link()
  11. And I should see "Grouping 1" behat_general::assert_page_contains_text()
  12. And I should see "Grouping 2" behat_general::assert_page_contains_text()
  • @javascript

Scenario: Role overrides /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/data_generators.feature:69

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
  2. And the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
  3. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname
    Course 1 C1
  4. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    student1 C1 student
    teacher1 C1 editingteacher
  5. And the following "permission overrides" exists: behat_data_generators::the_following_exists()
    capability permission role contextlevel reference
    mod/forum:editanypost Allow student Course C1
    mod/forum:replynews Prevent editingteacher Course C1
  6. When I log in as "admin" behat_auth::i_log_in_as()
  7. And I follow "Course 1" behat_general::click_link()
  8. And I expand "Users" node behat_navigation::i_expand_node()
  9. And I follow "Permissions" behat_general::click_link()
  10. And I select "Student (1)" from "Advanced role override" behat_forms::select_option()
  11. Then the "mod/forum:editanypost" field should match "1" value behat_forms::the_field_should_match_value()
  12. And I press "Cancel" behat_forms::press_button()
  13. And I select "Teacher (1)" from "Advanced role override" behat_forms::select_option()
  14. And the "mod/forum:replynews" field should match "-1" value behat_forms::the_field_should_match_value()
  15. And I press "Cancel" behat_forms::press_button()

Scenario: Add course enrolments /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/data_generators.feature:99

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    student1 Student 1 student1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname format
    Course 1 C1 topics
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    student1 C1 student
  4. When I log in as "student1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. Then I should see "Topic 1" behat_general::assert_page_contains_text()

Scenario: Add role assigns /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/data_generators.feature:113

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    user1 User 1 user1@moodlemoodle.com
    user2 User 2 user2@moodlemoodle.com
    user3 User 3 user3@moodlemoodle.com
  2. And the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
  3. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 CAT1
  4. And the following "role assigns" exists: behat_data_generators::the_following_exists()
    user role contextlevel reference
    user1 manager System
    user2 editingteacher Category CAT1
    user3 editingteacher Course C1
  5. When I log in as "user1" behat_auth::i_log_in_as()
  6. Then I should see "Front page settings" behat_general::assert_page_contains_text()
  7. And I log out behat_auth::i_log_out()
  8. And I log in as "user2" behat_auth::i_log_in_as()
  9. And I follow "Course 1" behat_general::click_link()
  10. And I should see "Turn editing on" behat_general::assert_page_contains_text()
  11. And I log out behat_auth::i_log_out()
  12. And I log in as "user3" behat_auth::i_log_in_as()
  13. And I follow "Course 1" behat_general::click_link()
  14. And I should see "Turn editing on" behat_general::assert_page_contains_text()

Scenario: Add modules /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/data_generators.feature:141

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname
    Course 1 C1
  2. And the following "activities" exists: behat_data_generators::the_following_exists()
    activity name intro course idnumber
    assign Test assignment name Test assignment description C1 assign1
    data Test database name Test database description C1 data1
  3. When I log in as "admin" behat_auth::i_log_in_as()
  4. And I follow "Course 1" behat_general::click_link()
  5. Then I should see "Test assignment name" behat_general::assert_page_contains_text()
  6. And I should see "Test database name" behat_general::assert_page_contains_text()
  7. And I follow "Test assignment name" behat_general::click_link()
  8. And I should see "Test assignment description" behat_general::assert_page_contains_text()
  • @javascript

Scenario: Add relations between users and groups /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/data_generators.feature:157

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    student1 Student 1 student1@asd.com
    student2 Student 2 student2@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname
    Course 1 C1
  3. And the following "groups" exists: behat_data_generators::the_following_exists()
    name course idnumber
    Group 1 C1 G1
    Group 2 C1 G2
  4. And the following "groupings" exists: behat_data_generators::the_following_exists()
    name course idnumber
    Grouping 1 C1 GG1
  5. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    student1 C1 student
    student2 C1 student
  6. And the following "group members" exists: behat_data_generators::the_following_exists()
    user group
    student1 G1
    student2 G2
  7. And the following "grouping groups" exists: behat_data_generators::the_following_exists()
    grouping group
    GG1 G1
  8. When I log in as "admin" behat_auth::i_log_in_as()
  9. And I follow "Course 1" behat_general::click_link()
  10. And I expand "Users" node behat_navigation::i_expand_node()
  11. And I follow "Groups" behat_general::click_link()
  12. Then the "groups" select box should contain "Group 1 (1)" behat_forms::the_select_box_should_contain()
  13. And the "groups" select box should contain "Group 2 (1)" behat_forms::the_select_box_should_contain()
  14. And I select "Group 1 (1)" from "groups" behat_forms::select_option()
  15. And I wait "5" seconds behat_general::i_wait_seconds()
  16. And the "members" select box should contain "Student 1" behat_forms::the_select_box_should_contain()
  17. And I select "Group 2 (1)" from "groups" behat_forms::select_option()
  18. And I wait "5" seconds behat_general::i_wait_seconds()
  19. And the "members" select box should contain "Student 2" behat_forms::the_select_box_should_contain()

Feature: Edit capabilities

In order to extend and restrict moodle features
As an admin or a teacher
I need to allow/deny the existing capabilities at different levels

Background: /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/edit_permissions.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  • @javascript

Scenario: Default system capabilities modification /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/edit_permissions.feature:19

  1. Given I log in as "admin" behat_auth::i_log_in_as()
  2. And I set the following system permissions of "Teacher" role: behat_permissions::i_set_the_following_system_permissions_of_role()
    capability permission
    block/mnet_hosts:myaddinstance Allow
    moodle/community:add Inherit
    moodle/grade:managesharedforms Prevent
    moodle/course:request Prohibit
  3. When I follow "Edit Teacher role" behat_general::click_link()
  4. Then the "block/mnet_hosts:myaddinstance" field should match "1" value behat_forms::the_field_should_match_value()
  5. And the "moodle/community:add" field should match "0" value behat_forms::the_field_should_match_value()
  6. And the "moodle/grade:managesharedforms" field should match "-1" value behat_forms::the_field_should_match_value()
  7. And the "moodle/course:request" field should match "-1000" value behat_forms::the_field_should_match_value()
  • @javascript

Scenario: Course capabilities overrides /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/edit_permissions.feature:34

  1. Given I log in as "teacher1" behat_auth::i_log_in_as()
  2. And I follow "Course 1" behat_general::click_link()
  3. And I expand "Users" node behat_navigation::i_expand_node()
  4. And I follow "Permissions" behat_general::click_link()
  5. And I override the system permissions of "Student" role with: behat_permissions::i_override_the_system_permissions_of_role_with()
    mod/forum:deleteanypost Prohibit
    mod/forum:editanypost Prevent
    mod/forum:addquestion Allow
  6. When I select "Student (3)" from "Advanced role override" behat_forms::select_option()
  7. Then the "mod/forum:deleteanypost" field should match "-1000" value behat_forms::the_field_should_match_value()
  8. And the "mod/forum:editanypost" field should match "-1" value behat_forms::the_field_should_match_value()
  9. And the "mod/forum:addquestion" field should match "1" value behat_forms::the_field_should_match_value()
  • @javascript

Scenario: Module capabilities overrides /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/edit_permissions.feature:49

  1. Given I log in as "teacher1" behat_auth::i_log_in_as()
  2. And I follow "Course 1" behat_general::click_link()
  3. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  4. And I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name I'm the name
    Description I'm the introduction
  5. And I follow "I'm the name" behat_general::click_link()
  6. And I follow "Permissions" behat_general::click_link()
  7. And I override the system permissions of "Student" role with: behat_permissions::i_override_the_system_permissions_of_role_with()
    mod/forum:deleteanypost Prohibit
    mod/forum:editanypost Prevent
    mod/forum:addquestion Allow
  8. When I select "Student (3)" from "Advanced role override" behat_forms::select_option()
  9. Then the "mod/forum:deleteanypost" field should match "-1000" value behat_forms::the_field_should_match_value()
  10. And the "mod/forum:editanypost" field should match "-1" value behat_forms::the_field_should_match_value()
  11. And the "mod/forum:addquestion" field should match "1" value behat_forms::the_field_should_match_value()

Feature: List the system steps definitions

In order to create new tests
As a tests writer
I need to list and filter the system steps definitions

Background: /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/list_steps.feature:7

  1. Given I am on homepage behat_general::i_am_on_homepage()
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I expand "Site administration" node behat_navigation::i_expand_node()
  4. And I expand "Development" node behat_navigation::i_expand_node()
  5. And I follow "Acceptance testing" behat_general::click_link()
  • @javascript

Scenario: Accessing the list /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/list_steps.feature:15

  1. Then I should see "Steps definitions" behat_general::assert_page_contains_text()
  2. And I should not see "There aren't steps definitions matching this filter" behat_general::assert_page_not_contains_text()
  • @javascript

Scenario: Filtering by type /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/list_steps.feature:20

  1. Given I select "Then. Checkings to ensure the outcomes are the expected ones" from "Type" behat_forms::select_option()
  2. When I press "Filter" behat_forms::press_button()
  3. Then I should see "Checks, that page contains specified text." behat_general::assert_page_contains_text()
  4. And I should not see "Opens Moodle homepage." behat_general::assert_page_not_contains_text()
  • @javascript

Scenario: Filtering by keyword /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/list_steps.feature:27

  1. Given I fill in "Contains" with "homepage" behat_forms::fill_field()
  2. When I press "Filter" behat_forms::press_button()
  3. Then I should see "Opens Moodle homepage." behat_general::assert_page_contains_text()

Feature: Forms manipulation

In order to interact with Moodle
As a user
I need to set forms values

  • @javascript

Scenario: Basic forms manipulation /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/manipulate_forms.feature:8

  1. Given I log in as "admin" behat_auth::i_log_in_as()
  2. And I follow "Admin User" behat_general::click_link()
  3. And I follow "Edit profile" behat_general::click_link()
  4. When I fill in "First name" with "Field value" behat_forms::fill_field()
  5. And I select "Plain text area" from "Text editor" behat_forms::select_option()
  6. And I check "Unmask" behat_forms::check_option()
  7. Then the "First name" field should match "Field value" value behat_forms::the_field_should_match_value()
  8. And the "Text editor" select box should contain "Plain text area" behat_forms::the_select_box_should_contain()
  9. And the "Unmask" checkbox should be checked behat_forms::assert_checkbox_checked()
  10. And I uncheck "Unmask" behat_forms::uncheck_option()
  11. And the "Unmask" checkbox should not be checked behat_forms::assert_checkbox_not_checked()
  12. And I press "Update profile" behat_forms::press_button()
  • @javascript

Scenario: Expand all fieldsets and advanced elements /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/manipulate_forms.feature:23

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I follow "Course 1" behat_general::click_link()
  4. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  5. And I add a "Quiz" to section "1" behat_course::i_add_to_section()
  6. When I expand all fieldsets behat_forms::i_expand_all_fieldsets()
  7. Then I should see "Close the quiz" behat_general::assert_page_contains_text()
  8. And I should see "Group mode" behat_general::assert_page_contains_text()
  9. And I should see "Grouping" behat_general::assert_page_contains_text()
  10. And I should not see "Show more..." in the "region-main-box" "region" behat_general::assert_element_not_contains_text()
  11. And I should see "Show less..." behat_general::assert_page_contains_text()

Feature: Transform steps arguments

In order to write tests with complex nasty arguments
As a tests writer
I need to apply some transformations to the steps arguments

Background: /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/nasty_strings.feature:7

  1. Given I am on homepage behat_general::i_am_on_homepage()
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I follow "Admin User" behat_general::click_link()
  5. And I follow "Edit profile" behat_general::click_link()

Scenario: Use nasty strings on steps arguments /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/nasty_strings.feature:16

  1. When I fill in "Surname" with "$NASTYSTRING1" behat_forms::fill_field()
  2. And I fill in "Description" with "$NASTYSTRING2" behat_forms::fill_field()
  3. And I fill in "City/town" with "$NASTYSTRING3" behat_forms::fill_field()
  4. And I press "Update profile" behat_forms::press_button()
  5. And I follow "Edit profile" behat_general::click_link()
  6. Then I should not see "NASTYSTRING" behat_general::assert_page_not_contains_text()
  7. And the "Surname" field should match "$NASTYSTRING1" value behat_forms::the_field_should_match_value()
  8. And the "City/town" field should match "$NASTYSTRING3" value behat_forms::the_field_should_match_value()

Scenario: Use nasty strings on table nodes /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/nasty_strings.feature:26

  1. When I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Surname \\" \ , ; : . 日本語­% < > & < > & ' \" \ '$@NULL@$ @@TEST@@ %%
    Description ' \" \ '$@NULL@$ @@TEST@@ < > & < > & \\" \ , ; : . 日本語­% %%
    City/town & ' \" \ '$@NULL@$ < > & < > @@TEST@@ \\" \ , ; : . 日本語­% %%
  2. And I press "Update profile" behat_forms::press_button()
  3. And I follow "Edit profile" behat_general::click_link()
  4. Then I should not see "NASTYSTRING" behat_general::assert_page_not_contains_text()
  5. And the "Surname" field should match "$NASTYSTRING1" value behat_forms::the_field_should_match_value()
  6. And the "City/town" field should match "$NASTYSTRING3" value behat_forms::the_field_should_match_value()

Scenario: Use double quotes /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/nasty_strings.feature:37

  1. When I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    First name va"lue1
    Description va\"lue2
  2. And I fill in "City/town" with "va\"lue3" behat_forms::fill_field()
  3. And I press "Update profile" behat_forms::press_button()
  4. And I follow "Edit profile" behat_general::click_link()
  5. Then I should not see "NASTYSTRING" behat_general::assert_page_not_contains_text()
  6. And the "First name" field should match "va\"lue1" value behat_forms::the_field_should_match_value()
  7. And the "Description" field should match "va\\"lue2" value behat_forms::the_field_should_match_value()
  8. And the "City/town" field should match "va\"lue3" value behat_forms::the_field_should_match_value()
  • @javascript

Scenario: Nasty strings with other contents /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/nasty_strings.feature:50

  1. When I fill in "First name" with "My Firstname $NASTYSTRING1" behat_forms::fill_field()
  2. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Surname My Surname < > & < > \\" \ , ; : . 日本語& ' \" \ '$@NULL@$ @@TEST@@­% %%
  3. And I press "Update profile" behat_forms::press_button()
  4. And I follow "Edit profile" behat_general::click_link()
  5. Then I should not see "NASTYSTRING" behat_general::assert_page_not_contains_text()
  6. And I should see "My Firstname" behat_general::assert_page_contains_text()
  7. And I should see "My Surname" behat_general::assert_page_contains_text()
  8. And the "First name" field should match "My Firstname $NASTYSTRING1" value behat_forms::the_field_should_match_value()
  9. And the "Surname" field should match "My Surname $NASTYSTRING2" value behat_forms::the_field_should_match_value()

Feature: Set up the testing environment

In order to execute automated acceptance tests
As a developer
I need to use the test environment instead of the regular environment

Scenario: Accessing the site /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/behat/tests/behat/test_environment.feature:7

  1. When I am on homepage behat_general::i_am_on_homepage()
  2. Then I should see "Acceptance test site" behat_general::assert_page_contains_text()

Feature: An admin can create courses using a CSV file

In order to create courses using a CSV file
As an admin
I need to be able to upload a CSV file and navigate through the import process

Background: /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/uploadcourse/tests/behat/create.feature:7

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    First course C1 0
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I expand "Site administration" node behat_navigation::i_expand_node()
  4. And I expand "Courses" node behat_navigation::i_expand_node()
  5. And I follow "Upload courses" behat_general::click_link()
  • @javascript

Scenario: Creation of unexisting courses /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/uploadcourse/tests/behat/create.feature:17

  1. Given I upload "admin/tool/uploadcourse/tests/fixtures/courses.csv" file to "File" filepicker behat_repository_upload::i_upload_file_to_filepicker()
  2. And I click on "Preview" "button" behat_general::i_click_on()
  3. When I click on "Upload courses" "button" behat_general::i_click_on()
  4. Then I should see "The course exists and update is not allowed" behat_general::assert_page_contains_text()
  5. And I should see "Course created" behat_general::assert_page_contains_text()
  6. And I should see "Courses total: 3" behat_general::assert_page_contains_text()
  7. And I should see "Courses created: 2" behat_general::assert_page_contains_text()
  8. And I should see "Courses errors: 1" behat_general::assert_page_contains_text()
  9. And I follow "Home" behat_general::click_link()
  10. And I should see "Course 2" behat_general::assert_page_contains_text()
  11. And I should see "Course 3" behat_general::assert_page_contains_text()
  • @javascript

Scenario: Creation of existing courses /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/uploadcourse/tests/behat/create.feature:31

  1. Given I upload "admin/tool/uploadcourse/tests/fixtures/courses.csv" file to "File" filepicker behat_repository_upload::i_upload_file_to_filepicker()
  2. And I select "Create all, increment shortname if needed" from "Upload mode" behat_forms::select_option()
  3. And I click on "Preview" "button" behat_general::i_click_on()
  4. When I click on "Upload courses" "button" behat_general::i_click_on()
  5. Then I should see "Course created" behat_general::assert_page_contains_text()
  6. And I should see "Course shortname incremented C1 -> C2" behat_general::assert_page_contains_text()
  7. And I should see "Course shortname incremented C2 -> C3" behat_general::assert_page_contains_text()
  8. And I should see "Course shortname incremented C3 -> C4" behat_general::assert_page_contains_text()
  9. And I should see "Courses total: 3" behat_general::assert_page_contains_text()
  10. And I should see "Courses created: 3" behat_general::assert_page_contains_text()
  11. And I should see "Courses errors: 0" behat_general::assert_page_contains_text()
  12. And I follow "Home" behat_general::click_link()
  13. And I should see "Course 1" behat_general::assert_page_contains_text()
  14. And I should see "Course 2" behat_general::assert_page_contains_text()
  15. And I should see "Course 3" behat_general::assert_page_contains_text()

Feature: An admin can update courses using a CSV file

In order to update courses using a CSV file
As an admin
I need to be able to upload a CSV file and navigate through the import process

Background: /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/uploadcourse/tests/behat/update.feature:7

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Some random name C1 0
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I expand "Site administration" node behat_navigation::i_expand_node()
  4. And I expand "Courses" node behat_navigation::i_expand_node()
  5. And I follow "Upload courses" behat_general::click_link()
  • @javascript

Scenario: Updating a course fullname /private/srv/www/loganberry.local/data/40975/moodle/admin/tool/uploadcourse/tests/behat/update.feature:17

  1. Given I upload "admin/tool/uploadcourse/tests/fixtures/courses.csv" file to "File" filepicker behat_repository_upload::i_upload_file_to_filepicker()
  2. And I select "Only update existing courses" from "Upload mode" behat_forms::select_option()
  3. And I select "Update with CSV data only" from "Update mode" behat_forms::select_option()
  4. And I click on "Preview" "button" behat_general::i_click_on()
  5. When I click on "Upload courses" "button" behat_general::i_click_on()
  6. Then I should see "Course updated" behat_general::assert_page_contains_text()
  7. And I should see "The course does not exist and creating course is not allowed" behat_general::assert_page_contains_text()
  8. And I should see "Courses total: 3" behat_general::assert_page_contains_text()
  9. And I should see "Courses updated: 1" behat_general::assert_page_contains_text()
  10. And I should see "Courses created: 0" behat_general::assert_page_contains_text()
  11. And I should see "Courses errors: 2" behat_general::assert_page_contains_text()
  12. And I follow "Home" behat_general::click_link()
  13. And I should see "Course 1" behat_general::assert_page_contains_text()
  14. And I should not see "Course 2" behat_general::assert_page_not_contains_text()
  15. And I should not see "Course 3" behat_general::assert_page_not_contains_text()

Feature: Display extended course names

In order to display more info about the courses
As an admin
I need to display courses short names along with courses full names

Background: /private/srv/www/loganberry.local/data/40975/moodle/admin/tests/behat/display_short_names.feature:7

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course fullname C_shortname 0
  2. And I log in as "admin" behat_auth::i_log_in_as()

Scenario: Courses list without extended course names (default value) /private/srv/www/loganberry.local/data/40975/moodle/admin/tests/behat/display_short_names.feature:13

  1. Then I should see "Course fullname" behat_general::assert_page_contains_text()
  2. And I should not see "C_shortname Course fullname" behat_general::assert_page_not_contains_text()

Scenario: Courses list with extended course names /private/srv/www/loganberry.local/data/40975/moodle/admin/tests/behat/display_short_names.feature:17

  1. Given I go to notifications page behat_admin::i_go_to_notifications_page()
  2. And I click on "Courses" "link" in the "//div[@id='settingsnav']/descendant::li[contains(concat(' ', normalize-space(@class), ' '), ' type_setting ')][contains(., 'Appearance')]" "xpath_element" behat_general::i_click_on_in_the()
  3. And I check "Display extended course names" behat_forms::check_option()
  4. When I press "Save changes" behat_forms::press_button()
  5. And I am on homepage behat_general::i_am_on_homepage()
  6. Then I should see "C_shortname Course fullname" behat_general::assert_page_contains_text()

Feature: An administrator can filter user accounts by role, cohort and other profile fields

In order to find the user accounts I am looking for
As an admin
I need to filter the users account list using different filter

Background: /private/srv/www/loganberry.local/data/40975/moodle/admin/tests/behat/filter_users.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email auth confirmed
    user1 User One one@asd.com manual 0
    user2 User Two one@asd.com ldap 1
    user3 User Three one@asd.com manual 1
    user4 User Four one@asd.com ldap 0
  2. And the following "cohorts" exists: behat_data_generators::the_following_exists()
    name idnumber
    Cohort 1 CH1
  3. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  4. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    user1 C1 student
    user2 C1 student
    user3 C1 student
  5. And I log in as "admin" behat_auth::i_log_in_as()
  6. And I add "user2" user to "CH1" cohort behat_cohort::i_add_user_to_cohort()
  7. And I add "user3" user to "CH1" cohort behat_cohort::i_add_user_to_cohort()
  8. And I follow "Browse list of users" behat_general::click_link()
  • @javascript

Scenario: Filter user accounts by role and cohort /private/srv/www/loganberry.local/data/40975/moodle/admin/tests/behat/filter_users.feature:31

  1. When I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    courserole_rl Student
    courserole_ct any category
    courserole C1
  2. And I press "Add filter" behat_forms::press_button()
  3. Then I should see "User One" behat_general::assert_page_contains_text()
  4. And I should see "User Two" behat_general::assert_page_contains_text()
  5. And I should see "User Three" behat_general::assert_page_contains_text()
  6. And I should not see "User Four" behat_general::assert_page_not_contains_text()
  7. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    cohort CH1
  8. And I press "Add filter" behat_forms::press_button()
  9. And I should not see "User One" behat_general::assert_page_not_contains_text()
  10. And I should see "User Two" behat_general::assert_page_contains_text()
  11. And I should see "User Three" behat_general::assert_page_contains_text()
  12. And I should not see "User Four" behat_general::assert_page_not_contains_text()
  13. And I press "Remove all filters" behat_forms::press_button()
  14. And I should see "User One" behat_general::assert_page_contains_text()
  15. And I should see "User Two" behat_general::assert_page_contains_text()
  16. And I should see "User Three" behat_general::assert_page_contains_text()
  17. And I should see "User Four" behat_general::assert_page_contains_text()
  • @javascript

Scenario: Filter user accounts by confirm and authentication method /private/srv/www/loganberry.local/data/40975/moodle/admin/tests/behat/filter_users.feature:55

  1. When I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Confirmed No
  2. And I press "Add filter" behat_forms::press_button()
  3. Then I should see "User One" behat_general::assert_page_contains_text()
  4. And I should not see "User Two" behat_general::assert_page_not_contains_text()
  5. And I should not see "User Three" behat_general::assert_page_not_contains_text()
  6. And I should see "User Four" behat_general::assert_page_contains_text()
  7. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Authentication manual
  8. And I press "Add filter" behat_forms::press_button()
  9. And I should see "User One" behat_general::assert_page_contains_text()
  10. And I should not see "User Two" behat_general::assert_page_not_contains_text()
  11. And I should not see "User Three" behat_general::assert_page_not_contains_text()
  12. And I should not see "User Four" behat_general::assert_page_not_contains_text()

Feature: Upload users

In order to add users to the system
As an admin
I need to upload files containing the users data

  • @javascript

Scenario: Upload users enrolling them on courses and groups /private/srv/www/loganberry.local/data/40975/moodle/admin/tests/behat/upload_users.feature:8

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Maths math102 0
  2. And the following "groups" exists: behat_data_generators::the_following_exists()
    name course idnumber
    Section 1 math102 S1
    Section 3 math102 S3
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I collapse "Front page settings" node behat_navigation::i_collapse_node()
  5. And I expand "Site administration" node behat_navigation::i_expand_node()
  6. And I expand "Users" node behat_navigation::i_expand_node()
  7. And I expand "Accounts" node behat_navigation::i_expand_node()
  8. And I follow "Upload users" behat_general::click_link()
  9. When I upload "lib/tests/fixtures/upload_users.csv" file to "File" filepicker behat_repository_upload::i_upload_file_to_filepicker()
  10. And I press "Upload users" behat_forms::press_button()
  11. Then I should see "Upload users preview" behat_general::assert_page_contains_text()
  12. And I should see "Tom" behat_general::assert_page_contains_text()
  13. And I should see "Jones" behat_general::assert_page_contains_text()
  14. And I should see "verysecret" behat_general::assert_page_contains_text()
  15. And I should see "jonest@someplace.edu" behat_general::assert_page_contains_text()
  16. And I should see "Reznor" behat_general::assert_page_contains_text()
  17. And I should see "course1" behat_general::assert_page_contains_text()
  18. And I should see "math102" behat_general::assert_page_contains_text()
  19. And I should see "group1" behat_general::assert_page_contains_text()
  20. And I should see "Section 1" behat_general::assert_page_contains_text()
  21. And I press "Upload users" behat_forms::press_button()
  22. And I press "Continue" behat_forms::press_button()
  23. And I follow "Browse list of users" behat_general::click_link()
  24. And I should see "Tom Jones" behat_general::assert_page_contains_text()
  25. And I should see "Trent Reznor" behat_general::assert_page_contains_text()
  26. And I should see "reznor@someplace.edu" behat_general::assert_page_contains_text()
  27. And I am on homepage behat_general::i_am_on_homepage()
  28. And I follow "Maths" behat_general::click_link()
  29. And I expand "Users" node behat_navigation::i_expand_node()
  30. And I follow "Groups" behat_general::click_link()
  31. And I select "Section 1 (1)" from "groups" behat_forms::select_option()
  32. And I wait "4" seconds behat_general::i_wait_seconds()
  33. And the "members" select box should contain "Tom Jones" behat_forms::the_select_box_should_contain()

Feature: Authentication

In order to validate my credentials in the system
As a user
I need to log into the system

Scenario: Log in with the predefined admin user /private/srv/www/loganberry.local/data/40975/moodle/auth/tests/behat/login.feature:7

  1. Given I log in as "admin" behat_auth::i_log_in_as()

Scenario: Log in as an existing admin user filling the form /private/srv/www/loganberry.local/data/40975/moodle/auth/tests/behat/login.feature:10

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username password firstname lastname email
    testuser testuser Test User moodle@moodlemoodle.com
  2. And I am on homepage behat_general::i_am_on_homepage()
  3. When I follow "Log in" behat_general::click_link()
  4. And I fill in "Username" with "testuser" behat_forms::fill_field()
  5. And I fill in "Password" with "testuser" behat_forms::fill_field()
  6. And I press "Log in" behat_forms::press_button()
  7. Then I should see "You are logged in as" behat_general::assert_page_contains_text()

Scenario: Log in as an unexisting user filling the form /private/srv/www/loganberry.local/data/40975/moodle/auth/tests/behat/login.feature:21

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username password firstname lastname email
    testuser testuser Test User moodle@moodlemoodle.com
  2. And I am on homepage behat_general::i_am_on_homepage()
  3. When I follow "Log in" behat_general::click_link()
  4. And I fill in "Username" with "testuser" behat_forms::fill_field()
  5. And I fill in "Password" with "unexisting" behat_forms::fill_field()
  6. And I press "Log in" behat_forms::press_button()
  7. Then I should see "Invalid login, please try again" behat_general::assert_page_contains_text()

Scenario: Log out /private/srv/www/loganberry.local/data/40975/moodle/auth/tests/behat/login.feature:32

  1. Given I log in as "admin" behat_auth::i_log_in_as()
  2. When I log out behat_auth::i_log_out()
  3. Then I should see "You are not logged in" behat_general::assert_page_contains_text()

Feature: Add badges to the system

In order to give badges to users for their achievements
As an admin
I need to manage badges in the system

Background: /private/srv/www/loganberry.local/data/40975/moodle/badges/tests/behat/add_badge.feature:7

  1. Given I am on homepage behat_general::i_am_on_homepage()
  2. And I log in as "admin" behat_auth::i_log_in_as()
  • @javascript

Scenario: Setting badges settings /private/srv/www/loganberry.local/data/40975/moodle/badges/tests/behat/add_badge.feature:12

  1. Given I expand "Site administration" node behat_navigation::i_expand_node()
  2. And I expand "Badges" node behat_navigation::i_expand_node()
  3. And I follow "Badges settings" behat_general::click_link()
  4. And I fill in "Default badge issuer name" with "Test Badge Site" behat_forms::fill_field()
  5. And I fill in "Default badge issuer contact details" with "testuser@test-badge-site.com" behat_forms::fill_field()
  6. And I press "Save changes" behat_forms::press_button()
  7. When I follow "Add a new badge" behat_general::click_link()
  8. Then the "issuercontact" field should match "testuser@test-badge-site.com" value behat_forms::the_field_should_match_value()
  9. And the "issuername" field should match "Test Badge Site" value behat_forms::the_field_should_match_value()
  • @javascript

Scenario: Accessing the badges /private/srv/www/loganberry.local/data/40975/moodle/badges/tests/behat/add_badge.feature:24

  1. Given I expand "Site pages" node behat_navigation::i_expand_node()
  2. And I follow "Site badges" behat_general::click_link()
  3. Then I should see "There are no badges available." behat_general::assert_page_contains_text()
  • @javascript

Scenario: Add a badge /private/srv/www/loganberry.local/data/40975/moodle/badges/tests/behat/add_badge.feature:30

  1. Given I expand "Site administration" node behat_navigation::i_expand_node()
  2. And I expand "Badges" node behat_navigation::i_expand_node()
  3. And I follow "Add a new badge" behat_general::click_link()
  4. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Name Test Badge
    Description Test badge description
    issuername Test Badge Site
    issuercontact testuser@test-badge-site.com
  5. And I upload "badges/tests/behat/badge.png" file to "Image" filepicker behat_repository_upload::i_upload_file_to_filepicker()
  6. When I press "Create badge" behat_forms::press_button()
  7. Then I should see "Edit details" behat_general::assert_page_contains_text()
  8. And I should see "Test Badge" behat_general::assert_page_contains_text()
  9. And I should not see "Create badge" behat_general::assert_page_not_contains_text()
  10. And I follow "Manage badges" behat_general::click_link()
  11. And I should see "Number of badges available: 1" behat_general::assert_page_contains_text()
  12. And I should not see "There are no badges available." behat_general::assert_page_not_contains_text()

Feature: Award badges

In order to award badges to users for their achievements
As an admin
I need to add criteria to badges in the system

Background: /private/srv/www/loganberry.local/data/40975/moodle/badges/tests/behat/award_badge.feature:7

  1. Given I am on homepage behat_general::i_am_on_homepage()
  2. And I log in as "admin" behat_auth::i_log_in_as()
  • @javascript

Scenario: Award profile badge /private/srv/www/loganberry.local/data/40975/moodle/badges/tests/behat/award_badge.feature:12

  1. Given I expand "Site administration" node behat_navigation::i_expand_node()
  2. And I expand "Badges" node behat_navigation::i_expand_node()
  3. And I follow "Add a new badge" behat_general::click_link()
  4. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Name Profile Badge
    Description Test badge description
    issuername Test Badge Site
    issuercontact testuser@test-badge-site.com
  5. And I upload "badges/tests/behat/badge.png" file to "Image" filepicker behat_repository_upload::i_upload_file_to_filepicker()
  6. And I press "Create badge" behat_forms::press_button()
  7. And I select "Profile completion" from "type" behat_forms::select_option()
  8. And I check "First name" behat_forms::check_option()
  9. And I check "Email address" behat_forms::check_option()
  10. And I check "Phone" behat_forms::check_option()
  11. When I press "Save" behat_forms::press_button()
  12. Then I should see "Profile completion" behat_general::assert_page_contains_text()
  13. And I should see "First name" behat_general::assert_page_contains_text()
  14. And I should see "Email address" behat_general::assert_page_contains_text()
  15. And I should not see "Criteria for this badge have not been set up yet." behat_general::assert_page_not_contains_text()
  16. And I press "Enable access" behat_forms::press_button()
  17. And I press "Continue" behat_forms::press_button()
  18. And I expand "My profile settings" node behat_navigation::i_expand_node()
  19. And I follow "Edit profile" behat_general::click_link()
  20. And I expand all fieldsets behat_forms::i_expand_all_fieldsets()
  21. And I fill in "Phone" with "123456789" behat_forms::fill_field()
  22. And I press "Update profile" behat_forms::press_button()
  23. And I follow "My badges" behat_general::click_link()
  24. Then I should see "Profile Badge" behat_general::assert_page_contains_text()
  25. And I should not see "There are no badges available." behat_general::assert_page_not_contains_text()
  • @javascript

Scenario: Award site badge /private/srv/www/loganberry.local/data/40975/moodle/badges/tests/behat/award_badge.feature:44

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher teacher 1 teacher1@asd.com
    student student 1 student1@asd.com
  2. And I expand "Site administration" node behat_navigation::i_expand_node()
  3. And I expand "Badges" node behat_navigation::i_expand_node()
  4. And I follow "Add a new badge" behat_general::click_link()
  5. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Name Site Badge
    Description Site badge description
    issuername Tester of site badge
  6. And I upload "badges/tests/behat/badge.png" file to "Image" filepicker behat_repository_upload::i_upload_file_to_filepicker()
  7. And I press "Create badge" behat_forms::press_button()
  8. And I select "Manual issue by role" from "type" behat_forms::select_option()
  9. And I check "Teacher" behat_forms::check_option()
  10. And I press "Save" behat_forms::press_button()
  11. And I press "Enable access" behat_forms::press_button()
  12. And I press "Continue" behat_forms::press_button()
  13. And I follow "Recipients (0)" behat_general::click_link()
  14. And I press "Award badge" behat_forms::press_button()
  15. And I select "teacher 1 (teacher1@asd.com)" from "potentialrecipients[]" behat_forms::select_option()
  16. And I press "Award badge" behat_forms::press_button()
  17. And I select "student 1 (student1@asd.com)" from "potentialrecipients[]" behat_forms::select_option()
  18. And I press "Award badge" behat_forms::press_button()
  19. When I follow "Site Badge" behat_general::click_link()
  20. Then I should see "Recipients (2)" behat_general::assert_page_contains_text()
  21. And I log out behat_auth::i_log_out()
  22. And I log in as "student" behat_auth::i_log_in_as()
  23. And I expand "My profile" node behat_navigation::i_expand_node()
  24. And I follow "My badges" behat_general::click_link()
  25. Then I should see "Site Badge" behat_general::assert_page_contains_text()
  • @javascript

Scenario: Award course badge /private/srv/www/loganberry.local/data/40975/moodle/badges/tests/behat/award_badge.feature:78

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
    student2 Student 2 student2@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category groupmode
    Course 1 C1 0 1
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
    student2 C1 student
  4. And I log out behat_auth::i_log_out()
  5. And I log in as "teacher1" behat_auth::i_log_in_as()
  6. And I follow "Course 1" behat_general::click_link()
  7. And I click on "//span[text()='Badges']" "xpath_element" in the "Administration" "block" behat_general::i_click_on_in_the()
  8. And I follow "Add a new badge" behat_general::click_link()
  9. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Name Course Badge
    Description Course badge description
    issuername Tester of course badge
  10. And I upload "badges/tests/behat/badge.png" file to "Image" filepicker behat_repository_upload::i_upload_file_to_filepicker()
  11. And I press "Create badge" behat_forms::press_button()
  12. And I select "Manual issue by role" from "type" behat_forms::select_option()
  13. And I check "Teacher" behat_forms::check_option()
  14. And I press "Save" behat_forms::press_button()
  15. And I press "Enable access" behat_forms::press_button()
  16. And I press "Continue" behat_forms::press_button()
  17. And I follow "Recipients (0)" behat_general::click_link()
  18. And I press "Award badge" behat_forms::press_button()
  19. And I select "Student 2 (student2@asd.com)" from "potentialrecipients[]" behat_forms::select_option()
  20. And I press "Award badge" behat_forms::press_button()
  21. And I select "Student 1 (student1@asd.com)" from "potentialrecipients[]" behat_forms::select_option()
  22. When I press "Award badge" behat_forms::press_button()
  23. And I follow "Course Badge" behat_general::click_link()
  24. Then I should see "Recipients (2)" behat_general::assert_page_contains_text()
  25. And I log out behat_auth::i_log_out()
  26. And I log in as "student1" behat_auth::i_log_in_as()
  27. And I follow "Course 1" behat_general::click_link()
  28. And I expand "My profile" node behat_navigation::i_expand_node()
  29. And I follow "My badges" behat_general::click_link()
  30. Then I should see "Course Badge" behat_general::assert_page_contains_text()
  • @javascript

Scenario: Award badge on activity completion /private/srv/www/loganberry.local/data/40975/moodle/badges/tests/behat/award_badge.feature:124

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  2. And the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher Frist teacher1@asd.com
    student1 Student First student1@asd.com
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log out behat_auth::i_log_out()
  5. And I log in as "admin" behat_auth::i_log_in_as()
  6. And I set the following administration settings values: behat_admin::i_set_the_following_administration_settings_values()
    Enable completion tracking 1
  7. And I follow "Home" behat_general::click_link()
  8. And I follow "Course 1" behat_general::click_link()
  9. And I follow "Edit settings" behat_general::click_link()
  10. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Enable completion tracking Yes
  11. And I press "Save changes" behat_forms::press_button()
  12. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  13. And I add a "Assignment" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Assignment name Test assignment name
    Description Submit your online text
  14. And I log out behat_auth::i_log_out()
  15. And I log in as "teacher1" behat_auth::i_log_in_as()
  16. And I follow "Course 1" behat_general::click_link()
  17. And I click on "//span[text()='Badges']" "xpath_element" in the "Administration" "block" behat_general::i_click_on_in_the()
  18. And I follow "Add a new badge" behat_general::click_link()
  19. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Name Course Badge
    Description Course badge description
    issuername Tester of course badge
  20. And I upload "badges/tests/behat/badge.png" file to "Image" filepicker behat_repository_upload::i_upload_file_to_filepicker()
  21. And I press "Create badge" behat_forms::press_button()
  22. And I select "Activity completion" from "type" behat_forms::select_option()
  23. And I check "Test assignment name" behat_forms::check_option()
  24. And I press "Save" behat_forms::press_button()
  25. And I press "Enable access" behat_forms::press_button()
  26. When I press "Continue" behat_forms::press_button()
  27. And I log out behat_auth::i_log_out()
  28. And I log in as "student1" behat_auth::i_log_in_as()
  29. And I follow "Course 1" behat_general::click_link()
  30. And I expand "My profile" node behat_navigation::i_expand_node()
  31. And I follow "My badges" behat_general::click_link()
  32. Then I should see "There are no badges available." behat_general::assert_page_contains_text()
  33. And I follow "Home" behat_general::click_link()
  34. And I follow "Course 1" behat_general::click_link()
  35. And I press "Mark as complete: Test assignment name" behat_forms::press_button()
  36. And I wait "2" seconds behat_general::i_wait_seconds()
  37. And I expand "My profile" node behat_navigation::i_expand_node()
  38. And I follow "My badges" behat_general::click_link()
  39. Then I should see "Course Badge" behat_general::assert_page_contains_text()
  • @javascript

Scenario: Award badge on course completion /private/srv/www/loganberry.local/data/40975/moodle/badges/tests/behat/award_badge.feature:181

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  2. And the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher Frist teacher1@asd.com
    student1 Student First student1@asd.com
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log out behat_auth::i_log_out()
  5. And I log in as "admin" behat_auth::i_log_in_as()
  6. And I set the following administration settings values: behat_admin::i_set_the_following_administration_settings_values()
    Enable completion tracking 1
  7. And I follow "Home" behat_general::click_link()
  8. And I follow "Course 1" behat_general::click_link()
  9. And I follow "Edit settings" behat_general::click_link()
  10. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Enable completion tracking Yes
  11. And I press "Save changes" behat_forms::press_button()
  12. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  13. And I add a "Assignment" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Assignment name Test assignment name
    Description Submit your online text
    assignsubmission_onlinetext_enabled 1
  14. And I follow "Course completion" behat_general::click_link()
  15. And I select "2" from "id_overall_aggregation" behat_forms::select_option()
  16. And I click on "Condition: Activity completion" "link" behat_general::i_click_on()
  17. And I check "Assign - Test assignment name" behat_forms::check_option()
  18. And I press "Save changes" behat_forms::press_button()
  19. And I log out behat_auth::i_log_out()
  20. And I log in as "teacher1" behat_auth::i_log_in_as()
  21. And I follow "Course 1" behat_general::click_link()
  22. And I click on "//span[text()='Badges']" "xpath_element" in the "Administration" "block" behat_general::i_click_on_in_the()
  23. And I follow "Add a new badge" behat_general::click_link()
  24. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Name Course Badge
    Description Course badge description
    issuername Tester of course badge
  25. And I upload "badges/tests/behat/badge.png" file to "Image" filepicker behat_repository_upload::i_upload_file_to_filepicker()
  26. And I press "Create badge" behat_forms::press_button()
  27. And I select "Course completion" from "type" behat_forms::select_option()
  28. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    grade_2 0
  29. And I press "Save" behat_forms::press_button()
  30. And I press "Enable access" behat_forms::press_button()
  31. When I press "Continue" behat_forms::press_button()
  32. And I log out behat_auth::i_log_out()
  33. And I log in as "student1" behat_auth::i_log_in_as()
  34. And I follow "Course 1" behat_general::click_link()
  35. And I expand "My profile" node behat_navigation::i_expand_node()
  36. And I follow "My badges" behat_general::click_link()
  37. Then I should see "There are no badges available." behat_general::assert_page_contains_text()
  38. And I follow "Home" behat_general::click_link()
  39. And I follow "Course 1" behat_general::click_link()
  40. And I press "Mark as complete: Test assignment name" behat_forms::press_button()
  41. And I log out behat_auth::i_log_out()
  42. And I log in as "admin" behat_auth::i_log_in_as()
  43. And I trigger cron behat_general::i_trigger_cron()
  44. And I trigger cron behat_general::i_trigger_cron()
  45. And I am on homepage behat_general::i_am_on_homepage()
  46. And I log out behat_auth::i_log_out()
  47. And I log in as "student1" behat_auth::i_log_in_as()
  48. And I expand "My profile" node behat_navigation::i_expand_node()
  49. And I follow "My badges" behat_general::click_link()
  50. Then I should see "Course Badge" behat_general::assert_page_contains_text()

Feature: Add blocks

In order to add more functionality to pages
As a teacher
I need to add blocks to pages

Background: /private/srv/www/loganberry.local/data/40975/moodle/blocks/tests/behat/add_blocks.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    student1 Student 1 student1@asd.com
    student2 Student 2 student2@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname format
    Course 1 C1 topics
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    student1 C1 student
    student2 C1 student
  4. And I log in as "admin" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. When I add the "Blog menu" block behat_blocks::i_add_the_block()
  8. Then I should see "View my entries about this course" behat_general::assert_page_contains_text()
  • @javascript

Scenario: Add a block to a course with Javascript enabled /private/srv/www/loganberry.local/data/40975/moodle/blocks/tests/behat/add_blocks.feature:26

Scenario: Add a block to a course with Javascript disabled /private/srv/www/loganberry.local/data/40975/moodle/blocks/tests/behat/add_blocks.feature:28

Feature: Add and configure blocks throughout the site

In order to maintain some patterns across all the site
As a manager
I need to set and configure blocks throughout the site

  • @javascript

Scenario: Add and configure a block throughtout the site /private/srv/www/loganberry.local/data/40975/moodle/blocks/tests/behat/configure_block_throughout_site.feature:8

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  2. And the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    manager1 Manager 1 manager1@asd.com
  3. And the following "system role assigns" exists: behat_data_generators::the_following_exists()
    user course role
    manager1 Acceptance test site manager
  4. And I log in as "manager1" behat_auth::i_log_in_as()
  5. And I follow "Turn editing on" behat_general::click_link()
  6. And I add the "Comments" block behat_blocks::i_add_the_block()
  7. And I click on "Actions" "link" in the "Comments" "block" behat_general::i_click_on_in_the()
  8. And I follow "Configure Comments block" behat_general::click_link()
  9. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Page contexts Display throughout the entire site
  10. And I press "Save changes" behat_forms::press_button()
  11. When I follow "Course 1" behat_general::click_link()
  12. Then I should see "Comments" in the "Comments" "block" behat_general::assert_element_contains_text()
  13. And I should see "Save comment" in the "Comments" "block" behat_general::assert_element_contains_text()
  14. And I am on homepage behat_general::i_am_on_homepage()
  15. And I click on "Actions" "link" in the "Comments" "block" behat_general::i_click_on_in_the()
  16. And I follow "Configure Comments block" behat_general::click_link()
  17. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Default weight -10 (first)
  18. And I press "Save changes" behat_forms::press_button()
  19. And I follow "Course 1" behat_general::click_link()
  20. And I should see "Comments" in the "//*[@id='region-pre']/descendant::div[contains(concat(' ', normalize-space(@class), ' '), ' block ')]" "xpath_element" behat_general::assert_element_contains_text()

Feature: Block appearances

In order to configure blocks appearance
As a teacher
I need to add and modify block configuration for the page

Background: /private/srv/www/loganberry.local/data/40975/moodle/blocks/tests/behat/manage_blocks.feature:7

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  2. And the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 teacher 1 teacher1@asd.com
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  4. And I log in as "admin" behat_auth::i_log_in_as()
  5. And I expand "Site administration" node behat_navigation::i_expand_node()
  6. And I expand "Appearance" node behat_navigation::i_expand_node()
  7. And I expand "Themes" node behat_navigation::i_expand_node()
  8. And I follow "Theme selector" behat_general::click_link()
  9. And I click on "Change theme" "button" in the "Default" "table_row" behat_general::i_click_on_in_the()
  10. And I click on "Use theme" "button" in the "Afterburner" "table_row" behat_general::i_click_on_in_the()
  11. And I press "Continue" behat_forms::press_button()
  12. And I am on homepage behat_general::i_am_on_homepage()
  13. And I follow "Course 1" behat_general::click_link()
  14. And I follow "Turn editing on" behat_general::click_link()
  15. And I add a "Survey" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name Test survey name
    Survey type ATTLS (20 item version)
    Description Test survey description
  16. And I add a "Book" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name Test book name
    Description Test book description
  17. And I follow "Test book name" behat_general::click_link()
  18. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Chapter title Book title
    Content Book content test test
  19. And I press "Save changes" behat_forms::press_button()
  20. And I log out behat_auth::i_log_out()
  21. And I log in as "teacher1" behat_auth::i_log_in_as()
  22. And I follow "Course 1" behat_general::click_link()
  23. And I follow "Turn editing on" behat_general::click_link()
  24. And I add the "Comments" block behat_blocks::i_add_the_block()
  25. And I follow "Configure Comments block" behat_general::click_link()
    Exception thrown by (//html/.//a[./@href][(((./@id = 'Configure Comments block' or contains(normalize-space(string(.)), 'Configure Comments block')) or contains(./@title, 'Configure Comments block') or contains(./@rel, 'Configure Comments block')) or .//img[contains(./@alt, 'Configure Comments block')])] | .//*[./@role = 'link'][((./@id = 'Configure Comments block' or contains(./@value, 'Configure Comments block')) or contains(./@title, 'Configure Comments block') or contains(normalize-space(string(.)), 'Configure Comments block'))])[1]
    Element is not currently visible and so may not be interacted with
    Command duration or timeout: 14 milliseconds
    Build info: version: '2.35.0', revision: 'c916b9d', time: '2013-08-12 15:42:01'
    System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9', java.version: '1.7.0_40'
    Session ID: 01586328-f689-fd44-8403-cbc6dee83e8f
    Driver info: org.openqa.selenium.firefox.FirefoxDriver
    Capabilities [{platform=MAC, databaseEnabled=true, cssSelectorsEnabled=true, javascriptEnabled=true, acceptSslCerts=true, handlesAlerts=true, browserName=firefox, browserConnectionEnabled=true, nativeEvents=false, webStorageEnabled=true, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=true, takesScreenshot=true, version=25.0}]
  26. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Display on page types Any page
  27. And I press "Save changes" behat_forms::press_button()
  • @javascript

Scenario: Block settings can be modified so that a block apprears on any page /private/srv/www/loganberry.local/data/40975/moodle/blocks/tests/behat/manage_blocks.feature:51

  1. When I follow "Test survey name" behat_general::click_link()
  2. Then I should see "Comments" in the "Comments" "block" behat_general::assert_element_contains_text()
  3. And I follow "Course 1" behat_general::click_link()
  4. And I follow "Configure Comments block" behat_general::click_link()
  5. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Display on page types Any course page
  6. And I press "Save changes" behat_forms::press_button()
  7. And I follow "Turn editing off" behat_general::click_link()
  8. And I follow "Test survey name" behat_general::click_link()
  9. And I should not see "Comments" behat_general::assert_page_not_contains_text()
  • @javascript

Scenario: Block settings can be modified so that a block can be hidden or moved /private/srv/www/loganberry.local/data/40975/moodle/blocks/tests/behat/manage_blocks.feature:64

  1. When I follow "Test book name" behat_general::click_link()
  2. And I follow "Configure Comments block" behat_general::click_link()
  3. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Visible No
  4. And I press "Save changes" behat_forms::press_button()
  5. And I follow "Turn editing off" behat_general::click_link()
  6. And I follow "Test book name" behat_general::click_link()
  7. Then I should not see "Comments" behat_general::assert_page_not_contains_text()
  8. And I expand "Course administration" node behat_navigation::i_expand_node()
  9. And I follow "Turn editing on" behat_general::click_link()
  10. And I follow "Configure Comments block" behat_general::click_link()
  11. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Visible Yes
    Region Right
  12. And I press "Save changes" behat_forms::press_button()
  13. And I should see "Comments" in the "#region-post" "css_element" behat_general::assert_element_contains_text()

Feature: Allowed blocks controls

In order to prevent the use of some blocks
As an admin
I need to restrict some blocks to be used in courses

Background: /private/srv/www/loganberry.local/data/40975/moodle/blocks/tests/behat/restrict_available_blocks.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  • @javascript

Scenario: Blocks can be added with the default permissions /private/srv/www/loganberry.local/data/40975/moodle/blocks/tests/behat/restrict_available_blocks.feature:19

  1. Given I log in as "teacher1" behat_auth::i_log_in_as()
  2. And I follow "Course 1" behat_general::click_link()
  3. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  4. When I add the "Course completion status" block behat_blocks::i_add_the_block()
  5. And I add the "Activities" block behat_blocks::i_add_the_block()
  6. Then I should see "Activities" in the "Activities" "block" behat_general::assert_element_contains_text()
  7. And I should see "Course completion status" in the "Course completion status" "block" behat_general::assert_element_contains_text()
  • @javascript

Scenario: Blocks can not be added when the admin restricts the permissions /private/srv/www/loganberry.local/data/40975/moodle/blocks/tests/behat/restrict_available_blocks.feature:29

  1. Given I log in as "admin" behat_auth::i_log_in_as()
  2. And I set the following system permissions of "Teacher" role: behat_permissions::i_set_the_following_system_permissions_of_role()
    block/activity_modules:addinstance Prohibit
  3. And I am on homepage behat_general::i_am_on_homepage()
  4. And I follow "Course 1" behat_general::click_link()
  5. And I expand "Users" node behat_navigation::i_expand_node()
  6. And I follow "Permissions" behat_general::click_link()
  7. And I override the system permissions of "Teacher" role with: behat_permissions::i_override_the_system_permissions_of_role_with()
    block/completionstatus:addinstance Prohibit
  8. And I log out behat_auth::i_log_out()
  9. When I log in as "teacher1" behat_auth::i_log_in_as()
  10. And I follow "Course 1" behat_general::click_link()
  11. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  12. Then the "Add a block" select box should not contain "Activities" behat_forms::the_select_box_should_not_contain()
  13. And the "Add a block" select box should not contain "Course completion status" behat_forms::the_select_box_should_not_contain()

Feature: The context of a block can always be returned to it's original state.

In order to revert actions when configuring blocks
As an admin
I need to be able to return the block to original state

  • @javascript

Scenario: Add and configure a block to display on every page and revert back /private/srv/www/loganberry.local/data/40975/moodle/blocks/tests/behat/return_block_original_state.feature:8

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. When I follow "Course 1" behat_general::click_link()
  4. And I follow "Turn editing on" behat_general::click_link()
  5. And I add the "Tags" block behat_blocks::i_add_the_block()
  6. Then I should see "Tags" in the "Tags" "block" behat_general::assert_element_contains_text()
  7. And I click on "Participants" "link" in the "//li[p/span[contains(normalize-space(string(.)), 'Current course')]]" "xpath_element" behat_general::i_click_on_in_the()
  8. And I click on "Actions" "link" in the "Tags" "block" behat_general::i_click_on_in_the()
  9. And I follow "Configure Tags block" behat_general::click_link()
  10. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Display on page types Any page
  11. And I press "Save changes" behat_forms::press_button()
  12. And I follow "Course 1" behat_general::click_link()
  13. And I add a "Assignment" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Assignment name Assignment1
    Description Description
  14. And I follow "Assignment1" behat_general::click_link()
  15. And I click on "Actions" "link" in the "Tags" "block" behat_general::i_click_on_in_the()
  16. And I follow "Configure Tags block" behat_general::click_link()
  17. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Display on page types Any assignment module page
  18. And I press "Save changes" behat_forms::press_button()
  19. And I should see "Tags" in the "Tags" "block" behat_general::assert_element_contains_text()
  20. And I follow "Course 1" behat_general::click_link()
  21. And "Tags" "block" should not exists behat_general::should_not_exists()
  22. And I click on "Participants" "link" in the "//li[p/span[contains(normalize-space(string(.)), 'Current course')]]" "xpath_element" behat_general::i_click_on_in_the()
  23. And "Tags" "block" should not exists behat_general::should_not_exists()
  24. And I follow "Course 1" behat_general::click_link()
  25. And I add a "Assignment" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Assignment name Assignment2
    Description Description
  26. And I follow "Assignment2" behat_general::click_link()
  27. And I should see "Tags" in the "Tags" "block" behat_general::assert_element_contains_text()
  28. And I click on "Actions" "link" in the "Tags" "block" behat_general::i_click_on_in_the()
  29. And I follow "Configure Tags block" behat_general::click_link()
  30. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Display on page types Any page
  31. And I press "Save changes" behat_forms::press_button()
  32. And I follow "Course 1" behat_general::click_link()
  33. And I should see "Tags" in the "Tags" "block" behat_general::assert_element_contains_text()
  34. And I click on "Participants" "link" in the "//li[p/span[contains(normalize-space(string(.)), 'Current course')]]" "xpath_element" behat_general::i_click_on_in_the()
  35. And I should see "Tags" in the "Tags" "block" behat_general::assert_element_contains_text()

Feature: Comment on a blog entry

In order to respond to a blog post
As a user
I need to be able to comment on a blog entry

Background: /private/srv/www/loganberry.local/data/40975/moodle/blog/tests/behat/comment.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    testuser Test User moodle@moodlemoodle.com
    testuser2 Test2 User2 moodle2@moodlemoodle.com
  2. And I log in as "testuser" behat_auth::i_log_in_as()
  3. And I am on homepage behat_general::i_am_on_homepage()
  4. And I expand "My profile" node behat_navigation::i_expand_node()
  5. And I expand "Blogs" node behat_navigation::i_expand_node()
  6. And I follow "Add a new entry" behat_general::click_link()
  7. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Entry title Blog post from user 1
    Blog entry body User 1 blog post content
  8. And I press "Save changes" behat_forms::press_button()
  9. And I log out behat_auth::i_log_out()
  • @javascript

Scenario: Commenting on my own blog entry /private/srv/www/loganberry.local/data/40975/moodle/blog/tests/behat/comment.feature:24

  1. Given I am on homepage behat_general::i_am_on_homepage()
  2. And I log in as "testuser" behat_auth::i_log_in_as()
  3. And I am on homepage behat_general::i_am_on_homepage()
  4. And I expand "My profile" node behat_navigation::i_expand_node()
  5. And I expand "Blogs" node behat_navigation::i_expand_node()
  6. And I follow "View all of my entries" behat_general::click_link()
  7. And I follow "Blog post from user 1" behat_general::click_link()
  8. And I should see "User 1 blog post content" behat_general::assert_page_contains_text()
  9. And I follow "Comments (0)" behat_general::click_link()
  10. When I fill in "content" with "$My own >nasty< \"string\"!" behat_forms::fill_field()
  11. And I follow "Save comment" behat_general::click_link()
  12. And I wait "4" seconds behat_general::i_wait_seconds()
  13. Then I should see "$My own >nasty< \"string\"!" behat_general::assert_page_contains_text()
  14. And I fill in "content" with "Another $Nasty <string?>" behat_forms::fill_field()
  15. And I follow "Save comment" behat_general::click_link()
  16. And I wait "4" seconds behat_general::i_wait_seconds()
  17. And I should see "Comments (2)" in the ".comment-link" "css_element" behat_general::assert_element_contains_text()
  • @javascript

Scenario: Deleting my own comment /private/srv/www/loganberry.local/data/40975/moodle/blog/tests/behat/comment.feature:44

  1. Given I am on homepage behat_general::i_am_on_homepage()
  2. And I log in as "testuser" behat_auth::i_log_in_as()
  3. And I am on homepage behat_general::i_am_on_homepage()
  4. And I expand "My profile" node behat_navigation::i_expand_node()
  5. And I expand "Blogs" node behat_navigation::i_expand_node()
  6. And I follow "View all of my entries" behat_general::click_link()
  7. And I follow "Blog post from user 1" behat_general::click_link()
  8. And I should see "User 1 blog post content" behat_general::assert_page_contains_text()
  9. And I follow "Comments (0)" behat_general::click_link()
  10. And I fill in "content" with "$My own >nasty< \"string\"!" behat_forms::fill_field()
  11. And I follow "Save comment" behat_general::click_link()
  12. And I wait "4" seconds behat_general::i_wait_seconds()
  13. When I click on ".comment-delete a" "css_element" behat_general::i_click_on()
  14. And I wait "4" seconds behat_general::i_wait_seconds()
  15. Then I should not see "$My own >nasty< \"string\"!" behat_general::assert_page_not_contains_text()
  16. And I follow "Blog post from user 1" behat_general::click_link()
  17. And I click on ".comment-link" "css_element" behat_general::i_click_on()
  18. And I should not see "$My own >nasty< \"string\"!" behat_general::assert_page_not_contains_text()
  19. And I should see "Comments (0)" in the ".comment-link" "css_element" behat_general::assert_element_contains_text()
  • @javascript

Scenario: Commenting on someone's blog post /private/srv/www/loganberry.local/data/40975/moodle/blog/tests/behat/comment.feature:66

  1. Given I am on homepage behat_general::i_am_on_homepage()
  2. And I log in as "testuser2" behat_auth::i_log_in_as()
  3. And I am on homepage behat_general::i_am_on_homepage()
  4. And I expand "Site pages" node behat_navigation::i_expand_node()
  5. And I follow "Site blogs" behat_general::click_link()
  6. And I follow "Blog post from user 1" behat_general::click_link()
  7. When I follow "Comments (0)" behat_general::click_link()
  8. And I fill in "content" with "$My own >nasty< \"string\"!" behat_forms::fill_field()
  9. And I follow "Save comment" behat_general::click_link()
  10. And I wait "4" seconds behat_general::i_wait_seconds()
  11. Then I should see "$My own >nasty< \"string\"!" behat_general::assert_page_contains_text()

Feature: Perform basic calendar functionality

In order to ensure the calendar works as expected
As an admin
I need to create calendar data

Background: /private/srv/www/loganberry.local/data/40975/moodle/calendar/tests/behat/calendar.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    student1 Student 1 student1@asd.com
    student2 Student 2 student2@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname format
    Course 1 C1 topics
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    student1 C1 student
  4. When I log in as "admin" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add the "Calendar" block behat_blocks::i_add_the_block()

Scenario: Create a site event /private/srv/www/loganberry.local/data/40975/moodle/calendar/tests/behat/calendar.feature:23

  1. And I create a calendar event with form data: behat_calendar::i_create_a_calendar_event_with_form_data()
    Type of event site
    Event title Really awesome event!
    Description Come join this awesome event, sucka!
  2. And I log out behat_auth::i_log_out()
  3. And I log in as "student1" behat_auth::i_log_in_as()
  4. And I follow "Course 1" behat_general::click_link()
  5. And I follow "This month" behat_general::click_link()
  6. And I should see "Really awesome event!" behat_general::assert_page_contains_text()
  7. And I log out behat_auth::i_log_out()
  8. And I log in as "student2" behat_auth::i_log_in_as()
  9. And I follow "This month" behat_general::click_link()
  10. And I should see "Really awesome event!" behat_general::assert_page_contains_text()

Scenario: Create a course event /private/srv/www/loganberry.local/data/40975/moodle/calendar/tests/behat/calendar.feature:38

  1. And I create a calendar event with form data: behat_calendar::i_create_a_calendar_event_with_form_data()
    Type of event course
    Event title Really awesome event!
    Description Come join this awesome event, sucka!
  2. And I log out behat_auth::i_log_out()
  3. And I log in as "student1" behat_auth::i_log_in_as()
  4. And I follow "Course 1" behat_general::click_link()
  5. And I follow "This month" behat_general::click_link()
  6. And I should see "Really awesome event!" behat_general::assert_page_contains_text()
  7. And I log out behat_auth::i_log_out()
  8. And I log in as "student2" behat_auth::i_log_in_as()
  9. And I follow "This month" behat_general::click_link()
  10. And I should not see "Really awesome event!" behat_general::assert_page_not_contains_text()

Scenario: Create a user event /private/srv/www/loganberry.local/data/40975/moodle/calendar/tests/behat/calendar.feature:53

  1. And I create a calendar event with form data: behat_calendar::i_create_a_calendar_event_with_form_data()
    Type of event user
    Event title Really awesome event!
    Description Come join this awesome event, sucka!
  2. And I log out behat_auth::i_log_out()
  3. And I log in as "student1" behat_auth::i_log_in_as()
  4. And I follow "Course 1" behat_general::click_link()
  5. And I follow "This month" behat_general::click_link()
  6. And I should not see "Really awesome event!" behat_general::assert_page_not_contains_text()

Scenario: Delete an event /private/srv/www/loganberry.local/data/40975/moodle/calendar/tests/behat/calendar.feature:64

  1. And I create a calendar event with form data: behat_calendar::i_create_a_calendar_event_with_form_data()
    Type of event user
    Event title Really awesome event!
    Description Come join this awesome event, sucka!
  2. And I click on "//div[@class='commands']//a[contains(@href, 'delete')]" "xpath_element" behat_general::i_click_on()
  3. And I click on "Delete" "button" behat_general::i_click_on()
  4. And I should not see "Really awesome event!" behat_general::assert_page_not_contains_text()

Scenario: Edit an event /private/srv/www/loganberry.local/data/40975/moodle/calendar/tests/behat/calendar.feature:73

  1. And I create a calendar event with form data: behat_calendar::i_create_a_calendar_event_with_form_data()
    Type of event user
    Event title Really awesome event!
    Description Come join this awesome event, sucka!
  2. And I click on "//div[@class='commands']//a[contains(@href, 'edit')]" "xpath_element" behat_general::i_click_on()
  3. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Event title Mediocre event :(
    Description Wait, this event isn't that great.
  4. And I press "Save changes" behat_forms::press_button()
  5. And I should see "Mediocre event" behat_general::assert_page_contains_text()

Feature: Add cohorts of users

In order to create site-wide groups
As an admin
I need to create cohorts and add users on them

Background: /private/srv/www/loganberry.local/data/40975/moodle/cohort/tests/behat/add_cohort.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    user1 First User first@user.com
    user2 Second User second@user.com
    user3 Third User third@user.com
    user4 Forth User forth@user.com
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I collapse "Front page settings" node behat_navigation::i_collapse_node()
  4. And I expand "Site administration" node behat_navigation::i_expand_node()
  5. And I expand "Users" node behat_navigation::i_expand_node()
  6. And I expand "Accounts" node behat_navigation::i_expand_node()
  7. And I follow "Cohorts" behat_general::click_link()
  8. And I press "Add" behat_forms::press_button()
  9. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Name Test cohort name
    Context System
    Cohort ID 333
    Description Test cohort description
  10. And I press "Save changes" behat_forms::press_button()
  • @javascript

Scenario: Add a cohort /private/srv/www/loganberry.local/data/40975/moodle/cohort/tests/behat/add_cohort.feature:29

  1. When I follow "Cohorts" behat_general::click_link()
  2. Then I should see "Test cohort name" behat_general::assert_page_contains_text()
  3. And I should see "333" behat_general::assert_page_contains_text()
  4. And I should see "Test cohort description" behat_general::assert_page_contains_text()
  5. And I should see "Created manually" behat_general::assert_page_contains_text()
  • @javascript

Scenario: Add users to a cohort selecting them from the system users list /private/srv/www/loganberry.local/data/40975/moodle/cohort/tests/behat/add_cohort.feature:37

  1. When I add "user1" user to "333" cohort behat_cohort::i_add_user_to_cohort()
  2. And I add "user2" user to "333" cohort behat_cohort::i_add_user_to_cohort()
  3. Then I should see "2" in the "#cohorts" "css_element" behat_general::assert_element_contains_text()
  4. And I follow "Assign" behat_general::click_link()
  5. And the "Current users" select box should contain "First User (first@user.com)" behat_forms::the_select_box_should_contain()
  6. And the "Current users" select box should contain "Second User (second@user.com)" behat_forms::the_select_box_should_contain()
  7. And the "Current users" select box should not contain "Forth User (forth@user.com)" behat_forms::the_select_box_should_not_contain()
  • @javascript

Scenario: Add users to a cohort using a bulk user action /private/srv/www/loganberry.local/data/40975/moodle/cohort/tests/behat/add_cohort.feature:47

  1. When I follow "Bulk user actions" behat_general::click_link()
  2. And I select "Third User" from "Available" behat_forms::select_option()
  3. And I press "Add to selection" behat_forms::press_button()
  4. And I select "Forth User" from "Available" behat_forms::select_option()
  5. And I press "Add to selection" behat_forms::press_button()
  6. And I select "Add to cohort" from "id_action" behat_forms::select_option()
  7. And I press "Go" behat_forms::press_button()
  8. And I select "Test cohort name [333]" from "Cohort" behat_forms::select_option()
  9. And I press "Add to cohort" behat_forms::press_button()
  10. And I follow "Cohorts" behat_general::click_link()
  11. Then I should see "2" in the "#cohorts" "css_element" behat_general::assert_element_contains_text()
  12. And I follow "Assign" behat_general::click_link()
  13. And the "Current users" select box should contain "Third User (third@user.com)" behat_forms::the_select_box_should_contain()
  14. And the "Current users" select box should contain "Forth User (forth@user.com)" behat_forms::the_select_box_should_contain()
  15. And the "Current users" select box should not contain "First User (first@user.com)" behat_forms::the_select_box_should_not_contain()

Feature: Upload users to a cohort

In order to quickly fill site-wide groups with users
As an admin
I need to upload a file with users data containing cohort assigns

  • @javascript

Scenario: Upload users and assign them to a course with cohort enrolment method enabled /private/srv/www/loganberry.local/data/40975/moodle/cohort/tests/behat/upload_cohort_users.feature:8

  1. Given the following "cohorts" exists: behat_data_generators::the_following_exists()
    name idnumber
    Cohort 1 ASD
    Cohort 2 DSA
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
    Course 2 C2 0
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I follow "Course 1" behat_general::click_link()
  5. And I add "Cohort sync" enrolment method with: behat_enrol::i_add_enrolment_method_with()
    Cohort Cohort 1
  6. And I am on homepage behat_general::i_am_on_homepage()
  7. And I follow "Course 2" behat_general::click_link()
  8. And I add "Cohort sync" enrolment method with: behat_enrol::i_add_enrolment_method_with()
    Cohort Cohort 2
  9. And I collapse "Course administration" node behat_navigation::i_collapse_node()
  10. And I expand "Site administration" node behat_navigation::i_expand_node()
  11. And I expand "Users" node behat_navigation::i_expand_node()
  12. And I expand "Accounts" node behat_navigation::i_expand_node()
  13. When I follow "Upload users" behat_general::click_link()
  14. And I upload "lib/tests/fixtures/upload_users_cohorts.csv" file to "File" filepicker behat_repository_upload::i_upload_file_to_filepicker()
  15. And I press "Upload users" behat_forms::press_button()
  16. And I press "Upload users" behat_forms::press_button()
  17. And I press "Continue" behat_forms::press_button()
  18. And I follow "Cohorts" behat_general::click_link()
  19. And I click on "Assign" "link" in the "Cohort 1" table row behat_general::i_click_on_in_the_table_row()
  20. Then the "Current users" select box should contain "Tom Jones (tomjones@example.com)" behat_forms::the_select_box_should_contain()
  21. And the "Current users" select box should contain "Bob Jones (bobjones@example.com)" behat_forms::the_select_box_should_contain()
  22. And I press "Back to cohorts" behat_forms::press_button()
  23. And I click on "Assign" "link" in the "Cohort 2" table row behat_general::i_click_on_in_the_table_row()
  24. And the "Current users" select box should contain "Mary Smith (marysmith@example.com)" behat_forms::the_select_box_should_contain()
  25. And the "Current users" select box should contain "Alice Smith (alicesmith@example.com)" behat_forms::the_select_box_should_contain()
  26. And I am on homepage behat_general::i_am_on_homepage()
  27. And I follow "Course 1" behat_general::click_link()
  28. And I expand "Users" node behat_navigation::i_expand_node()
  29. And I follow "Enrolled users" behat_general::click_link()
  30. And I should see "Tom Jones" behat_general::assert_page_contains_text()
  31. And I should see "Bob Jones" behat_general::assert_page_contains_text()
  32. And I should not see "Mary Smith" behat_general::assert_page_not_contains_text()
  33. And I am on homepage behat_general::i_am_on_homepage()
  34. And I follow "Course 2" behat_general::click_link()
  35. And I expand "Users" node behat_navigation::i_expand_node()
  36. And I follow "Enrolled users" behat_general::click_link()
  37. And I should see "Mary Smith" behat_general::assert_page_contains_text()
  38. And I should see "Alice Smith" behat_general::assert_page_contains_text()
  39. And I should not see "Tom Jones" behat_general::assert_page_not_contains_text()

Feature: Toggle activities groups mode from the course page

In order to split activities in groups
As a teacher
I need to change quickly the group mode of an activity

  • @javascript

Scenario: Groups mode toggle with javascript enabled /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/activities_group_icons.feature:8

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname format
    Course 1 C1 topics
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name
    Description Test forum description
  8. And I click on "Edit settings" "link" in the "Administration" "block" behat_general::i_click_on_in_the()
  9. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Group mode No groups
    Force group mode No
  10. When I press "Save changes" behat_forms::press_button()
  11. Then "No groups (Click to change)" "link" should exists behat_general::should_exists()
  12. And "//a/child::img[contains(@src, 'groupn')]" "xpath_element" should exists behat_general::should_exists()
  13. And I click on "No groups (Click to change)" "link" in the "Test forum name" activity behat_course::i_click_on_in_the_activity()
  14. And I wait "3" seconds behat_general::i_wait_seconds()
  15. And "Separate groups (Click to change)" "link" should exists behat_general::should_exists()
  16. And "//a/child::img[contains(@src, 'groups')]" "xpath_element" should exists behat_general::should_exists()
  17. And I reload the page behat_general::reload()
  18. And "Separate groups (Click to change)" "link" should exists behat_general::should_exists()
  19. And "//a/child::img[contains(@src, 'groups')]" "xpath_element" should exists behat_general::should_exists()
  20. And I click on "Separate groups (Click to change)" "link" in the "Test forum name" activity behat_course::i_click_on_in_the_activity()
  21. And I wait "3" seconds behat_general::i_wait_seconds()
  22. And "Visible groups (Click to change)" "link" should exists behat_general::should_exists()
  23. And "//a/child::img[contains(@src, 'groupv')]" "xpath_element" should exists behat_general::should_exists()
  24. And I reload the page behat_general::reload()
  25. And "Visible groups (Click to change)" "link" should exists behat_general::should_exists()
  26. And "//a/child::img[contains(@src, 'groupv')]" "xpath_element" should exists behat_general::should_exists()
  27. And I click on "Visible groups (Click to change)" "link" in the "Test forum name" activity behat_course::i_click_on_in_the_activity()
  28. And "No groups (Click to change)" "link" should exists behat_general::should_exists()
  29. And "//a/child::img[contains(@src, 'groupn')]" "xpath_element" should exists behat_general::should_exists()

Feature: Indent items on the course page

In order to create a structured view of activities
As a teacher
I need to move activities and resources to left and right

  • @javascript

Scenario: Indent course items with Javascript enabled /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/activities_indentation.feature:8

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname format
    Course 1 C1 weeks
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Glossary" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name Test glossary name
    Description Test glossary description
  8. When I indent right "Test glossary name" activity behat_course::i_indent_right_activity()
  9. Then "#section-1 li.glossary div.mod-indent-1" "css_element" should exists behat_general::should_exists()
  10. And I indent right "Test glossary name" activity behat_course::i_indent_right_activity()
  11. And "//li[@id='section-1']/descendant::li[contains(concat(' ', @class, ' '), ' glossary ')]/descendant::a[not(contains(concat(' ', @class, ' '), ' hidden '))]/descendant::span[normalize-space(.)='Move left']" "xpath_element" should exists behat_general::should_exists()
  12. And "#section-1 li.glossary div.mod-indent-2" "css_element" should exists behat_general::should_exists()
  13. And I reload the page behat_general::reload()
  14. And "#section-1 li.glossary div.mod-indent-2" "css_element" should exists behat_general::should_exists()
  15. And I indent left "Test glossary name" activity behat_course::i_indent_left_activity()
  16. And I indent left "Test glossary name" activity behat_course::i_indent_left_activity()
  17. And "#section-1 li.glossary div.mod-indent-2" "css_element" should not exists behat_general::should_not_exists()
  18. And "#section-1 li.glossary div.mod-indent-1" "css_element" should not exists behat_general::should_not_exists()
  19. And "//li[@id='section-1']/descendant::li[contains(concat(' ', @class, ' '), ' glossary ')]/descendant::a[not(contains(concat(' ', @class, ' '), ' hidden '))]/descendant::span[normalize-space(.)='Move left']" "xpath_element" should not exists behat_general::should_not_exists()

Feature: Toggle activities visibility from the course page

In order to delay activities availability
As a teacher
I need to quickly change the visibility of an activity

  • @javascript

Scenario: Hide/Show toggle with javascript enabled /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/activities_visibility_icons.feature:8

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname format
    Course 1 C1 topics
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name
    Description Test forum description
    Visible Show
  8. When I open "Test forum name" actions menu behat_course::i_open_actions_menu()
  9. And I click on "Hide" "link" in the "Test forum name" activity behat_course::i_click_on_in_the_activity()
  10. Then "Test forum name" activity should be hidden behat_course::activity_should_be_hidden()
  11. And I click on "Show" "link" in the "Test forum name" activity behat_course::i_click_on_in_the_activity()
  12. And "Test forum name" activity should be visible behat_course::activity_should_be_visible()
  13. And I click on "Hide" "link" in the "Test forum name" activity behat_course::i_click_on_in_the_activity()
  14. And "Test forum name" activity should be hidden behat_course::activity_should_be_hidden()
  15. And I reload the page behat_general::reload()
  16. And "Test forum name" activity should be hidden behat_course::activity_should_be_hidden()
  17. And I log out behat_auth::i_log_out()
  18. And I log in as "student1" behat_auth::i_log_in_as()
  19. And I follow "Course 1" behat_general::click_link()
  20. And "Test forum name" activity should be hidden behat_course::activity_should_be_hidden()

Feature: Add activities to courses

In order to provide tools for students learning
As a teacher
I need to add activites to a course

Background: /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/add_activities.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    student1 Student 1 student1@asd.com
    student2 Student 2 student2@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname format
    Course 1 C1 topics
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    student1 C1 student
    student2 C1 student
  4. And I log in as "admin" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  • @javascript

Scenario: Add an activity to a course /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/add_activities.feature:24

  1. When I add a "Database" to section "3" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name Test name
    Description Test database description
    Entries required for completion 9
    Allow comments on entries Yes
  2. And I turn editing mode off behat_course::i_turn_editing_mode_off()
  3. Then I should not see "Adding a new" behat_general::assert_page_not_contains_text()
  4. And I follow "Test name" behat_general::click_link()
  5. And I click on "Edit settings" "link" in the "Administration" "block" behat_general::i_click_on_in_the()
  6. And I expand all fieldsets behat_forms::i_expand_all_fieldsets()
  7. And the "Name" field should match "Test name" value behat_forms::the_field_should_match_value()
  8. And the "Entries required for completion" field should match "9" value behat_forms::the_field_should_match_value()
  9. And the "Allow comments on entries" field should match "Yes" value behat_forms::the_field_should_match_value()
  • @javascript

Scenario: Add an activity without the required fields /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/add_activities.feature:40

  1. When I add a "Database" to section "3" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name Test name
  2. Then I should see "Adding a new" behat_general::assert_page_contains_text()
  3. And I should see "Required" behat_general::assert_page_contains_text()

Scenario: Add an activity to a course with Javascript disabled /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/add_activities.feature:46

  1. Then I should see "Add a resource to section 'Topic 1'" behat_general::assert_page_contains_text()
  2. And I should see "Add an activity to section 'Topic 1'" behat_general::assert_page_contains_text()
  3. And I should see "Add a resource to section 'Topic 2'" behat_general::assert_page_contains_text()
  4. And I should see "Add an activity to section 'Topic 2'" behat_general::assert_page_contains_text()
  5. And I should see "Add a resource to section 'Topic 3'" behat_general::assert_page_contains_text()
  6. And I should see "Add an activity to section 'Topic 3'" behat_general::assert_page_contains_text()
  7. And I add a "Label" to section "2" behat_course::i_add_to_section()
  8. And I should see "Adding a new Label to Topic 2" behat_general::assert_page_contains_text()
  9. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Label text I'm a label
  10. And I press "Save and return to course" behat_forms::press_button()
  11. And I add a "Database" to section "3" behat_course::i_add_to_section()
  12. And I should see "Adding a new Database to Topic 3" behat_general::assert_page_contains_text()
  13. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Name Test database name
    Description Test database description
  14. And I press "Save and return to course" behat_forms::press_button()
  15. And I should not see "Adding a new" behat_general::assert_page_not_contains_text()
  16. And I should see "Test database name" behat_general::assert_page_contains_text()
  17. And I should see "I'm a label" behat_general::assert_page_contains_text()

Feature: We can change the visibility of categories in the management interface.

As a moodle admin
I need to test hiding and showing a category.
I need to test hiding and showing a sub category.
I need to test visibility is applied to sub categories.
I need to test visibility is applied to courses.
I need to test visibility of children is reset when changing back.

Scenario: Test making a category hidden and then visible again. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/category_change_visibility.feature:11

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  4. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  5. And I should see "Cat 1" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  6. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  7. And I toggle visibility of category "CAT1" in management listing behat_course::i_toggle_visibility_of_category_in_management_listing()
  8. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  9. And category in management listing should be dimmed "CAT1" behat_course::category_in_management_listing_should_be_dimmed()
  10. And I toggle visibility of category "CAT1" in management listing behat_course::i_toggle_visibility_of_category_in_management_listing()
  11. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  12. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  • @javascript

Scenario: Test using AJAX to make a category hidden and then visible again. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/category_change_visibility.feature:32

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  4. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  5. And I should see "Cat 1" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  6. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  7. And I toggle visibility of category "CAT1" in management listing behat_course::i_toggle_visibility_of_category_in_management_listing()
  8. And category in management listing should be dimmed "CAT1" behat_course::category_in_management_listing_should_be_dimmed()
  9. And I toggle visibility of category "CAT1" in management listing behat_course::i_toggle_visibility_of_category_in_management_listing()
  10. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()

Scenario: Test making a subcategory hidden and then visible again. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/category_change_visibility.feature:50

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
    Cat 2 CAT1 CAT2
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  4. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  5. And I should see "Cat 1" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  6. And I should not see "Cat 2" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  7. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  8. And I click on category "Cat 1" in the management interface behat_course::i_click_on_category_in_the_management_interface()
  9. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  10. And I should see "Cat 1" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  11. And I should see "Cat 2" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  12. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  13. And category in management listing should be visible "CAT2" behat_course::category_in_management_listing_should_be_visible()
  14. And I toggle visibility of category "CAT2" in management listing behat_course::i_toggle_visibility_of_category_in_management_listing()
  15. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  16. And I should see "Cat 1" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  17. And I should see "Cat 2" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  18. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  19. And category in management listing should be dimmed "CAT2" behat_course::category_in_management_listing_should_be_dimmed()
  20. And I toggle visibility of category "CAT2" in management listing behat_course::i_toggle_visibility_of_category_in_management_listing()
  21. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  22. And I should see "Cat 1" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  23. And I should see "Cat 2" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  24. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  25. And category in management listing should be visible "CAT2" behat_course::category_in_management_listing_should_be_visible()
  • @javascript

Scenario: Test using AJAX to make a subcategory hidden and then visible again. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/category_change_visibility.feature:86

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
    Cat 2 CAT1 CAT2
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  4. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  5. And I should see "Cat 1" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  6. And I should not see "Cat 2" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  7. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  8. And I click to expand category "CAT1" in the management interface behat_course::i_click_to_expand_category_in_the_management_interface()
  9. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  10. And category in management listing should be visible "CAT2" behat_course::category_in_management_listing_should_be_visible()
  11. And I toggle visibility of category "CAT2" in management listing behat_course::i_toggle_visibility_of_category_in_management_listing()
  12. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  13. And category in management listing should be dimmed "CAT2" behat_course::category_in_management_listing_should_be_dimmed()
  14. And I toggle visibility of category "CAT2" in management listing behat_course::i_toggle_visibility_of_category_in_management_listing()
  15. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  16. And category in management listing should be visible "CAT2" behat_course::category_in_management_listing_should_be_visible()

Scenario: Test relation between category and course when changing visibility. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/category_change_visibility.feature:112

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
    Cat 2 0 CAT2
    Cat 3 CAT1 CAT3
    Cat 4 CAT1 CAT4
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    category fullname shortname idnumber
    CAT1 Course 1 Course 1 C1
    CAT1 Course 2 Course 2 C2
    CAT1 Course 3 Course 3 C3
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I click on category "Cat 1" in the management interface behat_course::i_click_on_category_in_the_management_interface()
  7. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  8. And I should see "Cat 1" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  9. And I should see "Cat 2" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  10. And I should see "Cat 3" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  11. And I should see "Cat 4" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  12. And I should see "Course 1" in the "#course-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  13. And I should see "Course 2" in the "#course-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  14. And I should see "Course 3" in the "#course-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  15. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  16. And category in management listing should be visible "CAT2" behat_course::category_in_management_listing_should_be_visible()
  17. And category in management listing should be visible "CAT3" behat_course::category_in_management_listing_should_be_visible()
  18. And category in management listing should be visible "CAT4" behat_course::category_in_management_listing_should_be_visible()
  19. And course in management listing should be visible "C1" behat_course::course_in_management_listing_should_be_visible()
  20. And course in management listing should be visible "C2" behat_course::course_in_management_listing_should_be_visible()
  21. And course in management listing should be visible "C3" behat_course::course_in_management_listing_should_be_visible()
  22. And I toggle visibility of course "C2" in management listing behat_course::i_toggle_visibility_of_course_in_management_listing()
  23. And I should see the "Course categories and courses" management page with a course selected behat_course::i_should_see_the_courses_management_page_with_a_course_selected()
  24. And course in management listing should be visible "C1" behat_course::course_in_management_listing_should_be_visible()
  25. And course in management listing should be dimmed "C2" behat_course::course_in_management_listing_should_be_dimmed()
  26. And course in management listing should be visible "C3" behat_course::course_in_management_listing_should_be_visible()
  27. And I toggle visibility of category "CAT3" in management listing behat_course::i_toggle_visibility_of_category_in_management_listing()
  28. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  29. And I click on "Cat 1" "link" behat_general::i_click_on()
  30. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  31. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  32. And category in management listing should be visible "CAT2" behat_course::category_in_management_listing_should_be_visible()
  33. And category in management listing should be dimmed "CAT3" behat_course::category_in_management_listing_should_be_dimmed()
  34. And category in management listing should be visible "CAT4" behat_course::category_in_management_listing_should_be_visible()
  35. And course in management listing should be visible "C1" behat_course::course_in_management_listing_should_be_visible()
  36. And course in management listing should be dimmed "C2" behat_course::course_in_management_listing_should_be_dimmed()
  37. And course in management listing should be visible "C3" behat_course::course_in_management_listing_should_be_visible()
  38. And I toggle visibility of category "CAT1" in management listing behat_course::i_toggle_visibility_of_category_in_management_listing()
  39. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  40. And category in management listing should be dimmed "CAT1" behat_course::category_in_management_listing_should_be_dimmed()
  41. And category in management listing should be visible "CAT2" behat_course::category_in_management_listing_should_be_visible()
  42. And category in management listing should be dimmed "CAT3" behat_course::category_in_management_listing_should_be_dimmed()
  43. And category in management listing should be dimmed "CAT4" behat_course::category_in_management_listing_should_be_dimmed()
  44. And course in management listing should be dimmed "C1" behat_course::course_in_management_listing_should_be_dimmed()
  45. And course in management listing should be dimmed "C2" behat_course::course_in_management_listing_should_be_dimmed()
  46. And course in management listing should be dimmed "C3" behat_course::course_in_management_listing_should_be_dimmed()
  47. And I toggle visibility of category "CAT1" in management listing behat_course::i_toggle_visibility_of_category_in_management_listing()
  48. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  49. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  50. And category in management listing should be visible "CAT2" behat_course::category_in_management_listing_should_be_visible()
  51. And category in management listing should be dimmed "CAT3" behat_course::category_in_management_listing_should_be_dimmed()
  52. And category in management listing should be visible "CAT4" behat_course::category_in_management_listing_should_be_visible()
  53. And course in management listing should be visible "C1" behat_course::course_in_management_listing_should_be_visible()
  54. And course in management listing should be dimmed "C2" behat_course::course_in_management_listing_should_be_dimmed()
  55. And course in management listing should be visible "C3" behat_course::course_in_management_listing_should_be_visible()
  • @javascript
  • @_cross_browser

Scenario: Test the relation between category and course when changing visibility with AJAX /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/category_change_visibility.feature:187

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
    Cat 2 0 CAT2
    Cat 3 CAT1 CAT3
    Cat 4 CAT1 CAT4
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    category fullname shortname idnumber
    CAT1 Course 1 Course 1 C1
    CAT1 Course 2 Course 2 C2
    CAT1 Course 3 Course 3 C3
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I click on category "Cat 1" in the management interface behat_course::i_click_on_category_in_the_management_interface()
  7. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  8. And I should see "Cat 1" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  9. And I should see "Cat 2" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  10. And I should see "Cat 3" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  11. And I should see "Cat 4" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  12. And I should see "Course 1" in the "#course-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  13. And I should see "Course 2" in the "#course-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  14. And I should see "Course 3" in the "#course-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  15. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  16. And category in management listing should be visible "CAT2" behat_course::category_in_management_listing_should_be_visible()
  17. And category in management listing should be visible "CAT3" behat_course::category_in_management_listing_should_be_visible()
  18. And category in management listing should be visible "CAT4" behat_course::category_in_management_listing_should_be_visible()
  19. And course in management listing should be visible "C1" behat_course::course_in_management_listing_should_be_visible()
  20. And course in management listing should be visible "C2" behat_course::course_in_management_listing_should_be_visible()
  21. And course in management listing should be visible "C3" behat_course::course_in_management_listing_should_be_visible()
  22. And I toggle visibility of course "C2" in management listing behat_course::i_toggle_visibility_of_course_in_management_listing()
  23. And I should see "Cat 3" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  24. And course in management listing should be visible "C1" behat_course::course_in_management_listing_should_be_visible()
  25. And course in management listing should be dimmed "C2" behat_course::course_in_management_listing_should_be_dimmed()
  26. And course in management listing should be visible "C3" behat_course::course_in_management_listing_should_be_visible()
  27. And I toggle visibility of category "CAT3" in management listing behat_course::i_toggle_visibility_of_category_in_management_listing()
  28. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  29. And category in management listing should be visible "CAT2" behat_course::category_in_management_listing_should_be_visible()
  30. And category in management listing should be dimmed "CAT3" behat_course::category_in_management_listing_should_be_dimmed()
  31. And category in management listing should be visible "CAT4" behat_course::category_in_management_listing_should_be_visible()
  32. And course in management listing should be visible "C1" behat_course::course_in_management_listing_should_be_visible()
  33. And course in management listing should be dimmed "C2" behat_course::course_in_management_listing_should_be_dimmed()
  34. And course in management listing should be visible "C3" behat_course::course_in_management_listing_should_be_visible()
  35. And I toggle visibility of category "CAT1" in management listing behat_course::i_toggle_visibility_of_category_in_management_listing()
  36. And category in management listing should be dimmed "CAT1" behat_course::category_in_management_listing_should_be_dimmed()
  37. And category in management listing should be visible "CAT2" behat_course::category_in_management_listing_should_be_visible()
  38. And category in management listing should be dimmed "CAT3" behat_course::category_in_management_listing_should_be_dimmed()
  39. And category in management listing should be dimmed "CAT4" behat_course::category_in_management_listing_should_be_dimmed()
  40. And course in management listing should be dimmed "C1" behat_course::course_in_management_listing_should_be_dimmed()
  41. And course in management listing should be dimmed "C2" behat_course::course_in_management_listing_should_be_dimmed()
  42. And course in management listing should be dimmed "C3" behat_course::course_in_management_listing_should_be_dimmed()
  43. And I toggle visibility of category "CAT1" in management listing behat_course::i_toggle_visibility_of_category_in_management_listing()
  44. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  45. And category in management listing should be visible "CAT2" behat_course::category_in_management_listing_should_be_visible()
  46. And category in management listing should be dimmed "CAT3" behat_course::category_in_management_listing_should_be_dimmed()
  47. And category in management listing should be visible "CAT4" behat_course::category_in_management_listing_should_be_visible()
  48. And course in management listing should be visible "C1" behat_course::course_in_management_listing_should_be_visible()
  49. And course in management listing should be dimmed "C2" behat_course::course_in_management_listing_should_be_dimmed()
  50. And course in management listing should be visible "C3" behat_course::course_in_management_listing_should_be_visible()
  • @javascript
  • @_cross_browser

Scenario: Test courses are hidden when selected category parent is hidden. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/category_change_visibility.feature:255

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
    Cat 2 CAT1 CAT2
    Cat 3 CAT2 CAT3
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    category fullname shortname idnumber
    CAT3 Course 1 Course 1 C1
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I click on category "Cat 1" in the management interface behat_course::i_click_on_category_in_the_management_interface()
  7. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  8. And I click on category "Cat 2" in the management interface behat_course::i_click_on_category_in_the_management_interface()
  9. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  10. And I click on category "Cat 3" in the management interface behat_course::i_click_on_category_in_the_management_interface()
  11. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  12. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  13. And category in management listing should be visible "CAT2" behat_course::category_in_management_listing_should_be_visible()
  14. And category in management listing should be visible "CAT3" behat_course::category_in_management_listing_should_be_visible()
  15. And course in management listing should be visible "C1" behat_course::course_in_management_listing_should_be_visible()
  16. And I toggle visibility of category "CAT1" in management listing behat_course::i_toggle_visibility_of_category_in_management_listing()
  17. And category in management listing should be dimmed "CAT1" behat_course::category_in_management_listing_should_be_dimmed()
  18. And category in management listing should be dimmed "CAT2" behat_course::category_in_management_listing_should_be_dimmed()
  19. And category in management listing should be dimmed "CAT3" behat_course::category_in_management_listing_should_be_dimmed()
  20. And course in management listing should be dimmed "C1" behat_course::course_in_management_listing_should_be_dimmed()
  21. And I toggle visibility of category "CAT1" in management listing behat_course::i_toggle_visibility_of_category_in_management_listing()
  22. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  23. And category in management listing should be visible "CAT2" behat_course::category_in_management_listing_should_be_visible()
  24. And category in management listing should be visible "CAT3" behat_course::category_in_management_listing_should_be_visible()
  25. And course in management listing should be visible "C1" behat_course::course_in_management_listing_should_be_visible()
  26. And I toggle visibility of course "C1" in management listing behat_course::i_toggle_visibility_of_course_in_management_listing()
  27. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  28. And category in management listing should be visible "CAT2" behat_course::category_in_management_listing_should_be_visible()
  29. And category in management listing should be visible "CAT3" behat_course::category_in_management_listing_should_be_visible()
  30. And course in management listing should be dimmed "C1" behat_course::course_in_management_listing_should_be_dimmed()
  31. And I toggle visibility of category "CAT1" in management listing behat_course::i_toggle_visibility_of_category_in_management_listing()
  32. And category in management listing should be dimmed "CAT1" behat_course::category_in_management_listing_should_be_dimmed()
  33. And category in management listing should be dimmed "CAT2" behat_course::category_in_management_listing_should_be_dimmed()
  34. And category in management listing should be dimmed "CAT3" behat_course::category_in_management_listing_should_be_dimmed()
  35. And course in management listing should be dimmed "C1" behat_course::course_in_management_listing_should_be_dimmed()
  36. And I toggle visibility of category "CAT1" in management listing behat_course::i_toggle_visibility_of_category_in_management_listing()
  37. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  38. And category in management listing should be visible "CAT2" behat_course::category_in_management_listing_should_be_visible()
  39. And category in management listing should be visible "CAT3" behat_course::category_in_management_listing_should_be_visible()
  40. And course in management listing should be dimmed "C1" behat_course::course_in_management_listing_should_be_dimmed()

Feature: Test category management actions

As a moodle admin
Test we can create a category
Test we can create a sub category
Test we can edit a category
Test we can delete a category
Test we can move a category
Test we can assign roles within a category
Test we can set permissions on a category
Test we can manage cohorts within a category
Test we can manage filters for a category

Scenario: Test editing a category through the management interface. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/category_management.feature:14

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    category fullname shortname idnumber
    CAT1 Course 1 Course 1 C1
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I click on "edit" action for "Cat 1" in management category listing behat_course::i_click_on_action_for_item_in_management_category_listing()
  7. And I should see "Edit category settings" behat_general::assert_page_contains_text()
  8. And I should see "Cat 1" behat_general::assert_page_contains_text()
  9. And I press "Cancel" behat_forms::press_button()
  10. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  11. And I click on "edit" action for "Cat 1" in management category listing behat_course::i_click_on_action_for_item_in_management_category_listing()
  12. And I should see "Edit category settings" behat_general::assert_page_contains_text()
  13. And I should see "Cat 1" behat_general::assert_page_contains_text()
  14. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Category name Category 1 (edited)
    Category ID number CAT1e
  15. And I press "Save changes" behat_forms::press_button()
  16. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  17. And I should see "Category 1 (edited)" in the "#category-listing" "css_element" behat_general::assert_element_contains_text()
  18. And I should see "Category 1 (edited)" in the "#course-listing h3" "css_element" behat_general::assert_element_contains_text()

Scenario: Test deleting a categories through the management interface. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/category_management.feature:45

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
    Cat 2 0 CAT2
    Cat 3 0 CAT3
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    category fullname shortname idnumber
    CAT3 Course 1 Course 1 C1
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I should see "Cat 1" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  7. And I should see "Cat 2" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  8. And I should see "Cat 3" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  9. And I click on "delete" action for "Cat 2" in management category listing behat_course::i_click_on_action_for_item_in_management_category_listing()
  10. And I should see "Delete category: Cat 2" behat_general::assert_page_contains_text()
  11. And I should see "Contents of Cat 2" behat_general::assert_page_contains_text()
  12. And I should see "This category is empty" behat_general::assert_page_contains_text()
  13. And I press "Cancel" behat_forms::press_button()
  14. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  15. And I should see "Cat 1" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  16. And I should see "Cat 2" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  17. And I should see "Cat 3" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  18. And I click on "delete" action for "Cat 2" in management category listing behat_course::i_click_on_action_for_item_in_management_category_listing()
  19. And I should see "Delete category: Cat 2" behat_general::assert_page_contains_text()
  20. And I should see "Contents of Cat 2" behat_general::assert_page_contains_text()
  21. And I should see "This category is empty" behat_general::assert_page_contains_text()
  22. And I press "Delete" behat_forms::press_button()
  23. And I should see "Delete category: Cat 2" behat_general::assert_page_contains_text()
  24. And I should see "Deleted course category Cat 2" behat_general::assert_page_contains_text()
  25. And I press "Continue" behat_forms::press_button()
  26. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  27. And I should see "Cat 1" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  28. And I should not see "Cat 2" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  29. And I should see "Cat 3" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  30. And I click on "delete" action for "Cat 3" in management category listing behat_course::i_click_on_action_for_item_in_management_category_listing()
  31. And I should see "Delete category: Cat 3" behat_general::assert_page_contains_text()
  32. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    What to do Move contents to another category
    Move into Cat 1
  33. And I press "Delete" behat_forms::press_button()
  34. And I should see "Delete category: Cat 3" behat_general::assert_page_contains_text()
  35. And I should see "Deleted course category Cat 3" behat_general::assert_page_contains_text()
  36. And I press "Continue" behat_forms::press_button()
  37. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  38. And I should see "Cat 1" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  39. And I should not see "Cat 2" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  40. And I should not see "Cat 3" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  41. And I should see "Course 1" in the "#course-listing ul.ml" "css_element" behat_general::assert_element_contains_text()

Scenario: Test I can assign roles for a category through the management interface. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/category_management.feature:106

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    category fullname shortname idnumber
    CAT1 Course 1 Course 1 C1
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I click on "assignroles" action for "Cat 1" in management category listing behat_course::i_click_on_action_for_item_in_management_category_listing()
  7. And I should see "Assign roles in Category: Cat 1" behat_general::assert_page_contains_text()
  8. And I should see "Please choose a role to assign" behat_general::assert_page_contains_text()
  9. And I click on "Back to Category: Cat 1" "link" behat_general::i_click_on()
  10. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  11. And I should see "Cat 1" in the "#course-listing h3" "css_element" behat_general::assert_element_contains_text()

Scenario: Test I can set access permissions for a category through the management interface. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/category_management.feature:126

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    category fullname shortname idnumber
    CAT1 Course 1 Course 1 C1
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I click on "permissions" action for "Cat 1" in management category listing behat_course::i_click_on_action_for_item_in_management_category_listing()
  7. And I should see "Permissions in Category: Cat 1" behat_general::assert_page_contains_text()
  8. And I click on "Back to Category: Cat 1" "link" behat_general::i_click_on()
  9. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  10. And I should see "Cat 1" in the "#course-listing h3" "css_element" behat_general::assert_element_contains_text()

Scenario: Test clicking to manage cohorts for a category through the management interface. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/category_management.feature:145

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    category fullname shortname idnumber
    CAT1 Course 1 Course 1 C1
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I click on "cohorts" action for "Cat 1" in management category listing behat_course::i_click_on_action_for_item_in_management_category_listing()
  7. And I should see "Category: Cat 1: available cohorts" behat_general::assert_page_contains_text()

Scenario: Test configuring filters for a category /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/category_management.feature:160

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    category fullname shortname idnumber
    CAT1 Course 1 Course 1 C1
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I click on "filters" action for "Cat 1" in management category listing behat_course::i_click_on_action_for_item_in_management_category_listing()
  7. And I should see "Filter settings in Category: Cat 1" behat_general::assert_page_contains_text()
  8. And I click on "Back to Category: Cat 1" "link" behat_general::i_click_on()
  9. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  10. And I should see "Cat 1" in the "#course-listing h3" "css_element" behat_general::assert_element_contains_text()
  • @javascript

Scenario: Test that I can create a category and view it in the management interface /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/category_management.feature:180

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  4. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  5. And I click on "Create new category" "link" in the ".category-listing-actions" "css_element" behat_general::i_click_on_in_the()
  6. And I should see "Add new category" behat_general::assert_page_contains_text()
  7. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Category name Test category 2
    Category ID number TC2
  8. And I press "Create category" behat_forms::press_button()
  9. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  10. And I should see "Test category 2" in the "#course-listing h3" "css_element" behat_general::assert_element_contains_text()
  11. And I should see category listing "Cat 1" before "Test category 2" behat_course::i_should_see_category_listing_before()
  12. And I should see "No courses in this category" behat_general::assert_page_contains_text()
  13. And I click on "createnewsubcategory" action for "Test category 2" in management category listing behat_course::i_click_on_action_for_item_in_management_category_listing()
  14. And I should see "Add new category" behat_general::assert_page_contains_text()
  15. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Category name Test category 3
    Category ID number TC3
  16. And I press "Create category" behat_forms::press_button()
  17. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  18. And I should see "Test category 3" in the "#course-listing h3" "css_element" behat_general::assert_element_contains_text()
  19. And I should see category listing "Cat 1" before "Test category 2" behat_course::i_should_see_category_listing_before()
  20. And I should see "No courses in this category" behat_general::assert_page_contains_text()
  • @javascript

Scenario: Test moving a categories through the management interface. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/category_management.feature:213

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
    Cat 2 0 CAT2
    Cat 3 0 CAT3
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  4. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  5. And I should see "Cat 1" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  6. And I should see "Cat 2" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  7. And I should see "Cat 3" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  8. And I select category "Cat 2" in the management interface behat_course::i_select_category_in_the_management_interface()
  9. And I select category "Cat 3" in the management interface behat_course::i_select_category_in_the_management_interface()
  10. And I select "Cat 1" from "menumovecategoriesto" behat_forms::select_option()
  11. When I press "bulkmovecategories" behat_forms::press_button()
  12. And I click on category "Cat 1" in the management interface behat_course::i_click_on_category_in_the_management_interface()
  13. Then I should see category "CAT3" as subcategory of "CAT1" in the management interface behat_course::i_should_see_category_as_subcategory_of_in_the_management_interface()
  14. And I move category "CAT3" to top level in the management interface behat_course::i_move_category_to_top_level_in_the_management_interface()
  15. And I should not see category "CAT3" as subcategory of "CAT1" in the management interface behat_course::i_should_not_see_category_as_subcategory_of_in_the_management_interface()
  16. Then I should see category "CAT2" as subcategory of "CAT1" in the management interface behat_course::i_should_see_category_as_subcategory_of_in_the_management_interface()

Feature: Test we can resort categories in the management interface.

As a moodle admin
I need to test we can resort top level categories.
I need to test we can resort sub categories.
I need to test we can manually sort categories.

Scenario Outline: Test bulk sorting all categories. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/category_resort.feature:8

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    category name idnumber sortorder
    0 Social studies Ext003 1
    0 Applied sciences Sci001 2
    0 Extended social studies Ext002 3
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  4. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  5. And I select "All categories" from "menuselectsortby" behat_forms::select_option()
  6. And I select <sortby> from "menuresortcategoriesby" behat_forms::select_option()
  7. And I press "Sort" behat_forms::press_button()
  8. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  9. And I should see category listing <cat1> before <cat2> behat_course::i_should_see_category_listing_before()
  10. And I should see category listing <cat2> before <cat3> behat_course::i_should_see_category_listing_before()

Examples

sortby cat1 cat2 cat3
"Sort categories by name" "Applied sciences" "Extended social studies" "Social studies"
"Sort categories by ID number" "Extended social studies" "Social studies" "Applied sciences"

Scenario Outline: Test bulk sorting current category. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/category_resort.feature:31

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    category name idnumber sortorder
    0 Test category Tes001 1
    Tes001 Social studies Ext003 2
    Tes001 Applied sciences Sci001 3
    Tes001 Extended social studies Ext002 4
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  4. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  5. And I click on "Test category" "link" behat_general::i_click_on()
  6. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  7. And I select "This category" from "menuselectsortby" behat_forms::select_option()
  8. And I select <sortby> from "menuresortcategoriesby" behat_forms::select_option()
  9. And I press "Sort" behat_forms::press_button()
  10. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  11. And I should see category listing <cat1> before <cat2> behat_course::i_should_see_category_listing_before()
  12. And I should see category listing <cat2> before <cat3> behat_course::i_should_see_category_listing_before()

Examples

sortby cat1 cat2 cat3
"Sort categories by name" "Applied sciences" "Extended social studies" "Social studies"
"Sort categories by ID number" "Extended social studies" "Social studies" "Applied sciences"

Scenario Outline: Test resorting subcategories. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/category_resort.feature:58

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    category name idnumber sortorder
    0 Master cat CAT1 1
    CAT1 Social studies Ext003 1
    CAT1 Applied sciences Sci001 2
    CAT1 Extended social studies Ext002 3
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  4. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  5. And I click on "Master cat" "link" behat_general::i_click_on()
  6. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  7. And I click on <sortby> action for "Master cat" in management category listing behat_course::i_click_on_action_for_item_in_management_category_listing()
  8. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  9. And I should see category listing <cat1> before <cat2> behat_course::i_should_see_category_listing_before()
  10. And I should see category listing <cat2> before <cat3> behat_course::i_should_see_category_listing_before()

Examples

sortby cat1 cat2 cat3
"resortbyname" "Applied sciences" "Extended social studies" "Social studies"
"resortbyidnumber" "Extended social studies" "Social studies" "Applied sciences"
  • @javascript

Scenario Outline: Test resorting subcategories with JS enabled. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/category_resort.feature:84

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    category name idnumber sortorder
    0 Master cat CAT1 1
    CAT1 Social studies Ext003 1
    CAT1 Applied sciences Sci001 2
    CAT1 Extended social studies Ext002 3
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  4. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  5. And I click on "Master cat" "link" behat_general::i_click_on()
  6. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  7. And I click on <sortby> action for "Master cat" in management category listing behat_course::i_click_on_action_for_item_in_management_category_listing()
  8. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  9. And I should see category listing <cat1> before <cat2> behat_course::i_should_see_category_listing_before()
  10. And I should see category listing <cat2> before <cat3> behat_course::i_should_see_category_listing_before()

Examples

sortby cat1 cat2 cat3
"resortbyname" "Applied sciences" "Extended social studies" "Social studies"
"resortbyidnumber" "Extended social studies" "Social studies" "Applied sciences"

Scenario: Test moving categories up and down by one. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/category_resort.feature:110

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    category idnumber name
    0 CAT1 Cat 1
    0 CAT2 Cat 2
    CAT1 CATA Cat 1a
    CAT1 CATB Cat 1b
    CAT1 CATC Cat 1c
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  4. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  5. And I click on category "Cat 1" in the management interface behat_course::i_click_on_category_in_the_management_interface()
  6. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  7. And I should see category listing "Cat 1" before "Cat 1a" behat_course::i_should_see_category_listing_before()
  8. And I should see category listing "Cat 1a" before "Cat 1b" behat_course::i_should_see_category_listing_before()
  9. And I should see category listing "Cat 1b" before "Cat 1c" behat_course::i_should_see_category_listing_before()
  10. And I should see category listing "Cat 1c" before "Cat 2" behat_course::i_should_see_category_listing_before()
  11. And I click to move category "CATA" down one behat_course::i_click_to_move_category_by_one()
  12. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  13. And I should see category listing "Cat 1" before "Cat 1b" behat_course::i_should_see_category_listing_before()
  14. And I should see category listing "Cat 1b" before "Cat 1a" behat_course::i_should_see_category_listing_before()
  15. And I should see category listing "Cat 1a" before "Cat 1c" behat_course::i_should_see_category_listing_before()
  16. And I should see category listing "Cat 1c" before "Cat 2" behat_course::i_should_see_category_listing_before()
  17. And I click to move category "CATC" up one behat_course::i_click_to_move_category_by_one()
  18. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  19. And I should see category listing "Cat 1" before "Cat 1b" behat_course::i_should_see_category_listing_before()
  20. And I should see category listing "Cat 1b" before "Cat 1c" behat_course::i_should_see_category_listing_before()
  21. And I should see category listing "Cat 1c" before "Cat 1a" behat_course::i_should_see_category_listing_before()
  22. And I should see category listing "Cat 1a" before "Cat 2" behat_course::i_should_see_category_listing_before()
  23. And I click to move category "CATA" down one behat_course::i_click_to_move_category_by_one()
  24. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  25. And I should see category listing "Cat 1" before "Cat 1b" behat_course::i_should_see_category_listing_before()
  26. And I should see category listing "Cat 1b" before "Cat 1c" behat_course::i_should_see_category_listing_before()
  27. And I should see category listing "Cat 1c" before "Cat 1a" behat_course::i_should_see_category_listing_before()
  28. And I should see category listing "Cat 1a" before "Cat 2" behat_course::i_should_see_category_listing_before()
  29. And I click to move category "CATB" up one behat_course::i_click_to_move_category_by_one()
  30. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  31. And I should see category listing "Cat 1" before "Cat 1b" behat_course::i_should_see_category_listing_before()
  32. And I should see category listing "Cat 1b" before "Cat 1c" behat_course::i_should_see_category_listing_before()
  33. And I should see category listing "Cat 1c" before "Cat 1a" behat_course::i_should_see_category_listing_before()
  34. And I should see category listing "Cat 1a" before "Cat 2" behat_course::i_should_see_category_listing_before()
  35. And I click to move category "CAT2" up one behat_course::i_click_to_move_category_by_one()
  36. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  37. And I should see category listing "Cat 2" before "Cat 1" behat_course::i_should_see_category_listing_before()
  38. And I click on category "Cat 1" in the management interface behat_course::i_click_on_category_in_the_management_interface()
  39. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  40. And I should see category listing "Cat 2" before "Cat 1" behat_course::i_should_see_category_listing_before()
  41. And I should see category listing "Cat 1" before "Cat 1b" behat_course::i_should_see_category_listing_before()
  42. And I should see category listing "Cat 1b" before "Cat 1c" behat_course::i_should_see_category_listing_before()
  43. And I should see category listing "Cat 1c" before "Cat 1a" behat_course::i_should_see_category_listing_before()
  • @javascript
  • @_cross_browser

Scenario: Test using AJAX to move categories up and down by one. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/category_resort.feature:170

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    category idnumber name
    0 CAT1 Cat 1
    0 CAT2 Cat 2
    CAT1 CATA Cat 1a
    CAT1 CATB Cat 1b
    CAT1 CATC Cat 1c
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  4. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  5. And I click on category "Cat 1" in the management interface behat_course::i_click_on_category_in_the_management_interface()
  6. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  7. And I should see category listing "Cat 1" before "Cat 1a" behat_course::i_should_see_category_listing_before()
  8. And I should see category listing "Cat 1a" before "Cat 1b" behat_course::i_should_see_category_listing_before()
  9. And I should see category listing "Cat 1b" before "Cat 1c" behat_course::i_should_see_category_listing_before()
  10. And I should see category listing "Cat 1c" before "Cat 2" behat_course::i_should_see_category_listing_before()
  11. And I click to move category "CATA" down one behat_course::i_click_to_move_category_by_one()
  12. And I should see category listing "Cat 1" before "Cat 1b" behat_course::i_should_see_category_listing_before()
  13. And I should see category listing "Cat 1b" before "Cat 1a" behat_course::i_should_see_category_listing_before()
  14. And I should see category listing "Cat 1a" before "Cat 1c" behat_course::i_should_see_category_listing_before()
  15. And I should see category listing "Cat 1c" before "Cat 2" behat_course::i_should_see_category_listing_before()
  16. And I click to move category "CATC" up one behat_course::i_click_to_move_category_by_one()
  17. And I should see category listing "Cat 1" before "Cat 1b" behat_course::i_should_see_category_listing_before()
  18. And I should see category listing "Cat 1b" before "Cat 1c" behat_course::i_should_see_category_listing_before()
  19. And I should see category listing "Cat 1c" before "Cat 1a" behat_course::i_should_see_category_listing_before()
  20. And I should see category listing "Cat 1a" before "Cat 2" behat_course::i_should_see_category_listing_before()

Feature: Course category management interface performs as expected

In order to test JS enhanced display of categories and subcategories.
As a moodle admin
I need to expand and collapse categories.

  • @javascript

Scenario: Test general look of management interface /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/course_category_management_listing.feature:8

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  4. And I should see "Course and category management" in the "h2" "css_element" behat_general::assert_element_contains_text()
  5. And I should see "Viewing Course categories" behat_general::assert_page_contains_text()
  6. And I should see "Course categories" in the "h3" "css_element" behat_general::assert_element_contains_text()
  7. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  • @javascript

Scenario: Test view mode functionality /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/course_category_management_listing.feature:20

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category format
    Course 1 C1 CAT1 topics
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I should see "Course categories" in the "#category-listing h3" "css_element" behat_general::assert_element_contains_text()
  7. And I should see "Cat 1" in the "#category-listing" "css_element" behat_general::assert_element_contains_text()
  8. And I should see "Viewing Course categories" in the ".view-mode-selector" "css_element" behat_general::assert_element_contains_text()
  9. And I should not see "Course categories and courses" in the ".view-mode-selector .menu" "css_element" behat_general::assert_element_not_contains_text()
  10. And I should not see "Course categories" in the ".view-mode-selector .menu" "css_element" behat_general::assert_element_not_contains_text()
  11. And I should not see "Courses" in the ".view-mode-selector .menu" "css_element" behat_general::assert_element_not_contains_text()
  12. When I click on "Viewing Course categories" "link" in the ".view-mode-selector" "css_element" behat_general::i_click_on_in_the()
  13. Then I should see "Course categories and courses" in the ".view-mode-selector .menu" "css_element" behat_general::assert_element_contains_text()
  14. And I should see "Course categories" in the ".view-mode-selector .menu" "css_element" behat_general::assert_element_contains_text()
  15. And I should see "Courses" in the ".view-mode-selector .menu" "css_element" behat_general::assert_element_contains_text()
  16. And I click on "Course categories and courses" "link" in the ".view-mode-selector .menu" "css_element" behat_general::i_click_on_in_the()
  17. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  18. And I should see "Course categories" in the "#category-listing h3" "css_element" behat_general::assert_element_contains_text()
  19. And I should see "Courses" in the "#course-listing h3" "css_element" behat_general::assert_element_contains_text()
  20. And I should see "Cat 1" in the "#category-listing" "css_element" behat_general::assert_element_contains_text()
  21. And I should see "Please select a category" in the "#course-listing" "css_element" behat_general::assert_element_contains_text()
  22. And I click on category "Cat 1" in the management interface behat_course::i_click_on_category_in_the_management_interface()
  23. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  24. And I should see "Course categories" in the "#category-listing h3" "css_element" behat_general::assert_element_contains_text()
  25. And I should see "Cat 1" in the "#course-listing h3" "css_element" behat_general::assert_element_contains_text()
  26. And I should see "Cat 1" in the "#category-listing" "css_element" behat_general::assert_element_contains_text()
  27. And I should see "Course 1" in the "#course-listing" "css_element" behat_general::assert_element_contains_text()
  28. When I click on "Viewing Course categories" "link" in the ".view-mode-selector" "css_element" behat_general::i_click_on_in_the()
  29. Then I should see "Courses" in the ".view-mode-selector .menu" "css_element" behat_general::assert_element_contains_text()
  30. And I click on "Courses" "link" in the ".view-mode-selector .menu" "css_element" behat_general::i_click_on_in_the()
  31. And I should see the "Courses" management page behat_course::i_should_see_the_courses_management_page()
  32. And I should see "Cat 1" in the "#course-listing h3" "css_element" behat_general::assert_element_contains_text()
  33. And I should see "Course 1" in the "#course-listing" "css_element" behat_general::assert_element_contains_text()
  34. And I click on course "Course 1" in the management interface behat_course::i_click_on_course_in_the_management_interface()
  35. And I should see the "Courses" management page with a course selected behat_course::i_should_see_the_courses_management_page_with_a_course_selected()
  36. And I should see "Cat 1" in the "#course-listing h3" "css_element" behat_general::assert_element_contains_text()
  37. And I should see "Course 1" in the "#course-listing" "css_element" behat_general::assert_element_contains_text()
  38. And I should see "Course 1" in the "#course-detail h3" "css_element" behat_general::assert_element_contains_text()
  39. And I should see "C1" in the "#course-detail .shortname" "css_element" behat_general::assert_element_contains_text()
  40. And I should see "Course 1" in the "#course-detail .fullname" "css_element" behat_general::assert_element_contains_text()
  41. And I should see "Topics" in the "#course-detail .format" "css_element" behat_general::assert_element_contains_text()
  42. And I should see "Cat 1" in the "#course-detail .category" "css_element" behat_general::assert_element_contains_text()

Scenario: Test displaying of sub categories /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/course_category_management_listing.feature:73

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
    Cat 2 0 CAT2
    Cat 1-1 CAT1 CAT3
    Cat 1-2 CAT1 CAT4
    Cat 1-1-1 CAT3 CAT5
    Cat 1-1-2 CAT3 CAT6
    Cat 2-1 CAT2 CAT7
    Cat 2-1-1 CAT7 CAT8
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 CAT1
    Course 2 C2 CAT1
    Course 3 C3 CAT3
    Course 4 C4 CAT3
    Course 5 C5 CAT5
    Course 6 C6 CAT5
    Course 7 C7 CAT8
    Course 8 C8 CAT8
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  7. And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  8. And I should not see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  9. And I should not see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  10. And I should not see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  11. And I should not see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  12. And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  13. And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  14. And I click on "Cat 1" "link" behat_general::i_click_on()
  15. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  16. And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  17. And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  18. And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  19. And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  20. And I should not see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  21. And I should not see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  22. And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  23. And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  24. And I click on "Cat 1-1" "link" behat_general::i_click_on()
  25. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  26. And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  27. And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  28. And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  29. And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  30. And I should see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  31. And I should see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  32. And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  33. And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  34. And I click on "Cat 2" "link" behat_general::i_click_on()
  35. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  36. And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  37. And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  38. And I should not see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  39. And I should not see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  40. And I should not see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  41. And I should not see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  42. And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  43. And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  • @javascript
  • @_cross_browser

Scenario: Test AJAX loading of sub categories /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/course_category_management_listing.feature:143

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
    Cat 2 0 CAT2
    Cat 1-1 CAT1 CAT3
    Cat 1-2 CAT1 CAT4
    Cat 1-1-1 CAT3 CAT5
    Cat 1-1-2 CAT3 CAT6
    Cat 2-1 CAT2 CAT7
    Cat 2-1-1 CAT7 CAT8
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 CAT1
    Course 2 C2 CAT1
    Course 3 C3 CAT3
    Course 4 C4 CAT3
    Course 5 C5 CAT5
    Course 6 C6 CAT5
    Course 7 C7 CAT8
    Course 8 C8 CAT8
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  7. And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  8. And I should not see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  9. And I should not see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  10. And I should not see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  11. And I should not see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  12. And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  13. And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  14. And I click to expand category "CAT1" in the management interface behat_course::i_click_to_expand_category_in_the_management_interface()
  15. And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  16. And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  17. And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  18. And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  19. And I should not see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  20. And I should not see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  21. And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  22. And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  23. And I click to expand category "CAT3" in the management interface behat_course::i_click_to_expand_category_in_the_management_interface()
  24. And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  25. And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  26. And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  27. And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  28. And I should see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  29. And I should see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  30. And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  31. And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  32. And I click to expand category "CAT2" in the management interface behat_course::i_click_to_expand_category_in_the_management_interface()
  33. And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  34. And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  35. And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  36. And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  37. And I should see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  38. And I should see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  39. And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  40. And I should not see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  41. And I click to expand category "CAT7" in the management interface behat_course::i_click_to_expand_category_in_the_management_interface()
  42. And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  43. And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  44. And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  45. And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  46. And I should see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  47. And I should see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  48. And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  49. And I should see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  50. And I click to expand category "CAT1" in the management interface behat_course::i_click_to_expand_category_in_the_management_interface()
  51. And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  52. And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  53. And I should not see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  54. And I should not see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  55. And I should not see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  56. And I should not see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  57. And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  58. And I should see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  59. And I click to expand category "CAT1" in the management interface behat_course::i_click_to_expand_category_in_the_management_interface()
  60. And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  61. And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  62. And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  63. And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  64. And I should see "Cat 1-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  65. And I should see "Cat 1-1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  66. And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  67. And I should see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  • @javascript

Scenario Outline: Top level categories are displayed correctly when resorted /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/course_category_management_listing.feature:238

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    category name idnumber sortorder
    0 Social studies Ext003 1
    0 Applied sciences Sci001 2
    0 Extended social studies Ext002 3
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  4. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  5. And I select "All categories" from "menuselectsortby" behat_forms::select_option()
  6. And I select <sortby> from "menuresortcategoriesby" behat_forms::select_option()
  7. And I press "Sort" behat_forms::press_button()
  8. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  9. And I should see category listing <cat1> before <cat2> behat_course::i_should_see_category_listing_before()
  10. And I should see category listing <cat2> before <cat3> behat_course::i_should_see_category_listing_before()

Examples

sortby cat1 cat2 cat3
"Sort categories by name" "Applied sciences" "Extended social studies" "Social studies"
"Sort categories by ID number" "Extended social studies" "Social studies" "Applied sciences"
  • @javascript

Scenario Outline: Sub categories are displayed correctly when resorted /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/course_category_management_listing.feature:262

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    category name idnumber sortorder
    0 Master cat CAT1 1
    CAT1 Social studies Ext003 1
    CAT1 Applied sciences Sci001 2
    CAT1 Extended social studies Ext002 3
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  4. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  5. And I click on "Master cat" "link" behat_general::i_click_on()
  6. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  7. And I click on <sortby> action for "Master cat" in management category listing behat_course::i_click_on_action_for_item_in_management_category_listing()
  8. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  9. And I should see category listing <cat1> before <cat2> behat_course::i_should_see_category_listing_before()
  10. And I should see category listing <cat2> before <cat3> behat_course::i_should_see_category_listing_before()

Examples

sortby cat1 cat2 cat3
"resortbyname" "Applied sciences" "Extended social studies" "Social studies"
"resortbyidnumber" "Extended social studies" "Social studies" "Applied sciences"
  • @javascript

Scenario Outline: Test courses are displayed correctly after being resorted. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/course_category_management_listing.feature:288

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category 0 idnumber
    Cat 1 0 CAT1
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    category fullname shortname idnumber sortorder
    CAT1 Social studies Senior school Ext003 1
    CAT1 Applied sciences Middle school Sci001 2
    CAT1 Extended social studies Junior school Ext002 3
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I click on "Cat 1" "link" behat_general::i_click_on()
  7. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  8. And I click on "Sort courses" "link" behat_general::i_click_on()
  9. And I should see "By fullname" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  10. And I should see "By shortname" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  11. And I should see "By idnumber" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  12. And I click on <sortby> "link" in the ".course-listing-actions" "css_element" behat_general::i_click_on_in_the()
  13. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  14. And I should see course listing <course1> before <course2> behat_course::i_should_see_course_listing_before()
  15. And I should see course listing <course2> before <course3> behat_course::i_should_see_course_listing_before()

Examples

sortby course1 course2 course3
"By fullname" "Applied sciences" "Extended social studies" "Social studies"
"By shortname" "Extended social studies" "Applied sciences" "Social studies"
"By idnumber" "Extended social studies" "Social studies" "Applied sciences"
  • @javascript

Scenario: Test course pagination /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/course_category_management_listing.feature:321

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    category fullname shortname idnumber
    CAT1 Course 1 Course 1 C1
    CAT1 Course 2 Course 2 C2
    CAT1 Course 3 Course 3 C3
    CAT1 Course 4 Course 4 C4
    CAT1 Course 5 Course 5 C5
    CAT1 Course 6 Course 6 C6
    CAT1 Course 7 Course 7 C7
    CAT1 Course 8 Course 8 C8
    CAT1 Course 9 Course 9 C9
    CAT1 Course 10 Course 10 C10
    CAT1 Course 11 Course 11 C11
    CAT1 Course 12 Course 12 C12
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I click on "Cat 1" "link" behat_general::i_click_on()
  7. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  8. And I click on "Sort courses" "link" behat_general::i_click_on()
  9. And I click on "By idnumber" "link" in the ".course-listing-actions" "css_element" behat_general::i_click_on_in_the()
  10. And I should see "Per page: 20" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  11. And I should see course listing "Course 1" before "Course 2" behat_course::i_should_see_course_listing_before()
  12. And I should see course listing "Course 2" before "Course 3" behat_course::i_should_see_course_listing_before()
  13. And I should see course listing "Course 3" before "Course 4" behat_course::i_should_see_course_listing_before()
  14. And I should see course listing "Course 4" before "Course 5" behat_course::i_should_see_course_listing_before()
  15. And I should see course listing "Course 5" before "Course 6" behat_course::i_should_see_course_listing_before()
  16. And I should see course listing "Course 6" before "Course 7" behat_course::i_should_see_course_listing_before()
  17. And I should see course listing "Course 7" before "Course 8" behat_course::i_should_see_course_listing_before()
  18. And I should see course listing "Course 8" before "Course 9" behat_course::i_should_see_course_listing_before()
  19. And I should see course listing "Course 9" before "Course 10" behat_course::i_should_see_course_listing_before()
  20. And I should see course listing "Course 10" before "Course 11" behat_course::i_should_see_course_listing_before()
  21. And I should see course listing "Course 11" before "Course 12" behat_course::i_should_see_course_listing_before()
  22. And "#course-listing .listing-pagination" "css_element" should not exists behat_general::should_not_exists()
  23. And I click on "Per page: 20" "link" in the ".course-listing-actions" "css_element" behat_general::i_click_on_in_the()
  24. And I should see "5" in the ".courses-per-page" "css_element" behat_general::assert_element_contains_text()
  25. And I should see "10" in the ".courses-per-page" "css_element" behat_general::assert_element_contains_text()
  26. And I should see "20" in the ".courses-per-page" "css_element" behat_general::assert_element_contains_text()
  27. And I should see "All" in the ".courses-per-page" "css_element" behat_general::assert_element_contains_text()
  28. And I click on "5" "link" in the ".courses-per-page" "css_element" behat_general::i_click_on_in_the()
  29. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  30. And I should see "Per page: 5" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  31. And I should see course listing "Course 1" before "Course 2" behat_course::i_should_see_course_listing_before()
  32. And I should see course listing "Course 2" before "Course 3" behat_course::i_should_see_course_listing_before()
  33. And I should see course listing "Course 3" before "Course 4" behat_course::i_should_see_course_listing_before()
  34. And I should see course listing "Course 4" before "Course 5" behat_course::i_should_see_course_listing_before()
  35. And I should not see "Course 6" behat_general::assert_page_not_contains_text()
  36. And I should not see "Course 7" behat_general::assert_page_not_contains_text()
  37. And I should not see "Course 8" behat_general::assert_page_not_contains_text()
  38. And I should not see "Course 9" behat_general::assert_page_not_contains_text()
  39. And I should not see "Course 10" behat_general::assert_page_not_contains_text()
  40. And I should not see "Course 11" behat_general::assert_page_not_contains_text()
  41. And I should not see "Course 12" behat_general::assert_page_not_contains_text()
  42. And "#course-listing .listing-pagination" "css_element" should exists behat_general::should_exists()
  43. And I should see "Showing courses 1 to 5 of 12 courses" behat_general::assert_page_contains_text()
  44. And I should not see "First" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_not_contains_text()
  45. And I should not see "Prev" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_not_contains_text()
  46. And I should see "1" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  47. And I should see "2" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  48. And I should see "3" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  49. And I should see "Next" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  50. And I should see "Last" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  51. And I click on "2" "link" in the "#course-listing .listing-pagination" "css_element" behat_general::i_click_on_in_the()
  52. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  53. And I should see "Per page: 5" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  54. And I should see "Course 10" in the "#course-listing" "css_element" behat_general::assert_element_contains_text()
  55. And I should not see "Course 2" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  56. And I should not see "Course 3" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  57. And I should not see "Course 4" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  58. And I should not see "Course 5" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  59. And I should see course listing "Course 6" before "Course 7" behat_course::i_should_see_course_listing_before()
  60. And I should see course listing "Course 7" before "Course 8" behat_course::i_should_see_course_listing_before()
  61. And I should see course listing "Course 8" before "Course 9" behat_course::i_should_see_course_listing_before()
  62. And I should see course listing "Course 9" before "Course 10" behat_course::i_should_see_course_listing_before()
  63. And I should not see "Course 11" behat_general::assert_page_not_contains_text()
  64. And I should not see "Course 12" behat_general::assert_page_not_contains_text()
  65. And "#course-listing .listing-pagination" "css_element" should exists behat_general::should_exists()
  66. And I should see "Showing courses 6 to 10 of 12 courses" behat_general::assert_page_contains_text()
  67. And I should see "First" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  68. And I should see "Prev" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  69. And I should see "1" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  70. And I should see "2" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  71. And I should see "3" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  72. And I should see "Next" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  73. And I should see "Last" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  74. And I click on "Next" "link" in the "#course-listing .listing-pagination" "css_element" behat_general::i_click_on_in_the()
  75. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  76. And I should see "Per page: 5" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  77. And I should see "Course 11" behat_general::assert_page_contains_text()
  78. And I should not see "Course 2" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  79. And I should not see "Course 3" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  80. And I should not see "Course 4" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  81. And I should not see "Course 5" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  82. And I should not see "Course 6" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  83. And I should not see "Course 7" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  84. And I should not see "Course 8" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  85. And I should not see "Course 9" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  86. And I should not see "Course 10" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  87. And I should see course listing "Course 11" before "Course 12" behat_course::i_should_see_course_listing_before()
  88. And "#course-listing .listing-pagination" "css_element" should exists behat_general::should_exists()
  89. And I should see "Showing courses 11 to 12 of 12 courses" behat_general::assert_page_contains_text()
  90. And I should see "First" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  91. And I should see "Prev" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  92. And I should see "1" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  93. And I should see "2" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  94. And I should see "3" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  95. And I should not see "Next" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_not_contains_text()
  96. And I should not see "Last" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_not_contains_text()
  97. And I click on "First" "link" in the "#course-listing .listing-pagination" "css_element" behat_general::i_click_on_in_the()
  98. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  99. And I should see "Per page: 5" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  100. And I should see course listing "Course 1" before "Course 2" behat_course::i_should_see_course_listing_before()
  101. And I should see course listing "Course 2" before "Course 3" behat_course::i_should_see_course_listing_before()
  102. And I should see course listing "Course 3" before "Course 4" behat_course::i_should_see_course_listing_before()
  103. And I should see course listing "Course 4" before "Course 5" behat_course::i_should_see_course_listing_before()
  104. And I should not see "Course 6" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  105. And I should not see "Course 7" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  106. And I should not see "Course 8" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  107. And I should not see "Course 9" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  108. And I should not see "Course 10" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  109. And I should not see "Course 11" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  110. And I should not see "Course 12" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  111. And "#course-listing .listing-pagination" "css_element" should exists behat_general::should_exists()
  112. And I should see "Showing courses 1 to 5 of 12 courses" behat_general::assert_page_contains_text()
  113. And I should not see "First" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_not_contains_text()
  114. And I should not see "Prev" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_not_contains_text()
  115. And I should see "1" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  116. And I should see "2" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  117. And I should see "3" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  118. And I should see "Next" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  119. And I should see "Last" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  120. And I click on "Last" "link" in the "#course-listing .listing-pagination" "css_element" behat_general::i_click_on_in_the()
  121. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  122. And I should see "Per page: 5" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  123. And I should see "Course 11" in the "#course-listing" "css_element" behat_general::assert_element_contains_text()
  124. And I should not see "Course 2" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  125. And I should not see "Course 3" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  126. And I should not see "Course 4" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  127. And I should not see "Course 5" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  128. And I should not see "Course 6" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  129. And I should not see "Course 7" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  130. And I should not see "Course 8" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  131. And I should not see "Course 9" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  132. And I should not see "Course 10" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  133. And I should see course listing "Course 11" before "Course 12" behat_course::i_should_see_course_listing_before()
  134. And "#course-listing .listing-pagination" "css_element" should exists behat_general::should_exists()
  135. And I should see "Showing courses 11 to 12 of 12 courses" behat_general::assert_page_contains_text()
  136. And I should see "First" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  137. And I should see "Prev" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  138. And I should see "1" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  139. And I should see "2" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  140. And I should see "3" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  141. And I should not see "Next" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_not_contains_text()
  142. And I should not see "Last" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_not_contains_text()
  143. And I click on "Prev" "link" in the "#course-listing .listing-pagination" "css_element" behat_general::i_click_on_in_the()
  144. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  145. And I should see "Per page: 5" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  146. And I should see "Course 10" in the "#course-listing" "css_element" behat_general::assert_element_contains_text()
  147. And I should not see "Course 2" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  148. And I should not see "Course 3" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  149. And I should not see "Course 4" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  150. And I should not see "Course 5" in the "#course-listing" "css_element" behat_general::assert_element_not_contains_text()
  151. And I should see course listing "Course 6" before "Course 7" behat_course::i_should_see_course_listing_before()
  152. And I should see course listing "Course 7" before "Course 8" behat_course::i_should_see_course_listing_before()
  153. And I should see course listing "Course 8" before "Course 9" behat_course::i_should_see_course_listing_before()
  154. And I should see course listing "Course 9" before "Course 10" behat_course::i_should_see_course_listing_before()
  155. And I should not see "Course 11" behat_general::assert_page_not_contains_text()
  156. And I should not see "Course 12" behat_general::assert_page_not_contains_text()
  157. And "#course-listing .listing-pagination" "css_element" should exists behat_general::should_exists()
  158. And I should see "Showing courses 6 to 10 of 12 courses" behat_general::assert_page_contains_text()
  159. And I should see "First" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  160. And I should see "Prev" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  161. And I should see "1" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  162. And I should see "2" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  163. And I should see "3" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  164. And I should see "Next" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  165. And I should see "Last" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()

Scenario: Test pagination is only shown when required /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/course_category_management_listing.feature:512

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    category fullname shortname idnumber
    CAT1 Course 1 Course 1 C1
    CAT1 Course 2 Course 2 C2
    CAT1 Course 3 Course 3 C3
    CAT1 Course 4 Course 4 C4
    CAT1 Course 5 Course 5 C5
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I click on "Cat 1" "link" behat_general::i_click_on()
  7. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  8. And I click on "Sort courses" "link" behat_general::i_click_on()
  9. And I click on "By idnumber" "link" in the ".course-listing-actions" "css_element" behat_general::i_click_on_in_the()
  10. And I should see "Per page: 20" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  11. And I should see course listing "Course 1" before "Course 2" behat_course::i_should_see_course_listing_before()
  12. And I should see course listing "Course 2" before "Course 3" behat_course::i_should_see_course_listing_before()
  13. And I should see course listing "Course 3" before "Course 4" behat_course::i_should_see_course_listing_before()
  14. And I should see course listing "Course 4" before "Course 5" behat_course::i_should_see_course_listing_before()
  15. And "#course-listing .listing-pagination" "css_element" should not exists behat_general::should_not_exists()
  16. And I click on "5" "link" in the ".course-listing-actions" "css_element" behat_general::i_click_on_in_the()
  17. And I should see "Per page: 5" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  18. And I should see course listing "Course 1" before "Course 2" behat_course::i_should_see_course_listing_before()
  19. And I should see course listing "Course 2" before "Course 3" behat_course::i_should_see_course_listing_before()
  20. And I should see course listing "Course 3" before "Course 4" behat_course::i_should_see_course_listing_before()
  21. And I should see course listing "Course 4" before "Course 5" behat_course::i_should_see_course_listing_before()
  22. And "#course-listing .listing-pagination" "css_element" should not exists behat_general::should_not_exists()
  • @javascript

Scenario: Test many course pagination /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/course_category_management_listing.feature:549

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category 0 idnumber
    Cat 1 0 CAT1
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    category fullname shortname idnumber
    CAT1 Course 1 Course 1 C1
    CAT1 Course 2 Course 2 C2
    CAT1 Course 3 Course 3 C3
    CAT1 Course 4 Course 4 C4
    CAT1 Course 5 Course 5 C5
    CAT1 Course 6 Course 6 C6
    CAT1 Course 7 Course 7 C7
    CAT1 Course 8 Course 8 C8
    CAT1 Course 9 Course 9 C9
    CAT1 Course 10 Course 10 C10
    CAT1 Course 11 Course 11 C11
    CAT1 Course 12 Course 12 C12
    CAT1 Course 13 Course 13 C13
    CAT1 Course 14 Course 14 C14
    CAT1 Course 15 Course 15 C15
    CAT1 Course 16 Course 16 C16
    CAT1 Course 17 Course 17 C17
    CAT1 Course 18 Course 18 C18
    CAT1 Course 19 Course 19 C19
    CAT1 Course 20 Course 20 C20
    CAT1 Course 21 Course 21 C21
    CAT1 Course 22 Course 22 C22
    CAT1 Course 23 Course 23 C23
    CAT1 Course 24 Course 24 C24
    CAT1 Course 25 Course 25 C25
    CAT1 Course 26 Course 26 C26
    CAT1 Course 27 Course 27 C27
    CAT1 Course 28 Course 28 C28
    CAT1 Course 29 Course 29 C29
    CAT1 Course 30 Course 30 C30
    CAT1 Course 31 Course 31 C31
    CAT1 Course 32 Course 32 C32
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I click on "Cat 1" "link" behat_general::i_click_on()
  7. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  8. And I click on "Sort courses" "link" behat_general::i_click_on()
  9. And I click on "By idnumber" "link" in the ".course-listing-actions" "css_element" behat_general::i_click_on_in_the()
  10. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  11. And I should see "Per page: 20" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  12. And I should see course listing "Course 1" before "Course 2" behat_course::i_should_see_course_listing_before()
  13. And I should see course listing "Course 19" before "Course 20" behat_course::i_should_see_course_listing_before()
  14. And I should not see "Course 21" behat_general::assert_page_not_contains_text()
  15. And I should see "Showing courses 1 to 20 of 32 courses" behat_general::assert_page_contains_text()
  16. And I click on "Per page: 20" "link" in the ".course-listing-actions" "css_element" behat_general::i_click_on_in_the()
  17. And I click on "100" "link" in the ".courses-per-page" "css_element" behat_general::i_click_on_in_the()
  18. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  19. And I should see "Per page: 100" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  20. And I should see course listing "Course 1" before "Course 2" behat_course::i_should_see_course_listing_before()
  21. And I should see course listing "Course 19" before "Course 20" behat_course::i_should_see_course_listing_before()
  22. And I should see course listing "Course 21" before "Course 22" behat_course::i_should_see_course_listing_before()
  23. And I should see course listing "Course 31" before "Course 32" behat_course::i_should_see_course_listing_before()
  24. And "#course-listing .listing-pagination" "css_element" should not exists behat_general::should_not_exists()
  25. And I click on "Per page: 100" "link" in the ".course-listing-actions" "css_element" behat_general::i_click_on_in_the()
  26. And I click on "5" "link" in the ".courses-per-page" "css_element" behat_general::i_click_on_in_the()
  27. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  28. And I should see "Per page: 5" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  29. And I should see course listing "Course 1" before "Course 2" behat_course::i_should_see_course_listing_before()
  30. And I should see course listing "Course 4" before "Course 5" behat_course::i_should_see_course_listing_before()
  31. And I should not see "Course 6" behat_general::assert_page_not_contains_text()
  32. And I should see "Showing courses 1 to 5 of 32 courses" behat_general::assert_page_contains_text()
  33. And I should not see "First" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_not_contains_text()
  34. And I should not see "Prev" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_not_contains_text()
  35. And I should see "1" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  36. And I should see "2" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  37. And I should see "3" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  38. And I should see "4" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  39. And I should see "5" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  40. And I should not see "6" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_not_contains_text()
  41. And I should not see "7" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_not_contains_text()
  42. And I should see "Next" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  43. And I should see "Last" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  44. And I click on "Last" "link" in the "#course-listing .listing-pagination" "css_element" behat_general::i_click_on_in_the()
  45. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  46. And I should see "Per page: 5" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  47. And I should not see "Course 30" behat_general::assert_page_not_contains_text()
  48. And I should see course listing "Course 31" before "Course 32" behat_course::i_should_see_course_listing_before()
  49. And I should see "Showing courses 31 to 32 of 32 courses" behat_general::assert_page_contains_text()
  50. And I should see "First" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  51. And I should see "Prev" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  52. And I should not see "1" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_not_contains_text()
  53. And I should not see "2" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_not_contains_text()
  54. And I should see "3" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  55. And I should see "4" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  56. And I should see "5" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  57. And I should see "6" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  58. And I should see "7" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  59. And I should not see "Next" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_not_contains_text()
  60. And I should not see "Last" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_not_contains_text()
  61. And I click on "4" "link" in the "#course-listing .listing-pagination" "css_element" behat_general::i_click_on_in_the()
  62. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  63. And I should see "Per page: 5" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  64. And I should not see "Course 15" behat_general::assert_page_not_contains_text()
  65. And I should see course listing "Course 16" before "Course 17" behat_course::i_should_see_course_listing_before()
  66. And I should see course listing "Course 17" before "Course 18" behat_course::i_should_see_course_listing_before()
  67. And I should see course listing "Course 18" before "Course 19" behat_course::i_should_see_course_listing_before()
  68. And I should see course listing "Course 19" before "Course 20" behat_course::i_should_see_course_listing_before()
  69. And I should not see "Course 21" behat_general::assert_page_not_contains_text()
  70. And I should see "Showing courses 16 to 20 of 32 courses" behat_general::assert_page_contains_text()
  71. And I should see "First" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  72. And I should see "Prev" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  73. And I should not see "1" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_not_contains_text()
  74. And I should see "2" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  75. And I should see "3" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  76. And I should see "4" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  77. And I should see "5" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  78. And I should see "6" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  79. And I should not see "7" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_not_contains_text()
  80. And I should see "Next" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()
  81. And I should see "Last" in the "#course-listing .listing-pagination" "css_element" behat_general::assert_element_contains_text()

Scenario: Test clicking to edit a course. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/course_category_management_listing.feature:674

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    category fullname shortname idnumber
    CAT1 Course 1 Course 1 C1
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I click on category "Cat 1" in the management interface behat_course::i_click_on_category_in_the_management_interface()
  7. And I click on "edit" action for "Course 1" in management course listing behat_course::i_click_on_action_for_item_in_management_course_listing()
  8. And I should see "Edit course settings" behat_general::assert_page_contains_text()
  9. And I should see "Course 1" behat_general::assert_page_contains_text()
  • @javascript

Scenario: Test AJAX expanded categories stay open. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/course_category_management_listing.feature:692

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
    Cat 2 0 CAT2
    Cat 1-1 CAT1 CAT3
    Cat 1-2 CAT1 CAT4
    Cat 1-1-1 CAT3 CAT5
    Cat 1-1-2 CAT3 CAT6
    Cat 2-1 CAT2 CAT7
    Cat 2-1-1 CAT7 CAT8
    Cat 2-1-1-1 CAT8 CAT10
    Cat 2-1-2 CAT7 CAT9
    Cat 2-1-2-1 CAT9 CAT11
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  4. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  5. And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  6. And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  7. And I should not see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  8. And I should not see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  9. And I should not see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  10. And I click to expand category "CAT2" in the management interface behat_course::i_click_to_expand_category_in_the_management_interface()
  11. And I click to expand category "CAT7" in the management interface behat_course::i_click_to_expand_category_in_the_management_interface()
  12. And I click to expand category "CAT9" in the management interface behat_course::i_click_to_expand_category_in_the_management_interface()
  13. And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  14. And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  15. And I should not see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  16. And I should not see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  17. And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  18. And I should see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  19. And I should see "Cat 2-1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  20. And I should not see "Cat 2-1-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  21. And I should see "Cat 2-1-2-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  22. And I click on "Cat 1" "link" behat_general::i_click_on()
  23. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  24. And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  25. And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  26. And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  27. And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  28. And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  29. And I should see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  30. And I should see "Cat 2-1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  31. And I should not see "Cat 2-1-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  32. And I should see "Cat 2-1-2-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  33. And I click on "resortbyidnumber" action for "Cat 1" in management category listing behat_course::i_click_on_action_for_item_in_management_category_listing()
  34. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  35. And I should see "Cat 1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  36. And I should see "Cat 2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  37. And I should see "Cat 1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  38. And I should see "Cat 1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  39. And I should see "Cat 2-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  40. And I should see "Cat 2-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  41. And I should see "Cat 2-1-2" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  42. And I should not see "Cat 2-1-1-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  43. And I should see "Cat 2-1-2-1" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  • @javascript

Scenario: Test category expansion after deletion /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/course_category_management_listing.feature:756

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat A (1) 0 CAT1
    Cat B (2) 0 CAT2
    Cat C (1-1) CAT1 CAT3
    Cat D (2-1) CAT2 CAT4
    Cat E (2-1-1) CAT4 CAT5
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  4. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  5. And I should see "Cat A (1)" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  6. And I should see "Cat B (2)" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  7. And I should not see "Cat C (1-1)" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  8. And I should not see "Cat D (2-1)" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  9. And I should not see "Cat E (2-1-1)" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()
  10. And I click to expand category "CAT1" in the management interface behat_course::i_click_to_expand_category_in_the_management_interface()
  11. And I should see "Cat C (1-1)" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  12. And I click to expand category "CAT2" in the management interface behat_course::i_click_to_expand_category_in_the_management_interface()
  13. And I should see "Cat D (2-1)" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  14. And I click to expand category "CAT4" in the management interface behat_course::i_click_to_expand_category_in_the_management_interface()
  15. And I should see "Cat E (2-1-1)" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  16. And I click on "delete" action for "Cat B (2)" in management category listing behat_course::i_click_on_action_for_item_in_management_category_listing()
  17. And I should see "Delete category: Cat B (2)" behat_general::assert_page_contains_text()
  18. And I should see "Contents of Cat B (2)" behat_general::assert_page_contains_text()
  19. And I press "Delete" behat_forms::press_button()
  20. And I should see "Delete category: Cat B (2)" behat_general::assert_page_contains_text()
  21. And I should see "Deleted course category Cat B (2)" behat_general::assert_page_contains_text()
  22. And I press "Continue" behat_forms::press_button()
  23. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  24. And I should see "Cat A (1)" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_contains_text()
  25. And I should not see "Cat B (2)" in the "#course-category-listings ul.ml" "css_element" behat_general::assert_element_not_contains_text()

Feature: We can change the visibility of courses in the management interface.

As a moodle admin
I need to test hiding and then showing a course.
I need to test hiding a course and then hiding and showing the category its within.

Scenario: Test toggling course visibility through the management interfaces. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/course_change_visibility.feature:8

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    category fullname shortname idnumber
    CAT1 Course 1 Course 1 C1
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I click on category "Cat 1" in the management interface behat_course::i_click_on_category_in_the_management_interface()
  7. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  8. And I should see "Cat 1" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  9. And I should see "Course 1" in the "#course-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  10. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  11. And course in management listing should be visible "C1" behat_course::course_in_management_listing_should_be_visible()
  12. And I toggle visibility of course "C1" in management listing behat_course::i_toggle_visibility_of_course_in_management_listing()
  13. And I should see the "Course categories and courses" management page with a course selected behat_course::i_should_see_the_courses_management_page_with_a_course_selected()
  14. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  15. And course in management listing should be dimmed "C1" behat_course::course_in_management_listing_should_be_dimmed()
  16. And I toggle visibility of course "C1" in management listing behat_course::i_toggle_visibility_of_course_in_management_listing()
  17. And I should see the "Course categories and courses" management page with a course selected behat_course::i_should_see_the_courses_management_page_with_a_course_selected()
  18. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  19. And course in management listing should be visible "C1" behat_course::course_in_management_listing_should_be_visible()
  20. And I toggle visibility of course "C1" in management listing behat_course::i_toggle_visibility_of_course_in_management_listing()
  21. And I should see the "Course categories and courses" management page with a course selected behat_course::i_should_see_the_courses_management_page_with_a_course_selected()
  22. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  23. And course in management listing should be dimmed "C1" behat_course::course_in_management_listing_should_be_dimmed()
  24. And I toggle visibility of category "CAT1" in management listing behat_course::i_toggle_visibility_of_category_in_management_listing()
  25. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  26. And category in management listing should be dimmed "CAT1" behat_course::category_in_management_listing_should_be_dimmed()
  27. And course in management listing should be dimmed "C1" behat_course::course_in_management_listing_should_be_dimmed()
  28. And I toggle visibility of category "CAT1" in management listing behat_course::i_toggle_visibility_of_category_in_management_listing()
  29. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  30. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  31. And course in management listing should be dimmed "C1" behat_course::course_in_management_listing_should_be_dimmed()
  32. And I toggle visibility of category "CAT1" in management listing behat_course::i_toggle_visibility_of_category_in_management_listing()
  • @javascript

Scenario: Test using AJAX to hide a course through the management interfaces. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/course_change_visibility.feature:55

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    category fullname shortname idnumber
    CAT1 Course 1 Course 1 C1
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I click on category "Cat 1" in the management interface behat_course::i_click_on_category_in_the_management_interface()
  7. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  8. And I should see "Cat 1" in the "#category-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  9. And I should see "Course 1" in the "#course-listing ul.ml" "css_element" behat_general::assert_element_contains_text()
  10. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  11. And course in management listing should be visible "C1" behat_course::course_in_management_listing_should_be_visible()
  12. And I toggle visibility of course "C1" in management listing behat_course::i_toggle_visibility_of_course_in_management_listing()
  13. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  14. And course in management listing should be dimmed "C1" behat_course::course_in_management_listing_should_be_dimmed()
  15. And I toggle visibility of course "C1" in management listing behat_course::i_toggle_visibility_of_course_in_management_listing()
  16. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  17. And course in management listing should be visible "C1" behat_course::course_in_management_listing_should_be_visible()
  18. And I toggle visibility of course "C1" in management listing behat_course::i_toggle_visibility_of_course_in_management_listing()
  19. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  20. And course in management listing should be dimmed "C1" behat_course::course_in_management_listing_should_be_dimmed()
  21. And I toggle visibility of category "CAT1" in management listing behat_course::i_toggle_visibility_of_category_in_management_listing()
  22. And category in management listing should be dimmed "CAT1" behat_course::category_in_management_listing_should_be_dimmed()
  23. And course in management listing should be dimmed "C1" behat_course::course_in_management_listing_should_be_dimmed()
  24. And I toggle visibility of category "CAT1" in management listing behat_course::i_toggle_visibility_of_category_in_management_listing()
  25. And category in management listing should be visible "CAT1" behat_course::category_in_management_listing_should_be_visible()
  26. And course in management listing should be dimmed "C1" behat_course::course_in_management_listing_should_be_dimmed()
  27. And I toggle visibility of category "CAT1" in management listing behat_course::i_toggle_visibility_of_category_in_management_listing()

Feature: Course activity controls works as expected

In order to manage my course's activities
As a teacher
I need to edit, hide, show and indent activities inside course sections

  • @javascript
  • @_cross_browser

Scenario Outline: General activities course controls using topics and weeks formats, and paged mode and not paged mode works as expected /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/course_controls.feature:20

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname format coursedisplay numsections
    Course 1 C1 topics 0 5
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. When I follow <targetpage> behat_general::click_link()
  7. And I press "Turn editing on" behat_forms::press_button()
  8. Then I should see "Turn editing off" behat_general::assert_page_contains_text()
  9. And I press "Turn editing off" behat_forms::press_button()
  10. And "Turn editing on" "button" should exists behat_general::should_exists()
  11. And I follow "Turn editing on" behat_general::click_link()
  12. And "Turn editing off" "button" should exists behat_general::should_exists()
  13. And I follow "Turn editing off" behat_general::click_link()
  14. And I should see "Turn editing on" behat_general::assert_page_contains_text()
  15. And "Turn editing on" "button" should exists behat_general::should_exists()
  16. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  17. And I click on "Actions" "link" in the "Recent activity" "block" behat_general::i_click_on_in_the()
  18. And I click on "Delete Recent activity block" "link" behat_general::i_click_on()
  19. And I press "Yes" behat_forms::press_button()
  20. And "#section-2" "css_element" <should_see_other_sections> exists behat_general::should_exists()
  21. And I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name 1
    Description Test forum description 1
  22. And I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name 2
    Description Test forum description 2
  23. And "#section-2" "css_element" <should_see_other_sections> exists behat_general::should_exists()
  24. And I indent right "Test forum name 1" activity behat_course::i_indent_right_activity()
  25. And "#section-2" "css_element" <should_see_other_sections> exists behat_general::should_exists()
  26. And I indent left "Test forum name 1" activity behat_course::i_indent_left_activity()
  27. And "#section-2" "css_element" <should_see_other_sections> exists behat_general::should_exists()
  28. And I open "Test forum name 1" actions menu behat_course::i_open_actions_menu()
  29. And I click on "Edit settings" "link" in the "Test forum name 1" activity behat_course::i_click_on_in_the_activity()
  30. And I should see "Updating Forum" behat_general::assert_page_contains_text()
  31. And I should see "Display description on course page" behat_general::assert_page_contains_text()
  32. And I press "Save and return to course" behat_forms::press_button()
  33. And "#section-2" "css_element" <should_see_other_sections> exists behat_general::should_exists()
  34. And I open "Test forum name 1" actions menu behat_course::i_open_actions_menu()
  35. And I click on "Hide" "link" in the "Test forum name 1" activity behat_course::i_click_on_in_the_activity()
  36. And "#section-2" "css_element" <should_see_other_sections> exists behat_general::should_exists()
  37. And I duplicate "Test forum name 2" activity editing the new copy with: behat_course::i_duplicate_activity_editing_the_new_copy_with()
    Forum name Edited test forum name 2
  38. And "#section-2" "css_element" <should_see_other_sections> exists behat_general::should_exists()
  39. And I should see "Test forum name 2" behat_general::assert_page_contains_text()
  40. And I should see "Edited test forum name 2" behat_general::assert_page_contains_text()
  41. And I hide section "1" behat_course::i_hide_section()
  42. And "#section-2" "css_element" <should_see_other_sections> exists behat_general::should_exists()
  43. And section "1" should be hidden behat_course::section_should_be_hidden()
  44. And I show section "1" behat_course::i_show_section()
  45. And "#section-2" "css_element" <should_see_other_sections> exists behat_general::should_exists()
  46. And section "1" should be visible behat_course::section_should_be_visible()
  47. And I add the "Section links" block behat_blocks::i_add_the_block()
  48. And "#section-2" "css_element" <should_see_other_sections> exists behat_general::should_exists()
  49. And I should see "1 2 3 4 5" in the "Section links" "block" behat_general::assert_element_contains_text()
  50. And I click on "2" "link" in the "Section links" "block" behat_general::i_click_on_in_the()
  51. And I <should_see_other_sections_following_block_sections_links> see "Test forum name 2" behat_general::assert_page_contains_text()

Examples

courseformat coursedisplay targetpage should_see_other_sections should_see_other_sections_following_block_sections_links
topics 0 "Course 1" should should
topics 1 "Topic 1" should not should not
topics 1 "Course 1" should should not
weeks 0 "Course 1" should should
weeks 1 "1 January - 7 January" should not should not
weeks 1 "Course 1" should should not

Scenario Outline: General activities course controls using topics and weeks formats, and paged mode and not paged mode works as expected /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/course_controls.feature:93

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname format coursedisplay numsections
    Course 1 C1 topics 0 5
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. When I follow <targetpage> behat_general::click_link()
  7. And I press "Turn editing on" behat_forms::press_button()
  8. Then I should see "Turn editing off" behat_general::assert_page_contains_text()
  9. And I press "Turn editing off" behat_forms::press_button()
  10. And "Turn editing on" "button" should exists behat_general::should_exists()
  11. And I follow "Turn editing on" behat_general::click_link()
  12. And "Turn editing off" "button" should exists behat_general::should_exists()
  13. And I follow "Turn editing off" behat_general::click_link()
  14. And I should see "Turn editing on" behat_general::assert_page_contains_text()
  15. And "Turn editing on" "button" should exists behat_general::should_exists()
  16. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  17. And I click on "Actions" "link" in the "Recent activity" "block" behat_general::i_click_on_in_the()
  18. And I click on "Delete Recent activity block" "link" behat_general::i_click_on()
  19. And I press "Yes" behat_forms::press_button()
  20. And "#section-2" "css_element" <should_see_other_sections> exists behat_general::should_exists()
  21. And I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name 1
    Description Test forum description 1
  22. And I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name 2
    Description Test forum description 2
  23. And "#section-2" "css_element" <should_see_other_sections> exists behat_general::should_exists()
  24. And I indent right "Test forum name 1" activity behat_course::i_indent_right_activity()
  25. And "#section-2" "css_element" <should_see_other_sections> exists behat_general::should_exists()
  26. And I indent left "Test forum name 1" activity behat_course::i_indent_left_activity()
  27. And "#section-2" "css_element" <should_see_other_sections> exists behat_general::should_exists()
  28. And I click on "Edit settings" "link" in the "Test forum name 1" activity behat_course::i_click_on_in_the_activity()
  29. And I should see "Updating Forum" behat_general::assert_page_contains_text()
  30. And I should see "Display description on course page" behat_general::assert_page_contains_text()
  31. And I press "Save and return to course" behat_forms::press_button()
  32. And "#section-2" "css_element" <should_see_other_sections> exists behat_general::should_exists()
  33. And I click on "Hide" "link" in the "Test forum name 1" activity behat_course::i_click_on_in_the_activity()
  34. And "#section-2" "css_element" <should_see_other_sections> exists behat_general::should_exists()
  35. And I delete "Test forum name 1" activity behat_course::i_delete_activity()
  36. And "#section-2" "css_element" <should_see_other_sections> exists behat_general::should_exists()
  37. And I should not see "Test forum name 1" in the ".region-content" "css_element" behat_general::assert_element_not_contains_text()
  38. And I duplicate "Test forum name 2" activity editing the new copy with: behat_course::i_duplicate_activity_editing_the_new_copy_with()
    Forum name Edited test forum name 2
  39. And "#section-2" "css_element" <should_see_other_sections> exists behat_general::should_exists()
  40. And I should see "Test forum name 2" behat_general::assert_page_contains_text()
  41. And I should see "Edited test forum name 2" behat_general::assert_page_contains_text()
  42. And I hide section "1" behat_course::i_hide_section()
  43. And "#section-2" "css_element" <should_see_other_sections> exists behat_general::should_exists()
  44. And section "1" should be hidden behat_course::section_should_be_hidden()
  45. And I show section "1" behat_course::i_show_section()
  46. And "#section-2" "css_element" <should_see_other_sections> exists behat_general::should_exists()
  47. And section "1" should be visible behat_course::section_should_be_visible()
  48. And I add the "Section links" block behat_blocks::i_add_the_block()
  49. And "#section-2" "css_element" <should_see_other_sections> exists behat_general::should_exists()
  50. And I should see "1 2 3 4 5" in the "Section links" "block" behat_general::assert_element_contains_text()
  51. And I click on "2" "link" in the "Section links" "block" behat_general::i_click_on_in_the()
  52. And I <should_see_other_sections_following_block_sections_links> see "Test forum name 2" behat_general::assert_page_contains_text()

Examples

courseformat coursedisplay targetpage should_see_other_sections should_see_other_sections_following_block_sections_links
topics 0 "Course 1" should should
topics 1 "Topic 1" should not should not
topics 1 "Course 1" should should not
weeks 0 "Course 1" should should
weeks 1 "1 January - 7 January" should not should not
weeks 1 "Course 1" should should not

Feature: Test we can resort course in the management interface.

As a moodle admin
I need to test we can resort courses within a category.
I need to test we can manually sort courses.

Scenario Outline: Resort courses. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/course_resort.feature:8

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category 0 idnumber
    Cat 1 0 CAT1
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    category fullname shortname idnumber sortorder
    CAT1 Social studies Senior school Ext003 1
    CAT1 Applied sciences Middle school Sci001 2
    CAT1 Extended social studies Junior school Ext002 3
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I click on category "Cat 1" in the management interface behat_course::i_click_on_category_in_the_management_interface()
  7. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  8. And I should see "Sort courses" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  9. And I should see "By fullname" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  10. And I should see "By shortname" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  11. And I should see "By idnumber" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  12. And I click on <sortby> "link" in the ".course-listing-actions" "css_element" behat_general::i_click_on_in_the()
  13. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  14. And I should see course listing <course1> before <course2> behat_course::i_should_see_course_listing_before()
  15. And I should see course listing <course2> before <course3> behat_course::i_should_see_course_listing_before()

Examples

sortby course1 course2 course3
"By fullname" "Applied sciences" "Extended social studies" "Social studies"
"By shortname" "Extended social studies" "Applied sciences" "Social studies"
"By idnumber" "Extended social studies" "Social studies" "Applied sciences"
  • @javascript

Scenario Outline: Resort courses with JavaScript enabled. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/course_resort.feature:41

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category 0 idnumber
    Cat 1 0 CAT1
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    category fullname shortname idnumber sortorder
    CAT1 Social studies Senior school Ext003 1
    CAT1 Applied sciences Middle school Sci001 2
    CAT1 Extended social studies Junior school Ext002 3
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I click on category "Cat 1" in the management interface behat_course::i_click_on_category_in_the_management_interface()
  7. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  8. And I should see "Sort courses" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  9. And I should not see "By fullname" in the ".course-listing-actions" "css_element" behat_general::assert_element_not_contains_text()
  10. And I should not see "By shortname" in the ".course-listing-actions" "css_element" behat_general::assert_element_not_contains_text()
  11. And I should not see "By idnumber" in the ".course-listing-actions" "css_element" behat_general::assert_element_not_contains_text()
  12. And I click on "Sort courses" "link" behat_general::i_click_on()
  13. And I should see "By fullname" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  14. And I should see "By shortname" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  15. And I should see "By idnumber" in the ".course-listing-actions" "css_element" behat_general::assert_element_contains_text()
  16. And I click on <sortby> "link" in the ".course-listing-actions" "css_element" behat_general::i_click_on_in_the()
  17. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  18. And I should see course listing <course1> before <course2> behat_course::i_should_see_course_listing_before()
  19. And I should see course listing <course2> before <course3> behat_course::i_should_see_course_listing_before()

Examples

sortby course1 course2 course3
"By fullname" "Applied sciences" "Extended social studies" "Social studies"
"By shortname" "Extended social studies" "Applied sciences" "Social studies"
"By idnumber" "Extended social studies" "Social studies" "Applied sciences"

Scenario: Test moving courses up and down by one. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/course_resort.feature:77

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    category fullname shortname idnumber
    CAT1 Course 1 Course 1 C1
    CAT1 Course 2 Course 2 C2
    CAT1 Course 3 Course 3 C3
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I click on category "Cat 1" in the management interface behat_course::i_click_on_category_in_the_management_interface()
  7. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  8. And I should see "Course categories" in the "#category-listing h3" "css_element" behat_general::assert_element_contains_text()
  9. And I should see "Cat 1" in the "#category-listing" "css_element" behat_general::assert_element_contains_text()
  10. And I click on "Sort courses" "link" behat_general::i_click_on()
  11. And I click on "By idnumber" "link" in the ".course-listing-actions" "css_element" behat_general::i_click_on_in_the()
  12. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  13. And I should see course listing "Course 1" before "Course 2" behat_course::i_should_see_course_listing_before()
  14. And I should see course listing "Course 2" before "Course 3" behat_course::i_should_see_course_listing_before()
  15. And I click to move course "C1" down one behat_course::i_click_to_move_course_by_one()
  16. And I should see the "Course categories and courses" management page with a course selected behat_course::i_should_see_the_courses_management_page_with_a_course_selected()
  17. And I should see course listing "Course 2" before "Course 1" behat_course::i_should_see_course_listing_before()
  18. And I should see course listing "Course 1" before "Course 3" behat_course::i_should_see_course_listing_before()
  19. And I click to move course "C3" up one behat_course::i_click_to_move_course_by_one()
  20. And I should see the "Course categories and courses" management page with a course selected behat_course::i_should_see_the_courses_management_page_with_a_course_selected()
  21. And I should see course listing "Course 2" before "Course 3" behat_course::i_should_see_course_listing_before()
  22. And I should see course listing "Course 3" before "Course 1" behat_course::i_should_see_course_listing_before()
  • @javascript

Scenario: Test using AJAX to move courses up and down by one. /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/course_resort.feature:114

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Cat 1 0 CAT1
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    category fullname shortname idnumber
    CAT1 Course 1 Course 1 C1
    CAT1 Course 2 Course 2 C2
    CAT1 Course 3 Course 3 C3
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I click on category "Cat 1" in the management interface behat_course::i_click_on_category_in_the_management_interface()
  7. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  8. And I should see "Course categories" in the "#category-listing h3" "css_element" behat_general::assert_element_contains_text()
  9. And I should see "Cat 1" in the "#category-listing" "css_element" behat_general::assert_element_contains_text()
  10. And I click on "Sort courses" "link" behat_general::i_click_on()
  11. And I click on "By idnumber" "link" in the ".course-listing-actions" "css_element" behat_general::i_click_on_in_the()
  12. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  13. And I should see course listing "Course 1" before "Course 2" behat_course::i_should_see_course_listing_before()
  14. And I should see course listing "Course 2" before "Course 3" behat_course::i_should_see_course_listing_before()
  15. And I click to move course "C1" down one behat_course::i_click_to_move_course_by_one()
  16. And I should see course listing "Course 2" before "Course 1" behat_course::i_should_see_course_listing_before()
  17. And I should see course listing "Course 1" before "Course 3" behat_course::i_should_see_course_listing_before()
  18. And I click to move course "C3" up one behat_course::i_click_to_move_course_by_one()
  19. And I should see course listing "Course 2" before "Course 3" behat_course::i_should_see_course_listing_before()
  20. And I should see course listing "Course 3" before "Course 1" behat_course::i_should_see_course_listing_before()

Feature: Test we can both create and delete a course.

As a Moodle admin
I need to test I can create a course
I need to test I can delete a course

Scenario: Create a course /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/create_delete_course.feature:7

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category 0 idnumber
    Cat 1 0 CAT1
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  4. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  5. And I click on category "Cat 1" in the management interface behat_course::i_click_on_category_in_the_management_interface()
  6. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  7. And I should see "Cat 1" in the "#category-listing" "css_element" behat_general::assert_element_contains_text()
  8. And I should see "No courses in this category" in the "#course-listing" "css_element" behat_general::assert_element_contains_text()
  9. And I click on "Create new course" "link" in the ".course-listing-actions" "css_element" behat_general::i_click_on_in_the()
  10. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Course full name Test course: create a course
    Course short name TCCAC
    Course ID number TC3401
    Course summary This course has been created by automated tests.
  11. And I press "Save changes" behat_forms::press_button()
  12. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  13. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  14. And I click on category "Cat 1" in the management interface behat_course::i_click_on_category_in_the_management_interface()
  15. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  16. And I should see "Cat 1" in the "#category-listing" "css_element" behat_general::assert_element_contains_text()
  17. And I should see "Test course: create a course" in the "#course-listing" "css_element" behat_general::assert_element_contains_text()

Scenario: Delete a course via its management listing /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/create_delete_course.feature:36

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category 0 idnumber
    Cat 1 0 CAT1
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    category fullname shortname idnumber
    CAT1 Test course: create a course TCCAC TC3401
    CAT1 Test course 2: create another course TC2CAC TC3402
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I click on category "Cat 1" in the management interface behat_course::i_click_on_category_in_the_management_interface()
  7. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  8. And I should see "Cat 1" in the "#category-listing" "css_element" behat_general::assert_element_contains_text()
  9. And I should see "Test course: create a course" in the "#course-listing" "css_element" behat_general::assert_element_contains_text()
  10. And I should see "Test course 2: create another course" in the "#course-listing" "css_element" behat_general::assert_element_contains_text()
  11. And I click on "delete" action for "Test course: create a course" in management course listing behat_course::i_click_on_action_for_item_in_management_course_listing()
  12. And I should see "Delete TCCAC" behat_general::assert_page_contains_text()
  13. And I should see "Test course: create a course (TCCAC)" behat_general::assert_page_contains_text()
  14. And I press "Continue" behat_forms::press_button()
  15. And I should see "Deleting TCCAC" behat_general::assert_page_contains_text()
  16. And I should see "TCCAC has been completely deleted" behat_general::assert_page_contains_text()
  17. And I press "Continue" behat_forms::press_button()
  18. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  19. And I should see "Cat 1" in the "#category-listing" "css_element" behat_general::assert_element_contains_text()
  20. And I should see "Test course 2: create another course" in the "#course-listing" "css_element" behat_general::assert_element_contains_text()

Scenario: Delete a course via its management details page /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/create_delete_course.feature:68

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category 0 idnumber
    Cat 1 0 CAT1
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    category fullname shortname idnumber
    CAT1 Test course: create a course TCCAC TC3401
    CAT1 Test course 2: create another course TC2CAC TC3402
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I go to the courses management page behat_course::i_go_to_the_courses_management_page()
  5. And I should see the "Course categories" management page behat_course::i_should_see_the_courses_management_page()
  6. And I click on category "Cat 1" in the management interface behat_course::i_click_on_category_in_the_management_interface()
  7. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  8. And I should see "Cat 1" in the "#category-listing" "css_element" behat_general::assert_element_contains_text()
  9. And I should see "Test course: create a course" in the "#course-listing" "css_element" behat_general::assert_element_contains_text()
  10. And I should see "Test course 2: create another course" in the "#course-listing" "css_element" behat_general::assert_element_contains_text()
  11. And I click on course "Test course: create a course" in the management interface behat_course::i_click_on_course_in_the_management_interface()
  12. And I should see the "Course categories and courses" management page with a course selected behat_course::i_should_see_the_courses_management_page_with_a_course_selected()
  13. And I should see "Cat 1" in the "#category-listing" "css_element" behat_general::assert_element_contains_text()
  14. And I should see "Test course: create a course" in the "#course-listing" "css_element" behat_general::assert_element_contains_text()
  15. And I should see "Test course 2: create another course" in the "#course-listing" "css_element" behat_general::assert_element_contains_text()
  16. And I should see "Test course: create a course" in the "#course-detail" "css_element" behat_general::assert_element_contains_text()
  17. And I click on "Delete" "link" in the ".course-detail-listing-actions" "css_element" behat_general::i_click_on_in_the()
  18. And I should see "Delete TCCAC" behat_general::assert_page_contains_text()
  19. And I should see "Test course: create a course (TCCAC)" behat_general::assert_page_contains_text()
  20. And I press "Continue" behat_forms::press_button()
  21. And I should see "Deleting TCCAC" behat_general::assert_page_contains_text()
  22. And I should see "TCCAC has been completely deleted" behat_general::assert_page_contains_text()
  23. And I press "Continue" behat_forms::press_button()
  24. And I should see the "Course categories and courses" management page behat_course::i_should_see_the_courses_management_page()
  25. And I should see "Cat 1" in the "#category-listing" "css_element" behat_general::assert_element_contains_text()
  26. And I should see "Test course 2: create another course" in the "#course-listing" "css_element" behat_general::assert_element_contains_text()

Feature: Edit course settings

In order to set the course according to my teaching needs
As a teacher
I need to edit the course settings

  • @javascript

Scenario: Edit course settings /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/edit_settings.feature:8

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname summary format
    Course 1 C1

    Course summary

    topics
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. When I click on "Edit settings" "link" in the "Administration" "block" behat_general::i_click_on_in_the()
  7. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Course full name Edited course fullname
    Course short name Edited course shortname
    Course summary Edited course summary
  8. And I press "Save changes" behat_forms::press_button()
  9. And I follow "Edited course fullname" behat_general::click_link()
  10. Then I should not see "Course 1" behat_general::assert_page_not_contains_text()
  11. And I should not see "C1" behat_general::assert_page_not_contains_text()
  12. And I should see "Edited course fullname" behat_general::assert_page_contains_text()
  13. And I should see "Edited course shortname" behat_general::assert_page_contains_text()
  14. And I click on "Edit settings" "link" in the "Administration" "block" behat_general::i_click_on_in_the()
  15. And the "Course full name" field should match "Edited course fullname" value behat_forms::the_field_should_match_value()
  16. And the "Course short name" field should match "Edited course shortname" value behat_forms::the_field_should_match_value()
  17. And the "Course summary" field should match "Edited course summary" value behat_forms::the_field_should_match_value()
  18. And I am on homepage behat_general::i_am_on_homepage()
  19. And I should see "Edited course fullname" behat_general::assert_page_contains_text()

Feature: Force group mode in a course

In order to use the same group mode all over the course
As a teacher
I need to force the group mode of all course's activities

Background: /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/force_group_mode.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Chat" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name of this chat room Chat room
    Description Chat description
  8. And I click on "Edit settings" "link" in the "Administration" "block" behat_general::i_click_on_in_the()
  • @javascript

Scenario: Forced group mode using separate groups /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/force_group_mode.feature:26

  1. Given I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Group mode Separate groups
    Force group mode Yes
  2. When I press "Save changes" behat_forms::press_button()
  3. Then "//a/child::img[contains(@alt, 'Separate groups (forced mode)')]" "xpath_element" should not exists behat_general::should_not_exists()
  4. And "//img[contains(@alt, 'Separate groups (forced mode)')]" "xpath_element" should not exists behat_general::should_not_exists()
  • @javascript

Scenario: Forced group mode using visible groups /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/force_group_mode.feature:35

  1. Given I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Group mode Visible groups
    Force group mode Yes
  2. And I press "Save changes" behat_forms::press_button()
  3. Then "//a/child::img[contains(@alt, 'Visible groups (forced mode)')]" "xpath_element" should not exists behat_general::should_not_exists()
  4. And "//img[contains(@alt, 'Visible groups (forced mode)')]" "xpath_element" should not exists behat_general::should_not_exists()
  • @javascript

Scenario: Forced group mode without groups /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/force_group_mode.feature:44

  1. Given I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Group mode No groups
    Force group mode Yes
  2. And I press "Save changes" behat_forms::press_button()
  3. Then "//a/child::img[contains(@alt, 'No groups (forced mode)')]" "xpath_element" should not exists behat_general::should_not_exists()
  4. And "//img[contains(@alt, 'No groups (forced mode)')]" "xpath_element" should not exists behat_general::should_not_exists()

Feature: Front page displays items in different modes

In order to show a clean and clear list of the site categories and course
As an admin
I need to set different frontpage display modes

Background: /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/frontpage_display_modes.feature:7

  1. Given the following "categories" exists: behat_data_generators::the_following_exists()
    name category idnumber
    Category 1 0 CAT1
    Category 2 0 CAT2
    Category 1 child CAT1 CAT11
    Category 2 child CAT2 CAT21
    Category 1 child child CAT11 CAT111
    Category 3 0 CAT3
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 1 COURSE1_1 CAT1
    Course 2 1 COURSE2_1 CAT2
    Course 11 1 COURSE11_1 CAT11
    Course 2 2 COURSE2_2 CAT2
    Course 21 1 COURSE21_1 CAT21
    Course 111 1 COURSE111_1 CAT111
    Course 111 2 COURSE111_2 CAT111
  3. And I log in as "admin" behat_auth::i_log_in_as()
  • @javascript

Scenario: Displays a list of categories /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/frontpage_display_modes.feature:28

  1. When I set the following administration settings values: behat_admin::i_set_the_following_administration_settings_values()
    Front page items when logged in List of categories
    Maximum category depth 2
  2. And I am on homepage behat_general::i_am_on_homepage()
  3. Then I should see "Category 1" in the "region-main" "region" behat_general::assert_element_contains_text()
  4. And I should see "Category 1 child" in the "region-main" "region" behat_general::assert_element_contains_text()
  5. And I should not see "Category 1 child child" in the "region-main" "region" behat_general::assert_element_not_contains_text()
  6. And I toggle "Category 1" category children visibility in frontpage behat_course::i_toggle_category_children_visibility_in_frontpage()
  7. And I should not see "Category 1 child" in the "region-main" "region" behat_general::assert_element_not_contains_text()
  8. And I toggle "Category 1" category children visibility in frontpage behat_course::i_toggle_category_children_visibility_in_frontpage()
  9. And I should see "Category 1 child" in the "region-main" "region" behat_general::assert_element_contains_text()
  10. And I toggle "Category 1 child" category children visibility in frontpage behat_course::i_toggle_category_children_visibility_in_frontpage()
  11. And I should see "Category 1 child child" in the "region-main" "region" behat_general::assert_element_contains_text()
  • @javascript

Scenario: Displays a combo list /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/frontpage_display_modes.feature:44

  1. When I set the following administration settings values: behat_admin::i_set_the_following_administration_settings_values()
    Front page items when logged in Combo list
    Maximum category depth 2
  2. And I am on homepage behat_general::i_am_on_homepage()
  3. Then I should see "Category 1" in the "region-main" "region" behat_general::assert_element_contains_text()
  4. And I should see "Category 1 child" in the "region-main" "region" behat_general::assert_element_contains_text()
  5. And I should not see "Category 1 child child" in the "region-main" "region" behat_general::assert_element_not_contains_text()
  6. And I should see "Course 1 1" in the "region-main" "region" behat_general::assert_element_contains_text()
  7. And I should see "Course 2 2" in the "region-main" "region" behat_general::assert_element_contains_text()
  8. And I should not see "Course 11 1" in the "region-main" "region" behat_general::assert_element_not_contains_text()
  9. And I toggle "Category 1 child" category children visibility in frontpage behat_course::i_toggle_category_children_visibility_in_frontpage()
  10. And I should see "Course 11 1" in the "region-main" "region" behat_general::assert_element_contains_text()
  11. And I should see "Category 1 child child" in the "region-main" "region" behat_general::assert_element_contains_text()
  12. And I toggle "Category 1" category children visibility in frontpage behat_course::i_toggle_category_children_visibility_in_frontpage()
  13. And I should not see "Course 1 1" in the "region-main" "region" behat_general::assert_element_not_contains_text()
  14. And I should not see "Category 1 child" in the "region-main" "region" behat_general::assert_element_not_contains_text()
  15. And I toggle "Category 1" category children visibility in frontpage behat_course::i_toggle_category_children_visibility_in_frontpage()
  16. And I should see "Course 11 1" in the "region-main" "region" behat_general::assert_element_contains_text()

Feature: The maximum number of weeks/topics in a course can be configured

In order to set boundaries to courses size
As a manager
I need to limit the number of weeks/topics a course can have

Background: /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/max_number_sections.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    manager1 Manager 1 manager1@asd.com
  2. And the following "system role assigns" exists: behat_data_generators::the_following_exists()
    user course role
    manager1 Acceptance test site manager
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I expand "Site administration" node behat_navigation::i_expand_node()
  5. And I expand "Courses" node behat_navigation::i_expand_node()
  6. And I follow "Course default settings" behat_general::click_link()
  • @javascript

Scenario: The number of sections can be increased and the limits are applied to courses /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/max_number_sections.feature:20

  1. Given I fill in "Maximum number of sections" with "100" behat_forms::fill_field()
  2. When I press "Save changes" behat_forms::press_button()
  3. Then the "Maximum number of sections" field should match "100" value behat_forms::the_field_should_match_value()
  4. And the "Number of sections" select box should contain "100" behat_forms::the_select_box_should_contain()
  5. And I log out behat_auth::i_log_out()
  6. And I log in as "manager1" behat_auth::i_log_in_as()
  7. And I create a course with: behat_course::i_create_a_course_with()
    Course full name New course fullname
    Course short name New course shortname
    Number of sections 90
    Format Topics format
  8. And I follow "New course fullname" behat_general::click_link()
  9. And I should see "Topic 90" behat_general::assert_page_contains_text()
  • @javascript

Scenario: The number of sections can be reduced to 0 and the limits are applied to courses /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/max_number_sections.feature:36

  1. Given I fill in "Maximum number of sections" with "0" behat_forms::fill_field()
  2. When I press "Save changes" behat_forms::press_button()
  3. Then the "Maximum number of sections" field should match "0" value behat_forms::the_field_should_match_value()
  4. And the "Number of sections" select box should contain "0" behat_forms::the_select_box_should_contain()
  5. And the "Number of sections" select box should not contain "52" behat_forms::the_select_box_should_not_contain()
  6. And I log out behat_auth::i_log_out()
  7. And I log in as "manager1" behat_auth::i_log_in_as()
  8. And I create a course with: behat_course::i_create_a_course_with()
    Course full name New course fullname
    Course short name New course shortname
    Number of sections 0
    Format Topics format
  9. And I follow "New course fullname" behat_general::click_link()
  10. And I should not see "Topic 1" behat_general::assert_page_not_contains_text()

Feature: Activities can be moved between sections

In order to rearrange my course contents
As a teacher
I need to move activities between sections

Background: /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/move_activities.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname format coursedisplay numsections
    Course 1 C1 topics 0 5
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I follow "Delete Recent activity block" behat_general::click_link()
  8. And I press "Yes" behat_forms::press_button()
  9. And I follow "Configure Navigation block" behat_general::click_link()
  10. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Visible Yes
  11. And I press "Save changes" behat_forms::press_button()
  12. And I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name
    Description Test forum description

Scenario: Move activities in a single page course with Javascript disabled /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/move_activities.feature:30

  1. When I move "Test forum name" activity to section "2" behat_course::i_move_activity_to_section()
  2. Then I should see "Test forum name" in the "#section-2" "css_element" behat_general::assert_element_contains_text()
  3. And I should not see "Test forum name" in the "#section-1" "css_element" behat_general::assert_element_not_contains_text()

Scenario: Move activities in the course home with Javascript disabled using paged mode /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/move_activities.feature:35

  1. Given I click on "Edit settings" "link" in the "Administration" "block" behat_general::i_click_on_in_the()
  2. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Course layout Show one section per page
  3. And I press "Save changes" behat_forms::press_button()
  4. When I move "Test forum name" activity to section "2" behat_course::i_move_activity_to_section()
  5. Then I should see "Test forum name" in the "#section-2" "css_element" behat_general::assert_element_contains_text()
  6. And I should not see "Test forum name" in the "#section-1" "css_element" behat_general::assert_element_not_contains_text()

Scenario: Move activities in a course section with Javascript disabled using paged mode /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/move_activities.feature:44

  1. Given I click on "Edit settings" "link" in the "Administration" "block" behat_general::i_click_on_in_the()
  2. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Course layout Show one section per page
  3. And I press "Save changes" behat_forms::press_button()
  4. And I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Second forum name
    Description Second forum description
  5. And I follow "Topic 1" behat_general::click_link()
  6. When I move "Second forum name" activity to section "1" behat_course::i_move_activity_to_section()
  7. Then "Second forum name" "link" should appear before "Test forum name" "link" behat_general::should_appear_before()

Feature: Sections can be moved

In order to rearrange my course contents
As a teacher
I need to move sections up and down

Background: /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/move_sections.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname format coursedisplay numsections
    Course 1 C1 topics 0 5
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()

Scenario: Move up and down a section with Javascript disabled in a single page course /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/move_sections.feature:21

  1. Given I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name
    Description Test forum description
  2. When I move down section "1" behat_course::i_move_down_section()
  3. Then I should see "Test forum name" in the "#section-2" "css_element" behat_general::assert_element_contains_text()
  4. And I move up section "2" behat_course::i_move_up_section()
  5. And I should see "Test forum name" in the "#section-1" "css_element" behat_general::assert_element_contains_text()

Scenario: Move up and down a section with Javascript disabled in the course home of a course using paged mode /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/move_sections.feature:30

  1. Given I click on "Edit settings" "link" in the "Administration" "block" behat_general::i_click_on_in_the()
  2. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Course layout Show one section per page
  3. And I press "Save changes" behat_forms::press_button()
  4. And I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name
    Description Test forum description
  5. When I move down section "1" behat_course::i_move_down_section()
  6. Then I should see "Test forum name" in the "#section-2" "css_element" behat_general::assert_element_contains_text()
  7. And I move up section "2" behat_course::i_move_up_section()
  8. And I should see "Test forum name" in the "#section-1" "css_element" behat_general::assert_element_contains_text()

Scenario: Sections can not be moved with Javascript disabled in a section page of a course using paged mode /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/move_sections.feature:43

  1. Given I click on "Edit settings" "link" in the "Administration" "block" behat_general::i_click_on_in_the()
  2. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Course layout Show one section per page
  3. And I press "Save changes" behat_forms::press_button()
  4. And I add a "Forum" to section "2" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name
    Description Test forum description
  5. When I follow "Topic 2" behat_general::click_link()
  6. Then "#section-1" "css_element" should not exists behat_general::should_not_exists()
  7. And "#section-3" "css_element" should not exists behat_general::should_not_exists()
  8. And "Move down" "link" should not exists behat_general::should_not_exists()
  9. And "Move up" "link" should not exists behat_general::should_not_exists()

Feature: Course paged mode

In order to split the course in parts
As a teacher
I need to display the course in a paged mode and navigate through the different sections

  • @javascript
  • @_cross_browser

Scenario Outline: Weekly and topics course formats with Javascript enabled /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/paged_course_navigation.feature:8

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category format coursedisplay numsections
    Course 1 C1 0 topics 1 3
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I follow "Course 1" behat_general::click_link()
  4. Then I click on <section2> "link" in the "#section-2" "css_element" behat_general::i_click_on_in_the()
  5. And I follow "C1" behat_general::click_link()
  6. And I click on <section3> "link" in the "#section-3" "css_element" behat_general::i_click_on_in_the()
  7. And I follow "C1" behat_general::click_link()
  8. And I click on <section1> "link" in the "#section-1" "css_element" behat_general::i_click_on_in_the()
  9. And I should see <section1> in the "div.single-section" "css_element" behat_general::assert_element_contains_text()
  10. And I should see <section2> in the ".single-section span.mdl-right" "css_element" behat_general::assert_element_contains_text()
  11. And I should not see <prevunexistingsection> in the ".single-section" "css_element" behat_general::assert_element_not_contains_text()
  12. And I click on <section2> "link" in the ".single-section" "css_element" behat_general::i_click_on_in_the()
  13. And I should see <section2> in the "div.single-section" "css_element" behat_general::assert_element_contains_text()
  14. And I should see <section1> in the ".single-section span.mdl-left" "css_element" behat_general::assert_element_contains_text()
  15. And I should see <section3> in the ".single-section span.mdl-right" "css_element" behat_general::assert_element_contains_text()
  16. And I click on <section1> "link" in the ".single-section" "css_element" behat_general::i_click_on_in_the()
  17. And I should see <section1> in the "div.single-section" "css_element" behat_general::assert_element_contains_text()
  18. And I click on <section2> "link" in the ".single-section" "css_element" behat_general::i_click_on_in_the()
  19. And I click on <section3> "link" in the ".single-section" "css_element" behat_general::i_click_on_in_the()
  20. And I should see <section3> in the "div.single-section" "css_element" behat_general::assert_element_contains_text()
  21. And I should see <section2> in the ".single-section span.mdl-left" "css_element" behat_general::assert_element_contains_text()
  22. And I should not see <section1> in the ".single-section .section-navigation" "css_element" behat_general::assert_element_not_contains_text()
  23. And I should not see <prevunexistingsection> in the ".single-section" "css_element" behat_general::assert_element_not_contains_text()
  24. And I should not see <nextunexistingsection> in the ".single-section" "css_element" behat_general::assert_element_not_contains_text()

Examples

courseformat section1 section2 section3 prevunexistingsection nextunexistingsection
topics "Topic 1" "Topic 2" "Topic 3" "Topic 0" "Topic 4"
weeks "1 January - 7 January" "8 January - 14 January" "15 January - 21 January" "25 December - 31 December" "22 January - 28 January"

Scenario Outline: Weekly and topics course formats with Javascript disabled /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/paged_course_navigation.feature:41

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category format coursedisplay numsections
    Course 1 C1 0 topics 1 3
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I follow "Course 1" behat_general::click_link()
  4. Then I click on <section2> "link" in the "#section-2" "css_element" behat_general::i_click_on_in_the()
  5. And I follow "C1" behat_general::click_link()
  6. And I click on <section3> "link" in the "#section-3" "css_element" behat_general::i_click_on_in_the()
  7. And I follow "C1" behat_general::click_link()
  8. And I click on <section1> "link" in the "#section-1" "css_element" behat_general::i_click_on_in_the()
  9. And I should see <section1> in the "div.single-section" "css_element" behat_general::assert_element_contains_text()
  10. And I should see <section2> in the ".single-section span.mdl-right" "css_element" behat_general::assert_element_contains_text()
  11. And I should not see <prevunexistingsection> in the ".single-section" "css_element" behat_general::assert_element_not_contains_text()
  12. And I click on <section2> "link" in the ".single-section" "css_element" behat_general::i_click_on_in_the()
  13. And I should see <section2> in the "div.single-section" "css_element" behat_general::assert_element_contains_text()
  14. And I should see <section1> in the ".single-section span.mdl-left" "css_element" behat_general::assert_element_contains_text()
  15. And I should see <section3> in the ".single-section span.mdl-right" "css_element" behat_general::assert_element_contains_text()
  16. And I click on <section1> "link" in the ".single-section" "css_element" behat_general::i_click_on_in_the()
  17. And I should see <section1> in the "div.single-section" "css_element" behat_general::assert_element_contains_text()
  18. And I click on <section2> "link" in the ".single-section" "css_element" behat_general::i_click_on_in_the()
  19. And I click on <section3> "link" in the ".single-section" "css_element" behat_general::i_click_on_in_the()
  20. And I should see <section3> in the "div.single-section" "css_element" behat_general::assert_element_contains_text()
  21. And I should see <section2> in the ".single-section span.mdl-left" "css_element" behat_general::assert_element_contains_text()
  22. And I should not see <section1> in the ".single-section .section-navigation" "css_element" behat_general::assert_element_not_contains_text()
  23. And I should not see <prevunexistingsection> in the ".single-section" "css_element" behat_general::assert_element_not_contains_text()
  24. And I should not see <nextunexistingsection> in the ".single-section" "css_element" behat_general::assert_element_not_contains_text()

Examples

courseformat section1 section2 section3 prevunexistingsection nextunexistingsection
topics "Topic 1" "Topic 2" "Topic 3" "Topic 0" "Topic 4"
weeks "1 January - 7 January" "8 January - 14 January" "15 January - 21 January" "25 December - 31 December" "22 January - 28 January"

Feature: Rename roles within a course

In order to set course roles names according to their responsabilities
As a teacher
I need to edit the course role names

  • @javascript

Scenario: Rename roles within a course /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/rename_roles.feature:8

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    teacher2 Teacher 2 teacher2@asd.com
    student1 Student 1 student1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname format
    Course 1 C1 topics
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    teacher2 C1 teacher
    student1 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. When I click on "Edit settings" "link" in the "Administration" "block" behat_general::i_click_on_in_the()
  7. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Your word for 'Non-editing teacher' Tutor
    Your word for 'Student' Learner
  8. And I press "Save changes" behat_forms::press_button()
  9. And I expand "Switch role to..." node behat_navigation::i_expand_node()
  10. Then I should see "Tutor" behat_general::assert_page_contains_text()
  11. And I should see "Learner" behat_general::assert_page_contains_text()
  12. And I follow "Participants" behat_general::click_link()
  13. And the "roleid" select box should contain "Tutor" behat_forms::the_select_box_should_contain()
  14. And the "roleid" select box should contain "Learner" behat_forms::the_select_box_should_contain()
  15. And the "roleid" select box should not contain "Student" behat_forms::the_select_box_should_not_contain()
  16. And I click on "Edit settings" "link" in the "Administration" "block" behat_general::i_click_on_in_the()
  17. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Your word for 'Non-editing teacher'
    Your word for 'Student'
  18. And I press "Save changes" behat_forms::press_button()
  19. And I expand "Switch role to..." node behat_navigation::i_expand_node()
  20. And I should see "Teacher" behat_general::assert_page_contains_text()
  21. And I should see "Student" behat_general::assert_page_contains_text()
  22. And I should not see "Learner" behat_general::assert_page_not_contains_text()
  23. And I follow "Participants" behat_general::click_link()
  24. And the "roleid" select box should contain "Non-editing teacher" behat_forms::the_select_box_should_contain()
  25. And the "roleid" select box should contain "Student" behat_forms::the_select_box_should_contain()

Feature: Restrict activities availability

In order to prevent the use of some activities
As an admin
I need to control which activities can be used in courses

Background: /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/restrict_available_activities.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category format
    Course 1 C1 0 topics
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  • @javascript

Scenario: Activities can be added with the default permissions /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/restrict_available_activities.feature:19

  1. Given I log in as "teacher1" behat_auth::i_log_in_as()
  2. And I follow "Course 1" behat_general::click_link()
  3. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  4. When I add a "Glossary" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name Test glossary name
    Description Test glossary description
  5. And I add a "Chat" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name of this chat room Test chat name
    Description Test chat description
  6. Then I should see "Test glossary name" behat_general::assert_page_contains_text()
  7. And I should see "Test chat name" behat_general::assert_page_contains_text()
  • @javascript

Scenario: Activities can not be added when the admin restricts the permissions /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/restrict_available_activities.feature:33

  1. Given I log in as "admin" behat_auth::i_log_in_as()
  2. And I set the following system permissions of "Teacher" role: behat_permissions::i_set_the_following_system_permissions_of_role()
    mod/chat:addinstance Prohibit
  3. And I am on homepage behat_general::i_am_on_homepage()
  4. And I follow "Course 1" behat_general::click_link()
  5. And I expand "Users" node behat_navigation::i_expand_node()
  6. And I follow "Permissions" behat_general::click_link()
  7. And I override the system permissions of "Teacher" role with: behat_permissions::i_override_the_system_permissions_of_role_with()
    mod/glossary:addinstance Prohibit
  8. And I log out behat_auth::i_log_out()
  9. And I log in as "teacher1" behat_auth::i_log_in_as()
  10. And I follow "Course 1" behat_general::click_link()
  11. When I turn editing mode on behat_course::i_turn_editing_mode_on()
  12. And I follow "Activity chooser off" behat_general::click_link()
  13. Then the "Add an activity to section 'Topic 1'" select box should not contain "Chat" behat_forms::the_select_box_should_not_contain()
  14. Then the "Add an activity to section 'Topic 1'" select box should not contain "Glossary" behat_forms::the_select_box_should_not_contain()

Feature: Topic's course sections highlighting

In order to highlight parts of the course to students
As a teacher
I need to highlight one specific section

  • @javascript

Scenario Outline: Highlight a topic's course section with course paged mode and without it /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/section_highlighting.feature:8

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname format coursedisplay
    Course 1 C1 topics 0
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. When I turn section "1" highlighting on behat_course::i_turn_section_highlighting_on()
  8. Then section "1" should be highlighted behat_course::section_should_be_highlighted()
  9. And I turn section "2" highlighting on behat_course::i_turn_section_highlighting_on()
  10. And section "2" should be highlighted behat_course::section_should_be_highlighted()
  11. And section "1" should not be highlighted behat_course::section_should_not_be_highlighted()
  12. And I am on homepage behat_general::i_am_on_homepage()
  13. And I follow "Course 1" behat_general::click_link()
  14. And section "2" should be highlighted behat_course::section_should_be_highlighted()
  15. And section "1" should not be highlighted behat_course::section_should_not_be_highlighted()
  16. And I turn section "2" highlighting off behat_course::i_turn_section_highlighting_off()
  17. And section "2" should not be highlighted behat_course::section_should_not_be_highlighted()
  18. And I reload the page behat_general::reload()
  19. And section "2" should not be highlighted behat_course::section_should_not_be_highlighted()
  20. And I am on homepage behat_general::i_am_on_homepage()
  21. And I follow "Course 1" behat_general::click_link()
  22. And section "2" should not be highlighted behat_course::section_should_not_be_highlighted()
  23. And I log out behat_auth::i_log_out()
  24. And I log in as "student1" behat_auth::i_log_in_as()
  25. And I follow "Course 1" behat_general::click_link()
  26. And section "1" should not be highlighted behat_course::section_should_not_be_highlighted()
  27. And section "2" should not be highlighted behat_course::section_should_not_be_highlighted()

Examples

coursedisplay
0
1

Feature: Show/hide course sections

In order to delay sections availability
As a teacher
I need to show or hide sections

  • @javascript

Scenario: Show / hide section icon functions correctly /private/srv/www/loganberry.local/data/40975/moodle/course/tests/behat/section_visibility.feature:8

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student1 Student 1 student1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname format
    Course 1 C1 topics
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test hidden forum 11 name
    Description Test hidden forum 11 description
    Visible Hide
  8. And I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test hidden forum 12 name
    Description Test hidden forum 12 description
    Visible Show
  9. And I add a "Forum" to section "2" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test hidden forum 21 name
    Description Test hidden forum 21 description
    Visible Hide
  10. And I add a "Forum" to section "2" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test hidden forum 22 name
    Description Test hidden forum 22 description
    Visible Show
  11. And I add a "Forum" to section "3" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test hidden forum 31 name
    Description Test hidden forum 31 description
    Visible Hide
  12. And I add a "Forum" to section "3" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test hidden forum 32 name
    Description Test hidden forum 32 description
    Visible Show
  13. And I follow "Course 1" behat_general::click_link()
  14. When I hide section "1" behat_course::i_hide_section()
  15. Then section "1" should be hidden behat_course::section_should_be_hidden()
  16. And section "2" should be visible behat_course::section_should_be_visible()
  17. And section "3" should be visible behat_course::section_should_be_visible()
  18. And I hide section "2" behat_course::i_hide_section()
  19. And section "2" should be hidden behat_course::section_should_be_hidden()
  20. And I show section "2" behat_course::i_show_section()
  21. And section "2" should be visible behat_course::section_should_be_visible()
  22. And I hide section "3" behat_course::i_hide_section()
  23. And I show section "3" behat_course::i_show_section()
  24. And I hide section "3" behat_course::i_hide_section()
  25. And section "3" should be hidden behat_course::section_should_be_hidden()
  26. And I reload the page behat_general::reload()
  27. And section "1" should be hidden behat_course::section_should_be_hidden()
  28. And section "2" should be visible behat_course::section_should_be_visible()
  29. And section "3" should be hidden behat_course::section_should_be_hidden()
  30. And I log out behat_auth::i_log_out()
  31. And I log in as "student1" behat_auth::i_log_in_as()
  32. And I follow "Course 1" behat_general::click_link()
  33. And section "1" should be hidden behat_course::section_should_be_hidden()
  34. And section "2" should be visible behat_course::section_should_be_visible()
  35. And section "3" should be hidden behat_course::section_should_be_hidden()

Feature: Course files

In order to add legacy files
As a user
I need to upload files

  • @javascript

Scenario: Add legacy files /private/srv/www/loganberry.local/data/40975/moodle/files/tests/behat/course_files.feature:8

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category legacyfiles
    Course 1 C1 0 2
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I set the following administration settings values: behat_admin::i_set_the_following_administration_settings_values()
    Legacy course files in new courses 1
    Allow adding to legacy course files 1
  4. When I follow "Home" behat_general::click_link()
  5. And I follow "Course 1" behat_general::click_link()
  6. Then I should see "Legacy course files" behat_general::assert_page_contains_text()
  7. And I follow "Legacy course files" behat_general::click_link()
  8. And I press "Edit legacy course files" behat_forms::press_button()
  9. And "Add..." "link" should be visible behat_general::should_be_visible()
  10. And "Create folder" "link" should be visible behat_general::should_be_visible()
  • @javascript

Scenario: Add legacy file disabled /private/srv/www/loganberry.local/data/40975/moodle/files/tests/behat/course_files.feature:25

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category legacyfiles
    Course 1 C1 0 2
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I set the following administration settings values: behat_admin::i_set_the_following_administration_settings_values()
    Legacy course files in new courses 1
    Allow adding to legacy course files 0
  4. When I follow "Home" behat_general::click_link()
  5. And I follow "Course 1" behat_general::click_link()
  6. Then I should see "Legacy course files" behat_general::assert_page_contains_text()
  7. And I follow "Legacy course files" behat_general::click_link()
  8. And I press "Edit legacy course files" behat_forms::press_button()
  9. And "Add..." "link" should not be visible behat_general::should_not_be_visible()
  10. And "Create folder" "link" should not be visible behat_general::should_not_be_visible()

Feature: Automatic creation of groups

In order to quickly create groups
As a teacher
I need to create groups automatically and allocate them in groupings if necessary

Background: /private/srv/www/loganberry.local/data/40975/moodle/group/tests/behat/auto_creation.feature:7

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  2. And the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student0 Student 0 student0@asd.com
    student1 Student 1 student1@asd.com
    student2 Student 2 student2@asd.com
    student3 Student 3 student3@asd.com
    student4 Student 4 student4@asd.com
    student5 Student 5 student5@asd.com
    student6 Student 6 student6@asd.com
    student7 Student 7 student7@asd.com
    student8 Student 8 student8@asd.com
    student9 Student 9 student9@asd.com
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student0 C1 student
    student1 C1 student
    student2 C1 student
    student3 C1 student
    student4 C1 student
    student5 C1 student
    student6 C1 student
    student7 C1 student
    student8 C1 student
    student9 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I expand "Users" node behat_navigation::i_expand_node()
  7. And I follow "Groups" behat_general::click_link()
  8. When I press "Auto-create groups" behat_forms::press_button()
  9. And I expand all fieldsets behat_forms::i_expand_all_fieldsets()
  • @javascript

Scenario: Split automatically the course users in groups and add the groups to a new grouping /private/srv/www/loganberry.local/data/40975/moodle/group/tests/behat/auto_creation.feature:45

  1. Given I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Auto create based on Number of groups
    Group/member count 2
    Grouping of auto-created groups New grouping
    Grouping name Grouping name
  2. And I press "Preview" behat_forms::press_button()
  3. Then I should see "Group members" behat_general::assert_page_contains_text()
  4. And I should see "User count" behat_general::assert_page_contains_text()
  5. And I should see "Group A" behat_general::assert_page_contains_text()
  6. And I should see "Group B" behat_general::assert_page_contains_text()
  7. And I press "Submit" behat_forms::press_button()
  8. And the "groups" select box should contain "Group A (5)" behat_forms::the_select_box_should_contain()
  9. And the "groups" select box should contain "Group B (5)" behat_forms::the_select_box_should_contain()
  10. And I follow "Groupings" behat_general::click_link()
  11. And I should see "Grouping name" behat_general::assert_page_contains_text()
  12. And I click on "Show groups in grouping" "link" in the "Grouping name" "table_row" behat_general::i_click_on_in_the()
  13. And the "removeselect" select box should contain "Group A" behat_forms::the_select_box_should_contain()
  14. And the "removeselect" select box should contain "Group B" behat_forms::the_select_box_should_contain()
  • @javascript

Scenario: Split automatically the course users in groups based on group member count /private/srv/www/loganberry.local/data/40975/moodle/group/tests/behat/auto_creation.feature:66

  1. Given I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Auto create based on Members per group
    Group/member count 4
    Grouping of auto-created groups New grouping
    Grouping name Grouping name
  2. And I press "Preview" behat_forms::press_button()
  3. Then I should see "Group members" behat_general::assert_page_contains_text()
  4. And I should see "User count" behat_general::assert_page_contains_text()
  5. And I should see "Group A" in the ".generaltable" "css_element" behat_general::assert_element_contains_text()
  6. And I should see "Group B" in the ".generaltable" "css_element" behat_general::assert_element_contains_text()
  7. And I should see "Group C" in the ".generaltable" "css_element" behat_general::assert_element_contains_text()
  8. And I should see "4" in the "Group A" "table_row" behat_general::assert_element_contains_text()
  9. And I should see "4" in the "Group B" "table_row" behat_general::assert_element_contains_text()
  10. And I should see "2" in the "Group C" "table_row" behat_general::assert_element_contains_text()
  11. And I check "Prevent last small group" behat_forms::check_option()
  12. And I press "Preview" behat_forms::press_button()
  13. And I should see "Group A" in the ".generaltable" "css_element" behat_general::assert_element_contains_text()
  14. And I should see "Group B" in the ".generaltable" "css_element" behat_general::assert_element_contains_text()
  15. And I should see "5" in the "Group A" "table_row" behat_general::assert_element_contains_text()
  16. And I should see "5" in the "Group B" "table_row" behat_general::assert_element_contains_text()

Feature: Organize students into groups

In order to organize course activities in groups
As a teacher
I need to group students

  • @javascript

Scenario: Assign students to groups /private/srv/www/loganberry.local/data/40975/moodle/group/tests/behat/create_groups.feature:8

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category groupmode
    Course 1 C1 0 1
  2. And the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
    student0 Student 0 student0@asd.com
    student1 Student 1 student1@asd.com
    student2 Student 2 student2@asd.com
    student3 Student 3 student3@asd.com
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student0 C1 student
    student1 C1 student
    student2 C1 student
    student3 C1 student
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I expand "Users" node behat_navigation::i_expand_node()
  7. And I follow "Groups" behat_general::click_link()
  8. And I press "Create group" behat_forms::press_button()
  9. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Group name Group 1
  10. And I press "Save changes" behat_forms::press_button()
  11. And I press "Create group" behat_forms::press_button()
  12. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Group name Group 2
  13. And I press "Save changes" behat_forms::press_button()
  14. When I add "student0" user to "Group 1" group behat_groups::i_add_user_to_group()
  15. And I add "student1" user to "Group 1" group behat_groups::i_add_user_to_group()
  16. And I add "student2" user to "Group 2" group behat_groups::i_add_user_to_group()
  17. And I add "student3" user to "Group 2" group behat_groups::i_add_user_to_group()
  18. Then I select "Group 1 (2)" from "groups" behat_forms::select_option()
  19. And I wait "5" seconds behat_general::i_wait_seconds()
  20. And the "members" select box should contain "Student 0" behat_forms::the_select_box_should_contain()
  21. And the "members" select box should contain "Student 1" behat_forms::the_select_box_should_contain()
  22. And the "members" select box should not contain "Student 2" behat_forms::the_select_box_should_not_contain()
  23. And I select "Group 2 (2)" from "groups" behat_forms::select_option()
  24. And I wait "5" seconds behat_general::i_wait_seconds()
  25. And the "members" select box should contain "Student 2" behat_forms::the_select_box_should_contain()
  26. And the "members" select box should contain "Student 3" behat_forms::the_select_box_should_contain()
  27. And the "members" select box should not contain "Student 0" behat_forms::the_select_box_should_not_contain()
  28. And I follow "Participants" behat_general::click_link()
  29. And I select "Group 1" from "Separate groups" behat_forms::select_option()
  30. And I should see "Student 0" behat_general::assert_page_contains_text()
  31. And I should see "Student 1" behat_general::assert_page_contains_text()
  32. And I should not see "Student 2" behat_general::assert_page_not_contains_text()
  33. And I select "Group 2" from "Separate groups" behat_forms::select_option()
  34. And I should see "Student 2" behat_general::assert_page_contains_text()
  35. And I should see "Student 3" behat_general::assert_page_contains_text()
  36. And I should not see "Student 0" behat_general::assert_page_not_contains_text()

Feature: Importing of groups and groupings

In order to import groups and grouping
As a teacher
I need to upload a file and verify groups and groupings can be imported

Background: /private/srv/www/loganberry.local/data/40975/moodle/group/tests/behat/groups_import.feature:7

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  2. And the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  • @javascript

Scenario: Import groups and groupings as teacher /private/srv/www/loganberry.local/data/40975/moodle/group/tests/behat/groups_import.feature:19

  1. Given I log in as "teacher1" behat_auth::i_log_in_as()
  2. And I follow "Course 1" behat_general::click_link()
  3. And I expand "Users" node behat_navigation::i_expand_node()
  4. And I follow "Groups" behat_general::click_link()
  5. And I press "Import groups" behat_forms::press_button()
  6. When I upload "group/tests/fixtures/groups_import.csv" file to "Import" filepicker behat_repository_upload::i_upload_file_to_filepicker()
  7. And I press "Import groups" behat_forms::press_button()
  8. And I press "Continue" behat_forms::press_button()
  9. Then I should see "group-id-1" behat_general::assert_page_contains_text()
  10. And I should see "group-id-2" behat_general::assert_page_contains_text()
  11. And I should see "group-id-1-duplicate" behat_general::assert_page_contains_text()
  12. And I should see "group-noid-1" behat_general::assert_page_contains_text()
  13. And I should see "group-noid-2" behat_general::assert_page_contains_text()
  14. And I follow "Groupings" behat_general::click_link()
  15. And I should see "Grouping-1" behat_general::assert_page_contains_text()
  16. And I should see "Grouping-2" behat_general::assert_page_contains_text()
  17. And I should see "Grouping-3" behat_general::assert_page_contains_text()
  18. And I should see "group-id-1" in the "Grouping-1" "table_row" behat_general::assert_element_contains_text()
  19. And I should see "group-id-2" in the "Grouping-2" "table_row" behat_general::assert_element_contains_text()
  20. And I should see "group-noid-2" in the "Grouping-2" "table_row" behat_general::assert_element_contains_text()
  21. And I should see "group-id-1-duplicate" in the "Grouping-3" "table_row" behat_general::assert_element_contains_text()
  22. And I should see "group-noid-1" in the "Grouping-3" "table_row" behat_general::assert_element_contains_text()
  • @javascript

Scenario: Import groups with idnumber when the user has proper permissions for the idnumber field /private/srv/www/loganberry.local/data/40975/moodle/group/tests/behat/groups_import.feature:44

  1. Given I log in as "teacher1" behat_auth::i_log_in_as()
  2. And I follow "Course 1" behat_general::click_link()
  3. And I expand "Users" node behat_navigation::i_expand_node()
  4. And I follow "Groups" behat_general::click_link()
  5. And I press "Import groups" behat_forms::press_button()
  6. When I upload "group/tests/fixtures/groups_import.csv" file to "Import" filepicker behat_repository_upload::i_upload_file_to_filepicker()
  7. And I press "Import groups" behat_forms::press_button()
  8. Then I should see "Group group-id-1 added successfully" behat_general::assert_page_contains_text()
  9. And I should see "Group group-id-2 added successfully" behat_general::assert_page_contains_text()
  10. And I should see "group-id-1-duplicate: Group \"group-id-1\" with an idnumber of \"group-id-1\" already exists for this course" behat_general::assert_page_contains_text()
  11. And I should see "Group group-id-1-duplicate added successfully" behat_general::assert_page_contains_text()
  12. And I should see "Group group-noid-1 added successfully" behat_general::assert_page_contains_text()
  13. And I should see "Group group-noid-2 added successfully" behat_general::assert_page_contains_text()
  14. And I press "Continue" behat_forms::press_button()
  15. And I select "group-id-1" from "groups" behat_forms::select_option()
  16. And I press "Edit group settings" behat_forms::press_button()
  17. And the "id_idnumber" field should match "group-id-1" value behat_forms::the_field_should_match_value()
  18. And I press "Cancel" behat_forms::press_button()
  19. And I select "group-id-2" from "groups" behat_forms::select_option()
  20. And I press "Edit group settings" behat_forms::press_button()
  21. And the "id_idnumber" field should match "group-id-2" value behat_forms::the_field_should_match_value()
  22. And I press "Cancel" behat_forms::press_button()
  23. And I select "group-id-1-duplicate" from "groups" behat_forms::select_option()
  24. And I press "Edit group settings" behat_forms::press_button()
  25. And the "id_idnumber" field should match "" value behat_forms::the_field_should_match_value()
  26. And I press "Cancel" behat_forms::press_button()
  27. And I select "group-noid-1" from "groups" behat_forms::select_option()
  28. And I press "Edit group settings" behat_forms::press_button()
  29. And the "id_idnumber" field should match "" value behat_forms::the_field_should_match_value()
  30. And I press "Cancel" behat_forms::press_button()
  31. And I select "group-noid-2" from "groups" behat_forms::select_option()
  32. And I press "Edit group settings" behat_forms::press_button()
  33. And the "id_idnumber" field should match "" value behat_forms::the_field_should_match_value()
  34. And I press "Cancel" behat_forms::press_button()
  • @javascript

Scenario: Import groups with idnumber when the user does not have proper permissions for the idnumber field /private/srv/www/loganberry.local/data/40975/moodle/group/tests/behat/groups_import.feature:81

  1. Given I log in as "admin" behat_auth::i_log_in_as()
  2. And I follow "Course 1" behat_general::click_link()
  3. And I expand "Users" node behat_navigation::i_expand_node()
  4. And I follow "Permissions" behat_general::click_link()
  5. And I override the system permissions of "Teacher" role with: behat_permissions::i_override_the_system_permissions_of_role_with()
    moodle/course:changeidnumber Prevent
  6. And I log out behat_auth::i_log_out()
  7. And I log in as "teacher1" behat_auth::i_log_in_as()
  8. And I follow "Course 1" behat_general::click_link()
  9. And I expand "Users" node behat_navigation::i_expand_node()
  10. And I follow "Groups" behat_general::click_link()
  11. And I press "Import groups" behat_forms::press_button()
  12. When I upload "group/tests/fixtures/groups_import.csv" file to "Import" filepicker behat_repository_upload::i_upload_file_to_filepicker()
  13. And I press "Import groups" behat_forms::press_button()
  14. And I press "Continue" behat_forms::press_button()
  15. Then I select "group-id-1" from "groups" behat_forms::select_option()
  16. And I press "Edit group settings" behat_forms::press_button()
  17. And the "id_idnumber" field should match "" value behat_forms::the_field_should_match_value()
  18. And I press "Cancel" behat_forms::press_button()
  19. And I select "group-id-2" from "groups" behat_forms::select_option()
  20. And I press "Edit group settings" behat_forms::press_button()
  21. And the "id_idnumber" field should match "" value behat_forms::the_field_should_match_value()
  22. And I press "Cancel" behat_forms::press_button()
  23. And I select "group-id-1-duplicate" from "groups" behat_forms::select_option()
  24. And I press "Edit group settings" behat_forms::press_button()
  25. And the "id_idnumber" field should match "" value behat_forms::the_field_should_match_value()
  26. And I press "Cancel" behat_forms::press_button()
  27. And I select "group-noid-1" from "groups" behat_forms::select_option()
  28. And I press "Edit group settings" behat_forms::press_button()
  29. And the "id_idnumber" field should match "" value behat_forms::the_field_should_match_value()
  30. And I press "Cancel" behat_forms::press_button()
  31. And I select "group-noid-2" from "groups" behat_forms::select_option()
  32. And I press "Edit group settings" behat_forms::press_button()
  33. And the "id_idnumber" field should match "" value behat_forms::the_field_should_match_value()
  34. And I press "Cancel" behat_forms::press_button()

Feature: Uniqueness of Group ID number

In order to create unique groups and groupings
As a teacher
I need to create groups with unique identificators

Background: /private/srv/www/loganberry.local/data/40975/moodle/group/tests/behat/id_uniqueness.feature:7

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  2. And the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I expand "Users" node behat_navigation::i_expand_node()
  7. And I follow "Groups" behat_general::click_link()
  • @javascript

Scenario: Group ID number uniqueness /private/srv/www/loganberry.local/data/40975/moodle/group/tests/behat/id_uniqueness.feature:23

  1. Given I press "Create group" behat_forms::press_button()
  2. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Group name Group 1
    Group ID number G1
  3. And I press "Save changes" behat_forms::press_button()
  4. When I press "Create group" behat_forms::press_button()
  5. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Group name Group 2
    Group ID number G1
  6. And I press "Save changes" behat_forms::press_button()
  7. Then I should see "This ID number is already taken" behat_general::assert_page_contains_text()
  8. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Group ID number G2
  9. And I press "Save changes" behat_forms::press_button()
  10. And I select "Group 1 (0)" from "groups" behat_forms::select_option()
  11. And I press "Edit group settings" behat_forms::press_button()
  12. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Group ID number G2
  13. And I press "Save changes" behat_forms::press_button()
  14. And I should see "This ID number is already taken" behat_general::assert_page_contains_text()
  15. And I press "Cancel" behat_forms::press_button()
  • @javascript

Scenario: Grouping ID number uniqueness /private/srv/www/loganberry.local/data/40975/moodle/group/tests/behat/id_uniqueness.feature:47

  1. Given I follow "Groupings" behat_general::click_link()
  2. And I press "Create grouping" behat_forms::press_button()
  3. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Grouping name Grouping 1
    Grouping ID number GG1
  4. And I press "Save changes" behat_forms::press_button()
  5. When I press "Create grouping" behat_forms::press_button()
  6. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Grouping name Grouping 2
    Grouping ID number GG1
  7. And I press "Save changes" behat_forms::press_button()
  8. Then I should see "This ID number is already taken" behat_general::assert_page_contains_text()
  9. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Grouping ID number GG2
  10. And I press "Save changes" behat_forms::press_button()
  11. And I click on "Edit" "link" in the "Grouping 1" table row behat_general::i_click_on_in_the_table_row()
  12. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Grouping ID number GG2
  13. And I press "Save changes" behat_forms::press_button()
  14. And I should see "This ID number is already taken" behat_general::assert_page_contains_text()
  15. And I press "Cancel" behat_forms::press_button()

Feature: Block users from contacting me

In order to block other users
As a user
I need to prevent specific users to sending me messages

  • @javascript

Scenario: Block users from contacting me with Javascript enabled /private/srv/www/loganberry.local/data/40975/moodle/message/tests/behat/block_users.feature:8

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    user1 User One one@asd.com
    user2 User Two two@asd.com
  2. And I log in as "user1" behat_auth::i_log_in_as()
  3. And I expand "My profile" node behat_navigation::i_expand_node()
  4. And I follow "Messages" behat_general::click_link()
  5. And I fill in "Search people and messages" with "User Two" behat_forms::fill_field()
  6. And I press "Search people and messages" behat_forms::press_button()
  7. When I click on "Block contact" "link" in the "User Two" table row behat_general::i_click_on_in_the_table_row()
  8. Then the "Message navigation:" select box should contain "Blocked users (1)" behat_forms::the_select_box_should_contain()
  9. And I select "Blocked users (1)" from "Message navigation:" behat_forms::select_option()
  10. And I should see "User Two" behat_general::assert_page_contains_text()
  11. And I log out behat_auth::i_log_out()
  12. And I log in as "user2" behat_auth::i_log_in_as()
  13. And I expand "My profile" node behat_navigation::i_expand_node()
  14. And I follow "Messages" behat_general::click_link()
  15. And I fill in "Search people and messages" with "User One" behat_forms::fill_field()
  16. And I press "Search people and messages" behat_forms::press_button()
  17. And I follow "Send message to User One" behat_general::click_link()
  18. And I should see "This user has blocked you from sending messages to them" behat_general::assert_page_contains_text()

Feature: Message history displays correctly

In order to read messages between two users
As a user
I need to view the conversation with another user

Background: /private/srv/www/loganberry.local/data/40975/moodle/message/tests/behat/display_history.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    user1 User One one@asd.com
    user2 User Two two@asd.com
  2. And I log in as "user1" behat_auth::i_log_in_as()
  3. And I send "Message 1 from user1 to user2" message to "user2" behat_message::i_send_message_to_user()
  4. And I send "Message 2 from user1 to user2" message to "user2" behat_message::i_send_message_to_user()
  5. And I send "Message 3 from user1 to user2" message to "user2" behat_message::i_send_message_to_user()
  6. And I send "Message 4 from user1 to user2" message to "user2" behat_message::i_send_message_to_user()
  7. And I send "Message 5 from user1 to user2" message to "user2" behat_message::i_send_message_to_user()
  8. And I send "Message 6 from user1 to user2" message to "user2" behat_message::i_send_message_to_user()
  9. And I send "Message 7 from user1 to user2" message to "user2" behat_message::i_send_message_to_user()
  10. And I send "Message 8 from user1 to user2" message to "user2" behat_message::i_send_message_to_user()
  11. And I send "Message 9 from user1 to user2" message to "user2" behat_message::i_send_message_to_user()
  12. And I send "Message 10 from user1 to user2" message to "user2" behat_message::i_send_message_to_user()

Scenario: View sent messages /private/srv/www/loganberry.local/data/40975/moodle/message/tests/behat/display_history.feature:24

  1. When I expand "My profile" node behat_navigation::i_expand_node()
  2. And I click on "Messages" "link" in the "Navigation" "block" behat_general::i_click_on_in_the()
  3. And I fill in "Search people and messages" with "User Two" behat_forms::fill_field()
  4. And I press "Search people and messages" behat_forms::press_button()
  5. And I click on "Message history" "link" in the "User Two" table row behat_general::i_click_on_in_the_table_row()
  6. Then I should see "Message 1 from user1 to user2" behat_general::assert_page_contains_text()
  7. And I should see "Message 10 from user1 to user2" behat_general::assert_page_contains_text()
  8. And I follow "Recent messages" behat_general::click_link()
  9. And I should see "Message 10 from user1 to user2" behat_general::assert_page_contains_text()
  10. And I should not see "Message 1 from user1 to user2" behat_general::assert_page_not_contains_text()

Scenario: View received messages /private/srv/www/loganberry.local/data/40975/moodle/message/tests/behat/display_history.feature:38

  1. When I log out behat_auth::i_log_out()
  2. And I log in as "user2" behat_auth::i_log_in_as()
  3. And I expand "My profile" node behat_navigation::i_expand_node()
  4. And I click on "Messages" "link" in the "Navigation" "block" behat_general::i_click_on_in_the()
  5. And I follow "User One (10)" behat_general::click_link()
  6. Then I should see "Message 1 from user1 to user2" behat_general::assert_page_contains_text()
  7. And I should see "Message 10 from user1 to user2" behat_general::assert_page_contains_text()

Feature: Manage contacts

In order to easily access the users I interact more with
As a user
I need to add and remove users to/from my contacts list

Background: /private/srv/www/loganberry.local/data/40975/moodle/message/tests/behat/manage_contacts.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    user1 User One one@asd.com
    user2 User Two two@asd.com
  2. And I log in as "user1" behat_auth::i_log_in_as()
  3. And I send "Message 1 from user1 to user2" message to "user2" behat_message::i_send_message_to_user()
  4. And I send "Message 2 from user1 to user2" message to "user2" behat_message::i_send_message_to_user()
  5. And I expand "My profile" node behat_navigation::i_expand_node()
  6. And I click on "Messages" "link" in the "Navigation" "block" behat_general::i_click_on_in_the()
  7. And I fill in "Search people and messages" with "User Two" behat_forms::fill_field()
  8. And I press "Search people and messages" behat_forms::press_button()
  9. When I click on "Add contact" "link" in the "User Two" table row behat_general::i_click_on_in_the_table_row()
  10. Then I should see "Message 1 from user1 to user2" behat_general::assert_page_contains_text()
  11. And I should see "Message 2 from user1 to user2" behat_general::assert_page_contains_text()
  12. And I should see "User Two" in the "#message_contacts" "css_element" behat_general::assert_element_contains_text()
  13. And I follow "Remove contact" behat_general::click_link()
  14. And I should not see "User Two" in the "#message_contacts" "css_element" behat_general::assert_element_not_contains_text()
  15. And I should not see "Remove contact" behat_general::assert_page_not_contains_text()
  16. And I should see "Add contact" behat_general::assert_page_contains_text()
  17. And I follow "Add contact" behat_general::click_link()
  18. And I should see "User Two" in the "#message_contacts" "css_element" behat_general::assert_element_contains_text()
  • @javascript

Scenario: Adding and removing contacts with Javascript enabled /private/srv/www/loganberry.local/data/40975/moodle/message/tests/behat/manage_contacts.feature:31

Scenario: Adding and removing contacts with Javascript disabled /private/srv/www/loganberry.local/data/40975/moodle/message/tests/behat/manage_contacts.feature:33

Feature: Users can search their message history

In order to read old messages
As a user
I need to search in my messages history

Background: /private/srv/www/loganberry.local/data/40975/moodle/message/tests/behat/search_history.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    user1 User One one@asd.com
    user2 User Two two@asd.com
  2. And I log in as "user1" behat_auth::i_log_in_as()
  3. When I send "Give me your biscuits" message to "user2" behat_message::i_send_message_to_user()
  4. And I expand "My profile" node behat_navigation::i_expand_node()
  5. And I click on "Messages" "link" in the "Navigation" "block" behat_general::i_click_on_in_the()
  6. And I fill in "Search people and messages" with "your biscuits" behat_forms::fill_field()
  7. And I press "Search people and messages" behat_forms::press_button()
  8. Then I should see "User Two" behat_general::assert_page_contains_text()
  9. And I click on "context" "link" in the "User Two" table row behat_general::i_click_on_in_the_table_row()
  10. And I should see "Give me your biscuits" behat_general::assert_page_contains_text()
  • @javascript

Scenario: Search message history with Javascript enabled /private/srv/www/loganberry.local/data/40975/moodle/message/tests/behat/search_history.feature:23

Scenario: Search message history with Javascript disabled /private/srv/www/loganberry.local/data/40975/moodle/message/tests/behat/search_history.feature:25

Feature: A teacher can delete questions in the question bank

In order to remove unused questions from the question bank
As a teacher
I need to delete questions

Background: /private/srv/www/loganberry.local/data/40975/moodle/question/tests/behat/delete_questions.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname format
    Course 1 C1 weeks
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I add a "Essay" question filling the form with: behat_question::i_add_a_question_filling_the_form_with()
    Question name Test question name
    Question text Write about whatever you want
  7. And I follow "Course 1" behat_general::click_link()
  • @javascript

Scenario: Delete a question not used in a quiz /private/srv/www/loganberry.local/data/40975/moodle/question/tests/behat/delete_questions.feature:25

  1. Given I follow "Question bank" behat_general::click_link()
  2. And I click on "Delete" "link" in the "Test question name" "table_row" behat_general::i_click_on_in_the()
  3. When I press "Continue" behat_forms::press_button()
  4. Then I should not see "Test question name" behat_general::assert_page_not_contains_text()
  • @javascript

Scenario: Delete a question used in a quiz /private/srv/www/loganberry.local/data/40975/moodle/question/tests/behat/delete_questions.feature:32

  1. Given I turn editing mode on behat_course::i_turn_editing_mode_on()
  2. And I add a "Quiz" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name Test quiz
  3. And I follow "Test quiz" behat_general::click_link()
  4. And I follow "Edit quiz" behat_general::click_link()
  5. And I follow "Show" behat_general::click_link()
  6. And I click on "Add to quiz" "link" in the "Test question name" "table_row" behat_general::i_click_on_in_the()
  7. And I follow "Course 1" behat_general::click_link()
  8. And I follow "Question bank" behat_general::click_link()
  9. And I click on "Delete" "link" in the "Test question name" "table_row" behat_general::i_click_on_in_the()
  10. When I press "Continue" behat_forms::press_button()
  11. Then I should not see "Test question name" behat_general::assert_page_not_contains_text()
  12. And I click on "Also show old questions" "checkbox" behat_general::i_click_on()
  13. And I should see "Test question name" behat_general::assert_page_contains_text()
  14. And I follow "Course 1" behat_general::click_link()
  15. And I follow "Test quiz" behat_general::click_link()
  16. And I click on "Preview quiz now" "button" behat_general::i_click_on()
  17. And I should see "Write about whatever you want" behat_general::assert_page_contains_text()

Feature: A teacher can edit questions in the question bank

In order to refine questions contents
As a teacher
I need to edit questions

  • @javascript

Scenario: Edit a previously created question /private/srv/www/loganberry.local/data/40975/moodle/question/tests/behat/edit_questions.feature:8

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname format
    Course 1 C1 weeks
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  4. And I log in as "admin" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I add a "Essay" question filling the form with: behat_question::i_add_a_question_filling_the_form_with()
    Question name Test question name
    Question text Write about whatever you want
  7. And I log out behat_auth::i_log_out()
  8. And I log in as "teacher1" behat_auth::i_log_in_as()
  9. And I follow "Course 1" behat_general::click_link()
  10. And I follow "Question bank" behat_general::click_link()
  11. When I click on "Edit" "link" in the "Test question name" table row behat_general::i_click_on_in_the_table_row()
  12. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Question name Edited question name
    Question text Write a lot about what you want
  13. And I press "Save changes" behat_forms::press_button()
  14. Then I should see "Edited question name" behat_general::assert_page_contains_text()
  15. And I should not see "Test question name" behat_general::assert_page_not_contains_text()
  16. And I should see "Admin User" in the ".categoryquestionscontainer tbody .creatorname" "css_element" behat_general::assert_element_contains_text()
  17. And I should see "Teacher 1" in the ".categoryquestionscontainer tbody .modifiername" "css_element" behat_general::assert_element_contains_text()
  18. And I click on "Edit" "link" in the "Edited question name" table row behat_general::i_click_on_in_the_table_row()
  19. And the "Question name" field should match "Edited question name" value behat_forms::the_field_should_match_value()
  20. And I press "Cancel" behat_forms::press_button()
  21. And I click on "Preview" "link" in the "Edited question name" table row behat_general::i_click_on_in_the_table_row()
  22. And I switch to "questionpreview" window behat_general::switch_to_window()
  23. And I should see "Edited question name" behat_general::assert_page_contains_text()
  24. And I should see "Write a lot about what you want" behat_general::assert_page_contains_text()
  25. And I press "Close preview" behat_forms::press_button()
  26. And I switch to the main window behat_general::switch_to_the_main_window()

Feature: A teacher can preview questions in the question bank

In order to ensure the questions are properly created
As a teacher
I need to preview the questions

  • @javascript

Scenario: Preview a previously created question /private/srv/www/loganberry.local/data/40975/moodle/question/tests/behat/preview_question.feature:8

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname format
    Course 1 C1 weeks
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I add a "Numerical" question filling the form with: behat_question::i_add_a_question_filling_the_form_with()
    Question name Test question name
    Question text How much is 1 + 1
    answer[0] 2
    fraction[0] 100%
    answer[1] *
    fraction[1] None
  7. When I click on "Preview" "link" in the "Test question name" table row behat_general::i_click_on_in_the_table_row()
  8. And I switch to "questionpreview" window behat_general::switch_to_window()
  9. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Whether correct Shown
    How questions behave Deferred feedback
  10. And I press "Start again with these options" behat_forms::press_button()
  11. Then I should see "Not yet answered" behat_general::assert_page_contains_text()
  12. And I fill in "Answer:" with "2" behat_forms::fill_field()
  13. And I press "Submit and finish" behat_forms::press_button()
  14. And the state of "How much is 1 + 1" question is shown as "Correct" behat_question::the_state_of_question_is_shown_as()
  15. And I press "Start again" behat_forms::press_button()
  16. And the state of "How much is 1 + 1" question is shown as "Not yet answered" behat_question::the_state_of_question_is_shown_as()
  17. And I fill in "Answer:" with "1" behat_forms::fill_field()
  18. And I press "Submit and finish" behat_forms::press_button()
  19. And the state of "How much is 1 + 1" question is shown as "Incorrect" behat_question::the_state_of_question_is_shown_as()
  20. And I press "Start again" behat_forms::press_button()
  21. And I press "Fill in correct responses" behat_forms::press_button()
  22. And the "Answer:" field should match "2" value behat_forms::the_field_should_match_value()
  23. And I press "Close preview" behat_forms::press_button()
  24. And I switch to the main window behat_general::switch_to_the_main_window()

Feature: A teacher can put questions in categories in the question bank

In order to organize their questions
As a teacher
I need to put questions in categories

Background: /private/srv/www/loganberry.local/data/40975/moodle/question/tests/behat/question_categories.feature:7

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname format
    Course 1 C1 weeks
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I follow "Question bank" behat_general::click_link()
  7. And I follow "Categories" behat_general::click_link()
  8. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Name New Category 1
    Parent category Top
  9. And I press "id_submitbutton" behat_forms::press_button()
  10. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Name New Category 2
    Parent category Top
  11. And I press "id_submitbutton" behat_forms::press_button()
  12. And I add a "Essay" question filling the form with: behat_question::i_add_a_question_filling_the_form_with()
    Question name my test question
    Question text my test question
    Category New Category 1
  • @javascript

Scenario: Move a question between categories via the question page /private/srv/www/loganberry.local/data/40975/moodle/question/tests/behat/question_categories.feature:37

  1. When I select "New Category 1 (1)" from "category" behat_forms::select_option()
  2. And I click on "my test question" "checkbox" in the "my test question" "table_row" behat_general::i_click_on_in_the()
  3. And I select "New Category 2" from "menucategory" behat_forms::select_option()
  4. And I press "Move to >>" behat_forms::press_button()
  5. Then I should see "my test question" behat_general::assert_page_contains_text()
  6. And the "category" select box should contain "New Category 2 (1)" behat_forms::the_select_box_should_contain()
  7. And the "category" select box should contain "New Category 1" behat_forms::the_select_box_should_contain()
  8. And the "category" select box should not contain "New Category 1 (1)" behat_forms::the_select_box_should_not_contain()
  • @javascript

Scenario: Move a question between categories via the question settings page /private/srv/www/loganberry.local/data/40975/moodle/question/tests/behat/question_categories.feature:48

  1. When I click on "Edit" "link" in the "my test question" "table_row" behat_general::i_click_on_in_the()
  2. And I click on "Use this category" "checkbox" behat_general::i_click_on()
  3. And I select "New Category 2" from "Save in category" behat_forms::select_option()
  4. And I press "Save changes" behat_forms::press_button()
  5. Then I should see "my test question" behat_general::assert_page_contains_text()
  6. And the "category" select box should contain "New Category 2 (1)" behat_forms::the_select_box_should_contain()
  7. And the "category" select box should not contain "New Category 1 (1)" behat_forms::the_select_box_should_not_contain()
  • @javascript

Scenario: Delete a question category /private/srv/www/loganberry.local/data/40975/moodle/question/tests/behat/question_categories.feature:58

  1. When I follow "Categories" behat_general::click_link()
  2. And I click on "Delete" "link" in the "//a[text()='New Category 1']/parent::b/parent::li" "xpath_element" behat_general::i_click_on_in_the()
  3. Then I should see "The category 'New Category 1' contains 1 questions" behat_general::assert_page_contains_text()
  4. And I press "Save in category" behat_forms::press_button()
  5. And I should not see "New Category 1" behat_general::assert_page_not_contains_text()

Feature: A teacher can sort questions in the question bank

In order to order the question bank's questions
As a teacher
I need to sort the questions list using different sort orders

  • @javascript

Scenario: Sort using question name, question type and created by sort order links /private/srv/www/loganberry.local/data/40975/moodle/question/tests/behat/sort_questions.feature:8

  1. Given the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
  2. And the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname format
    Course 1 C1 weeks
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  4. And I log in as "admin" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I add a "Essay" question filling the form with: behat_question::i_add_a_question_filling_the_form_with()
    Question name A question 1 name
    Question text A question 1 text
  7. And I log out behat_auth::i_log_out()
  8. And I log in as "teacher1" behat_auth::i_log_in_as()
  9. And I follow "Course 1" behat_general::click_link()
  10. And I add a "Essay" question filling the form with: behat_question::i_add_a_question_filling_the_form_with()
    Question name B question 2 name
    Question text B question 2 text
  11. And I add a "Numerical" question filling the form with: behat_question::i_add_a_question_filling_the_form_with()
    Question name C question 3 name
    Question text C question 3 text
    answer[0] 2
    fraction[0] 100%
    answer[1] 1
    fraction[1] None
  12. When I follow "Sort by Question ascending" behat_general::click_link()
  13. Then "A question 1 name" "checkbox" should appear before "B question 2 name" "checkbox" behat_general::should_appear_before()
  14. And "B question 2 name" "checkbox" should appear before "C question 3 name" "checkbox" behat_general::should_appear_before()
  15. And I follow "Sort by Question descending" behat_general::click_link()
  16. And "C question 3 name" "checkbox" should appear before "B question 2 name" "checkbox" behat_general::should_appear_before()
  17. And "B question 2 name" "checkbox" should appear before "A question 1 name" "checkbox" behat_general::should_appear_before()
  18. And I follow "Sort by Question type ascending" behat_general::click_link()
  19. And "A question 1 name" "checkbox" should appear before "C question 3 name" "checkbox" behat_general::should_appear_before()
  20. And I follow "Sort by Question type descending" behat_general::click_link()
  21. And "C question 3 name" "checkbox" should appear before "A question 1 name" "checkbox" behat_general::should_appear_before()
  22. And I follow "Sort by First name ascending" behat_general::click_link()
  23. And "A question 1 name" "checkbox" should appear before "B question 2 name" "checkbox" behat_general::should_appear_before()
  24. And I follow "Sort by First name descending" behat_general::click_link()
  25. And "B question 2 name" "checkbox" should appear before "A question 1 name" "checkbox" behat_general::should_appear_before()
  26. And I click on "Show question text in the question list" "checkbox" behat_general::i_click_on()
  27. And I should see "A question 1 text" behat_general::assert_page_contains_text()
  28. And I should see "B question 2 text" behat_general::assert_page_contains_text()
  29. And I should see "C question 3 text" behat_general::assert_page_contains_text()

Feature: A selected file can be cancelled

In order to refine the file manager contents
As a user
I need to cancel a selected file

  • @javascript

Scenario: Cancel a selected recent file from being added to a folder /private/srv/www/loganberry.local/data/40975/moodle/repository/tests/behat/cancel_add_file.feature:8

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I expand "My profile" node behat_navigation::i_expand_node()
  4. And I follow "My private files" behat_general::click_link()
  5. And I upload "lib/tests/fixtures/empty.txt" file to "Files" filepicker behat_repository_upload::i_upload_file_to_filepicker()
  6. And I press "Save changes" behat_forms::press_button()
  7. And I am on homepage behat_general::i_am_on_homepage()
  8. And I follow "Course 1" behat_general::click_link()
  9. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  10. When I add a "Folder" to section "1" behat_course::i_add_to_section()
  11. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Name Folder name
    Description Folder description
  12. And I upload "lib/tests/fixtures/upload_users.csv" file to "Files" filepicker behat_repository_upload::i_upload_file_to_filepicker()
  13. And I click on "#fitem_id_files .fp-btn-add a" "css_element" behat_general::i_click_on()
  14. And I click on "Recent files" "link" in the ".fp-repo-area" "css_element" behat_general::i_click_on_in_the()
  15. And I click on "//a[contains(concat(' ', normalize-space(@class), ' '), ' fp-file ')][normalize-space(.)='empty.txt']" "xpath_element" behat_general::i_click_on()
  16. And I click on ".moodle-dialogue-focused .fp-select .fp-select-cancel" "css_element" behat_general::i_click_on()
  17. And I click on ".moodle-dialogue-focused.filepicker .yui3-button.closebutton" "css_element" behat_general::i_click_on()
  18. And I press "Save and display" behat_forms::press_button()
  19. Then I should see "upload_users.csv" behat_general::assert_page_contains_text()
  20. And I should not see "empty.txt" behat_general::assert_page_not_contains_text()
  21. And I should see "Folder description" behat_general::assert_page_contains_text()

Feature: Create folders in the file manager

In order to create a directory structure in a file area
As a user
I need to create folders and subfolders in a file area

  • @javascript

Scenario: Create folders and subfolders /private/srv/www/loganberry.local/data/40975/moodle/repository/tests/behat/create_folders.feature:8

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I follow "Course 1" behat_general::click_link()
  4. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  5. And I add a "Folder" to section "0" behat_course::i_add_to_section()
  6. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Name Folder resource
    Description The description
  7. And I create "Folder 1" folder in "Files" filepicker behat_filepicker::i_create_folder_in_filepicker()
  8. And I open "Folder 1" folder from "Files" filepicker behat_filepicker::i_open_folder_from_filepicker()
  9. And I create "SubFolder 1" folder in "Files" filepicker behat_filepicker::i_create_folder_in_filepicker()
  10. When I open "Files" folder from "Files" filepicker behat_filepicker::i_open_folder_from_filepicker()
  11. Then I should see "Folder 1" behat_general::assert_page_contains_text()
  12. And I open "Folder 1" folder from "Files" filepicker behat_filepicker::i_open_folder_from_filepicker()
  13. And I should see "SubFolder 1" behat_general::assert_page_contains_text()
  14. And I press "Save and return to course" behat_forms::press_button()

Feature: Delete files and folders from the file manager

In order to clean the file manager contents
As a user
I need to delete files from file areas

  • @javascript

Scenario: Delete a file and a folder /private/srv/www/loganberry.local/data/40975/moodle/repository/tests/behat/delete_files.feature:8

  1. Given I log in as "admin" behat_auth::i_log_in_as()
  2. And I expand "My profile" node behat_navigation::i_expand_node()
  3. And I follow "My private files" behat_general::click_link()
  4. And I upload "lib/tests/fixtures/empty.txt" file to "Files" filepicker behat_repository_upload::i_upload_file_to_filepicker()
  5. And I create "Delete me" folder in "Files" filepicker behat_filepicker::i_create_folder_in_filepicker()
  6. And I press "Save changes" behat_forms::press_button()
  7. When I delete "empty.txt" from "Files" filepicker behat_filepicker::i_delete_file_from_filepicker()
  8. And I press "Save changes" behat_forms::press_button()
  9. Then I should not see "empty.txt" behat_general::assert_page_not_contains_text()
  10. And I delete "Delete me" from "Files" filepicker behat_filepicker::i_delete_file_from_filepicker()
  11. And I press "Save changes" behat_forms::press_button()
  12. And I should not see "Delete me" behat_general::assert_page_not_contains_text()
  13. And I press "Cancel" behat_forms::press_button()

Feature: Zip folders and unzip compressed files

In order to download or add contents to file areas easily
As a user
I need to zip and unzip folders and files

  • @javascript

Scenario: Zip and unzip folders and files /private/srv/www/loganberry.local/data/40975/moodle/repository/tests/behat/zip_and_unzip.feature:8

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  2. And I log in as "admin" behat_auth::i_log_in_as()
  3. And I follow "Course 1" behat_general::click_link()
  4. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  5. And I add a "Folder" to section "0" behat_course::i_add_to_section()
  6. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Name Folder resource
    Description The description
  7. And I create "Folder 1" folder in "Files" filepicker behat_filepicker::i_create_folder_in_filepicker()
  8. And I open "Folder 1" folder from "Files" filepicker behat_filepicker::i_open_folder_from_filepicker()
  9. And I create "SubFolder 1" folder in "Files" filepicker behat_filepicker::i_create_folder_in_filepicker()
  10. And I open "Files" folder from "Files" filepicker behat_filepicker::i_open_folder_from_filepicker()
  11. And I zip "Folder 1" folder from "Files" filepicker behat_filepicker::i_zip_folder_from_filepicker()
  12. And I delete "Folder 1" from "Files" filepicker behat_filepicker::i_delete_file_from_filepicker()
  13. When I unzip "Folder 1.zip" file from "Files" filepicker behat_filepicker::i_unzip_file_from_filepicker()
  14. And I delete "Folder 1.zip" from "Files" filepicker behat_filepicker::i_delete_file_from_filepicker()
  15. Then I should see "Folder 1" behat_general::assert_page_contains_text()
  16. And I open "Folder 1" folder from "Files" filepicker behat_filepicker::i_open_folder_from_filepicker()
  17. And I should see "SubFolder 1" behat_general::assert_page_contains_text()
  18. And I press "Save and return to course" behat_forms::press_button()

Feature: Backup Moodle courses

In order to save and store course contents
As an admin
I need to create backups of courses

Background: /private/srv/www/loganberry.local/data/40975/moodle/backup/util/ui/tests/behat/backup_courses.feature:7

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category numsections
    Course 1 C1 0 10
    Course 2 C2 0 2
  2. And the following "activities" exists: behat_data_generators::the_following_exists()
    activity course idnumber name intro section
    assign C2 assign1 Test assign Assign description 1
    data C2 data1 Test data Database description 2
  3. And I log in as "admin" behat_auth::i_log_in_as()
  • @javascript

Scenario: Backup a course providing options /private/srv/www/loganberry.local/data/40975/moodle/backup/util/ui/tests/behat/backup_courses.feature:19

  1. When I backup "Course 1" course using this options: behat_backup::i_backup_course_using_this_options()
    Filename test_backup.mbz
  2. Then I should see "Restore" behat_general::assert_page_contains_text()
  3. And I click on "Restore" "link" in the "test_backup.mbz" "table_row" behat_general::i_click_on_in_the()
  4. And I should see "URL of backup" behat_general::assert_page_contains_text()
  5. And I should see "Anonymize user information" behat_general::assert_page_contains_text()
  • @javascript

Scenario: Backup a course with default options /private/srv/www/loganberry.local/data/40975/moodle/backup/util/ui/tests/behat/backup_courses.feature:28

  1. When I backup "Course 1" course using this options: behat_backup::i_backup_course_using_this_options()
    Filename test_backup.mbz
    Include calendar events 0
    Include course logs 1
    setting_section_section_5_userinfo 0
    setting_section_section_5_included 0
  2. Then I should see "Restore" behat_general::assert_page_contains_text()
  3. And I click on "Restore" "link" in the "test_backup.mbz" "table_row" behat_general::i_click_on_in_the()
  4. And I should not see "Section 3" behat_general::assert_page_not_contains_text()
  5. And I press "Continue" behat_forms::press_button()
  6. And I click on "Continue" "button" in the ".bcs-current-course" "css_element" behat_general::i_click_on_in_the()
  7. And "//div[contains(concat(' ', normalize-space(@class), ' '), ' fitem ')][contains(., 'Include calendar events')]/descendant::img" "xpath_element" should exists behat_general::should_exists()
  8. And I check "Include course logs" behat_forms::check_option()
  9. And I press "Next" behat_forms::press_button()
  • @javascript

Scenario: Backup a course without blocks /private/srv/www/loganberry.local/data/40975/moodle/backup/util/ui/tests/behat/backup_courses.feature:45

  1. When I backup "Course 1" course using this options: behat_backup::i_backup_course_using_this_options()
    id_setting_root_blocks 0
  2. Then I should see "Course backup area" behat_general::assert_page_contains_text()
  • @javascript

Scenario: Backup selecting just one section /private/srv/www/loganberry.local/data/40975/moodle/backup/util/ui/tests/behat/backup_courses.feature:51

  1. When I backup "Course 2" course using this options: behat_backup::i_backup_course_using_this_options()
    Filename test_backup.mbz
    setting_section_section_2_userinfo 0
    setting_section_section_2_included 0
    setting_section_section_4_userinfo 0
    setting_section_section_4_included 0
  2. Then I should see "Course backup area" behat_general::assert_page_contains_text()
  3. And I click on "Restore" "link" in the "test_backup.mbz" "table_row" behat_general::i_click_on_in_the()
  4. And I should not see "Section 2" behat_general::assert_page_not_contains_text()
  5. And I press "Continue" behat_forms::press_button()
  6. And I click on "Continue" "button" in the ".bcs-current-course" "css_element" behat_general::i_click_on_in_the()
  7. And I press "Next" behat_forms::press_button()
  8. And I should see "Test assign" behat_general::assert_page_contains_text()
  9. And I should not see "Test data" behat_general::assert_page_not_contains_text()

Feature: Duplicate activities

In order to set up my course contents quickly
As a teacher
I need to duplicate activities inside the same course

  • @javascript

Scenario: Duplicate an activity /private/srv/www/loganberry.local/data/40975/moodle/backup/util/ui/tests/behat/duplicate_activities.feature:8

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  2. And the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Database" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name Test database name
    Description Test database description
  8. And I open "Test database name" actions menu behat_course::i_open_actions_menu()
  9. When I click on "Duplicate" "link" in the "Test database name" activity behat_course::i_click_on_in_the_activity()
  10. And I click on "Edit settings" "link" in the "Test database name" activity behat_course::i_click_on_in_the_activity()
  11. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Name Original database name
  12. And I press "Save and return to course" behat_forms::press_button()
  13. And I open "Test database name" actions menu behat_course::i_open_actions_menu()
  14. And I click on "Edit settings" "link" in the "Test database name" activity behat_course::i_click_on_in_the_activity()
  15. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Name Duplicated database name
    Description Duplicated database description
  16. And I press "Save and return to course" behat_forms::press_button()
  17. Then I should see "Original database name" in the "#section-1" "css_element" behat_general::assert_element_contains_text()
  18. And I should see "Duplicated database name" in the "#section-1" "css_element" behat_general::assert_element_contains_text()
  19. And "Original database name" "link" should appear before "Duplicated database name" "link" behat_general::should_appear_before()

Feature: Import course's contents into another course

In order to move and copy contents between courses
As a teacher
I need to import a course contents into another course selecting what I want to import

  • @javascript

Scenario: Import course's contents to another course /private/srv/www/loganberry.local/data/40975/moodle/backup/util/ui/tests/behat/import_course.feature:8

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
    Course 2 C2 0
  2. And the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher 1 teacher1@asd.com
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    teacher1 C2 editingteacher
  4. And I log in as "teacher1" behat_auth::i_log_in_as()
  5. And I follow "Course 1" behat_general::click_link()
  6. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  7. And I add a "Database" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name Test database name
    Description Test database description
  8. And I add a "Forum" to section "2" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name
    Description Test forum description
  9. And I add the "Comments" block behat_blocks::i_add_the_block()
  10. And I add the "Recent blog entries" block behat_blocks::i_add_the_block()
  11. When I import "Course 1" course into "Course 2" course using this options: behat_backup::i_import_course_into_course()
  12. Then I should see "Test database name" behat_general::assert_page_contains_text()
  13. And I should see "Test forum name" behat_general::assert_page_contains_text()
  14. And I should see "Comments" in the "Comments" "block" behat_general::assert_element_contains_text()
  15. And I should see "Recent blog entries" behat_general::assert_page_contains_text()

Feature: Restore Moodle 2 course backups

In order to continue using my stored course contents
As a teacher and an admin
I need to restore them inside other Moodle courses or in new courses

Background: /private/srv/www/loganberry.local/data/40975/moodle/backup/util/ui/tests/behat/restore_moodle2_courses.feature:7

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category format numsections coursedisplay
    Course 1 C1 0 topics 15 1
    Course 2 C2 0 topics 5 0
    Course 3 C3 0 topics 2 0
  2. And the following "activities" exists: behat_data_generators::the_following_exists()
    activity course idnumber name intro section
    assign C3 assign1 Test assign name Assign description 1
    data C3 data1 Test database name Database description 2
  3. And I log in as "admin" behat_auth::i_log_in_as()
  4. And I follow "Course 1" behat_general::click_link()
  5. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  6. And I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name
    Description Test forum description
  7. And I add the "Community finder" block behat_blocks::i_add_the_block()
  • @javascript

Scenario: Restore a course in another existing course /private/srv/www/loganberry.local/data/40975/moodle/backup/util/ui/tests/behat/restore_moodle2_courses.feature:26

  1. When I backup "Course 1" course using this options: behat_backup::i_backup_course_using_this_options()
    Filename test_backup.mbz
  2. And I restore "test_backup.mbz" backup into "Course 2" course using this options: behat_backup::i_restore_backup_into_course_using_this_options()
  3. Then I should see "Course 2" behat_general::assert_page_contains_text()
  4. And I should see "Community finder" in the "Community finder" "block" behat_general::assert_element_contains_text()
  5. And I should see "Test forum name" behat_general::assert_page_contains_text()
  • @javascript

Scenario: Restore a course in a new course /private/srv/www/loganberry.local/data/40975/moodle/backup/util/ui/tests/behat/restore_moodle2_courses.feature:35

  1. When I backup "Course 1" course using this options: behat_backup::i_backup_course_using_this_options()
    Filename test_backup.mbz
  2. And I restore "test_backup.mbz" backup into a new course using this options: behat_backup::i_restore_backup_into_a_new_course_using_this_options()
    Course name Course 1 restored in a new course
  3. Then I should see "Course 1 restored in a new course" behat_general::assert_page_contains_text()
  4. And I should see "Community finder" in the "Community finder" "block" behat_general::assert_element_contains_text()
  5. And I should see "Test forum name" behat_general::assert_page_contains_text()
  6. And I click on "Edit settings" "link" in the "Administration" "block" behat_general::i_click_on_in_the()
  7. And I expand all fieldsets behat_forms::i_expand_all_fieldsets()
  8. And the "id_format" field should match "Topics format" value behat_forms::the_field_should_match_value()
  9. And the "Number of sections" field should match "15" value behat_forms::the_field_should_match_value()
  10. And the "Course layout" field should match "Show one section per page" value behat_forms::the_field_should_match_value()
  11. And I press "Cancel" behat_forms::press_button()
  • @javascript

Scenario: Restore a backup into the same course /private/srv/www/loganberry.local/data/40975/moodle/backup/util/ui/tests/behat/restore_moodle2_courses.feature:51

  1. When I backup "Course 3" course using this options: behat_backup::i_backup_course_using_this_options()
    Filename test_backup.mbz
  2. And I restore "test_backup.mbz" backup into "Course 2" course using this options: behat_backup::i_restore_backup_into_course_using_this_options()
    setting_section_section_3_included 0
    setting_section_section_3_userinfo 0
    setting_section_section_5_included 0
    setting_section_section_5_userinfo 0
  3. Then I should see "Course 2" behat_general::assert_page_contains_text()
  4. And I should see "Test assign name" behat_general::assert_page_contains_text()
  5. And I should not see "Test database name" behat_general::assert_page_not_contains_text()
  • @javascript

Scenario: Restore a backup into the same course removing it's contents before that /private/srv/www/loganberry.local/data/40975/moodle/backup/util/ui/tests/behat/restore_moodle2_courses.feature:64

  1. When I backup "Course 1" course using this options: behat_backup::i_backup_course_using_this_options()
    Filename test_backup.mbz
  2. And I follow "Course 1" behat_general::click_link()
  3. And I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum post backup name
    Description Test forum post backup description
  4. And I follow "Restore" behat_general::click_link()
  5. And I merge "test_backup.mbz" backup into the current course after deleting it's contents using this options: behat_backup::i_merge_backup_into_current_course_deleting_its_contents()
    setting_section_section_5_userinfo 0
    setting_section_section_5_included 0
  6. Then I should see "Course 1" behat_general::assert_page_contains_text()
  7. And I should not see "Section 3" behat_general::assert_page_not_contains_text()
  8. And I should not see "Test forum post backup name" behat_general::assert_page_not_contains_text()
  9. And I should see "Community finder" in the "Community finder" "block" behat_general::assert_element_contains_text()
  10. And I should see "Test forum name" behat_general::assert_page_contains_text()
  • @javascript

Scenario: Restore a backup into a new course changing the course format afterwards /private/srv/www/loganberry.local/data/40975/moodle/backup/util/ui/tests/behat/restore_moodle2_courses.feature:82

  1. Given I backup "Course 1" course using this options: behat_backup::i_backup_course_using_this_options()
    Filename test_backup.mbz
  2. When I restore "test_backup.mbz" backup into a new course using this options: behat_backup::i_restore_backup_into_a_new_course_using_this_options()
  3. Then I should see "Topic 1" behat_general::assert_page_contains_text()
  4. And I should see "Test forum name" behat_general::assert_page_contains_text()
  5. And I click on "Edit settings" "link" in the "Administration" "block" behat_general::i_click_on_in_the()
  6. And I expand all fieldsets behat_forms::i_expand_all_fieldsets()
  7. And the "id_format" field should match "Topics format" value behat_forms::the_field_should_match_value()
  8. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    id_startdate_day 1
    id_startdate_month January
    id_startdate_year 2020
    id_format Weekly format
  9. And I press "Save changes" behat_forms::press_button()
  10. And I should see "1 January - 7 January" behat_general::assert_page_contains_text()
  11. And I should see "Test forum name" behat_general::assert_page_contains_text()
  12. And I click on "Edit settings" "link" in the "Administration" "block" behat_general::i_click_on_in_the()
  13. And I expand all fieldsets behat_forms::i_expand_all_fieldsets()
  14. And the "id_format" field should match "Weekly format" value behat_forms::the_field_should_match_value()
  15. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    id_format Social format
  16. And I press "Save changes" behat_forms::press_button()
  17. And I should see "An open forum for chatting about anything you want to" behat_general::assert_page_contains_text()
  18. And I click on "Edit settings" "link" in the "Administration" "block" behat_general::i_click_on_in_the()
  19. And I expand all fieldsets behat_forms::i_expand_all_fieldsets()
  20. And the "id_format" field should match "Social format" value behat_forms::the_field_should_match_value()
  21. And I press "Cancel" behat_forms::press_button()
  • @javascript

Scenario: Restore a backup in an existing course retaining the backup course settings /private/srv/www/loganberry.local/data/40975/moodle/backup/util/ui/tests/behat/restore_moodle2_courses.feature:112

  1. Given I add a "URL" to section "3" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name Test URL name
    Description Test URL description
    id_externalurl http://www.moodle.org
  2. And I hide section "3" behat_course::i_hide_section()
  3. And I hide section "7" behat_course::i_hide_section()
  4. When I backup "Course 1" course using this options: behat_backup::i_backup_course_using_this_options()
    Filename test_backup.mbz
  5. And I restore "test_backup.mbz" backup into "Course 2" course using this options: behat_backup::i_restore_backup_into_course_using_this_options()
    Overwrite course configuration Yes
  6. And I click on "Edit settings" "link" in the "Administration" "block" behat_general::i_click_on_in_the()
  7. And I expand all fieldsets behat_forms::i_expand_all_fieldsets()
  8. Then the "id_format" field should match "Topics format" value behat_forms::the_field_should_match_value()
  9. And the "Number of sections" field should match "15" value behat_forms::the_field_should_match_value()
  10. And the "Course layout" field should match "Show one section per page" value behat_forms::the_field_should_match_value()
  11. And I press "Cancel" behat_forms::press_button()
  12. And section "3" should be hidden behat_course::section_should_be_hidden()
  13. And section "7" should be hidden behat_course::section_should_be_hidden()
  14. And section "15" should be visible behat_course::section_should_be_visible()
  15. And I should see "Test URL name" in the "#section-3" "css_element" behat_general::assert_element_contains_text()
  16. And I should see "Test forum name" in the "#section-1" "css_element" behat_general::assert_element_contains_text()

Feature: Allow students to manually mark an activity as complete

In order to let students decide when an activity is completed
As a teacher
I need to allow students to mark activities as completed

  • @javascript

Scenario: Mark an activity as completed /private/srv/www/loganberry.local/data/40975/moodle/completion/tests/behat/enable_manual_complete_mark.feature:8

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  2. And the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher Frist teacher1@asd.com
    student1 Student First student1@asd.com
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "admin" behat_auth::i_log_in_as()
  5. And I set the following administration settings values: behat_admin::i_set_the_following_administration_settings_values()
    Enable completion tracking 1
    Enable conditional access 1
  6. And I log out behat_auth::i_log_out()
  7. And I log in as "teacher1" behat_auth::i_log_in_as()
  8. And I follow "Course 1" behat_general::click_link()
  9. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  10. And I click on "Edit settings" "link" in the "Administration" "block" behat_general::i_click_on_in_the()
  11. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Enable completion tracking Yes
  12. And I press "Save changes" behat_forms::press_button()
  13. When I add a "Forum" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Forum name Test forum name
    Description Test forum description
  14. Then "Student First" user has not completed "Test forum name" activity behat_completion::user_has_not_completed_activity()
  15. And I log out behat_auth::i_log_out()
  16. And I log in as "student1" behat_auth::i_log_in_as()
  17. And I follow "Course 1" behat_general::click_link()
  18. And I press "Mark as complete: Test forum name" behat_forms::press_button()
  19. And I wait "3" seconds behat_general::i_wait_seconds()
  20. And I log out behat_auth::i_log_out()
  21. And I log in as "teacher1" behat_auth::i_log_in_as()
  22. And I follow "Course 1" behat_general::click_link()
  23. And I expand "Reports" node behat_navigation::i_expand_node()
  24. And I follow "Activity completion" behat_general::click_link()
  25. And "Student First" user has completed "Test forum name" activity behat_completion::user_has_completed_activity()

Feature: Restrict activity availability through date conditions

In order to control activity access through date condition
As a teacher
I need to set allow access dates to restrict activity access

Background: /private/srv/www/loganberry.local/data/40975/moodle/completion/tests/behat/restrict_activity_by_date.feature:7

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  2. And the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher Frist teacher1@asd.com
    student1 Student First student1@asd.com
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "admin" behat_auth::i_log_in_as()
  5. And I set the following administration settings values: behat_admin::i_set_the_following_administration_settings_values()
    Enable conditional access 1
  6. And I log out behat_auth::i_log_out()
  • @javascript

Scenario: Show activity greyed-out to students when available from date is in future /private/srv/www/loganberry.local/data/40975/moodle/completion/tests/behat/restrict_activity_by_date.feature:25

  1. Given I log in as "teacher1" behat_auth::i_log_in_as()
  2. And I follow "Course 1" behat_general::click_link()
  3. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  4. And I add a "Assignment" to section "1" behat_course::i_add_to_section()
  5. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Assignment name Test assignment 1
    Description This assignment is restricted by date
    assignsubmission_onlinetext_enabled 1
    assignsubmission_file_enabled 0
    id_availablefrom_day 31
    id_availablefrom_month 12
    id_availablefrom_year 2050
    id_showavailability 1
  6. And I click on "id_availablefrom_enabled" "checkbox" behat_general::i_click_on()
  7. And I press "Save and return to course" behat_forms::press_button()
  8. And I log out behat_auth::i_log_out()
  9. When I log in as "student1" behat_auth::i_log_in_as()
  10. And I follow "Course 1" behat_general::click_link()
  11. Then I should see "Available from 31 December 2050." behat_general::assert_page_contains_text()
  12. And "Test assignment 1" activity should be hidden behat_course::activity_should_be_hidden()
  13. And I log out behat_auth::i_log_out()
  • @javascript

Scenario: Show activity hidden to students when available until date is in past /private/srv/www/loganberry.local/data/40975/moodle/completion/tests/behat/restrict_activity_by_date.feature:49

  1. Given I log in as "teacher1" behat_auth::i_log_in_as()
  2. And I follow "Course 1" behat_general::click_link()
  3. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  4. And I add a "Assignment" to section "2" behat_course::i_add_to_section()
  5. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Assignment name Test assignment 2
    Description This assignment is restricted by date
    assignsubmission_onlinetext_enabled 1
    assignsubmission_file_enabled 0
    id_availableuntil_day 1
    id_availableuntil_month 2
    id_availableuntil_year 2013
    id_showavailability 0
  6. And I click on "id_availableuntil_enabled" "checkbox" behat_general::i_click_on()
  7. And I press "Save and return to course" behat_forms::press_button()
  8. And I log out behat_auth::i_log_out()
  9. When I log in as "student1" behat_auth::i_log_in_as()
  10. And I follow "Course 1" behat_general::click_link()
  11. Then I should not see "Test assignment 2" behat_general::assert_page_not_contains_text()

Feature: Restrict activity availability through grade conditions

In order to control activity access through grade condition
As a teacher
I need to set grade condition to restrict activity access

  • @javascript

Scenario: Show activity greyed-out to students when grade condition is not satisfied /private/srv/www/loganberry.local/data/40975/moodle/completion/tests/behat/restrict_activity_by_grade.feature:8

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  2. And the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher Frist teacher1@asd.com
    student1 Student First student1@asd.com
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "admin" behat_auth::i_log_in_as()
  5. And I set the following administration settings values: behat_admin::i_set_the_following_administration_settings_values()
    Enable conditional access 1
  6. And I log out behat_auth::i_log_out()
  7. And I log in as "teacher1" behat_auth::i_log_in_as()
  8. And I follow "Course 1" behat_general::click_link()
  9. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  10. And I add a "Assignment" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Assignment name Grade assignment
    Description Grade this assignment to revoke restriction on restricted assignment
    assignsubmission_onlinetext_enabled 1
    assignsubmission_file_enabled 0
  11. And I add a "Page" to section "2" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name Test page name
    Description Restricted page, till grades in Grade assignment is at least 20%
    Page content Test page contents
    id_conditiongradegroup_0_conditiongradeitemid 2
    id_conditiongradegroup_0_conditiongrademin 20
    id_showavailability 1
  12. And I log out behat_auth::i_log_out()
  13. When I log in as "student1" behat_auth::i_log_in_as()
  14. And I follow "Course 1" behat_general::click_link()
  15. Then I should see "Not available until you achieve a required score in Grade assignment" behat_general::assert_page_contains_text()
  16. And "Test page name" activity should be hidden behat_course::activity_should_be_hidden()
  17. And I follow "Grade assignment" behat_general::click_link()
  18. And I press "Add submission" behat_forms::press_button()
  19. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Online text I'm the student submission
  20. And I press "Save changes" behat_forms::press_button()
  21. And I should see "Submitted for grading" behat_general::assert_page_contains_text()
  22. And I log out behat_auth::i_log_out()
  23. And I log in as "teacher1" behat_auth::i_log_in_as()
  24. And I follow "Course 1" behat_general::click_link()
  25. And I follow "Grade assignment" behat_general::click_link()
  26. And I follow "View/grade all submissions" behat_general::click_link()
  27. And I click on "Grade Student First" "link" in the "Student First" "table_row" behat_general::i_click_on_in_the()
  28. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Grade 21
  29. And I press "Save changes" behat_forms::press_button()
  30. And I log out behat_auth::i_log_out()
  31. And I log in as "student1" behat_auth::i_log_in_as()
  32. And I follow "Course 1" behat_general::click_link()
  33. And "Test page name" activity should be visible behat_course::activity_should_be_visible()
  34. And I should not see "Not available until you achieve a required score in Grade assignment" behat_general::assert_page_not_contains_text()

Feature: Restrict sections availability through completion or grade conditions

In order to control section's contents access through activities completion or grade condition
As a teacher
I need to restrict sections availability using different conditions

Background: /private/srv/www/loganberry.local/data/40975/moodle/completion/tests/behat/restrict_section_availability.feature:7

  1. Given the following "courses" exists: behat_data_generators::the_following_exists()
    fullname shortname category
    Course 1 C1 0
  2. And the following "users" exists: behat_data_generators::the_following_exists()
    username firstname lastname email
    teacher1 Teacher Frist teacher1@asd.com
    student1 Student First student1@asd.com
  3. And the following "course enrolments" exists: behat_data_generators::the_following_exists()
    user course role
    teacher1 C1 editingteacher
    student1 C1 student
  4. And I log in as "admin" behat_auth::i_log_in_as()
  5. And I set the following administration settings values: behat_admin::i_set_the_following_administration_settings_values()
    Enable completion tracking 1
    Enable conditional access 1
  6. And I log out behat_auth::i_log_out()
  • @javascript

Scenario: Show section greyed-out to student when completion condition is not satisfied /private/srv/www/loganberry.local/data/40975/moodle/completion/tests/behat/restrict_section_availability.feature:26

  1. Given I log in as "teacher1" behat_auth::i_log_in_as()
  2. And I follow "Course 1" behat_general::click_link()
  3. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  4. And I click on "Edit settings" "link" in the "Administration" "block" behat_general::i_click_on_in_the()
  5. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Enable completion tracking Yes
  6. And I press "Save changes" behat_forms::press_button()
  7. And I add a "Label" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Label text Test label
    Completion tracking Students can manually mark the activity as completed
  8. And I add a "Page" to section "2" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name Test page name
    Description Test page description
    Page content Test page contents
  9. When I edit the section "2" and I fill the form with: behat_course::i_edit_the_section_and_i_fill_the_form_with()
    id_conditioncompletiongroup_0_conditionsourcecmid Test label
    id_conditioncompletiongroup_0_conditionrequiredcompletion must be marked complete
    Before section can be accessed Show section greyed-out, with restriction information
  10. And I log out behat_auth::i_log_out()
  11. And I log in as "student1" behat_auth::i_log_in_as()
  12. And I follow "Course 1" behat_general::click_link()
  13. Then I should see "Not available until the activity Test label is marked complete." behat_general::assert_page_contains_text()
  14. And I should not see "Test page name" behat_general::assert_page_not_contains_text()
  15. And I press "Not completed: Test label. Select to mark as complete." behat_forms::press_button()
  16. And I should see "Test page name" behat_general::assert_page_contains_text()
  17. And I should not see "Not available until the activity Test label is marked complete." behat_general::assert_page_not_contains_text()
  • @javascript

Scenario: Show section greyed-out to student when grade condition is not satisfied /private/srv/www/loganberry.local/data/40975/moodle/completion/tests/behat/restrict_section_availability.feature:55

  1. Given I log in as "teacher1" behat_auth::i_log_in_as()
  2. And I follow "Course 1" behat_general::click_link()
  3. And I turn editing mode on behat_course::i_turn_editing_mode_on()
  4. And I add a "Assignment" to section "1" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Assignment name Grade assignment
    Description Grade this assignment to revoke restriction on restricted assignment
    assignsubmission_onlinetext_enabled 1
    assignsubmission_file_enabled 0
  5. And I add a "Page" to section "2" and I fill the form with: behat_course::i_add_to_section_and_i_fill_the_form_with()
    Name Test page name
    Description Restricted section page resource, till grades in Grade assignment is at least 20%
    Page content Test page contents
  6. And I edit the section "2" and I fill the form with: behat_course::i_edit_the_section_and_i_fill_the_form_with()
    id_conditiongradegroup_0_conditiongradeitemid 2
    id_conditiongradegroup_0_conditiongrademin 20
    Before section can be accessed 1
  7. And I log out behat_auth::i_log_out()
  8. When I log in as "student1" behat_auth::i_log_in_as()
  9. And I follow "Course 1" behat_general::click_link()
  10. Then I should see "Not available until you achieve a required score in Grade assignment" behat_general::assert_page_contains_text()
  11. And "Test page name" activity should be hidden behat_course::activity_should_be_hidden()
  12. And I follow "Grade assignment" behat_general::click_link()
  13. And I press "Add submission" behat_forms::press_button()
  14. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Online text I'm the student submission
  15. And I press "Save changes" behat_forms::press_button()
  16. And I should see "Submitted for grading" behat_general::assert_page_contains_text()
  17. And I log out behat_auth::i_log_out()
  18. And I log in as "teacher1" behat_auth::i_log_in_as()
  19. And I follow "Course 1" behat_general::click_link()
  20. And I follow "Grade assignment" behat_general::click_link()
  21. And I follow "View/grade all submissions" behat_general::click_link()
  22. And I click on "Grade Student First" "link" in the "Student First" "table_row" behat_general::i_click_on_in_the()
  23. And I fill the moodle form with: behat_forms::i_fill_the_moodle_form_with()
    Grade 21
  24. And I press "Save changes" behat_forms::press_button()
  25. And I log out behat_auth::i_log_out()
  26. And I log in as "student1" behat_auth::i_log_in_as()
  27. And I follow "Course 1" behat_general::click_link()
  28. And "Test page name" activity should be visible behat_course::activity_should_be_visible()
  29. And I should not see "Not available until you achieve a required score in Grade assignment" behat_general::assert_page_not_contains_text()

281 scenarios (279 passed, 2 failed)

6058 steps (6030 passed, 26 skipped, 2 failed)

233m33.32s