<commit_before>Feature:  provide feedback
    
    @deputy
    Scenario: Feedback can be accessed by users who are not logged in
        Given I am not logged in
        And I go to "/feedback"
        Then I should see "Your feedback"

    @deputy
    Scenario: I give feedback on all fields and it is emailed to OPG
        Given I am not logged in
        Given emails are sent from "deputy" area
        And I reset the email log
        And I am on "/feedback"
        And I fill in the following:
            | feedback_difficulty | I found it to be really easy |
            | feedback_ideas | I think it needs an iPhone app |
            | feedback_help_3 | No, I filled in this form myself |
            | feedback_satisfactionLevel_1 | Satisfied |
        And I press "feedback_save"
        Then the form should be valid
        And I should see a "#feedback-thankyou" element
        And the last email should have been sent to "<EMAIL>"
        And the last email should contain "I found it to be really easy"
        And the last email should contain "I think it needs an iPhone app"
        And the last email should contain "Satisfied"
        And the last email should contain "No, I filled in this form myself"

    @deputy
    Scenario: I give feedback on all fields including email and it is emailed to OPG
        Given I am not logged in
        And emails are sent from "deputy" area
        And I reset the email log
        # wrong email
        When I am on "/feedback"
        And I fill in the following:
            | feedback_emailYesNo_0 | yes |
            | feedback_email | wron |
        And I press "feedback_save"
        Then the following fields should have an error:
            |feedback_email |
        When I am on "/feedback"
        # empty email
        When I am on "/feedback"
        And I fill in the following:
            | feedback_difficulty | I found it to be really easy |
            | feedback_ideas | I think it needs an iPhone app |
            | feedback_help_3 | No, I filled in this form myself |
            | feedback_satisfactionLevel_1 | Satisfied |
            | feedback_emailYesNo_0 | no |
            | feedback_email | <EMAIL> |
        And I press "feedback_save"
        Then the form should be valid
        And I should see a "#feedback-thankyou" element
        And the last email should have been sent to "<EMAIL>"
        And the last email should not contain "<EMAIL>"
        # add email
        When I am on "/feedback"
        And I fill in the following:
            | feedback_difficulty | I found it to be really easy |
            | feedback_ideas | I think it needs an iPhone app |
            | feedback_help_3 | No, I filled in this form myself |
            | feedback_satisfactionLevel_1 | Satisfied |
            | feedback_emailYesNo_0 | yes |
            | feedback_email | <EMAIL> |
        And I press "feedback_save"
        Then the form should be valid
        And I should see a "#feedback-thankyou" element
        And the last email should have been sent to "<EMAIL>"
        And the last email should contain "<EMAIL>"


    @deputy
    Scenario: When I give feedback I dont have to fill all the fields in
        Given I am not logged in
        And emails are sent from "deputy" area
        And I reset the email log
        And I am on "/feedback"
        And I fill in the following:
            | feedback_help_3 | No, I filled in this form myself |
        And I press "feedback_save"
        Then the form should be valid
        And I should see a "#feedback-thankyou" element
        And the last email should have been sent to "<EMAIL>"
        And the last email should contain "No, I filled in this form myself"
    
    @deputy
    Scenario: After giving feedback I see a thank you
        Given I am on "/feedback"
        And I fill in the following:
            | feedback_difficulty | I found it to be really easy |
        And I press "feedback_save"
        Then I should see "Thank you for sending your feedback"

    @deputy
    Scenario: Feedback email filled with logged users' email
        Given I am logged in to admin as "<EMAIL>" with password "<PASSWORD>"
        When I create a new "Lay Deputy" user "Feedback" "Sender" with email "<EMAIL>"
        And I activate the user with password "<PASSWORD>"
        #Given I am logged in as "<EMAIL>" with password "<PASSWORD>"
        And I go to "/feedback"
        Then I should see "Your feedback"
        And the "feedback_email" field should contain "<EMAIL>"

    @deputy
    Scenario: On the feedback screen I can go back to my previous page
        Given I am on the login page
        And I go to "/feedback"
        Then the "Back to deputy report" link url should contain "/"
            
    @deputy
    Scenario: On the thank you screen I see a link back to the client home
        Given I am on the login page
        And I go to "/feedback"
        And I fill in the following:
            | feedback_difficulty | I found it to be really easy |
        And I press "feedback_save"
        Then the form should be valid
        And I should see a "#feedback-thankyou" element
        And the "Return to deputy report" link url should contain "/"
