@slow @authentication @ows_users @frontend_auth0
Feature: Workstation Login Migration Flow
  In order to ensure I can migrate to auth0
  As a non-migrated auth0 user
  I need to be able to migrate with the login page
  
  # when using the @auth0_empty_sms tag we need to have all relative scenarios in one feature file 
  # this hook clears all sms for any user that has an sms_number in config_user.yml
  @auth0_reset_user @auth0_empty_sms @auth0_empty_s3bucket
  Scenario Outline: check migration flow for guardian and google authenticator
    Given I am an Auth0 non-migrated <user> user
    And I am on the Workstation::LoginPage
    When I log in using the login page to Workstation as the <user> user
    And I enter new creds for the <user> user
    And I click the verification link from the email
    When I log in using new creds to Workstation as the <user> user
    And I enter the one time password for the <mfa> authenticator
    Then I should be logged in to Workstation
    When I log out of Workstation
    Then I should be logged out of Workstation
    Examples:
      | mfa    | user            |
      | google | non_auth0_25824 |
      | sms    | non_auth0_25824 |

  @auth0_empty_s3bucket
  Scenario: check reset password flow to login
    Given a Workstation react_homepage_flow_2_15063 user
    And I am on the ReactWorkstation::ReactHomePage
    When I create a new auth0 user
    Then the user should be created
    When I click the reset link from the email
    Then I see a message about Change Your Password
    When I enter a new password for auth0 user
    Then I should be logged in to Workstation

  @auth0_empty_sms @auth0_empty_s3bucket
  Scenario Outline: check migrated flow for guardian authenticator and sms
    Given I am on the Workstation::LoginPage
    When I log in using new creds to Workstation as the <user> user using <mfa> MFA
    Then I should be logged in to Workstation
    When I log out of Workstation
    Then I should be logged out of Workstation
  Examples:
      | mfa       | user                     |
      | guardian  | migrated_auth0_25824     |
      | sms_login | sms_migrated_auth0_25824 |
