<commit_before>Feature: Teacher filters instructional materials

  As Teacher
  In order to find materials
  I need to search for them by subject and grade

  Background:
    Given the database has been seeded
    And I am logged in with the username admin

  @javascript @search
  Scenario: Searching Tagged materials
    Given the following Admin::tag records exist:
      | scope         | tag       |
      | grade_levels  | 5         |
      | grade_levels  | 7         |
      | subject_areas | Math      |
      | subject_areas | Science   |
      | model_types   | mt_Video  |

    # Create a first grade math activity:
    And I am on the new material page
    Then I should see "(new) /eresources"
    When I fill in "external_activity[name]" with "My grade 5 Math Activity"
    And I check "external_activity[is_official]"
    And I select "published" from "external_activity[publication_status]"
    And under "Grade Levels" I check "5"
    And under "Subject Areas" I check "Math"
    And I press "Save"

    # Create a 7th grade Science Activity
    And I am on the new material page
    Then I should see "(new) /eresources"
    When I fill in "external_activity[name]" with "My grade 7 Science Activity"
    And I check "external_activity[is_official]"
    And I select "published" from "external_activity[publication_status]"
    And under "Grade Levels" I check "7"
    And under "Subject Areas" I check "Science"
    And I press "Save"

    Given I am on the search instructional materials page
    And I uncheck "Sequence"
    And I check "Math"
    And I wait for the search to be ready<commit_msg>Try explicit selectors to see if it fixes the checking failure<commit_after>Feature: Teacher filters instructional materials

  As Teacher
  In order to find materials
  I need to search for them by subject and grade

  Background:
    Given the database has been seeded
    And I am logged in with the username admin

  @javascript @search
  Scenario: Searching Tagged materials
    # the default data includes grade levels and many tags already
    Given the following Admin::tag records exist:
      | scope         | tag       |
      | subject_areas | Science   |
      | model_types   | mt_Video  |

    # Create a first grade math activity:
    And I am on the new material page
    Then I should see "(new) /eresources"
    When I fill in "external_activity[name]" with "My grade 5 Math Activity"
    And I check "external_activity[is_official]"
    And I select "published" from "external_activity[publication_status]"
    And I check "grade_levels_5"
    And I check "subject_areas_math"
    And I press "Save"

    # Create a 7th grade Science Activity
    And I am on the new material page
    Then I should see "(new) /eresources"
    When I fill in "external_activity[name]" with "My grade 7 Science Activity"
    And I check "external_activity[is_official]"
    And I select "published" from "external_activity[publication_status]"
    And I check "grade_levels_7"
    And I check "subject_areas_science"
    And I press "Save"

    Given I am on the search instructional materials page
    And I uncheck "Sequence"
    And I check "Math"
    And I wait for the search to be ready
{'fraction_non_alphanumeric': 0.056004978220286245, 'fraction_numerical': 0.00373366521468575, 'mean_word_length': 2.9987562189054726, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2559787', 'n_tokens_mistral': 917, 'n_tokens_neox': 861, 'n_words': 413}