From 0ac1fab8cbe879dce47afd65af9497bbb954fd25 Mon Sep 17 00:00:00 2001 From: Caleb Pollman Date: Mon, 22 Jan 2024 09:18:33 -0800 Subject: [PATCH] fix(e2e): add error fixture for sign-in-sms-mfa invalid code test (#4932) --- .../cypress/fixtures/code-mismatch-exception.json | 4 ++++ .../components/authenticator/sign-in-sms-mfa.feature | 12 +++--------- 2 files changed, 7 insertions(+), 9 deletions(-) create mode 100644 packages/e2e/cypress/fixtures/code-mismatch-exception.json diff --git a/packages/e2e/cypress/fixtures/code-mismatch-exception.json b/packages/e2e/cypress/fixtures/code-mismatch-exception.json new file mode 100644 index 00000000000..055193d7402 --- /dev/null +++ b/packages/e2e/cypress/fixtures/code-mismatch-exception.json @@ -0,0 +1,4 @@ +{ + "__type": "CodeMismatchException", + "message": "Invalid code or auth state for the user." +} diff --git a/packages/e2e/features/ui/components/authenticator/sign-in-sms-mfa.feature b/packages/e2e/features/ui/components/authenticator/sign-in-sms-mfa.feature index 9cdce6994eb..277a40efa73 100644 --- a/packages/e2e/features/ui/components/authenticator/sign-in-sms-mfa.feature +++ b/packages/e2e/features/ui/components/authenticator/sign-in-sms-mfa.feature @@ -12,6 +12,7 @@ Feature: Sign In with SMS MFA Then I type my "phone number" with status "CONFIRMED" Then I type my password Then I click the "Sign in" button + Then I will be redirected to the confirm sms mfa page Then I see "Confirm SMS Code" Then I type a valid SMS confirmation code Then I spy request '{ "headers": { "X-Amz-Target": "AWSCognitoIdentityProviderService.RespondToAuthChallenge" } }' @@ -19,15 +20,7 @@ Feature: Sign In with SMS MFA Then I confirm request '{"headers": { "X-Amz-Target": "AWSCognitoIdentityProviderService.RespondToAuthChallenge" } }' @angular @react @vue - Scenario: Sign in using a valid phone number and SMS MFA - When I select my country code with status "CONFIRMED" - Then I type my "phone number" with status "CONFIRMED" - Then I type my password - Then I click the "Sign in" button - Then I will be redirected to the confirm sms mfa page - - @angular @react @vue - Scenario: Redirect to sign in page + Scenario: Sign in and navigate back to sign in page When I select my country code with status "CONFIRMED" Then I type my "phone number" with status "CONFIRMED" Then I type my password @@ -43,6 +36,7 @@ Feature: Sign In with SMS MFA Then I click the "Sign in" button Then I type an invalid SMS code Then I click the "Confirm" button + Then I intercept '{ "headers": { "X-Amz-Target": "AWSCognitoIdentityProviderService.RespondToAuthChallenge" } }' with error fixture "code-mismatch-exception" Then I see "invalid code" @angular @react @vue