<commit_before>Feature: Forgot Password
    In order to recover a lost password
    A SIMS user
    Should be able to recover their password by email

    Scenario: District with forgot password disabled
        Given user "cuke_oneschool" with password "<PASSWORD>" exists
        When I go to the home page
        Then I should not see "Forgot Password"

    Scenario: Expired Token
        When I enter url "/change_password?token=<PASSWORD>"
        Then I should see "authentication token has expired"

     Scenario: No district support, multiple districts
        Given user "cuke_oneschool" with password "<PASSWORD>" exists
        And a district "other district"
        When I go to the home page
        And I press "Forgot Password"
        Then I should see "This district does not support password recovery"

    Scenario: No email
        Given user "cuke_oneschool" with password "<PASSWORD>" exists
        And user has no email address
        And district has forgot_password
        When I go to the home page
        And I press "Forgot Password"
        Then I should see "User does not have email assigned in SIMS."

    Scenario: Forgot and change password
        Given user "cuke_oneschool" with password "<PASSWORD>" exists
        And user has an email address
        And district has forgot_password
        When I go to the home page
        And I fill in "Login" with "cuke_oneschool"
        And I press "Forgot Password"
        Then I should see "An email has been sent, follow the link to change your password."
        Then I should receive an email

        When I open the email

        Then I should see "change your password" in the email

        When I click the change_password link in the email
        Then I should see "Change password"<commit_msg>[#674] add scenario for invalid user<commit_after>Feature: Forgot Password
    In order to recover a lost password
    A SIMS user
    Should be able to recover their password by email

    Scenario: District with forgot password disabled
        Given user "cuke_oneschool" with password "<PASSWORD>" exists
        When I go to the home page
        Then I should not see "Forgot Password"

    Scenario: Expired Token
        When I enter url "/change_password?token=<PASSWORD>"
        Then I should see "authentication token has expired"

    Scenario: No district support, multiple districts
        Given user "cuke_oneschool" with password "<PASSWORD>" exists
        And a district "other district"
        When I go to the home page
        And I press "Forgot Password"
        Then I should see "This district does not support password recovery"

    Scenario: Invalid user
        Given user "cuke_oneschool" with password "<PASSWORD>" exists
        And user has an email address
        And district has forgot_password
        When I go to the home page
        And I fill in "Login" with "not_cuke_oneschool"
        And I press "Forgot Password"
        Then I should see "User does not have email assigned in SIMS."

    Scenario: No email
        Given user "cuke_oneschool" with password "<PASSWORD>" exists
        And user has no email address
        And district has forgot_password
        When I go to the home page
        And I press "Forgot Password"
        Then I should see "User does not have email assigned in SIMS."

    Scenario: Forgot and change password
        Given user "cuke_oneschool" with password "<PASSWORD>" exists
        And user has an email address
        And district has forgot_password
        When I go to the home page
        And I fill in "Login" with "cuke_oneschool"
        And I press "Forgot Password"
        Then I should see "An email has been sent, follow the link to change your password."
        Then I should receive an email

        When I open the email

        Then I should see "change your password" in the email

        When I click the change_password link in the email
        Then I should see "Change password"
{'fraction_non_alphanumeric': 0.039799749687108886, 'fraction_numerical': 0.000750938673341677, 'mean_word_length': 2.5114235500878737, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, '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': '5386491', 'n_tokens_mistral': 1014, 'n_tokens_neox': 959, 'n_words': 541}