<commit_msg>dd-1433 fix all behat tests<commit_after>Feature:  provide feedback
    
    @deputy
    Scenario: Feedback can be accessed by users who are not logged in
        Given I am not logged in
        And I go to "/feedback"
        Then I should see "Your feedback"

    @deputy
    Scenario: I give feedback on all fields and it is emailed to OPG
        Given I am not logged in
        Given emails are sent from "deputy" area
        And I reset the email log
        And I am on "/feedback"
        And I fill in the following:
            | feedback_difficulty | I found it to be really easy |
            | feedback_ideas | I think it needs an iPhone app |
            | feedback_help_3 | No, I filled in this form myself |
            | feedback_satisfactionLevel_1 | Satisfied |
        And I press "feedback_save"
        Then the form should be valid
        And I should see a "#feedback-thankyou" element
        And the last email should have been sent to "<EMAIL>"
        And the last email should contain "I found it to be really easy"
        And the last email should contain "I think it needs an iPhone app"
        And the last email should contain "Satisfied"
        And the last email should contain "No, I filled in this form myself"

    @deputy
    Scenario: I give feedback on all fields including email and it is emailed to OPG
        Given I am not logged in
        And emails are sent from "deputy" area
        And I reset the email log
        # wrong email
        When I am on "/feedback"
        And I fill in the following:
            | feedback_emailYesNo_0 | yes |
            | feedback_email | wron |
        And I press "feedback_save"
        Then the following fields should have an error:
            |feedback_email |
        When I am on "/feedback"
        # empty email
        When I am on "/feedback"
        And I fill in the following:
            | feedback_difficulty | I found it to be really easy |
            | feedback_ideas | I think it needs an iPhone app |
            | feedback_help_3 | No, I filled in this form myself |
            | feedback_satisfactionLevel_1 | Satisfied |
            | feedback_emailYesNo_0 | no |
            | feedback_email | <EMAIL> |
        And I press "feedback_save"
        Then the form should be valid
        And I should see a "#feedback-thankyou" element
        And the last email should have been sent to "<EMAIL>"
        And the last email should not contain "<EMAIL>"
        # add email
        When I am on "/feedback"
        And I fill in the following:
            | feedback_difficulty | I found it to be really easy |
            | feedback_ideas | I think it needs an iPhone app |
            | feedback_help_3 | No, I filled in this form myself |
            | feedback_satisfactionLevel_1 | Satisfied |
            | feedback_emailYesNo_0 | yes |
            | feedback_email | <EMAIL> |
        And I press "feedback_save"
        Then the form should be valid
        And I should see a "#feedback-thankyou" element
        And the last email should have been sent to "<EMAIL>"
        And the last email should contain "<EMAIL>"


    @deputy
    Scenario: When I give feedback I dont have to fill all the fields in
        Given I am not logged in
        And emails are sent from "deputy" area
        And I reset the email log
        And I am on "/feedback"
        And I fill in the following:
            | feedback_help_3 | No, I filled in this form myself |
        And I press "feedback_save"
        Then the form should be valid
        And I should see a "#feedback-thankyou" element
        And the last email should have been sent to "<EMAIL>"
        And the last email should contain "No, I filled in this form myself"
    
    @deputy
    Scenario: After giving feedback I see a thank you
        Given I am on "/feedback"
        And I fill in the following:
            | feedback_difficulty | I found it to be really easy |
        And I press "feedback_save"
        Then I should see "Thank you for sending your feedback"

    @deputy
    Scenario: Feedback email filled with logged users' email
        Given I am not logged in
        And emails are sent from "admin" area
        And I am logged in to admin as "<EMAIL>" with password "<PASSWORD>"
        When I create a new "Lay Deputy" user "Feedback" "Sender" with email "<EMAIL>"
        And I activate the user with password "<PASSWORD>"
        #Given I am logged in as "<EMAIL>" with password "<PASSWORD>"
        And I go to "/feedback"
        Then I should see "Your feedback"
        And the "feedback_email" field should contain "<EMAIL>"

    @deputy
    Scenario: On the feedback screen I can go back to my previous page
        Given I am on the login page
        And I go to "/feedback"
        Then the "Back to deputy report" link url should contain "/"
            
    @deputy
    Scenario: On the thank you screen I see a link back to the client home
        Given I am on the login page
        And I go to "/feedback"
        And I fill in the following:
            | feedback_difficulty | I found it to be really easy |
        And I press "feedback_save"
        Then the form should be valid
        And I should see a "#feedback-thankyou" element
        And the "Return to deputy report" link url should contain "/"

{'fraction_non_alphanumeric': 0.05069385443217219, 'fraction_numerical': 0.0022656471254602095, 'mean_word_length': 2.0259925735504143, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, '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': '4043643', 'n_tokens_mistral': 2804, 'n_tokens_neox': 2679, 'n_words': 1441}