[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Loïk Fekkaï edited this page Feb 4, 2023 · 3 revisions

AWS E2E Setup

  1. Create a Cognito User Pool
  2. Add an app client, making sure to enable ALLOW_USER_PASSWORD_AUTH auth flow. Store this client ID in the environment variable COGNITO_CLIENT_ID.
  3. Create groups in the pool: dolphin, manta, and shark.
  4. Create a user (ex. user@example.com). Store the credentials in COGNITO_USER_EMAIL and COGNITO_USER_PASSWORD.
  5. Create a user (ex. flipper@example.com) and add to group dolphin. Store the credentials in FLIPPER_EMAIL and FLIPPER_PASSWORD.
  6. Create a user (ex. ray@example.com) and add to group manta. Store the credentials in RAY_EMAIL and RAY_PASSWORD.
  7. Create a user (ex. blue@example.com) and add to group shark. Store the credentials in BLUE_EMAIL and BLUE_PASSWORD.

Set COGNITO_REGION with the AWS region in which you created your user pool.

Create user pool

Configure sign-in experience

step-1_config-sign-in

Configure security requirements

step-2_config-security-requirements

Configure sign-up experience

step-3_config-sign-up

Configure message delivery

step-4_config-message-delivery

Integrate your app

step-5_integrate-your-app

Review and create

step-6_review

Congrats

That's done ! Now let's go to create users and group used by e2e tests !

Fill the user pool

Create simple user

create-user

Create admin user

create-admin-user

Create admin group

create-admin-group

Add admin group to admin user (expected)

admin-user-final

Congrats

Perfect ! There is one last step missing to be able to run the test !

Configure dotenv file

COGNITO_CLIENT_ID=YOUR_COGNITO_APPLICATION_CLIENT
COGNITO_REGION=COGNITO_REGION
COGNITO_USER_POOL_ID=USER_POOL_ID
FLIPPER_EMAIL=flipper@dolphin.com
FLIPPER_PASSWORD=password
BLUE_EMAIL=blue@shark.com
BLUE_PASSWORD=password
MOBY_EMAIL=moby@whale.com
MOBY_PASSWORD=password
RAY_EMAIL=ray@manta.com
RAY_PASSWORD=password
COGNITO_USER_EMAIL=user@mail.com
COGNITO_USER_EMAIL_ADMIN=admin@mail.com
COGNITO_USER_PASSWORD=password
COGNITO_USER_PASSWORD_ADMIN=password

Run the tests

npm run test