> **Experimental**
>
> `@aws-cdk/integ-tests-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# IntegTestProps

Integration test properties.

Extends: [TestOptions](/cdk/api/v2/docs/aws-cdk-lib.cloud_assembly_schema.TestOptions.html), [ProviderOptions](/cdk/api/v2/docs/@aws-cdk_integ-tests-alpha.ProviderOptions.html)
Used as props by: [IntegTest](/cdk/api/v2/docs/@aws-cdk_integ-tests-alpha.IntegTest.html)

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/test-case.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/@aws-cdk/integ-tests-alpha/lib/test-case.ts#L121)

## Example

TypeScript:

```ts
declare const app: App;
declare const stack: Stack;
declare const sm: IStateMachine;

const testCase = new IntegTest(app, 'IntegTest', {
  testCases: [stack],
});

// Start an execution
const start = testCase.assertions.awsApiCall('StepFunctions', 'startExecution', {
  stateMachineArn: sm.stateMachineArn,
});

// describe the results of the execution
const describe = testCase.assertions.awsApiCall('StepFunctions', 'describeExecution', {
  executionArn: start.getAttString('executionArn'),
});

// assert the results
describe.expect(ExpectedResult.objectLike({
  status: 'SUCCEEDED',
}));
```

Python:

```python
# app: App
# stack: Stack
# sm: IStateMachine

test_case = IntegTest(app, "IntegTest",
    test_cases=[stack]
)

# Start an execution
start = test_case.assertions.aws_api_call("StepFunctions", "startExecution", {
    "state_machine_arn": sm.state_machine_arn
})

# describe the results of the execution
describe = test_case.assertions.aws_api_call("StepFunctions", "describeExecution", {
    "execution_arn": start.get_att_string("executionArn")
})

# assert the results
describe.expect(ExpectedResult.object_like({
    "status": "SUCCEEDED"
}))
```

Java:

```java
App app;
Stack stack;
IStateMachine sm;

IntegTest testCase = IntegTest.Builder.create(app, "IntegTest")
        .testCases(List.of(stack))
        .build();

// Start an execution
IApiCall start = testCase.assertions.awsApiCall("StepFunctions", "startExecution", Map.of(
        "stateMachineArn", sm.getStateMachineArn()));

// describe the results of the execution
IApiCall describe = testCase.assertions.awsApiCall("StepFunctions", "describeExecution", Map.of(
        "executionArn", start.getAttString("executionArn")));

// assert the results
describe.expect(ExpectedResult.objectLike(Map.of(
        "status", "SUCCEEDED")));
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.IntegTests.Alpha
App app;
Stack stack;
IStateMachine sm;

var testCase = new IntegTest(app, "IntegTest", new IntegTestProps {
    TestCases = new [] { stack }
});

// Start an execution
var start = testCase.Assertions.AwsApiCall("StepFunctions", "startExecution", new Dictionary<string, string> {
    { "stateMachineArn", sm.StateMachineArn }
});

// describe the results of the execution
var describe = testCase.Assertions.AwsApiCall("StepFunctions", "describeExecution", new Dictionary<string, string> {
    { "executionArn", start.GetAttString("executionArn") }
});

// assert the results
describe.Expect(ExpectedResult.ObjectLike(new Dictionary<string, object> {
    { "status", "SUCCEEDED" }
}));
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdkintegtestsalpha/v2
var app App
var stack Stack
var sm IStateMachine

testCase := awscdkintegtestsalpha.NewIntegTest(app, jsii.String("IntegTest"), &IntegTestProps{
	TestCases: []Stack{
		stack,
	},
})

// Start an execution
start := testCase.Assertions.AwsApiCall(jsii.String("StepFunctions"), jsii.String("startExecution"), map[string]*string{
	"stateMachineArn": sm.stateMachineArn,
})

// describe the results of the execution
describe := testCase.Assertions.AwsApiCall(jsii.String("StepFunctions"), jsii.String("describeExecution"), map[string]*string{
	"executionArn": start.getAttString(jsii.String("executionArn")),
})

// assert the results
describe.Expect(awscdkintegtestsalpha.ExpectedResult_ObjectLike(map[string]interface{}{
	"status": jsii.String("SUCCEEDED"),
}))
```

## Properties

- `allowDeleteFailures`: boolean = false — Whether to allow resources that fail to delete during a stack update.

  When false, the test will fail if CloudFormation skips deleting a resource
  during a stack update. When true, only a warning is printed.

- `allowDestroy`: string[] — List of CloudFormation resource types in this stack that can be destroyed as part of an update without failing the test.

  **Default:** do not allow destruction of any resources on update

  This list should only include resources that for this specific
  integration test we are sure will not cause errors or an outage if
  destroyed. For example, maybe we know that a new resource will be created
  first before the old resource is destroyed which prevents any outage.

  e.g. ['AWS::IAM::Role']

- `assertionStack`: [Stack](/cdk/api/v2/docs/aws-cdk-lib.Stack.html) — Specify a stack to use for assertions.

  **Default:** a stack is created for you

- `cdkCommandOptions`: [CdkCommands](/cdk/api/v2/docs/aws-cdk-lib.cloud_assembly_schema.CdkCommands.html) — Additional options to use for each CDK command.

  **Default:** runner default options

- `diffAssets`: boolean = false — Whether or not to include asset hashes in the diff Asset hashes can introduces a lot of unneccessary noise into tests, but there are some cases where asset hashes _should_ be included.

  For example
  any tests involving custom resources or bundling

- `enableLookups`: boolean = false — Enable lookups for this test.

  If lookups are enabled
  then `stackUpdateWorkflow` must be set to false.
  Lookups should only be enabled when you are explicitly testing
  lookups.

- `hooks`: [Hooks](/cdk/api/v2/docs/aws-cdk-lib.cloud_assembly_schema.Hooks.html) — Additional commands to run at predefined points in the test workflow.

  **Default:** no hooks

  e.g. { postDeploy: ['yarn', 'test'] }

- `providerLogLevel`: [ApplicationLogLevel](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.ApplicationLogLevel.html) = ApplicationLogLevel.FATAL — The log level of the provider lambda function.

- `regions`: string[] — Limit deployment to these regions.

  **Default:** can run in any region

- `stackUpdateWorkflow`: boolean = true — Run update workflow on this test case This should only be set to false to test scenarios that are not possible to test as part of the update workflow.

- `testCases`: [Stack](/cdk/api/v2/docs/aws-cdk-lib.Stack.html)[] (required) — List of test cases that make up this test.
