<commit_before>Feature: Admin can work with interactives

  In order to work with interactives
  As an admin
  I need to create and manage interactives

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

  @javascript
  Scenario: Admin accesses Materials Collections
    When I am on the home page
    And I follow "Admin"
    And I wait 2 seconds
    And I follow "Interactives"
    Then I should be on the interactives index page
    And I should see "Displaying all 15 models"
    And I should see "Create Interactive"
    And I should see "Export Interactives"

  Scenario: Create Valid Article
    Given I am on the interactives index page
    When I click "create interactive"
    Then I should see "(new) /interactives"
    When I fill in "interactive[name]" with "New Interactive"
    And I fill in "interactive[description]" with "New Description"
    And I fill in "interactive[url]" with "http://www.google.com"
    And I press "Save"
    Then I should be on the show page for interactive "New Interactive"
    And I should see "Interactive was successfully created."
    And I should see "Run Interactive"

  # This is loading the materials info I think because
  # related_materials_wrapper seems to be added to to the interactives show page
  @javascript
  Scenario: Tagging Interactives
    Given the following Admin::tag records exist:
      | scope         | tag      |
      | grade_levels  | gl_K     |
      | subject_areas | sa_Math  |
      | model_types   | mt_Video |
    And I am on the interactives index page
    When I click "create interactive"
    Then I should see "(new) /interactives"
    When I fill in "interactive[name]" with "New Interactive"
    And I fill in "interactive[description]" with "New Description"
    And I fill in "interactive[url]" with "http://www.google.com"
    And under "Grade Levels" I check "gl_K"
    And under "Subject Areas" I check "sa_Math"
    And under "Model Types" I choose "mt_Video"
    And I press "Save"
    Then I should be on the show page for interactive "New Interactive"
    And I should see "Interactive was successfully created."
    And I should see "Run Interactive"
    And I should see "Model type: mt_Video"
    And I should see "Grade Levels: gl_K"
    And I should see "Subject Areas: sa_Math"

    Scenario: Removing tags from Interactives
      Given I am on the edit page of interactive "Interactive 1"
      Then I should see "11" within #primary
      When under "Grade Levels" I uncheck "11"
      And under "Subject Areas" I uncheck "Biology"
      And I press "Save"
      Then I should not see "11" within #primary
      And I should not see "Biology"

    # @javascript @search
    # Scenario: Admin can see search suggestions
    #  Given I am on the search instructional materials page
    #  When I enter search text "Interactive 1" on the search instructional materials page
    #  And I wait 2 seconds
    #  Then I should see search suggestions for "Interactive 1" on the search instructional materials page

    #@javascript @search
    #Scenario: Admin can sort search results alphabetically
    #  Given I am on the search instructional materials page
    #  When I search for "Interactive" on the search instructional materials page
    #  And I follow "Alphabetical" in Sort By on the search instructional materials page
    #  Then "Interactive 1" should appear before "Interactive 11"
    #  And "Interactive 11" should appear before "Interactive 2"

    #@javascript @search
    #Scenario: Admin can sort search results for interactive on the basis of creation date
    #  Given I am on the search instructional materials page
    #  When I create interactive "Interactive 1" before "Interactive 2" by date
    #  And I search for "Interactive" on the search instructional materials page
    #  And I follow "Oldest" in Sort By on the search instructional materials page
    #  And I wait 2 seconds
    #  Then "Interactive 1" should appear before "Interactive 2"
    #  When I follow "Newest" in Sort By on the search instructional materials page
    #  And I wait 2 seconds
    #  Then "Interactive 2" should appear before "Interactive 1"

    @javascript @search
    Scenario: Admin should be able to see grouped search results on the basis of material type
      Given I am on the search instructional materials page
      When I enter search text "Geometry" on the search instructional materials page
      And I close the search suggestions
      And I uncheck "Sequence"
      And I uncheck "Interactive"
      And I check "Activity"
      And I press "GO"
      And I wait 2 seconds
      Then I should see "Geometry"
      And I should not see "Radioactivity"
      When I enter search text "Radioactivity" on the search instructional materials page
      And I close the search suggestions
      And I check "Sequence"
      And I uncheck "Activity"
      And I uncheck "Interactive"
      And I press "GO"
      And I wait 2 seconds
      Then I should see "Radioactivity"
      And I should not see "Geometry"
      When I enter search text "Interactive" on the search instructional materials page
      And I close the search suggestions
      And I uncheck "Sequence"
      And I uncheck "Activity"
      And I check "Interactive"
      And I press "GO"
      And I wait 2 seconds
      Then I should see "Interactive"
      And I should not see "Geometry"

    #@javascript @search
    #Scenario: User can search Interactives using Subject Areas
    #  Given I am on the search instructional materials page<commit_msg>Update feature test for search page.<commit_after>Feature: Admin can work with interactives

  In order to work with interactives
  As an admin
  I need to create and manage interactives

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

  @javascript
  Scenario: Admin accesses Materials Collections
    When I am on the home page
    And I follow "Admin"
    And I wait 2 seconds
    And I follow "Interactives"
    Then I should be on the interactives index page
    And I should see "Displaying all 15 models"
    And I should see "Create Interactive"
    And I should see "Export Interactives"

  Scenario: Create Valid Article
    Given I am on the interactives index page
    When I click "create interactive"
    Then I should see "(new) /interactives"
    When I fill in "interactive[name]" with "New Interactive"
    And I fill in "interactive[description]" with "New Description"
    And I fill in "interactive[url]" with "http://www.google.<EMAIL>"
    And I press "Save"
    Then I should be on the show page for interactive "New Interactive"
    And I should see "Interactive was successfully created."
    And I should see "Run Interactive"

  # This is loading the materials info I think because
  # related_materials_wrapper seems to be added to to the interactives show page
  @javascript
  Scenario: Tagging Interactives
    Given the following Admin::tag records exist:
      | scope         | tag      |
      | grade_levels  | gl_K     |
      | subject_areas | sa_Math  |
      | model_types   | mt_Video |
    And I am on the interactives index page
    When I click "create interactive"
    Then I should see "(new) /interactives"
    When I fill in "interactive[name]" with "New Interactive"
    And I fill in "interactive[description]" with "New Description"
    And I fill in "interactive[url]" with "http://www.google.com"
    And under "Grade Levels" I check "gl_K"
    And under "Subject Areas" I check "sa_Math"
    And under "Model Types" I choose "mt_Video"
    And I press "Save"
    Then I should be on the show page for interactive "New Interactive"
    And I should see "Interactive was successfully created."
    And I should see "Run Interactive"
    And I should see "Model type: mt_Video"
    And I should see "Grade Levels: gl_K"
    And I should see "Subject Areas: sa_Math"

    Scenario: Removing tags from Interactives
      Given I am on the edit page of interactive "Interactive 1"
      Then I should see "11" within #primary
      When under "Grade Levels" I uncheck "11"
      And under "Subject Areas" I uncheck "Biology"
      And I press "Save"
      Then I should not see "11" within #primary
      And I should not see "Biology"

    # @javascript @search
    # Scenario: Admin can see search suggestions
    #  Given I am on the search instructional materials page
    #  When I enter search text "Interactive 1" on the search instructional materials page
    #  And I wait 2 seconds
    #  Then I should see search suggestions for "Interactive 1" on the search instructional materials page

    #@javascript @search
    #Scenario: Admin can sort search results alphabetically
    #  Given I am on the search instructional materials page
    #  When I search for "Interactive" on the search instructional materials page
    #  And I follow "Alphabetical" in Sort By on the search instructional materials page
    #  Then "Interactive 1" should appear before "Interactive 11"
    #  And "Interactive 11" should appear before "Interactive 2"

    #@javascript @search
    #Scenario: Admin can sort search results for interactive on the basis of creation date
    #  Given I am on the search instructional materials page
    #  When I create interactive "Interactive 1" before "Interactive 2" by date
    #  And I search for "Interactive" on the search instructional materials page
    #  And I follow "Oldest" in Sort By on the search instructional materials page
    #  And I wait 2 seconds
    #  Then "Interactive 1" should appear before "Interactive 2"
    #  When I follow "Newest" in Sort By on the search instructional materials page
    #  And I wait 2 seconds
    #  Then "Interactive 2" should appear before "Interactive 1"

    @javascript @search
    Scenario: Admin should be able to see grouped search results on the basis of material type
      Given I am on the search instructional materials page
      When I enter search text "Geometry" on the search instructional materials page
      And I close the search suggestions
      And I uncheck "Sequence"
      And I uncheck "Interactive"
      And I check "Activity"
      And I press "Go"
      And I wait 2 seconds
      Then I should see "Geometry"
      And I should not see "Radioactivity"
      When I enter search text "Radioactivity" on the search instructional materials page
      And I close the search suggestions
      And I check "Sequence"
      And I uncheck "Activity"
      And I uncheck "Interactive"
      And I press "Go"
      And I wait 2 seconds
      Then I should see "Radioactivity"
      And I should not see "Geometry"
      When I enter search text "Interactive" on the search instructional materials page
      And I close the search suggestions
      And I uncheck "Sequence"
      And I uncheck "Activity"
      And I check "Interactive"
      And I press "Go"
      And I wait 2 seconds
      Then I should see "Interactive"
      And I should not see "Geometry"

    #@javascript @search
    #Scenario: User can search Interactives using Subject Areas
    #  Given I am on the search instructional materials page
{'fraction_non_alphanumeric': 0.049308961212661616, 'fraction_numerical': 0.005349977708426215, 'mean_word_length': 2.995724973281083, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '6535381', 'n_tokens_mistral': 3021, 'n_tokens_neox': 2888, 'n_words': 1562}