<commit_before>Feature: Manage Forms
  As an author
  I want to create and manage Forms
  Scenario: Form List View
    Given I have a Form with the name "Test Form"
    And I am logged in as <EMAIL>
    When I go to the list of Forms
    Then I should see "Test Form"
    When I click on the menu link for the Form with the name "Test Form"
    Then I should see the option to Delete the Form with the name "Test Form"
    And I should see the option to View the Form with the name "Test Form"
    And I should see the option to Revise the Form with the name "Test Form"

  Scenario: Show Form in Detail
    Given I have a Form with the name "Test Form" and the description "Form description"
    And I am logged in as <EMAIL>
    When I go to the list of Forms
    And I click on the menu link for the Form with the name "Test Form"
    And I click on the option to View the Form with the name "Test Form"
    Then I should see "Test Form"
    Then I should see "Form description"

  Scenario: Revise Form
    Given I have a Form with the name "Test Form" and the description "Form description"
    And I have a Question with the content "What is your gender?" and the type "MC"
    And I have a Response Set with the name "Gender Partial"
    And I am logged in as <EMAIL>
    When I go to the list of Forms
    And I click on the menu link for the Form with the name "Test Form"
    And I click on the option to Revise the Form with the name "Test Form"
    And I fill in the "name" field with "Gender Form"
    And I fill in the "description" field with "Revised Description"
    And I fill in the "search" field with "What"
    And I click on the button to add the Question "What is your gender?"
    Then I select the "Gender Partial" option in the "responseSet" list
    And I click on the "Save" button
    Then I should see "Name: Gender Form"
    Then I should see "Revised Description"
    And I should see "What is your gender?"
    And I should see "Gender Partial"

  Scenario: Reorder Questions
    Given I have a Form with the name "Test Form"
    And I have a Question with the content "What is your gender?" and the type "MC"
    And I have a Question with the content "What is your name?" and the type "MC"
    And I have a Response Set with the name "Gender Partial"
    And I am logged in as <EMAIL>
    When I go to the list of Forms
    And I click on the menu link for the Form with the name "Test Form"
    And I click on the option to Revise the Form with the name "Test Form"
    And I fill in the "search" field with "What"
    And I click on the button to add the Question "What is your gender?"
    And I click on the button to add the Question "What is your name?"
    And I move the Question "What is your name?" up
    And I move the Question "What is your name?" down
    And I click on the "Save" button
    And I should see "What is your gender?"
    And I should see "Gender Partial"

  Scenario: Create New Form from List
    Given I have a Response Set with the name "Gender Full"
    And I have a Question with the content "What is your gender?" and the type "MC"
    And I am logged in as <EMAIL>
    When I go to the list of Forms
    And I click on the "New Form" link
    And I fill in the "name" field with "Test Form"
    And I fill in the "controlNumber" field with "1234-1234"
    And I fill in the "description" field with "Form description"
    And I fill in the "search" field with "What"
    And I click on the button to add the Question "What is your gender?"
    Then I select the "Gender Full" option in the "responseSet" list
    And I click on the "Save" button
    Then I should see "Test Form"
    And I should see "What is your gender?"

  Scenario: Create New Form from List with warning modal
    Given I have a Response Set with the name "Gender Full"
    And I have a Question with the content "What is your gender?" and the type "MC"
    And I am logged in as <EMAIL>
    When I go to the list of Forms
    And I click on the "New Form" link
    And I fill in the "name" field with "Test Form"
    And I fill in the "controlNumber" field with "1234-1234"
    When I go to the list of Forms
    And I click on the "Save & Leave" button
    Then I should see "Test Form"
    And I fill in the "search" field with "What"
    And I should see "What is your gender?"
    Then I should see "Name: Test Form"
    Then I should see "Description: Form description"
    And I should see "What is your gender?"

  Scenario: Abandon New Form from List with warning modal
    Given I have a Response Set with the name "Gender Full"
    And I have a Question with the content "What is your gender?" and the type "MC"
    And I am logged in as <EMAIL>
    When I go to the list of Forms
    And I click on the "New Form" link
    And I fill in the "name" field with "Test Form"
    And I fill in the "controlNumber" field with "1234-1234"
    When I go to the list of Forms
    And I click on the "Continue Without Saving" button
    Then I should not see "Test Form"

  Scenario: An invalid control number should not allow save
    Given I have a Response Set with the name "Gender Full"
    And I have a Question with the content "What is your gender?" and the type "MC"
    And I am logged in as <EMAIL>
    When I go to the list of Forms
    And I click on the "New Form" link
    And I fill in the "name" field with "Test Form"
    And I fill in the "controlNumber" field with "1234"
    And I fill in the "search" field with "What"
    And I click on the button to add the Question "What is your gender?"
    Then I select the "Gender Full" option in the "responseSet" list
    And I click on the "Save" button
    Then I should see "error(s) prohibited this form from being saved"
    And I should see "Control number: must be a valid OMB Control Number"

  Scenario: Delete Form
    Given I have a Form with the name "Test Form"
    And I am logged in as <EMAIL>
    When I go to the list of Forms
    And I click on the menu link for the Form with the name "Test Form"
    And I click on the option to Delete the Form with the name "Test Form"
    And I confirm my action
    Then I should see "Form was successfully destroyed."
    And I should not see "Test Form"

  Scenario: Export Form
    Given I have a Form with the name "Test Form"
    And I have a Question with the content "What is your gender?" and the type "MC"
    And I have a Response Set with the name "Gender Partial" and the description "Gender example" and with the Responses Male, Female
    And I am logged in as <EMAIL>
    When I go to the list of Forms
    And I click on the "New Form" link
    And I fill in the "name" field with "Test Form"
    And I fill in the "search" field with "What"
    And I click on the button to add the Question "What is your gender?"
    And I select the "Gender Partial" option in the "responseSet" list
    And I click on the "Save" button


  Scenario: Export Form to Redcap
    Given I have a Form with the name "Test Form"
    And I have a Question with the content "What is your gender?" and the type "MC"
    And I have a Response Set with the name "Gender Partial" and the description "Gender example" and with the Responses Male, Female
    And I am logged in as <EMAIL>
    When I go to the list of Forms
    And I click on the "New Form" link
    And I fill in the "name" field with "Test Form"
    And I fill in the "search" field with "What"
    And I click on the button to add the Question "What is your gender?"
    And I select the "Gender Partial" option in the "responseSet" list
    And I click on the "Save" button
    Then I should see the link "Export to Redcap" 
