Skip to content

Commit 6da0652

Browse files
authored
feat(auth): [EMAIL MFA] enable integ tests with backend configuration swapping (#13794)
* chore: enable mfa integ tests * chore: add mfa-setup test def
1 parent c1c7a5e commit 6da0652

File tree

4 files changed

+56
-3
lines changed

4 files changed

+56
-3
lines changed

.github/integ-config/integ-all.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,3 +877,48 @@ tests:
877877
sample_name: auth-gql-storage
878878
yarn_script: ci:node-env-test
879879
node_versions: ['18.x', '20.x', '22.x']
880+
- test_name: integ_next_mfa_req_email
881+
desc: 'mfa required with email sign in attribute'
882+
framework: next
883+
category: auth
884+
sample_name: [mfa]
885+
spec: mfa-req-email
886+
browser: [chrome]
887+
env:
888+
NEXT_PUBLIC_BACKEND_CONFIG: mfa-req-email
889+
- test_name: integ_next_mfa_req_phone
890+
desc: 'mfa required with phone sign in attribute'
891+
framework: next
892+
category: auth
893+
sample_name: [mfa]
894+
spec: mfa-req-phone
895+
browser: [chrome]
896+
env:
897+
NEXT_PUBLIC_BACKEND_CONFIG: mfa-req-phone
898+
- test_name: integ_next_mfa_opt_email
899+
desc: 'mfa optional with email sign in attribute'
900+
framework: next
901+
category: auth
902+
sample_name: [mfa]
903+
spec: mfa-opt-email
904+
browser: [chrome]
905+
env:
906+
NEXT_PUBLIC_BACKEND_CONFIG: mfa-opt-email
907+
- test_name: integ_next_mfa_opt_phone
908+
desc: 'mfa optional with phone sign in attribute'
909+
framework: next
910+
category: auth
911+
sample_name: [mfa]
912+
spec: mfa-opt-phone
913+
browser: [chrome]
914+
env:
915+
NEXT_PUBLIC_BACKEND_CONFIG: mfa-opt-phone
916+
- test_name: integ_next_mfa_setup
917+
desc: 'mfa setup sign in flow'
918+
framework: next
919+
category: auth
920+
sample_name: [mfa]
921+
spec: mfa-setup
922+
browser: [chrome]
923+
env:
924+
NEXT_PUBLIC_BACKEND_CONFIG: mfa-setup

.github/workflows/callable-e2e-test.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ on:
4040
node_versions:
4141
required: false
4242
type: string
43+
env:
44+
required: false
45+
type: string
4346

4447
env:
4548
AMPLIFY_DIR: /home/runner/work/amplify-js/amplify-js/amplify-js
@@ -91,6 +94,7 @@ jobs:
9194
E2E_RETRY_COUNT: ${{ inputs.retry_count }}
9295
E2E_TEST_NAME: ${{ inputs.test_name }}
9396
E2E_YARN_SCRIPT: ${{ inputs.yarn_script }}
97+
E2E_ENV: ${{ inputs.env }}
9498
run: |
9599
if [ -z "$E2E_YARN_SCRIPT" ]; then
96100
../amplify-js/scripts/retry-yarn-script.sh -s \
@@ -102,7 +106,8 @@ jobs:
102106
$E2E_BROWSER \
103107
dev \
104108
$E2E_BACKEND \
105-
$E2E_AMPLIFY_JS_DIR" \
109+
$E2E_AMPLIFY_JS_DIR \
110+
--env $(echo $E2E_ENV | jq -r 'tostring')" \
106111
$E2E_YARN_SCRIPT \
107112
-n $E2E_RETRY_COUNT
108113
else
@@ -122,6 +127,7 @@ jobs:
122127
E2E_RETRY_COUNT: ${{ inputs.retry_count }}
123128
E2E_TEST_NAME: ${{ inputs.test_name }}
124129
E2E_YARN_SCRIPT: ${{ inputs.yarn_script }}
130+
E2E_ENV: ${{ inputs.env }}
125131
run: |
126132
if [ -z "$E2E_YARN_SCRIPT" ]; then
127133
../amplify-js/scripts/retry-yarn-script.sh -s \
@@ -133,7 +139,8 @@ jobs:
133139
$E2E_BROWSER \
134140
prod \
135141
$E2E_BACKEND \
136-
$E2E_AMPLIFY_JS_DIR" \
142+
$E2E_AMPLIFY_JS_DIR \
143+
--env $(echo $E2E_ENV | jq -r 'tostring')" \
137144
$E2E_YARN_SCRIPT \
138145
-n $E2E_RETRY_COUNT
139146
else

.github/workflows/callable-e2e-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
retry_count: ${{ matrix.integ-config.retry_count || 3 }}
4646
yarn_script: ${{ matrix.integ-config.yarn_script || '' }}
4747
node_versions: ${{ toJSON(matrix.integ-config.node_versions) || '[""]' }}
48+
env: ${{ matrix.integ-config.env && toJSON(matrix.integ-config.env) || '{}' }}
4849

4950
# e2e-test-runner-headless:
5051
# name: E2E test runnner_headless

.github/workflows/push-integ-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ concurrency:
88
on:
99
push:
1010
branches:
11-
- replace-with-your-branch
11+
- test/email-mfa-integ
1212

1313
jobs:
1414
e2e:

0 commit comments

Comments
 (0)