For fast iteration of testing changes, the integration-tests package supports running integration tests against your
own deployment of DLT in AWS account. To do so, follow the steps:
API integration tests allow you to run integration tests against deployed DLT API endpoints and test API behavior. The tests use API authenticated with AWS SigV4. There is no browser interaction with API tests.
The recommended method to run integration tests in your account is using SSO with IAM Identity Center. To run the tests you need a user in Identity Center with at-minimum following permission added to the respective permission set.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["execute-api:Invoke"],
"Resource": "arn:aws:execute-api:*:*:*"
},
{
"Effect": "Allow",
"Action": ["s3:*"],
"Resource": "arn:aws:execute-api:::{s3ScenarioBucket}"
}
]
}For creating permission set and user in IAM Identity Center refer here.
Configure the AWS CLI to authenticate users with the AWS IAM Identity Center using named profile. The SSO token provider configuration can automatically retrieve refreshed authentication tokens.
aws configure ssoFor configuring your profile with SSO refer here. You may skip above steps if you already have SSO profile configured in your environment and wish to use the same.
aws sso login --profile {mySSOProfile}
eval "$(aws configure export-credentials --profile {mySSOProfile} --format env)"Replace {mySSOProfile} with the SSO profile configured in prior steps
cd source/integration-tests
npm ci
# for full test suite
API_URL={myDLTApiURL}
S3_SCENARIO_BUCKET={s3ScenarioBucket}
AWS_REGION={region}
npx jest
# for specific test
API_URL={myDLTApiURL} npx jest --testNamePattern={mySpecificTest}Replace {myDLTApiURL} with API Url from stack outputs and {mySpecificTest} with test name
Console tests or better referred as E2E tests interact with the deployed DLT application, the same way as customers. Test are authenticated using username, password and all tests run in the browser.
cd source/integration-tests
npm ci
USERNAME={myUsername} PASSWORD={myPassword} CONSOLE_URL={myConsoleURL} npx cypress runReplace {myUsername} {myPassword} {myConsoleURL} with appropriate values. They can also be directly supplied with cypress config.