<commit_msg>Fixing cucumber test for creating list and searching for it<commit_after>Feature: Manage Forms
  As an author
  I want to create and manage Forms
  Scenario: Form List View
    Given I have a Form with the name "Test Form"
    And I am logged in as <EMAIL>
    When I go to the list of Forms
    Then I should see "Test Form"
    When I click on the menu link for the Form with the name "Test Form"
    Then I should see the option to Delete the Form with the name "Test Form"
    And I should see the option to View the Form with the name "Test Form"
    And I should see the option to Revise the Form with the name "Test Form"

  Scenario: Show Form in Detail
    Given I have a Form with the name "Test Form" and the description "Form description"
    And I am logged in as <EMAIL>
    When I go to the list of Forms
    And I click on the menu link for the Form with the name "Test Form"
    And I click on the option to View the Form with the name "Test Form"
    Then I should see "Test Form"
    Then I should see "Form description"

  Scenario: Revise Form
    Given I have a Form with the name "Test Form" and the description "Form description"
    And I have a Question with the content "What is your gender?" and the type "MC"
    And I have a Response Set with the name "Gender Partial"
    And I am logged in as <EMAIL>
    When I go to the list of Forms
    And I click on the menu link for the Form with the name "Test Form"
    And I click on the option to Revise the Form with the name "Test Form"
    And I fill in the "name" field with "Gender Form"
    And I fill in the "description" field with "Revised Description"
    And I fill in the "search" field with "What"
    And I click on the button to add the Question "What is your gender?"
    Then I select the "Gender Partial" option in the "responseSet" list
    And I click on the "Save" button
    Then I should see "Name: Gender Form"
    Then I should see "Revised Description"
    And I should see "What is your gender?"
    And I should see "Gender Partial"

  Scenario: Reorder Questions
    Given I have a Form with the name "Test Form"
    And I have a Question with the content "What is your gender?" and the type "MC"
    And I have a Question with the content "What is your name?" and the type "MC"
    And I have a Response Set with the name "Gender Partial"
    And I am logged in as <EMAIL>
    When I go to the list of Forms
    And I click on the menu link for the Form with the name "Test Form"
    And I click on the option to Revise the Form with the name "Test Form"
    And I fill in the "search" field with "What"
    And I click on the button to add the Question "What is your gender?"
    And I click on the button to add the Question "What is your name?"
    And I move the Question "What is your name?" up
    And I move the Question "What is your name?" down
    And I click on the "Save" button
    And I should see "What is your gender?"
    And I should see "Gender Partial"

  Scenario: Create New Form from List
    Given I have a Response Set with the name "Gender Full"
    And I have a Question with the content "What is your gender?" and the type "MC"
    And I am logged in as <EMAIL>
    When I go to the list of Forms
    And I click on the "New Form" link
    And I fill in the "name" field with "Test Form"
    And I fill in the "controlNumber" field with "1234-1234"
    And I fill in the "description" field with "Form description"
    And I fill in the "search" field with "What"
    And I click on the button to add the Question "What is your gender?"
    Then I select the "Gender Full" option in the "responseSet" list
    And I click on the "Save" button
    Then I should see "Test Form"
    And I should see "What is your gender?"

  Scenario: Create New Form from List with warning modal
    Given I have a Response Set with the name "Gender Full"
    And I have a Question with the content "What is your gender?" and the type "MC"
    And I am logged in as <EMAIL>
    When I go to the list of Forms
    And I click on the "New Form" link
    And I fill in the "name" field with "Test Form"
    And I fill in the "controlNumber" field with "1234-1234"
    And I fill in the "search" field with "What"
    And I click on the button to add the Question "What is your gender?"
    When I go to the list of Forms
    And I click on the "Save & Leave" button
    Then I should see "Test Form"
    And I fill in the "search" field with "Test"
    And I click on the "Go!" button
    Then I should see "Test Form"
    And I fill in the "search" field with "Missing"
    And I click on the "Go!" button
    Then I should not see "Test Form"

  Scenario: Abandon New Form from List with warning modal
    Given I have a Response Set with the name "Gender Full"
    And I have a Question with the content "What is your gender?" and the type "MC"
    And I am logged in as <EMAIL>
    When I go to the list of Forms
    And I click on the "New Form" link
    And I fill in the "name" field with "Test Form"
    And I fill in the "controlNumber" field with "1234-1234"
    When I go to the list of Forms
    And I click on the "Continue Without Saving" button
    Then I should not see "Test Form"

  Scenario: An invalid control number should not allow save
    Given I have a Response Set with the name "Gender Full"
    And I have a Question with the content "What is your gender?" and the type "MC"
    And I am logged in as <EMAIL>
    When I go to the list of Forms
    And I click on the "New Form" link
    And I fill in the "name" field with "<NAME>"
    And I fill in the "controlNumber" field with "1234"
    And I fill in the "search" field with "What"
    And I click on the button to add the Question "What is your gender?"
    Then I select the "Gender Full" option in the "responseSet" list
    And I click on the "Save" button
    Then I should see "error(s) prohibited this form from being saved"
    And I should see "Control number: must be a valid OMB Control Number"

  Scenario: Delete Form
    Given I have a Form with the name "<NAME>"
    And I am logged in as <EMAIL>
    When I go to the list of Forms
    And I click on the menu link for the Form with the name "Test Form"
    And I click on the option to Delete the Form with the name "Test Form"
    And I confirm my action
    Then I should see "Form was successfully destroyed."
    And I should not see "Test Form"

  Scenario: Export Form
    Given I have a Form with the name "Test Form"
    And I have a Question with the content "What is your gender?" and the type "MC"
    And I have a Response Set with the name "Gender Partial" and the description "Gender example" and with the Responses Male, Female
    And I am logged in as <EMAIL>
    When I go to the list of Forms
    And I click on the "New Form" link
    And I fill in the "name" field with "Test Form"
    And I fill in the "search" field with "What"
    And I click on the button to add the Question "What is your gender?"
    And I select the "Gender Partial" option in the "responseSet" list
    And I click on the "Save" button


  Scenario: Export Form to Redcap
    Given I have a Form with the name "Test Form"
    And I have a Question with the content "What is your gender?" and the type "MC"
    And I have a Response Set with the name "Gender Partial" and the description "Gender example" and with the Responses Male, Female
    And I am logged in as <EMAIL>
    When I go to the list of Forms
    And I click on the "New Form" link
    And I fill in the "name" field with "Test Form"
    And I fill in the "search" field with "What"
    And I click on the button to add the Question "What is your gender?"
    And I select the "Gender Partial" option in the "responseSet" list
    And I click on the "Save" button
    Then I should see the link "Export to Redcap" 

{'fraction_non_alphanumeric': 0.04740100606216948, 'fraction_numerical': 0.0036115052237843414, 'mean_word_length': 2.8835462058602555, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '2463093', 'n_tokens_mistral': 4378, 'n_tokens_neox': 4227, 'n_words': 2846}