Skip to main content

test_cases

Creates, updates, deletes, gets or lists a test_cases resource.

Overview

Nametest_cases
TypeResource
Idaws.connect.test_cases

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe Amazon Resource Name (ARN) of the test case.
contentstringThe JSON string that represents the content of the test.
descriptionstringThe description of the test case.
entry_pointobjectDefines the starting point for a test case.
idstringThe identifier of the test case.
initialization_datastringDefines the test attributes for precise data representation. The value must be a valid JSON string.
last_modified_regionstringThe region in which the test case was last modified. (pattern: <code>[a-z]{2}(-[a-z]+){1,2}(-[0-9])?</code>)
last_modified_timestring (date-time)The time at which the test case was last modified.
namestringThe name of the test case.
statusstringThe status of a test case. (PUBLISHED, SAVED)
tagsobjectThe tags used to organize, track, or control access for this resource.
test_case_sha_256stringThe SHA256 hash of the test case content. (pattern: <code>^[a-zA-Z0-9]{64}$</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_test_caseselectinstance_id, test_case_id, regionstatusDescribes the specified test case and allows you to get the content and metadata of the test case for the specified Amazon Connect instance.
list_test_casesselectinstance_id, regionnextToken, maxResultsLists the test cases present in the specific Amazon Connect instance.
search_test_casesselectregionSearches for test cases in the specified Amazon Connect instance, with optional filtering.
create_test_caseinsertinstance_id, regionx-amz-resource-id, x-amz-last-modified-time, x-amz-last-modified-regionCreates a test case with its content and metadata for the specified Amazon Connect instance.
update_test_caseupdateinstance_id, test_case_id, regionx-amz-last-modified-time, x-amz-last-modified-regionUpdates any of the metadata for a test case, such as the name, description, and status or content of an existing test case. This API doesn't allow customers to update the tags of the test case resource for the specified Amazon Connect instance.
delete_test_casedeleteinstance_id, test_case_id, regionDeletes the test case that has already been created for the specified Amazon Connect instance.
start_test_case_executionexecinstance_id, test_case_id, regionStarts executing a published test case.
stop_test_case_executionexecinstance_id, test_case_execution_id, test_case_id, regionStops a running test execution.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
instance_idstringThe identifier of the Amazon Connect instance.
regionstringAWS region (default: us-east-1)
test_case_execution_idstringThe identifier of the test case execution to stop.
test_case_idstringThe identifier of the test case.
maxResultsintegerThe maximum number of results to return per page.
nextTokenstringThe token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
statusstringThe status of the test case version to retrieve. If not specified, returns the published version if available, otherwise returns the saved version.
x-amz-last-modified-regionstringThe region in which the resource was last modified
x-amz-last-modified-timestring (date-time)The time at which the resource was last modified.
x-amz-resource-idstringId of the test case if you want to create it in a replica region using Amazon Connect Global Resiliency

SELECT examples

Describes the specified test case and allows you to get the content and metadata of the test case for the specified Amazon Connect instance.

SELECT
arn,
content,
description,
entry_point,
id,
initialization_data,
last_modified_region,
last_modified_time,
name,
status,
tags,
test_case_sha_256
FROM aws.connect.test_cases
WHERE instance_id = '{{ instance_id }}' -- required
AND test_case_id = '{{ test_case_id }}' -- required
AND region = '{{ region }}' -- required
AND status = '{{ status }}'
;

INSERT examples

Creates a test case with its content and metadata for the specified Amazon Connect instance.

INSERT INTO aws.connect.test_cases (
Name,
Description,
Content,
EntryPoint,
InitializationData,
Status,
Tags,
instance_id,
region,
`x-amz-resource-id`,
`x-amz-last-modified-time`,
`x-amz-last-modified-region`
)
SELECT
'{{ Name }}',
'{{ Description }}',
'{{ Content }}',
'{{ EntryPoint }}',
'{{ InitializationData }}',
'{{ Status }}',
'{{ Tags }}',
'{{ instance_id }}',
'{{ region }}',
'{{ x-amz-resource-id }}',
'{{ x-amz-last-modified-time }}',
'{{ x-amz-last-modified-region }}'
RETURNING
test_case_arn,
test_case_id
;

UPDATE examples

Updates any of the metadata for a test case, such as the name, description, and status or content of an existing test case. This API doesn't allow customers to update the tags of the test case resource for the specified Amazon Connect instance.

UPDATE aws.connect.test_cases
SET
Content = '{{ Content }}',
EntryPoint = '{{ EntryPoint }}',
InitializationData = '{{ InitializationData }}',
Name = '{{ Name }}',
Description = '{{ Description }}',
Status = '{{ Status }}'
WHERE
instance_id = '{{ instance_id }}' --required
AND test_case_id = '{{ test_case_id }}' --required
AND region = '{{ region }}' --required
AND `x-amz-last-modified-time` = '{{ x-amz-last-modified-time}}'
AND `x-amz-last-modified-region` = '{{ x-amz-last-modified-region}}';

DELETE examples

Deletes the test case that has already been created for the specified Amazon Connect instance.

DELETE FROM aws.connect.test_cases
WHERE instance_id = '{{ instance_id }}' --required
AND test_case_id = '{{ test_case_id }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Starts executing a published test case.

EXEC aws.connect.test_cases.start_test_case_execution
@instance_id='{{ instance_id }}' --required,
@test_case_id='{{ test_case_id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"ClientToken": "{{ ClientToken }}"
}'
;