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()